21
21
- citations_chart = remove_duplicated_counts(citations,metrics.fetch(:citations_histogram, {}), attributes.fetch(" published" , nil).to_i )
22
22
- gon.chart_citations = citations_chart.fetch(" years" , [])
23
23
- gon.yop = attributes.fetch(" published" , nil).to_i
24
- - if ENV['RACK_ENV'] == 'production' && !is_admin_or_staff? && !is_beta_tester? ### TODO: Remove soon. set temporaly to send to production
25
- - citations = 0 ### TODO: Remove soon. set temporaly to send to production
24
+
26
25
27
26
.panel.panel-default
28
27
.panel-body
41
40
%a{:href => attributes[" license" ]}
42
41
= license_img(attributes[" license" ])
43
42
44
- - if ENV['RACK_ENV'] != 'production' || is_admin_or_staff? || is_beta_tester?
45
- .panel-footer
46
- - if (views + downloads + citations).zero?
43
+ .panel-footer
44
+ - if (views + downloads + citations).zero?
45
+ %span.metrics{id: " summary-citations" }
46
+ .fa.fa-info-circle
47
+ No citations were reported. No usage information was reported.
48
+ - else
49
+ - if citations.positive?
47
50
%span.metrics{id: " summary-citations" }
48
- .fa.fa-info-circle
49
- No citations were reported. No usage information was reported.
51
+ .fa.fa-quote-left
52
+ = pluralize( citations, " citation " )
50
53
- else
51
- - if citations.positive?
52
- %span.metrics{id: " summary-citations" }
53
- .fa.fa-quote-left
54
- = pluralize(citations, " citation" )
55
- - else
56
- %span.metrics
57
- .fa.fa-info-circle
58
- No citations were reported.
59
- - if (views + downloads).positive?
60
- %span.metrics{id: " summary-views" }
61
- .fa.fa-eye
62
- = pluralize(views, " view" )
63
- %span.metrics{id: " summary-downloads" }
64
- .fa.fa-download
65
- = pluralize(downloads, " download" )
66
- - else
67
- %span.metrics{id: " summary-views" }
68
- .fa.fa-info-circle
69
- No usage information was reported.
70
- - else
71
- .panel-footer
54
+ %span.metrics
55
+ .fa.fa-info-circle
56
+ No citations were reported.
72
57
- if (views + downloads).positive?
73
58
%span.metrics{id: " summary-views" }
74
59
.fa.fa-eye
97
82
- if user_signed_in? && is_person?
98
83
= haml :'works/claim', locals: { item: item }
99
84
100
- - if ENV['RACK_ENV'] != 'production' || is_admin_or_staff? || is_beta_tester?
101
- - if @work.present? && (views + downloads + citations).positive?
102
- = haml :'works/visualisation', locals: { attributes: attributes, views: views, downloads: downloads, citations: citations }
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)
106
- = haml :'works/citations', locals: { attributes: attributes, client_name: client_name, citations: citations, duplicated: has_duplicated, summary: metrics}
107
- - if @work.present? && (views + downloads).zero?
108
- .panel-body.alert.alert-simple-info
109
- = " This data repository is not currently reporting usage information. For information on how your repository can submit usage information, please see"
110
- %a {href: 'https://support.datacite.org/docs/views-and-downloads'}
111
- our documentation.
112
- - else
113
- - if @work.present? && (views + downloads).positive?
114
- = haml :'works/visualisation', locals: { attributes: attributes, views: views, downloads: downloads, citations: citations }
115
- - else
116
- .panel-body.alert.alert-simple-info
117
- = " This data repository is not currently reporting usage information. For information on how your repository can submit usage information, please see"
118
- %a{href: 'https://support.datacite.org/docs/views-and-downloads'}
119
- our documentation.
85
+ - if @work.present? && (views + downloads + citations).positive?
86
+ = haml :'works/visualisation', locals: { attributes: attributes, views: views, downloads: downloads, citations: citations }
87
+ - if @work.present?
88
+ - data_center = @work[:included].find { |i| i.fetch(" type" , nil) == " data-centers" }
89
+ - client_name = data_center.fetch(" attributes" , {}).fetch(" title" , nil)
90
+ = haml :'works/citations', locals: { attributes: attributes, client_name: client_name, citations: citations, duplicated: has_duplicated, summary: metrics}
91
+ - if @work.present? && (views + downloads).zero?
92
+ .panel-body.alert.alert-simple-info
93
+ = " This data repository is not currently reporting usage information. For information on how your repository can submit usage information, please see"
94
+ %a {href: 'https://support.datacite.org/docs/views-and-downloads'}
95
+ our documentation.
0 commit comments