Change read more url for tags.

This commit is contained in:
BoHung Chiu 2021-04-09 18:04:53 +08:00
parent 1d76ff87b7
commit 62b0cf84fa
1 changed files with 3 additions and 3 deletions

View File

@ -322,7 +322,7 @@ class AnnouncementsController < ApplicationController
read_more_text = I18n.t("announcement.more") read_more_text = I18n.t("announcement.more")
if cats.count == 1 && cats[0] != "all" if cats.count == 1 && cats[0] != "all"
begin begin
read_more_text = I18n.t("announcement.more_") + cats_translations[cats[0]] read_more_text = I18n.t("announcement.more_") + ((all_tags.count == 1 && all_tags[0] != 'all') ? tags_translations[tags[0]] : cats_translations[cats[0]])
rescue rescue
nil nil
end end
@ -374,9 +374,9 @@ class AnnouncementsController < ApplicationController
</script> </script>
" "
end end
read_more_url = "/#{I18n.locale.to_s + page.url}" rescue ""
read_more_url = read_more_url + "?" + {"category"=>all_cats}.to_param if read_more_url != ""
if @tab_option == 0 if @tab_option == 0
read_more_url = "/#{I18n.locale.to_s + page.url}" rescue ""
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> <script>
$(\"[data-subpart-id=\\\"#{subpart.id}\\\"] .w-annc__more\").attr(\"href\",\"#{read_more_url}\"); $(\"[data-subpart-id=\\\"#{subpart.id}\\\"] .w-annc__more\").attr(\"href\",\"#{read_more_url}\");