From b52e6b979b098287f13a583bedea145f8667b0ca Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 13 Dec 2013 11:52:37 +0800 Subject: [PATCH] Removed announcement index as it not required anymore --- config/environments/development.rb | 1 + .../widget/bulletins_controller.rb | 63 +++++++++---------- vendor/built_in_modules/announcement/init.rb | 8 +-- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index cc80c368..c7dbcea2 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -13,6 +13,7 @@ Orbit::Application.configure do config.consider_all_requests_local = true #config.action_view.debug_rjs = true config.action_controller.perform_caching = true + config.action_mailer.perform_deliveries = true # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = true diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb index 855cdc31..4dd7f7af 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb @@ -7,47 +7,46 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController # GET /bulletins # GET /bulletins.xml - def index + # def index - @part = PagePart.find(params[:part_id]) + # @part = PagePart.find(params[:part_id]) - if @part.widget_data_count - @page_num = @part.widget_data_count - else - @page_num = 4 - end + # if @part.widget_data_count + # @page_num = @part.widget_data_count + # else + # @page_num = 4 + # end - num_of_fields = @part.widget_field_name.reject(&:empty?).length - widget_field_names = @part.widget_field_name.reject(&:empty?) - widget_classes = @part.widget_class.reject(&:empty?) - @widget_fields = [] + # num_of_fields = @part.widget_field_name.reject(&:empty?).length + # widget_field_names = @part.widget_field_name.reject(&:empty?) + # widget_classes = @part.widget_class.reject(&:empty?) + # @widget_fields = [] - if @part.widget_field_name - num_of_fields.times do |index| - @widget_fields << [widget_field_names[index], widget_classes[index]] - end - end + # if @part.widget_field_name + # num_of_fields.times do |index| + # @widget_fields << [widget_field_names[index], widget_classes[index]] + # end + # end - @title = @part.title_translations[I18n.locale.to_s] - @widget_style = @part.widget_style - @category_id = @part.category + # @title = @part.title_translations[I18n.locale.to_s] + # @widget_style = @part.widget_style + # @category_id = @part.category - date_now = Time.now + # date_now = Time.now - if !params[:category_id].blank? && !params[:tag_id].blank? - @posts = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) - # @posts = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in=>params[:category_id],:tagged_ids.in=>params[:tag_id]) - elsif !params[:category_id].blank? - @posts = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) - elsif !params[:tag_id].blank? - @posts = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) - else - @posts = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) - end + # if !params[:category_id].blank? && !params[:tag_id].blank? + # @posts = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # elsif !params[:category_id].blank? + # @posts = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # elsif !params[:tag_id].blank? + # @posts = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # else + # @posts = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # end - @categories = @module_app.categories.enabled + # @categories = @module_app.categories.enabled - end + # end def bulletins_list_and_pic diff --git a/vendor/built_in_modules/announcement/init.rb b/vendor/built_in_modules/announcement/init.rb index bb0955d4..a3f38d9a 100644 --- a/vendor/built_in_modules/announcement/init.rb +++ b/vendor/built_in_modules/announcement/init.rb @@ -45,10 +45,10 @@ module Announcement categories_query 'Category.all' tags_query 'AnnouncementTag.all' - customize_widget "index" do - widget_i18n "announcement.widget.index" - style ["1","2"] - end + # customize_widget "index" do + # widget_i18n "announcement.widget.index" + # style ["1","2"] + # end customize_widget "bulletins_search_block" do widget_i18n "announcement.widget.search"