Skip to content

Commit

Permalink
Merge ab97305 into 09bffe4
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaraBi committed Dec 4, 2018
2 parents 09bffe4 + ab97305 commit 6ea8894
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
Expand Up @@ -5,7 +5,7 @@
<td class="logo"><span class="fa {{ relationship | logoType }} fa-lg fa-fw"></span></td>
<td>
<a ng-if="relationship | doiUrl" href="{{ relationship | doiUrl }}">
{{relationship.metadata.Source.Title | limitTo: 70 }}{{relationship.metadata.Source.Title.length > 70 ?
{{relationship.metadata.Source.Title | limitTo: 65 }}{{relationship.metadata.Source.Title.length > 65 ?
'&hellip;' : ''}}
<em ng-if="!relationship.metadata.Source.Title">Title unknown</em>
</a>
Expand All @@ -17,7 +17,7 @@
<span class="doiDisplayed">(doi: {{relationship | doi}})</span>
</td>
<td>
{{relationship.metadata.Source.PublicationDate || "-"}}
{{relationship.metadata.Source.PublicationDate | date : 'yyyy' || "-"}}
</td>
<td>
<a ng-repeat="identifier in (relationship.metadata.Source.Identifier | uniqueBadge) | orderBy:'IDScheme' | limitTo:5 track by $index"
Expand Down
Expand Up @@ -99,9 +99,9 @@
template="{{ url_for('static', filename='templates/citations/results.html') }}">
</invenio-search-results>
<div class="row">
<div class="col-md-3 col-sm-12">
<div class="col-md-2 col-sm-12">
</div>
<div class="col-md-6 col-sm-12 text-center">
<div class="col-md-7 col-sm-12 text-center">
<invenio-search-pagination
template="{{ url_for('static', filename='templates/citations/pagination.html') }}">
</invenio-search-pagination>
Expand Down
26 changes: 14 additions & 12 deletions zenodo/modules/theme/static/js/zenodo/filters/citations.js
Expand Up @@ -73,13 +73,13 @@ define([], function() {
function doiFilter() {
return function(relationship) {
var doi = "";

relationship.metadata.Source.Identifier.forEach( function(identifier) {
if (identifier.ID && identifier.IDScheme == "doi") {
doi = identifier.ID;
}
})

if(relationship.metadata.Source.Identifier) {
relationship.metadata.Source.Identifier.forEach( function(identifier) {
if (identifier.ID && identifier.IDScheme == "doi") {
doi = identifier.ID;
}
});
}
return doi;
};
}
Expand All @@ -100,24 +100,26 @@ define([], function() {
return function(identifiers) {
schemes = []
uniqueIdentifiers = []
if(identifiers) {
identifiers.forEach( function(identifier) {
if (identifier.IDURL && !schemes.includes(identifier.IDScheme)) {
uniqueIdentifiers.push(identifier)
schemes.push(identifier.IDScheme)
}

});
}
return uniqueIdentifiers;
};
}

function missingTypesFilter() {
return function(buckets) {
var missingTypes = ["literature", "dataset", "software", "unknown"];

buckets.forEach(function(bucket) {
missingTypes.splice(missingTypes.indexOf(bucket.key), 1);
});
if(buckets) {
buckets.forEach(function(bucket) {
missingTypes.splice(missingTypes.indexOf(bucket.key), 1);
});
}

return missingTypes;
};
Expand Down

0 comments on commit 6ea8894

Please sign in to comment.