Skip to content

Commit

Permalink
Make the views rely on local variables instead of ivars
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Feb 25, 2016
1 parent 6699597 commit 4beec89
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions app/views/collections/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<h3><%= @presenter.description %> </h3>

<% unless has_collection_search_parameters? %>
<%= render partial: 'collections/show_actions' %>
<%= render 'attributes', curation_concern: @presenter %>
<%= render 'collections/show_actions' %>
<%= render 'attributes', presenter: @presenter %>
<% end %>
<%= render 'search_form' %>
Expand Down
12 changes: 6 additions & 6 deletions app/views/curation_concerns/base/_attribute_rows.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= @presenter.attribute_to_html(:description) %>
<%= @presenter.attribute_to_html(:creator, catalog_search_link: true ) %>
<%= @presenter.attribute_to_html(:contributor, label: 'Contributors', catalog_search_link: true) %>
<%= @presenter.attribute_to_html(:subject, catalog_search_link: true) %>
<%= @presenter.attribute_to_html(:publisher) %>
<%= @presenter.attribute_to_html(:language) %>
<%= presenter.attribute_to_html(:description) %>
<%= presenter.attribute_to_html(:creator, catalog_search_link: true ) %>
<%= presenter.attribute_to_html(:contributor, label: 'Contributors', catalog_search_link: true) %>
<%= presenter.attribute_to_html(:subject, catalog_search_link: true) %>
<%= presenter.attribute_to_html(:publisher) %>
<%= presenter.attribute_to_html(:language) %>

12 changes: 6 additions & 6 deletions app/views/curation_concerns/base/_attributes.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<table class="table table-striped <%= dom_class(@presenter) %> attributes" <%= @presenter.microdata_type_to_html %>>
<table class="table table-striped <%= dom_class(presenter) %> attributes" <%= presenter.microdata_type_to_html %>>
<caption class="table-heading"><h2>Attributes</h2></caption>
<thead>
<tr><th>Attribute Name</th><th>Values</th></tr>
</thead>
<tbody>
<%= render 'attribute_rows' %>
<%= render 'attribute_rows', presenter: presenter %>
<tr>
<th>Visibility</th>
<td>
<%= @presenter.permission_badge %>
<%= presenter.permission_badge %>
</td>
</tr>
<%= @presenter.attribute_to_html(:embargo_release_date) %>
<%= @presenter.attribute_to_html(:lease_expiration_date) %>
<%= @presenter.attribute_to_html(:rights) %>
<%= presenter.attribute_to_html(:embargo_release_date) %>
<%= presenter.attribute_to_html(:lease_expiration_date) %>
<%= presenter.attribute_to_html(:rights) %>
</tbody>
</table>
2 changes: 1 addition & 1 deletion app/views/curation_concerns/base/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<% editor = can?(:edit, @presenter.id) %>
<%= render 'representative_media', work: @presenter %>
<%= render 'attributes', curation_concern: @presenter %>
<%= render "attributes", presenter: @presenter %>
<%= render 'related_files', presenter: @presenter %>
<% if editor %>
<%= render 'multiple_upload', presenter: @presenter %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/curation_concerns/file_sets/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<h1>File Details <small><%= @presenter.title %></small></h1>
<% end %>
<%= media_display @presenter %>
<%= render "attributes", curation_concern: @presenter %>
<%= render "attributes", presenter: @presenter %>
<%= render "show_actions", presenter: @presenter, parent: parent %>
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
</p>
<h2> Descriptions:</h2>

<%= render 'attributes' %>
<%= render 'attributes', presenter: @presenter %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
before do
allow(view).to receive(:dom_class) { '' }

assign(:presenter, presenter)
render
render 'curation_concerns/base/attributes', presenter: presenter
end

it 'has links to search for other objects with the same metadata' do
Expand Down

0 comments on commit 4beec89

Please sign in to comment.