Skip to content

Commit

Permalink
params.merge -> params.permit.merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Jul 4, 2016
1 parent 2a8192d commit f2c58c2
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion app/views/manifestations/_carrier_type_facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<li><%= carrier_type_facet(facet) %></li>
<%- end -%>
<%- if params[:carrier_type] -%>
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(carrier_type: nil, page: nil, view: nil, only_path: true)) -%></li>
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(carrier_type: nil, page: nil, view: nil, only_path: true)) -%></li>
<%- end -%>
</ul>
4 changes: 2 additions & 2 deletions app/views/manifestations/_classification_facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<% @classification_facet.each do |category| %>
<li>
<% if category.value == params[:classification].to_s.downcase %><strong><% end %>
<%= link_to "#{t('classification.category', number: category.value)} #{category_name(category.value)} (#{category.count})", url_for(params.merge(classification: category.value, page: nil, view: nil, only_path: true)) %>
<%= link_to "#{t('classification.category', number: category.value)} #{category_name(category.value)} (#{category.count})", url_for(params.permit.merge(classification: category.value, page: nil, view: nil, only_path: true)) %>
<% if category.value == params[:classification].to_s.downcase %></strong><% end %>
</li>
<% end %>
<%- if params[:classification] -%>
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(classification: nil, page: nil, view: nil, only_path: true)) -%></li>
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(classification: nil, page: nil, view: nil, only_path: true)) -%></li>
<%- end -%>
</ul>
<%- else -%>
Expand Down
5 changes: 5 additions & 0 deletions app/views/manifestations/_colorbox.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
$(document).ready(function(){
$('a[rel="manifestation_<%= @manifestation.id -%>"]').colorbox({transition:"none", photo:true});
})
</script>
2 changes: 1 addition & 1 deletion app/views/manifestations/_index_form_parent.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
<%= hidden_field_tag 'parent_id', @parent.id -%>
<%= hidden_field_tag 'reservable', h(@reservable) if @reservable -%>
<% if can? :update, Manifestation %>
<% if can? :update, @parent %>
<%= render 'page/add' %>
<% end %>
<%= submit_tag t('page.search') -%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/manifestations/_language_facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<%- end -%>
<%- end -%>
<%- if params[:language] -%>
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(language: nil, page: nil, view: nil, only_path: true)) -%></li>
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(language: nil, page: nil, view: nil, only_path: true)) -%></li>
<%- end -%>
</ul>
2 changes: 1 addition & 1 deletion app/views/manifestations/_library_facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<%= library_facet(current_libraries, facet) %>
<%- end -%>
<%- if params[:library] -%>
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(library: nil, page: nil, view: nil, only_path: true)) -%></li>
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(library: nil, page: nil, view: nil, only_path: true)) -%></li>
<%- end -%>
</ul>
2 changes: 1 addition & 1 deletion app/views/manifestations/_pub_year_facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</li>
<%- end -%>
<%- if params[:pub_date_from] and params[:pub_date_until] -%>
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(pub_date_from: nil, pub_date_until: nil, page: nil, view: nil, only_path: true)) -%></li>
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(pub_date_from: nil, pub_date_until: nil, page: nil, view: nil, only_path: true)) -%></li>
<%- end -%>
</ul>
4 changes: 2 additions & 2 deletions app/views/manifestations/_reservable_facet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<% facet.value ? facet_reservable = true : facet_reservable = false %>
<li>
<%- if @reservable == facet_reservable -%><strong><%- end -%>
<%= link_to "#{localized_boolean(facet.value)} (#{facet.count})", url_for(params.merge(page: nil, reservable: facet.value.to_s, view: nil, only_path: true)) -%>
<%= link_to "#{localized_boolean(facet.value)} (#{facet.count})", url_for(params.permit.merge(page: nil, reservable: facet.value.to_s, view: nil, only_path: true)) -%>
<%- if @reservable == facet_reservable -%></strong><%- end -%>
</li>
<%- end -%>
<%- unless @reservable.nil? -%>
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(reservable: nil, page: nil, view: nil, only_path: true)) -%></li>
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(reservable: nil, page: nil, view: nil, only_path: true)) -%></li>
<%- end -%>
</ul>
3 changes: 0 additions & 3 deletions app/views/manifestations/_show_series_detail.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<%= series_statement.original_title %>
<% end %>
<%= series_statement.volume_number_string %>
<% unless series_statement.creator_string.blank? %>
(<%= series_statement.creator_string %>)
<% end %>
</li>
<% end %>
</ul>
14 changes: 7 additions & 7 deletions app/views/manifestations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
<%- if params[:sort_by].blank? -%>
<strong><%= t('manifestation.date_of_acquisition') -%></strong>
<%- else -%>
<%= link_to t('manifestation.date_of_acquisition'), url_for(params.merge(sort_by: nil, only_path: true)) -%>
<%= link_to t('manifestation.date_of_acquisition'), url_for(params.permit.merge(sort_by: nil, only_path: true)) -%>
<%- end -%>
<%- if params[:sort_by] == 'pub_date' -%>
<strong><%= t('activerecord.attributes.manifestation.date_of_publication') -%></strong>
<%- else -%>
<%= link_to t('activerecord.attributes.manifestation.date_of_publication'), url_for(params.merge(sort_by: 'pub_date', only_path: true)) -%>
<%= link_to t('activerecord.attributes.manifestation.date_of_publication'), url_for(params.permit.merge(sort_by: 'pub_date', only_path: true)) -%>
<%- end -%>
<%- if params[:sort_by] == 'title' -%>
<strong><%= t('page.title') -%></strong>
<%- else -%>
<%= link_to t('page.title'), url_for(params.merge(sort_by: 'title', only_path: true)) -%>
<%= link_to t('page.title'), url_for(params.permit.merge(sort_by: 'title', only_path: true)) -%>
<%- end -%>
</p>

