Skip to content

Commit

Permalink
Added config option to disable register citation feature
Browse files Browse the repository at this point in the history
Added config option to disable register citation feature
Reference: #1475
  • Loading branch information
rushirajnenuji committed Dec 1, 2020
1 parent 51a5539 commit a2db290
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/js/models/AppModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@ define(['jquery', 'underscore', 'backbone'],
*/
displayDatasetViewMetric: true,
/**
* If true, displays the citation registration tool on the dataset landing page
* @type {boolean}
* @default true
*/
displayRegisterCitationTool: true,
/**
* If true, displays the "Edit" button on the dataset landing page
* @type {boolean}
* @default true
Expand Down
12 changes: 9 additions & 3 deletions src/js/views/CitationListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ define(['jquery', 'underscore', 'backbone', 'collections/Citations', 'views/Cita
emptyCitations: null,
citationsForDataCatalogView: null,

displayRegisterCitationTool: MetacatUI.appModel.get("displayRegisterCitationTool"),

events: {

},
Expand Down Expand Up @@ -71,14 +73,18 @@ define(['jquery', 'underscore', 'backbone', 'collections/Citations', 'views/Cita

// Dataset landing page - metadataview
if ( self.citationsForDataCatalogView ) {
var emptyString = "We couldn't find any citations for this dataset. " +
"If this dataset has been cited, you can register the citation to " + nodeName + ".";
var emptyString = "We couldn't find any citations for this dataset.";

if (self.displayRegisterCitationTool)
emptyString += " If this dataset has been cited, you can register the citation to " + nodeName + ".";

var $emptyDataElement = $(document.createElement("p"))
.text(emptyString)
.addClass("empty-citation-list-text");

$emptyList.append(this.registerCitationTemplate());
if (self.displayRegisterCitationTool)
$emptyList.append(this.registerCitationTemplate());

$emptyList.append($emptyDataElement);

}
Expand Down

0 comments on commit a2db290

Please sign in to comment.