app/views/resolve/_citation.html.erb in umlaut-3.1.1 vs app/views/resolve/_citation.html.erb in umlaut-3.2.0
- old
+ new
@@ -1,51 +1,42 @@
<%
-cite = @user_request.referent.to_citation
+# Get the citation from the user request
+cite = user_request.referent.to_citation
+# Set the page title to the citation's title
@page_title = cite[:title] %>
-
-<% if @user_request.referent.type_of_thing.present? %>
- <p class="resource-type"><%=@user_request.referent.type_of_thing.titlecase %></p>
+<% if user_request.referent.type_of_thing.present? %>
+ <p class="resource-type"><%= user_request.referent.type_of_thing.titlecase %></p>
<% end %>
-
<h2 class="title"><%= cite[:title] %></h2>
-
<% if cite[:author].present? || cite[:date].present? %>
<p class="author-and-date">
<% if cite[:author].present? %>
<span class="author"><%= cite[:author] %></span>
<% end %>
-
<% if cite[:author].present? && cite[:date].present? %>
<span class="sep">•</span>
<% end %>
-
<% if cite[:date].present? %>
<span class="date"><%= date_format(cite[:date]) %></span>
<% end %>
</p>
<% end %>
-
<p class="published_in">
<% if [:container_title, :volume, :issue, :page].find {|k| cite[k].present? } %>
-
- <span class="published-label">Published in <%= cite[:container_label] %></span> <span class="container-title">
- <%= cite[:container_title] %></span>.
+ <span class="published-label">Published in <%= cite[:container_label] %></span>
+ <span class="container-title"><%= cite[:container_title] %></span>.
<% end %>
-
<% if cite[:volume].present? %>
- <span class="volume">Volume <%= cite[:volume] %></span>.
+ <span class="volume">Volume <%= cite[:volume] %></span>.
<% end %>
-
<% if cite[:issue].present? %>
- <span class="issue">Issue <%= cite[:issue] %></span>.
+ <span class="issue">Issue <%= cite[:issue] %></span>.
<% end %>
-
<% if cite[:page].present? %>
- <span class="page">Page <%= cite[:page] %></span>.
+ <span class="page">Page <%= cite[:page] %></span>.
<% end %>
</p>
-
<dl class="citation-info">
<%= if cite[:pub].present?
content_tag(:dt, "Publisher:", :class => "publisher") +
content_tag(:dd, cite[:pub], :class => "publisher")
end %>
@@ -55,9 +46,7 @@
end %>
<%= if cite[:isbn].present?
content_tag(:dt, "ISBN:", :class => "isbn") +
content_tag(:dd, cite[:isbn], :class => "isbn")
end %>
-
<%# todo, doi %>
-
-</dl>
\ No newline at end of file
+</dl>