Skip to content

Commit b83ecfc

Browse files
committed
only check on doi view
1 parent a0bdeb5 commit b83ecfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

views/works/item.haml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
- attributes = item.fetch("attributes", {})
2-
- data_center = @work[:included].find { |i| i.fetch("type", nil) == "data-centers" }
3-
- client_name = data_center.fetch("attributes", {}).fetch("title", nil)
42
- type = attributes.fetch("resource-type-id", nil)
53
- includes = @works.present? ? @works[:included] : @work[:included]
64
- work_types = includes.select { |item| item["type"] == "work-types" }
@@ -19,6 +17,8 @@
1917
- gon.chart_downloads = metrics.fetch(:downloads_histogram,{}).fetch("yearMonths",[])
2018
- gon.yop = attributes.fetch("published", "").to_i
2119
- 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)
2222
- has_duplicated = citations != metrics.fetch(:citations_histogram,{}).fetch("count",0) ? true : false
2323
- citations_chart = remove_duplicated_counts(citations,metrics.fetch(:citations_histogram,{}), attributes.fetch("published", "").to_i )
2424
- gon.chart_citations = citations_chart.fetch("years", [])

0 commit comments

Comments
 (0)