Skip to content

Commit

Permalink
Improvement to how datasource logo is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenwalker committed Jul 22, 2020
1 parent f625763 commit c5891eb
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/js/views/SearchResultView.js
Expand Up @@ -85,17 +85,20 @@ define(['jquery', 'underscore', 'backbone', 'models/SolrResult', 'models/Package
if( json.logo && !json.logo.startsWith("http") ){
json.logo = MetacatUI.appModel.get("objectServiceUrl") + json.logo;
}

var datasourceId = json.memberNode? json.memberNode.identifier : json.datasource,
currentMemberNode = MetacatUI.appModel.get("nodeId") || datasourceId;

//Construct a URL to the profile of this repository
json.profileURL = (datasourceId == currentMemberNode)?
MetacatUI.root + "/profile" :
MetacatUI.appModel.get("dataoneSearchUrl") + "/portals/" + json.memberNode.shortIdentifier;

}

//Create a URL that leads to a view of this object
json.viewURL = this.model.createViewURL();

//Construct a URL to the profile of this repository
json.profileURL = (json.memberNode.identifier == MetacatUI.appModel.get("nodeId"))?
MetacatUI.root + "/profile" :
MetacatUI.appModel.get("dataoneSearchUrl") + "/portals/" + json.memberNode.shortIdentifier;


var resultRow = this.template(json);
this.$el.html(resultRow);

Expand Down

0 comments on commit c5891eb

Please sign in to comment.