|
17 | 17 | - gon.chart_downloads = metrics.fetch(:downloads_histogram,{}).fetch("yearMonths",[])
|
18 | 18 | - gon.yop = attributes.fetch("published", "").to_i
|
19 | 19 | - 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) |
22 | 20 | - has_duplicated = citations != metrics.fetch(:citations_histogram,{}).fetch("count",0) ? true : false
|
23 | 21 | - citations_chart = remove_duplicated_counts(citations,metrics.fetch(:citations_histogram,{}), attributes.fetch("published", "").to_i )
|
24 | 22 | - gon.chart_citations = citations_chart.fetch("years", [])
|
|
43 | 41 | %a{:href => attributes["license"]}
|
44 | 42 | = license_img(attributes["license"])
|
45 | 43 |
|
46 |
| - -# %data-metrics-badge{doi: attributes["doi"], display:"datacite"} |
47 | 44 | - if ENV['RACK_ENV'] != 'production' || is_admin_or_staff? || is_beta_tester?
|
48 | 45 | .panel-footer
|
49 | 46 | - if (views + downloads + citations).zero?
|
|
104 | 101 | - if @work.present? && (views + downloads + citations).positive?
|
105 | 102 | = haml :'works/visualisation', locals: { attributes: attributes, views: views, downloads: downloads, citations: citations }
|
106 | 103 | - 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) |
107 | 106 | = haml :'works/citations', locals: { attributes: attributes, client_name: client_name, citations: citations, duplicated: has_duplicated, summary: metrics}
|
108 | 107 | - if @work.present? && (views + downloads).zero?
|
109 | 108 | .panel-body.alert.alert-simple-info
|
|
0 commit comments