Expand Down Expand Up @@ -84,15 +84,15 @@
<% if @parent and can?(:update, @parent) %>
<%= render 'submenu_parent' %>
<% end %>
<h3><%= link_to h("#{t('page.total')}: #{@count[:query_result]}"), url_for(params.merge(action: 'index', view: nil, carrier_type: nil, library: nil, language: nil, subject: nil, only_path: true)) -%></h3>
<h3><%= link_to h("#{t('page.total')}: #{@count[:query_result]}"), url_for(params.permit.merge(action: 'index', view: nil, carrier_type: nil, library: nil, language: nil, subject: nil, only_path: true)) -%></h3>
<%- if @manifestations.total_count > 0 -%>
<%= render 'manifestations/all_facet' -%>
<%- end -%>
<div>
<%- if params[:library_id].blank? -%>
<%= link_to((image_tag 'icons/feed.png', size: '16x16', alt: t('page.feed'), class: 'icon'), url_for(params.merge(format: :rss, page: nil, library_id: nil, only_path: true))) -%> <%= link_to t('page.search_result_feed'), url_for(params.merge(format: :rss, page: nil, library_id: nil, commit: nil, only_path: true)) -%>
<%= link_to((image_tag 'icons/feed.png', size: '16x16', alt: t('page.feed'), class: 'icon'), url_for(params.permit.merge(format: :rss, page: nil, library_id: nil, only_path: true))) -%> <%= link_to t('page.search_result_feed'), url_for(params.permit.merge(format: :rss, page: nil, library_id: nil, commit: nil, only_path: true)) -%>
<%- else -%>
<%= link_to((image_tag 'icons/feed.png', size: '16x16', alt: t('page.feed'), class: 'icon'), url_for(params.merge(format: :rss, page: nil, only_path: true))) -%> <%= link_to t('page.search_result_feed'), url_for(params.merge(format: :rss, page: nil, commit: nil, only_path: true)) -%>
<%= link_to((image_tag 'icons/feed.png', size: '16x16', alt: t('page.feed'), class: 'icon'), url_for(params.permit.merge(format: :rss, page: nil, only_path: true))) -%> <%= link_to t('page.search_result_feed'), url_for(params.permit.merge(format: :rss, page: nil, commit: nil, only_path: true)) -%>
<%- end -%>
</div>
<%= render 'manifestations/export_list' %>
Expand All @@ -101,7 +101,7 @@
<% if defined?(EnjuBookmark) %>
<script type="text/javascript">
window.onload = function() {
$("#tag_cloud_list").load('<%= url_for(params.merge(view: "tag_cloud", only_path: true)) -%>', hideTagCloudSpinner);
$("#tag_cloud_list").load('<%= url_for(params.permit.merge(view: "tag_cloud", only_path: true)) -%>', hideTagCloudSpinner);
}

function hideTagCloudSpinner(){
Expand Down
4 changes: 2 additions & 2 deletions app/views/manifestations/index.rdf.builder
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ xml.rdf(:RDF,
'xmlns:foaf' => "http://xmlns.com/foaf/0.1/",
'xmlns:prism' => "http://prismstandard.org/namespaces/basic/2.0/",
'xmlns:rdfs' =>"http://www.w3.org/2000/01/rdf-schema#"){
xml.channel("rdf:about" => manifestations_url(params: params.merge(format: 'rdf', only_path: true))){
xml.channel("rdf:about" => manifestations_url(params: params.permit.merge(format: 'rdf', only_path: true))){
xml.title t('manifestation.query_search_result', query: @query, library_group_name: @library_group.display_name.localize)
xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: nil, only_path: true))}"
xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: nil, only_path: true))}"
xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
xml.language @locale.to_s
xml.ttl "60"
Expand Down
4 changes: 2 additions & 2 deletions app/views/manifestations/index.rss.builder
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ xml.rss('version' => "2.0",
'xmlns:atom' => "http://www.w3.org/2005/Atom"){
xml.channel{
xml.title t('manifestation.query_search_result', query: @query, library_group_name: @library_group.display_name.localize)
xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: nil, only_path: true))}"
xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: nil, only_path: true))}"
xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
xml.language @locale.to_s
xml.ttl "60"
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: :rss, only_path: true))}"
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: :rss, only_path: true))}"
xml.tag! "atom:link", rel: 'alternate', href: manifestations_url
xml.tag! "atom:link", rel: 'search', type: 'application/opensearchdescription+xml', href: page_opensearch_url
unless params[:query].blank?
Expand Down
6 changes: 1 addition & 5 deletions app/views/manifestations/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
<li><%= link_to t('page.new', model: t('activerecord.models.picture_file')), new_picture_file_path(manifestation_id: @manifestation.id) -%></li>
<%- end -%>
</ul>
<script type="text/javascript">
$(document).ready(function(){
$("a[rel='manifestation_<%= @manifestation.id -%>']").colorbox({transition:"none", photo:true});
})
</script>
<%= render 'manifestations/colorbox' %>
<div id="call_number_content">
<%- @manifestation.items.for_checkout(nil).on_shelf.sort_by{|item|
holding_item_sort_criteria(item)
Expand Down

0 comments on commit f2c58c2

Please sign in to comment.