Changeset 8597
- Timestamp:
- 02/10/12 15:10:46 (8 years ago)
- Location:
- mauRepo/MolesManager/trunk/cedaMoles/MolesManager
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/MolesManager/trunk/cedaMoles/MolesManager/settings_local.py
r8575 r8597 2 2 # Override settings.py for local configuration here 3 3 # 4 SERVE_LOCAL_STATIC_FILE = False4 SERVE_LOCAL_STATIC_FILE = True 5 5 if SERVE_LOCAL_STATIC_FILE: 6 6 STATIC_URL = 'http://127.0.0.1:8000/static/' 7 #RUN_MIGRATION = False8 -
mauRepo/MolesManager/trunk/cedaMoles/MolesManager/static/js/cedaObservation.js
r8595 r8597 7 7 // } 8 8 9 function getIDs( coObs){9 function getIDs(idArray){ 10 10 var idDict = {}; 11 for (loopVal=0; loopVal< coObs.identifier.length; loopVal++){11 for (loopVal=0; loopVal<idArray.length; loopVal++){ 12 12 var innerDict = {}; 13 innerDict['code'] = coObs.identifier[loopVal].code; 13 14 innerDict['code'] = idArray[loopVal].code; 14 15 15 16 try { 16 if ( coObs.identifier[loopVal].authority.title == 'DOI'){17 innerDict['doiDate'] = ( coObs.identifier[loopVal].authority.hasOwnProperty('date') && coObs.identifier[loopVal].authority.date.length != 0 )?coObs.identifier[loopVal].authority.date.dateTime8601.year:coObs.resultTime.position.dateTime8601.year;17 if (idArray[loopVal].authority.title == 'DOI'){ 18 innerDict['doiDate'] = (idArray[loopVal].authority.hasOwnProperty('date') && idArray[loopVal].authority.date.length != 0 )?idArray[loopVal].authority.date[0].year :'undefined'; 18 19 } 19 20 } … … 22 23 } 23 24 try { 24 idDict[ coObs.identifier[loopVal].authority.title] = innerDict;25 idDict[idArray[loopVal].authority.title] = innerDict; 25 26 } 26 27 catch(err){ 27 console.log('empty titlefield')28 console.log('empty id field') 28 29 } 29 30 … … 47 48 } 48 49 49 function timeLead0(timeElement){ 50 console.log(timeElement.length) 50 function timeLead(timeElement){ 51 51 if (timeElement.length == 1){ 52 //console.log(timeElement)52 console.log(timeElement) 53 53 timeElement = '0' + timeElement; 54 console.log(timeElement) 54 55 } 55 56 return timeElement; … … 57 58 } 58 59 59 function publicationDetails(coObs _old,ids){60 function publicationDetails(coObs,ids){ 60 61 var pubDetails = {}; 61 62 var typePub=(ids.hasOwnProperty('DOI'))?"Dataset is Citable <br /> additional metadata fields may be added ": coObs_old.publicationState.value; … … 65 66 66 67 try { 67 pubDetails['pubYear'] = coObs.resultTime.position.dateTime8601.year; 68 pubDetails['pubMonth'] = timeLead0(coObs.resultTime.position.dateTime8601.month) 69 pubDetails['pubDay'] = timeLead0(coObs.resultTime.position.dateTime8601.day) 68 pubDetails['pubYear'] = coObs_old.resultTime.position.dateTime8601.year; 69 pubDetails['pubMonth'] = timeLead(coObs_old.resultTime.position.dateTime8601.month); 70 console.log(timeLead(coObs_old.resultTime.position.dateTime8601.month.timeElement)) 71 pubDetails['pubDay'] = timeLead(coObs_old.resultTime.position.dateTime8601.day).timeElement; 70 72 71 73 } … … 75 77 pubDetails['pubDay'] = '' 76 78 } 79 console.log('try',pubDetails['pubMonth']) 77 80 pubDetails['pubString'] = '<p> Record Status: <b>'+ pubDetails['pubType'] +'</b><br /> Available: <b>' + pubDetails['pubYear'] +'-'+ pubDetails['pubMonth'] + '-' + pubDetails['pubDay']+'</b></p>'; 78 81 return pubDetails … … 331 334 } 332 335 333 var ids = getIDs( old_coObs);336 var ids = getIDs(coObs.identifier); 334 337 var pubDetails_old = publicationDetails(old_coObs,ids); 335 338 var old_rps = getRelatedParties(old_coObs); … … 342 345 } 343 346 344 coObs.resultTime.year 345 coObs.resultTime.month 346 coObs.resultTime.day 347 348 var pubString = '<p> Record Status: <b>'+ pubDetails_old['pubType'] +'</b><br /> Available: <b>' + coObs.resultTime.year +'-'+ coObs.resultTime.month + '-' + coObs.resultTime.day +'</b></p>'; 347 348 var pubString = '<p> Record Status: <b>'+ pubDetails_old['pubType'] +'</b><br /> Available: <b>' + coObs.resultTime.year +'-'+ timeLead(coObs.resultTime.month) + '-' + timeLead(coObs.resultTime.day) +'</b></p>'; 349 349 var pubDetails_id = new dojo.html.set(dojo.byId("pubDetails_id"),pubString); 350 350 … … 355 355 citation_id.startup(); 356 356 357 var dataLineage_id = new dojo.html.set(dojo.byId("dataLineage_id"),'<p>' + coObs.dataLineage + '</p>');358 357 var description_id = new dijit.TitlePane( 359 358 { … … 361 360 },"description_id"); 362 361 description_id.startup(); 362 363 if (ids.hasOwnProperty("moles2url")){ 364 var pastCitation_id = new dijit.TitlePane( 365 { 366 title: "Previous Identifiers Used:", content: '<a href="'+ids['moles2url'].code+'">'+ids['moles2url'].code+'</a>', open: 0 367 },"pastCitation_id"); 368 pastCitation_id.startup(); 369 } 363 370 364 371 var dataLink_id = new dojo.html.set(dojo.byId("datalink_id"),downloadLink(old_coObs.result)); … … 374 381 // following line is used to do the call to map object in cedaol JS file: 375 382 // uncomment to implement - removed at present due to issue with openlayers. 383 376 384 try { 377 385 cedaol.drawMap(coObs.geographicExtent,'map',ids); … … 385 393 },"bbox_id"); 386 394 bbox_id.startup(); 387 395 396 //lower tab area content 397 398 var dataLineage_id = new dojo.html.set(dojo.byId("dataLineage_id"),'<p>' + coObs.dataLineage + '</p>'); 399 388 400 } 389 401 // below is old stuff that is being re-worked to seciton above. … … 395 407 console.log(coObs.identifier.length) 396 408 } 397 var title_id = new dojo.html.set(dojo.byId("title_id"),'<h3>'+ids['ceda_title'].code+'</h3>'); 398 409 399 410 // var rps = getRelatedParties(coObs); 400 411 … … 412 423 // citation_id.startup(); 413 424 414 // if (ids.hasOwnProperty("moles2url")){415 // var pastCitation_id = new dijit.TitlePane(416 // {417 // title: "Previous Identifiers Used:", content: '<a href="'+ids['moles2url'].code+'">'+ids['moles2url'].code+'</a>', open: 0418 // },"pastCitation_id");419 // citation_id.startup();420 // }421 425 422 426 -
mauRepo/MolesManager/trunk/cedaMoles/MolesManager/static/js/cedaol.js
r8596 r8597 10 10 11 11 // This returned object becomes the defined value of this module 12 return {13 drawMap: function(extents, map_id,ids){12 return { 13 drawMap: function(extents, map_id,ids){ 14 14 map = new OpenLayers.Map(map_id); 15 15 if (ids['ceda_title'].code != 'Data from Mars Analysis Correction Data Assimilation (MACDA)'){ … … 37 37 style: layer_style, 38 38 renderers: renderer}) 39 39 40 40 var boxes = new OpenLayers.Layer.Vector( "Boxes" ); 41 41 for (var i = 0; i < extents.length; i++) {
Note: See TracChangeset
for help on using the changeset viewer.