2012-09-24 03:43:48 +00:00
|
|
|
module Announcement
|
|
|
|
OrbitApp.registration "Announcement",:type=> 'ModuleApp' do
|
2012-11-29 06:21:46 +00:00
|
|
|
module_label 'announcement.announcement'
|
2012-09-24 03:43:48 +00:00
|
|
|
base_url File.expand_path File.dirname(__FILE__)
|
|
|
|
|
2013-02-20 09:25:20 +00:00
|
|
|
# personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile",:i18n=>'announcement.announcement'
|
2012-09-24 03:43:48 +00:00
|
|
|
|
2012-11-29 06:21:46 +00:00
|
|
|
version "0.1"
|
|
|
|
organization "Rulingcom"
|
|
|
|
author "RD dep"
|
|
|
|
intro "I am intro"
|
|
|
|
update_info 'some update_info'
|
2012-09-24 03:43:48 +00:00
|
|
|
|
2012-11-29 06:21:46 +00:00
|
|
|
front_end do
|
2013-05-23 04:07:43 +00:00
|
|
|
app_page 'search_result' do
|
|
|
|
frontend_i18n "announcement.frontend.search_result"
|
|
|
|
end
|
|
|
|
|
2013-01-29 12:33:40 +00:00
|
|
|
app_page 'bulletins' do
|
2013-02-18 07:13:31 +00:00
|
|
|
frontend_i18n "announcement.frontend.bulletins"
|
2013-03-11 10:21:17 +00:00
|
|
|
style ["1","2","3"]
|
2013-01-29 12:33:40 +00:00
|
|
|
end
|
2012-11-29 06:21:46 +00:00
|
|
|
end
|
2012-09-24 03:43:48 +00:00
|
|
|
|
2013-07-02 08:46:44 +00:00
|
|
|
# category ["BulletinCategory"]
|
2013-02-23 10:29:50 +00:00
|
|
|
data_count 3..10
|
2012-09-13 10:31:44 +00:00
|
|
|
|
2013-07-02 08:46:44 +00:00
|
|
|
authorizable
|
2013-07-10 08:42:25 +00:00
|
|
|
approvable
|
2013-07-02 08:46:44 +00:00
|
|
|
categorizable
|
2013-05-24 10:42:01 +00:00
|
|
|
taggable
|
|
|
|
|
2012-11-29 06:21:46 +00:00
|
|
|
widgets do
|
|
|
|
default_widget do
|
2013-03-27 08:31:42 +00:00
|
|
|
query 'Bulletin.any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
|
2013-09-14 03:54:35 +00:00
|
|
|
enable ["typeA", "typeB_style3", "typeC"]
|
2012-11-29 06:21:46 +00:00
|
|
|
image :image
|
2013-01-29 12:33:40 +00:00
|
|
|
field :postdate
|
|
|
|
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
|
2013-10-22 07:53:37 +00:00
|
|
|
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}}
|
2013-09-14 03:54:35 +00:00
|
|
|
field :subtitle
|
2013-03-20 09:45:08 +00:00
|
|
|
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
2012-11-29 06:21:46 +00:00
|
|
|
end
|
2012-09-24 03:43:48 +00:00
|
|
|
|
2013-07-02 08:46:44 +00:00
|
|
|
categories_query 'Category.all'
|
2012-11-29 06:21:46 +00:00
|
|
|
tags_query 'AnnouncementTag.all'
|
2012-09-13 10:31:44 +00:00
|
|
|
|
2013-01-29 12:33:40 +00:00
|
|
|
customize_widget "index" do
|
|
|
|
widget_i18n "announcement.widget.index"
|
|
|
|
style ["1","2"]
|
|
|
|
end
|
2013-05-01 04:16:28 +00:00
|
|
|
|
|
|
|
customize_widget "bulletins_search_block" do
|
|
|
|
widget_i18n "announcement.widget.search"
|
|
|
|
end
|
|
|
|
|
2013-07-18 06:52:57 +00:00
|
|
|
customize_widget "bulletins_and_web_links" do
|
|
|
|
widget_i18n "announcement.widget.bulletins_and_web_links"
|
|
|
|
style ["bulletins_and_links","bulletins_only"]
|
|
|
|
end
|
|
|
|
|
2012-11-29 06:21:46 +00:00
|
|
|
# item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"]
|
|
|
|
# item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links"
|
|
|
|
end
|
|
|
|
|
2012-11-20 07:56:52 +00:00
|
|
|
side_bar do
|
2013-02-06 09:44:38 +00:00
|
|
|
head_label_i18n 'announcement.announcement',:icon_class=>"icons-megaphone"
|
2012-11-20 07:56:52 +00:00
|
|
|
available_for [:admin,:guest,:manager,:sub_manager]
|
2013-07-02 08:46:44 +00:00
|
|
|
active_for_controllers ({:private=>['bulletins', 'bulletin_categorys', 'approvals','module_tags', 'categories']})
|
2012-11-20 07:56:52 +00:00
|
|
|
active_for_object_auth ['BulletinCategory']
|
2012-09-24 03:43:48 +00:00
|
|
|
|
2012-11-20 07:56:52 +00:00
|
|
|
head_link_path "panel_announcement_back_end_bulletins_path"
|
2012-09-24 03:43:48 +00:00
|
|
|
|
2012-11-20 07:56:52 +00:00
|
|
|
context_link 'announcement.all_articles',
|
|
|
|
:link_path=>"panel_announcement_back_end_bulletins_path" ,
|
2013-07-02 08:46:44 +00:00
|
|
|
:priority=>1,
|
2012-12-03 10:52:36 +00:00
|
|
|
:active_for_action=>{:bulletins=>:index},
|
|
|
|
:available_for => [:all]
|
2012-11-20 07:56:52 +00:00
|
|
|
context_link 'announcement.add_new',
|
|
|
|
:link_path=>"new_panel_announcement_back_end_bulletin_path" ,
|
2013-07-02 08:46:44 +00:00
|
|
|
:priority=>2,
|
2012-11-20 07:56:52 +00:00
|
|
|
:active_for_action=>{:bulletins=>:new},
|
2012-12-03 10:52:36 +00:00
|
|
|
:available_for => [:sub_manager]
|
2012-11-20 07:56:52 +00:00
|
|
|
context_link 'announcement.categories',
|
2013-07-02 08:46:44 +00:00
|
|
|
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
|
2012-11-20 07:56:52 +00:00
|
|
|
:priority=>3,
|
2013-07-02 08:46:44 +00:00
|
|
|
:active_for_category => 'Announcement',
|
2012-11-20 07:56:52 +00:00
|
|
|
:available_for => [:manager]
|
2013-03-12 10:13:48 +00:00
|
|
|
context_link 'tags',
|
2013-07-02 08:46:44 +00:00
|
|
|
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
|
2012-11-20 07:56:52 +00:00
|
|
|
:priority=>4,
|
2013-07-02 08:46:44 +00:00
|
|
|
:active_for_tag => 'Announcement',
|
2012-11-20 07:56:52 +00:00
|
|
|
:available_for => [:manager]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|