|
13 | 13 | - if @work.present? && attributes["citations-over-time"].present?
|
14 | 14 | - gon.chart_citations = attributes["citations-over-time"].map { |d| { "id" => d["year"], "title" => d["year"], "sum" => d["total"] } }
|
15 | 15 | - gon.yop = attributes.fetch("published", nil).to_i
|
16 |
| -- gon.citation_events = includes.select { |e| e.dig("relationships", "doiForTarget", "data", "id") == attributes["doi"] } |
17 |
| -- gon.reference_events = includes.select { |e| e.dig("relationships", "doiForSource", "data", "id") == attributes["doi"] } |
| 16 | +- citation_events = includes.select { |e| e.dig("relationships", "doiForTarget", "data", "id") == attributes["doi"] } |
| 17 | +- reference_events = includes.select { |e| e.dig("relationships", "doiForSource", "data", "id") == attributes["doi"] } |
| 18 | +- list = JSON.generate({:citations => citation_events, :references => reference_events }, quirks_mode: true) |
18 | 19 |
|
19 | 20 | .panel.panel-default
|
20 | 21 | .panel-body
|
|
80 | 81 | - if @work.present?
|
81 | 82 | - data_center = @work[:included].find { |i| i.fetch("type", nil) == "data-centers" }
|
82 | 83 | - client_name = data_center.fetch("attributes", {}).fetch("title", nil)
|
83 |
| - -# = haml :'works/citations', locals: { attributes: attributes, client_name: client_name } |
| 84 | + = haml :'works/citations', locals: { attributes: attributes, client_name: client_name, list: list } |
84 | 85 | - if @work.present? && (attributes["view-count"].to_i + attributes["download-count"].to_i).zero?
|
85 | 86 | .panel-body.alert.alert-simple-info
|
86 | 87 | = "This data repository is not currently reporting usage information. For information on how your repository can submit usage information, please see"
|
|
0 commit comments