Commit 652cbbbe authored by Maxime Chaillet's avatar Maxime Chaillet

use doiData.accessibility to setup the experimental data box message.

parent 58a814ff
This diff is collapsed.
......@@ -81,11 +81,12 @@ DOIController.prototype.getData = function(doi) {
doiData.beamline = jsonExtractor.getFieldFromSubject(data.subject, "instrument");
doiData.investigationId = jsonExtractor.extractInvestigationId(data);
doiData.accessMessage = _this.view.setDataAccessMessage(data);
doiData.accessibility = doiData.getAccessibilityStatus(doiData.sessionDate, doiData.publiclyAccessibleYear);
doiData.accessMessage = _this.view.setDataAccessMessage(doiData);
doiData.citation = _this.createCitation(data);
doiData.resourceTypeGeneral = jsonExtractor.getResourceTypeGeneral(data);
doiData.resourceType = jsonExtractor.getResourceType(data);
doiData.accessibility = doiData.getAccessibilityStatus(doiData.sessionDate, doiData.publiclyAccessibleYear);
// Set the URL corresponding to the beamline name.
if (data.date_collected) {
......
......@@ -164,14 +164,11 @@ DOIView.prototype.renderBadges = function( data ) {
* @return {string}
* the message to display
*/
DOIView.prototype.setDataAccessMessage = function( data ) {
var publicationDate = moment( data.publication_year, "YYYY" );
var now = moment();
if ( now > publicationDate ) {
DOIView.prototype.setDataAccessMessage = function( doiData ) {
if ( doiData.accessibility === "Open access" ) {
return "The data can be accessed by clicking on the link below";
} else {
return "The data is under embargo until <b>" + data.publication_year + "</b> but could be released earlier. </p> " +
} else if ( doiData.accessibility === "Under embargo" ) {
return "The data is under embargo until <b>" + doiData.publiclyAccessibleYear + "</b> but could be released earlier. </p> " +
" <p> Currently, it is only accessible to proposal team members. </p>";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment