Removed announcement index as it not required anymore
This commit is contained in:
		
							parent
							
								
									e9a40774ac
								
							
						
					
					
						commit
						b52e6b979b
					
				|  | @ -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 | ||||
|  |  | |||
|  | @ -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 | ||||
|    | ||||
|  |  | |||
|  | @ -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" | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue