From 9817e5a2025a64e57eb7cdd05a15ccff02fadf71 Mon Sep 17 00:00:00 2001 From: bohung Date: Tue, 19 May 2020 14:20:02 +0800 Subject: [PATCH] Fix bug. --- app/controllers/announcements_controller.rb | 2 +- app/helpers/announcements_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 13b39d6..3763fb0 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -342,9 +342,9 @@ class AnnouncementsController < ApplicationController OrbitHelper.set_current_widget_module("announcement") OrbitHelper.set_params(params,current_user) Bulletin.remove_expired_status - sorted,total_pages = get_sorted_annc OrbitHelper.set_page_number(params[:page_no].to_i) OrbitHelper.set_page_data_count((params[:data_count].blank? ? 10 : params[:data_count].to_i)) + sorted,total_pages = get_sorted_annc anns = sorted.collect do |a| if a["source-site"].blank? statuses = a.statuses_with_classname.collect do |status| diff --git a/app/helpers/announcements_helper.rb b/app/helpers/announcements_helper.rb index 5d898bc..276d03b 100644 --- a/app/helpers/announcements_helper.rb +++ b/app/helpers/announcements_helper.rb @@ -372,7 +372,7 @@ module AnnouncementsHelper end html = render_link_to_edit(html, data["url_to_edit"]) if !data["url_to_edit"].nil? total_pages = data['total_pages'].to_i rescue 1 - if @show_page == false + if @show_page == "false" html = html.gsub("{{pagination_goes_here}}","") else if total_pages > 1