Skip to content

Commit ffbde9e

Browse files
committed
to obtain client name also when there are not citations
1 parent 89f6862 commit ffbde9e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

views/works/item.haml

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
- gon.chart_downloads = metrics.fetch(:downloads_histogram,{}).fetch("yearMonths",[])
1818
- gon.yop = attributes.fetch("published", "").to_i
1919
- if @work.present? && citations.positive?
20-
- data_center = @work[:included].find { |i| i.fetch("type", nil) == "data-centers" }
21-
- client_name = data_center.fetch("attributes", {}).fetch("title", nil)
2220
- has_duplicated = citations != metrics.fetch(:citations_histogram,{}).fetch("count",0) ? true : false
2321
- citations_chart = remove_duplicated_counts(citations,metrics.fetch(:citations_histogram,{}), attributes.fetch("published", "").to_i )
2422
- gon.chart_citations = citations_chart.fetch("years", [])
@@ -43,7 +41,6 @@
4341
%a{:href => attributes["license"]}
4442
= license_img(attributes["license"])
4543
46-
-# %data-metrics-badge{doi: attributes["doi"], display:"datacite"}
4744
- if ENV['RACK_ENV'] != 'production' || is_admin_or_staff? || is_beta_tester?
4845
.panel-footer
4946
- if (views + downloads + citations).zero?
@@ -104,6 +101,8 @@
104101
- if @work.present? && (views + downloads + citations).positive?
105102
= haml :'works/visualisation', locals: { attributes: attributes, views: views, downloads: downloads, citations: citations }
106103
- if @work.present?
104+
- data_center = @work[:included].find { |i| i.fetch("type", nil) == "data-centers" }
105+
- client_name = data_center.fetch("attributes", {}).fetch("title", nil)
107106
= haml :'works/citations', locals: { attributes: attributes, client_name: client_name, citations: citations, duplicated: has_duplicated, summary: metrics}
108107
- if @work.present? && (views + downloads).zero?
109108
.panel-body.alert.alert-simple-info

0 commit comments

Comments
 (0)