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.consider_all_requests_local = true
|
||||||
#config.action_view.debug_rjs = true
|
#config.action_view.debug_rjs = true
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
config.action_mailer.perform_deliveries = true
|
||||||
|
|
||||||
# Don't care if the mailer can't send
|
# Don't care if the mailer can't send
|
||||||
config.action_mailer.raise_delivery_errors = true
|
config.action_mailer.raise_delivery_errors = true
|
||||||
|
|
|
@ -7,47 +7,46 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||||
# GET /bulletins
|
# GET /bulletins
|
||||||
# GET /bulletins.xml
|
# GET /bulletins.xml
|
||||||
|
|
||||||
def index
|
# def index
|
||||||
|
|
||||||
@part = PagePart.find(params[:part_id])
|
# @part = PagePart.find(params[:part_id])
|
||||||
|
|
||||||
if @part.widget_data_count
|
# if @part.widget_data_count
|
||||||
@page_num = @part.widget_data_count
|
# @page_num = @part.widget_data_count
|
||||||
else
|
# else
|
||||||
@page_num = 4
|
# @page_num = 4
|
||||||
end
|
# end
|
||||||
|
|
||||||
num_of_fields = @part.widget_field_name.reject(&:empty?).length
|
# num_of_fields = @part.widget_field_name.reject(&:empty?).length
|
||||||
widget_field_names = @part.widget_field_name.reject(&:empty?)
|
# widget_field_names = @part.widget_field_name.reject(&:empty?)
|
||||||
widget_classes = @part.widget_class.reject(&:empty?)
|
# widget_classes = @part.widget_class.reject(&:empty?)
|
||||||
@widget_fields = []
|
# @widget_fields = []
|
||||||
|
|
||||||
if @part.widget_field_name
|
# if @part.widget_field_name
|
||||||
num_of_fields.times do |index|
|
# num_of_fields.times do |index|
|
||||||
@widget_fields << [widget_field_names[index], widget_classes[index]]
|
# @widget_fields << [widget_field_names[index], widget_classes[index]]
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
|
|
||||||
@title = @part.title_translations[I18n.locale.to_s]
|
# @title = @part.title_translations[I18n.locale.to_s]
|
||||||
@widget_style = @part.widget_style
|
# @widget_style = @part.widget_style
|
||||||
@category_id = @part.category
|
# @category_id = @part.category
|
||||||
|
|
||||||
date_now = Time.now
|
# date_now = Time.now
|
||||||
|
|
||||||
if !params[:category_id].blank? && !params[:tag_id].blank?
|
# 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]).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?
|
||||||
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)
|
||||||
@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?
|
||||||
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)
|
||||||
@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
|
||||||
else
|
# @posts = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||||
@posts = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
# end
|
||||||
end
|
|
||||||
|
|
||||||
@categories = @module_app.categories.enabled
|
# @categories = @module_app.categories.enabled
|
||||||
|
|
||||||
end
|
# end
|
||||||
|
|
||||||
def bulletins_list_and_pic
|
def bulletins_list_and_pic
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,10 @@ module Announcement
|
||||||
categories_query 'Category.all'
|
categories_query 'Category.all'
|
||||||
tags_query 'AnnouncementTag.all'
|
tags_query 'AnnouncementTag.all'
|
||||||
|
|
||||||
customize_widget "index" do
|
# customize_widget "index" do
|
||||||
widget_i18n "announcement.widget.index"
|
# widget_i18n "announcement.widget.index"
|
||||||
style ["1","2"]
|
# style ["1","2"]
|
||||||
end
|
# end
|
||||||
|
|
||||||
customize_widget "bulletins_search_block" do
|
customize_widget "bulletins_search_block" do
|
||||||
widget_i18n "announcement.widget.search"
|
widget_i18n "announcement.widget.search"
|
||||||
|
|
Loading…
Reference in New Issue