posts/show: rename tags params to q in various places.

Fixup for 011a6f1f7.
This commit is contained in:
evazion
2018-10-30 11:32:07 -05:00
parent 011a6f1f7c
commit 39374a70d3
6 changed files with 12 additions and 12 deletions

View File

@@ -36,9 +36,9 @@ class PostsController < ApplicationController
def show_seq
context = PostSearchContext.new(params)
if context.post_id
redirect_to(post_path(context.post_id, :tags => params[:tags]))
redirect_to(post_path(context.post_id, q: params[:q]))
else
redirect_to(post_path(params[:id], :tags => params[:tags]))
redirect_to(post_path(params[:id], q: params[:q]))
end
end
@@ -106,7 +106,7 @@ private
@error_message = post.errors.full_messages.join("; ")
render :template => "static/error", :status => 500
else
response_params = {:tags => params[:tags_query], :pool_id => params[:pool_id], :favgroup_id => params[:favgroup_id]}
response_params = {:q => params[:tags_query], :pool_id => params[:pool_id], :favgroup_id => params[:favgroup_id]}
response_params.reject!{|key, value| value.blank?}
redirect_to post_path(post, response_params)
end

View File

@@ -5,7 +5,7 @@ class PostSearchContext
def initialize(params)
@id = params[:id].to_i
@seq = params[:seq]
@tags = params[:tags].presence || "status:any"
@tags = params[:q].presence || "status:any"
end
def post_id

View File

@@ -187,7 +187,7 @@ class PostPresenter < Presenter
end
def has_sequential_navigation?(params)
return false if Tag.has_metatag?(params[:tags], :order, :ordfav, :ordpool)
return false if Tag.has_metatag?(params[:q], :order, :ordfav, :ordpool)
return false if params[:pool_id].present? || params[:favgroup_id].present?
return CurrentUser.user.enable_sequential_post_navigation
end
@@ -219,7 +219,7 @@ class PostPresenter < Presenter
first = true
pools = @post.pools.undeleted
pools.each do |pool|
if first && template.params[:tags].blank? && template.params[:favgroup_id].blank?
if first && template.params[:q].blank? && template.params[:favgroup_id].blank?
html += pool_link_html(template, pool, :include_rel => true)
first = false
else

View File

@@ -7,7 +7,7 @@
<%= render "sources/info" %>
<%= form_for(post, :html => {:class => "simple_form", :id => "form"}) do |f| %>
<%= hidden_field_tag :tags_query, params[:tags] %>
<%= hidden_field_tag :tags_query, params[:q] %>
<%= hidden_field_tag :pool_id, params[:pool_id] %>
<%= hidden_field_tag :favgroup_id, params[:favgroup_id] %>
<%= f.hidden_field :old_tag_string, :value => post.tag_string %>

View File

@@ -1,9 +1,9 @@
<div id="search-seq-nav">
<ul>
<li class="active">
<%= link_to "&lsaquo;&thinsp;prev".html_safe, show_seq_post_path(post, :tags => params[:q], :seq => "prev"), :rel => "prev nofollow", :class => "prev" %>
<%= link_to "&lsaquo;&thinsp;prev".html_safe, show_seq_post_path(post, :q => params[:q], :seq => "prev"), :rel => "prev nofollow", :class => "prev" %>
<span class="search-name">Search: <%= params[:q].presence || "status:any" %></span>
<%= link_to "next&thinsp;&rsaquo;".html_safe, show_seq_post_path(post, :tags => params[:q], :seq => "next"), :rel => "next nofollow", :class => "next" %>
<%= link_to "next&thinsp;&rsaquo;".html_safe, show_seq_post_path(post, :q => params[:q], :seq => "next"), :rel => "next nofollow", :class => "next" %>
</li>
</ul>
</div>

View File

@@ -1,12 +1,12 @@
<div id="c-posts">
<div id="a-show">
<aside id="sidebar">
<%= render "posts/partials/common/search", :path => posts_path, :tags => params[:tags], :tags_dom_id => "tags" %>
<%= render "posts/partials/common/search", :path => posts_path, :tags => params[:q], :tags_dom_id => "tags" %>
<%= render "posts/partials/index/blacklist" %>
<section id="tag-list">
<%= @post.presenter.split_tag_list_html(current_query: params[:tags], show_extra_links: CurrentUser.user.is_gold?) %>
<%= @post.presenter.split_tag_list_html(current_query: params[:q], show_extra_links: CurrentUser.user.is_gold?) %>
</section>
<section id="post-information">
@@ -67,7 +67,7 @@
<section id="mark-as-translated-section" style="display: none;">
<%= form_tag(mark_as_translated_post_path(@post), :class => "simple_form", :method => :put) do |f| %>
<%= hidden_field_tag :tags_query, params[:tags] %>
<%= hidden_field_tag :tags_query, params[:q] %>
<%= hidden_field_tag :pool_id, params[:pool_id] %>
<fieldset>