# GET /issues/search
def search
- @first_search = issues_query_params_sanitized.empty?
@issues_query_params = criteria_params
+ @first_search = issues_query_params_sanitized.empty?
+ @unchanged = issues_query_params_sanitized.empty?
if params[:id]
@filter = find_filter(params[:id].to_i)
end
def criteria_params
- params['pageSize'] = PAGE_SIZE unless request.xhr?
- params.delete('controller')
- params.delete('action')
- params
+ new_params = params.clone
+ new_params['pageSize'] = PAGE_SIZE unless request.xhr?
+ new_params.delete('controller')
+ new_params.delete('action')
+ new_params
end
def issues_query_params_sanitized
<% if @filter && @filter.id %>
<li><a id="copy" href="<%= url_for :action => 'copy_form', :id => @filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a></li>
<% end %>
- <% if !defined?(@unchanged) && @filter && @filter.id && @filter.user == current_user.login %>
+ <% if !@unchanged && @filter && @filter.id && @filter.user == current_user.login %>
<li>
<%= link_to message('save'), params.merge({:action => 'save', :id => @filter.id}), :class => 'link-action', :id => 'save', :method => :post -%>
</li>