Skip to content

Commit 0df3371

Browse files
authored
Merge pull request #2053 from projectblacklight/2052-citation-fix
Move modal content into _citation partial and simply render that from…
2 parents 2a38eab + 20f3d71 commit 0df3371

File tree

3 files changed

+25
-28
lines changed

3 files changed

+25
-28
lines changed
Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
<div class="modal-header">
2+
<h1><%= t('blacklight.tools.citation') %></h1>
3+
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
4+
<span aria-hidden="true">&times;</span>
5+
</button>
6+
</div>
7+
<div class="modal-body">
8+
<% @documents.each do |document| %>
9+
<h1 class="modal-title"><%= document_heading(document) %></h1>
110

2-
<% @documents.each do |document| %>
11+
<% if document.respond_to?(:export_as_mla_citation_txt) %>
12+
<h2><%= t('blacklight.citation.mla') %></h2>
13+
<%= document.send(:export_as_mla_citation_txt).html_safe %><br/><br/>
14+
<% end %>
315

4-
<h1 class="modal-title"><%= document_heading(document) %></h1>
16+
<% if document.respond_to?(:export_as_apa_citation_txt) %>
17+
<h2><%= t('blacklight.citation.apa') %></h2>
18+
<%= document.send(:export_as_apa_citation_txt).html_safe %><br/><br/>
19+
<% end %>
520

6-
<% if document.respond_to?(:export_as_mla_citation_txt) %>
7-
<h2><%= t('blacklight.citation.mla') %></h2>
8-
<%= document.send(:export_as_mla_citation_txt).html_safe %><br/><br/>
9-
<% end %>
10-
11-
<% if document.respond_to?(:export_as_apa_citation_txt) %>
12-
<h2><%= t('blacklight.citation.apa') %></h2>
13-
<%= document.send(:export_as_apa_citation_txt).html_safe %><br/><br/>
14-
<% end %>
15-
16-
<%- if document.respond_to?(:export_as_chicago_citation_txt) -%>
17-
<h2><%= t('blacklight.citation.chicago') %></h2>
18-
<%= document.send(:export_as_chicago_citation_txt).html_safe %>
19-
<%- end -%>
20-
21-
<% end %>
21+
<% if document.respond_to?(:export_as_chicago_citation_txt) %>
22+
<h2><%= t('blacklight.citation.chicago') %></h2>
23+
<%= document.send(:export_as_chicago_citation_txt).html_safe %>
24+
<% end %>
25+
<% end %>
26+
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<%= render :partial => 'citation' -%>
1+
<%= render partial: 'citation' %>

app/views/catalog/citation.js.erb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
<div class="modal-header">
2-
<h1><%= t('blacklight.tools.citation') %></h1>
3-
<button type="button" class="blacklight-modal-close close" data-dismiss="modal" aria-label="<%= t('blacklight.modal.close') %>">
4-
<span aria-hidden="true">&times;</span>
5-
</button>
6-
</div>
7-
<div class="modal-body">
8-
<%= render :partial => 'citation' -%>
9-
</div>
1+
<%= render partial: 'citation' %>

0 commit comments

Comments
 (0)