member plugin edit
This commit is contained in:
commit
bc44d38948
319 files changed
+5405
-2763
No files matched your search
+24
-17
@@ -1,17 +1,24 @@
|
||||
{
|
||||
"title": "announcement",
|
||||
"version": "0.1",
|
||||
"organization": "Rulingcom",
|
||||
"author": "RD dep",
|
||||
"intro": "A simple blog……",
|
||||
"update_info": "Some info",
|
||||
"create_date": "11-11-2011",
|
||||
"app_pages": ["bulletins"],
|
||||
"widgets": {
|
||||
"index":["1","2","3","4","5"],
|
||||
"bulletins_and_web_links":[]
|
||||
},
|
||||
"category": ["BulletinCategory"],
|
||||
"widget_fields":["title","category","postdate"],
|
||||
"enable_frontend": true
|
||||
}
|
||||
{
|
||||
"app_pages":["bulletins"],
|
||||
"author":"RD dep",
|
||||
"create_date":"11-11-2011",
|
||||
"enable_frontend":true,
|
||||
"get_default_widget":{"query":"Bulletin.all","image":"image"},
|
||||
"intro":"A simple blog",
|
||||
"key":"announcement",
|
||||
"organization":"Rulingcom",
|
||||
"title":"Announcement",
|
||||
"update_info":"Some info",
|
||||
"version":"0.1",
|
||||
"widget_fields":[["title","announcement.default_widget.title"],
|
||||
["bulletin_category_with_title","announcement.default_widget.bulletin_category_with_title"],
|
||||
["postdate","announcement.default_widget.postdate"]],
|
||||
"widget_fields_link_method":{"title":{"method":"panel_announcement_front_end_bulletin_path","args":"self"},
|
||||
"bulletin_category_with_title":{"method":"panel_announcement_front_end_bulletins_path",
|
||||
"args":{"category_id":["bulletin_category","id"]}
|
||||
}},
|
||||
"widget_options":null,
|
||||
"widget_options_fields_i18n":null,
|
||||
"widgets":{"index":["1","2"],
|
||||
"default_widget":["typeA","typeC","typeB_style2","typeB_style3","typeB_style4"]
|
||||
}}
|
||||
+15
-2
@@ -1,7 +1,20 @@
|
||||
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
|
||||
include OrbitControllerLib::DivisionForDisable
|
||||
# if someone want to use json format replace with rss, please add :get_bulletins_json to below
|
||||
before_filter :for_app_manager,:except => [:index,:get_categorys_json]
|
||||
|
||||
# <<<<<<< HEAD
|
||||
# before_filter :for_app_manager,:except => [:index,:get_categorys_json]
|
||||
# before_filter :set_module_app
|
||||
|
||||
# def set_module_app
|
||||
# @module_app = ModuleApp.where(:title=>'Announcement').first
|
||||
# end
|
||||
# =======
|
||||
before_filter :for_app_manager,:except => [:index,:get_categorys_json,:get_bulletins_json]
|
||||
|
||||
|
||||
before_filter :force_order_for_visitor,:only=>[:index,:get_categorys_json,:get_bulletins_json]
|
||||
before_filter :force_order_for_user,:except => [:index,:get_categorys_json,:get_bulletins_json]
|
||||
before_filter :for_app_sub_manager,:except => [:index,:get_categorys_json,:get_bulletins_json]
|
||||
|
||||
def index
|
||||
@bulletin_categorys = get_categories_for_index("BulletinCategory")
|
||||
|
||||
-7
@@ -70,13 +70,6 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
|
||||
end
|
||||
|
||||
def bulletins_and_web_links
|
||||
@tags = AnnouncementTag.any_in(key: ['students', 'alumni', 'employee', 'guest']).asc(:order)
|
||||
@selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0]
|
||||
@bulletins = @selected_tag.get_visible_bulletins(:postdate).available_for_lang(I18n.locale).can_display.page(params[:page]).per(5) rescue nil
|
||||
@web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links(:created_at).available_for_lang(I18n.locale).page(params[:page]).per(5) rescue nil
|
||||
end
|
||||
|
||||
def reload_bulletins
|
||||
@selected_tag = AnnouncementTag.find(params[:tag_id])
|
||||
@bulletins = @selected_tag.get_visible_bulletins(:postdate).available_for_lang(I18n.locale).can_display.page(params[:page]).per(5) rescue nil
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
<div class="tag_block">
|
||||
<ul id='bulletins_web_links_tags' class="tag_list">
|
||||
<%= render :partial => 'tag', :collection => @tags %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="news_block">
|
||||
<h3 class="news_title2"><%= link_to t("announcement.bulletins"), panel_announcement_front_end_bulletins_path, :class => 'more' %></h3>
|
||||
<ul id='bulletins_web_links_bulletins' class="news_list">
|
||||
<%= render 'bulletins' if @bulletins %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="links_block">
|
||||
<h3 class="links_title"><%= t(:related_links) %></h3>
|
||||
<ul id='bulletins_web_links_web_links' class="links_list">
|
||||
<%= render 'web_links' if @web_links %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "news_link" %>
|
||||
<% end %>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
$('#bulletins_web_links_tags').html("<%= j render :partial => 'tag', :collection => @tags %>")
|
||||
$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>")
|
||||
$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>")
|
||||
@@ -11,10 +11,21 @@ zh_tw:
|
||||
editing_announcement_category: 編輯公告類別
|
||||
error:
|
||||
no_avilb_cate_for_posting: 公告必需有一個類別才能發送,請與管理員聯絡
|
||||
front_end:
|
||||
bulletins: 請LIN給名字前台頁
|
||||
new_bulletin_category: 新增公告類別
|
||||
search: 搜尋公告
|
||||
update_bulletin_success: 公告已成功更新
|
||||
update_bulletin_category_success: 公告類別已成功更新
|
||||
widget:
|
||||
index: 目錄Widget
|
||||
bulletins_and_web_links: 公告與連結並排Widget
|
||||
#init don't merge
|
||||
all_articles: 全部公告
|
||||
add_new: 新增
|
||||
categories: 分類
|
||||
approval_setting: 審核權限
|
||||
tags: 標籤
|
||||
default_widget:
|
||||
bulletin_category_with_title: 分類
|
||||
title: 標題
|
||||
|
||||
+128
-17
@@ -1,25 +1,136 @@
|
||||
# module Announcement
|
||||
# OrbitApp.registration "Announcement",:type=> 'ModuleApp' do
|
||||
module Announcement
|
||||
OrbitApp.registration "Announcement",:type=> 'ModuleApp' do
|
||||
module_label 'announcement.announcement'
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
|
||||
# base_url File.expand_path File.dirname(__FILE__)
|
||||
# personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile"
|
||||
# personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile",:i18n=>'announcement.announcement'
|
||||
|
||||
version "0.1"
|
||||
organization "Rulingcom"
|
||||
author "RD dep"
|
||||
intro "I am intro"
|
||||
update_info 'some update_info'
|
||||
|
||||
# end
|
||||
front_end do
|
||||
app_page 'bulletins' do
|
||||
frontend_i18n "announcement.front_end.bulletins"
|
||||
end
|
||||
end
|
||||
|
||||
# end
|
||||
category ["BulletinCategory"]
|
||||
|
||||
widgets do
|
||||
default_widget do
|
||||
query 'Bulletin.all'
|
||||
image :image
|
||||
field :postdate
|
||||
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
|
||||
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
|
||||
end
|
||||
|
||||
categories_query 'BulletinCategory.all'
|
||||
tags_query 'AnnouncementTag.all'
|
||||
|
||||
customize_widget "index" do
|
||||
widget_i18n "announcement.widget.index"
|
||||
style ["1","2"]
|
||||
end
|
||||
# item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"]
|
||||
# item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links"
|
||||
end
|
||||
|
||||
side_bar do
|
||||
head_label_i18n 'admin.announcement',:icon_class=>"icons-megaphone"
|
||||
available_for [:admin,:guest,:manager,:sub_manager]
|
||||
active_for_controllers ({:private=>['bulletins', 'bulletin_categorys', 'approvals','tags']})
|
||||
active_for_object_auth ['BulletinCategory']
|
||||
|
||||
head_link_path "panel_announcement_back_end_bulletins_path"
|
||||
|
||||
context_link 'announcement.all_articles',
|
||||
:link_path=>"panel_announcement_back_end_bulletins_path" ,
|
||||
:priority=>2,
|
||||
:active_for_action=>{:bulletins=>:index},
|
||||
:available_for => [:all]
|
||||
context_link 'announcement.add_new',
|
||||
:link_path=>"new_panel_announcement_back_end_bulletin_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{:bulletins=>:new},
|
||||
:available_for => [:sub_manager]
|
||||
|
||||
context_link 'announcement.categories',
|
||||
:link_path=>"panel_announcement_back_end_bulletin_categorys_path" ,
|
||||
:priority=>3,
|
||||
:active_for_action=>{:bulletin_categorys=>:index},
|
||||
:available_for => [:manager]
|
||||
|
||||
|
||||
# OrbitApp.backend_side_bar 'News' do
|
||||
|
||||
# block :available_for => [:admin,:guest,:manager,:sub_manager],
|
||||
# :active_for_controllers=> ['news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals'],
|
||||
# :active_for_ob_auths_object => ['NewsBulletinCategory'],
|
||||
# :head_link => panel_news_back_end_news_bulletins_path ,
|
||||
# :head_label=> I18n.t(:news)
|
||||
context_link 'announcement.tags',
|
||||
:link_path=>"panel_announcement_back_end_tags_path" ,
|
||||
:priority=>4,
|
||||
# :active_for_action=>{:bulletin_categorys=>:index},
|
||||
:available_for => [:manager]
|
||||
|
||||
# context_link :link=>new_panel_news_back_end_news_bulletin_path ,
|
||||
# :priority=>1,:label=>I18n.t('announcement.add_new'),
|
||||
# :active_for_action=>{:news_bulletins=>:new}
|
||||
|
||||
# end
|
||||
# widgets do
|
||||
# default_widget do
|
||||
# query 'Bulletin.all'
|
||||
# image :image
|
||||
# end
|
||||
|
||||
# categories_query 'BulletinCategory.all'
|
||||
# tags_query 'AnnouncementTag.all'
|
||||
|
||||
# customize_widget "index","announcement.widget.index",:fields=>["title","category","postdate"],:style=>["cu_style_1","cu_style_2","cu_style_3","cu_style_4","cu_style_5"]
|
||||
# customize_widget "bulletins_and_web_links","announcement.widget.bulletins_and_web_links"
|
||||
# # item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"]
|
||||
# # item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links"
|
||||
# end
|
||||
|
||||
# side_bar do
|
||||
# head_label_i18n 'admin.announcement',:icon_class=>"icons-megaphone"
|
||||
# available_for [:admin,:guest,:manager,:sub_manager]
|
||||
# active_for_controllers ({:private=>['bulletins', 'bulletin_categorys', 'approvals','tags']})
|
||||
# active_for_object_auth ['BulletinCategory']
|
||||
|
||||
# head_link_path "panel_announcement_back_end_bulletins_path"
|
||||
|
||||
# context_link 'announcement.all_articles',
|
||||
# :link_path=>"panel_announcement_back_end_bulletins_path" ,
|
||||
# :priority=>1,
|
||||
# :active_for_action=>{:bulletins=>:index},
|
||||
# :available_for => [:all]
|
||||
|
||||
# context_link 'announcement.add_new',
|
||||
# :link_path=>"new_panel_announcement_back_end_bulletin_path" ,
|
||||
# :priority=>2,
|
||||
# :active_for_action=>{:bulletins=>:new},
|
||||
# :available_for => [:sub_manager]
|
||||
|
||||
# context_link 'announcement.categories',
|
||||
# :link_path=>"panel_announcement_back_end_bulletin_categorys_path" ,
|
||||
# :priority=>3,
|
||||
# :active_for_action=>{:bulletin_categorys=>:index},
|
||||
# :available_for => [:manager]
|
||||
|
||||
# context_link 'announcement.tags',
|
||||
# :link_path=>"panel_announcement_back_end_tags_path" ,
|
||||
# :priority=>4,
|
||||
# # :active_for_action=>{:bulletin_categorys=>:index},
|
||||
# :available_for => [:manager]
|
||||
|
||||
context_link 'announcement.approval_setting',
|
||||
:link_path=>"panel_announcement_back_end_approval_setting_path" ,
|
||||
:priority=>5,
|
||||
:active_for_action=>{:approvals=>:setting},
|
||||
:active_for_object_auth => 'BulletinCategory',
|
||||
:available_for => [:manager]
|
||||
|
||||
context_link 'admin.module.authorization',
|
||||
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'Announcement'}))",
|
||||
:priority=>6,
|
||||
:active_for_app_auth => 'Announcement',
|
||||
:available_for => [:admin]
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user