fix error

This commit is contained in:
邱博亞 2021-11-17 17:04:22 +08:00
parent 6f2101de4b
commit df61683f93
1 changed files with 4 additions and 4 deletions

View File

@ -201,7 +201,7 @@ class AnnouncementsController < ApplicationController
page = Page.where(:page_id=> subpart.read_more_page_id,:enabled_for=>locale).first rescue nil page = Page.where(:page_id=> subpart.read_more_page_id,:enabled_for=>locale).first rescue nil
page = Page.where(:module=>"announcement",:enabled_for=>locale).first rescue nil if page.nil? page = Page.where(:module=>"announcement",:enabled_for=>locale).first rescue nil if page.nil?
end end
page_url = page.get_url page_url = "/#{locale}#{page.get_url}"
end end
all_cats = cats.dup all_cats = cats.dup
all_cats.delete "all" all_cats.delete "all"
@ -219,7 +219,7 @@ class AnnouncementsController < ApplicationController
"<div style=\"clear: both;\"></div>" + "<div style=\"clear: both;\"></div>" +
"<ul class=\"nav_tabs_filter\">" + "<ul class=\"nav_tabs_filter\">" +
(use_tag ? tags.map.with_index{|tag,i| (use_tag ? tags.map.with_index{|tag,i|
read_more_url = "/#{locale + page_url}" rescue "" read_more_url = "/#{page_url}" rescue ""
read_more_url = read_more_url + "?" + {"category"=>all_cats,"tags"=>(tag == 'all' ? all_tags : [tag])}.to_param if read_more_url != "" read_more_url = read_more_url + "?" + {"category"=>all_cats,"tags"=>(tag == 'all' ? all_tags : [tag])}.to_param if read_more_url != ""
read_more_text = I18n.t("announcement.more") read_more_text = I18n.t("announcement.more")
if tag != "all" if tag != "all"
@ -231,7 +231,7 @@ class AnnouncementsController < ApplicationController
end end
"<li class=\"filter_tab#{i == 0 ? ' active' : ''}\" #{(tag == 'all' && @all_setting_option == 0) ? "data-count_limit=\"#{max_all_count}\"" : ''} data-read_more_text=\"#{read_more_text}\" data-read_more=\"#{read_more_url}\" data-tags=\"#{tag}\">#{tags_translations[tag]}</li>" "<li class=\"filter_tab#{i == 0 ? ' active' : ''}\" #{(tag == 'all' && @all_setting_option == 0) ? "data-count_limit=\"#{max_all_count}\"" : ''} data-read_more_text=\"#{read_more_text}\" data-read_more=\"#{read_more_url}\" data-tags=\"#{tag}\">#{tags_translations[tag]}</li>"
}.join("") : cats.map.with_index{|cat,i| }.join("") : cats.map.with_index{|cat,i|
read_more_url = "/#{locale + page_url}" rescue "" read_more_url = "/#{page_url}" rescue ""
read_more_url = read_more_url + "?" + {"category"=>(cat == 'all' ? all_cats : cat)}.to_param if read_more_url != "" read_more_url = read_more_url + "?" + {"category"=>(cat == 'all' ? all_cats : cat)}.to_param if read_more_url != ""
read_more_text = I18n.t("announcement.more") read_more_text = I18n.t("announcement.more")
if cat != "all" if cat != "all"
@ -374,7 +374,7 @@ class AnnouncementsController < ApplicationController
" "
end end
if @tab_option == 0 if @tab_option == 0
read_more_url = "/#{locale + page_url}" rescue "" read_more_url = "/#{page_url}" rescue ""
read_more_url = read_more_url + "?" + {"category"=>all_cats,"tags"=>all_tags}.to_param if read_more_url != "" read_more_url = read_more_url + "?" + {"category"=>all_cats,"tags"=>all_tags}.to_param if read_more_url != ""
extra_after_html += " extra_after_html += "
<script style=\"display:none\"> <script style=\"display:none\">