diff --git a/app/views/layouts/page_layout.html.erb b/app/views/layouts/page_layout.html.erb
index 8fb884b0..dd9aa94a 100644
--- a/app/views/layouts/page_layout.html.erb
+++ b/app/views/layouts/page_layout.html.erb
@@ -4,7 +4,6 @@
<%= page_title(@item).html_safe %>
<%= page_metas(@item).html_safe %>
- <%= @metas %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 69491cbc..4713415f 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -68,6 +68,14 @@ en:
traffic: Traffic
admin:
+ access:
+ denied:
+ app:
+ not_sub_manager: Access Denied for you are not SubManager for this app
+ not_manager: Access Denied for you are not SubManager for this app
+ not_authed_user: Access Denied for you are not User for this app
+ not_admin: Access Denied for you are not Admin
+ object: "Access Denied for you don't have permission for this object"
action: Action
ad_banner: AD Banner
ad:
@@ -90,6 +98,7 @@ en:
admin: Admin
action: Action
all_articles: List
+ always_display_title: Always displayed in the title bar
announcement: Announcement
asset: Asset
assets:
@@ -128,6 +137,7 @@ en:
editing_role: Editing user role
email: Email
enable_language: Enable language
+ enabled_for: Enabled for
file_name: Filename
file_size: File size
format: Format
@@ -138,6 +148,7 @@ en:
is_published: Is published
item: Item
key: Key
+ keywords: Keywords
language: Language
layout: Layout
layout_name: Layout name
@@ -152,6 +163,7 @@ en:
list_infos: User information list
list_roles: User roles list
member: Member
+ menu_enabled_for: Menu enabled for
module:
authorization: Module Authorization
move_down: Move down
@@ -190,7 +202,10 @@ en:
setup_translations: Translations setup
setup_designs: Designs setup
site: Site
+ site_description: Site description
+ site_footer: Site footer
site_settings: Site Setting
+ site_title: Site title
super_pages: Super pages
structure: Structure
title: Title
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index 6e680094..dc9e0cb8 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -8,12 +8,12 @@ zh_tw:
back: 回上一步
browse: 選擇檔案
cancel: 取消
- create: 創建
+ create: 新增
delete: 刪除
desktop: 桌面
disable: 禁用
dots: …
- downloaded: 已經下載
+ downloaded: 已下載
download: 下載
edit: 編輯
email: 電子郵件
@@ -50,7 +50,7 @@ zh_tw:
file_type: 檔案類型
hits: 點擊率
item: 項目
- member: 成員
+ member: 會員
module: 模組
most_visited_page: 熱門頁面
quantity: 數量
@@ -65,6 +65,14 @@ zh_tw:
traffic: 流量
admin:
+ access:
+ denied:
+ app:
+ not_sub_manager: 拒絕存取因你不是此應用程式次管理員
+ not_manager: 拒絕存取因你不是此應用程式管理員
+ not_authed_user: 拒絕存取因你不是此應用程式授權使用者
+ not_admin: 拒絕存取因你不是此應用程式次管理員
+ object: 拒絕存取因你不是網站管理者
action: 操作
ad_banner: 廣告輪播
ad:
@@ -84,8 +92,9 @@ zh_tw:
add_item: 新增項目
add_language: 新增語言
add_drop_down_item: +增加Orbit選單
- admin: 管理
+ admin: 網站管理者
all_articles: 列表
+ always_display_title: 永遠顯示於標題列
announcement: 公告管理
asset: 資產
assets:
@@ -97,22 +106,22 @@ zh_tw:
author: 作者
calendar: 行事曆
cant_delete_self: 您不可以刪除自己。
- cant_revoke_self_admin: 您不可以撤銷自己的管理作用。
+ cant_revoke_self_admin: 您不可以撤銷自己的管理身份。
choose_file: 請選擇一個文件...
class: 階級
content: 內容
- create_error_link: 創建連接時出錯。
- create_error_page: 創建頁面時出錯。
- create_success_home: 首頁已成功創建。
- create_success_layout: 樣板已成功創建。
- create_success_link: 連結已成功創建。
- create_success_page: 頁面已成功創建。
- create_success_home: 首頁已成功創建。
- create_success_layout: 佈局已成功創建。
- create_success_link: 連結已成功創建。
- create_success_page: 頁面已成功創建。
- create_success_snippet: 片段已成功創建。
- create_success_user: 用戶已成功創建。。
+ create_error_link: 新增連接時出錯。
+ create_error_page: 新增頁面時出錯。
+ create_success_home: 首頁已成功新增。
+ create_success_layout: 樣板已成功新增。
+ create_success_link: 連結已成功新增。
+ create_success_page: 頁面已成功新增。
+ create_success_home: 首頁已成功新增。
+ create_success_layout: 佈局已成功新增。
+ create_success_link: 連結已成功新增。
+ create_success_page: 頁面已成功新增。
+ create_success_snippet: 片段已成功新增。
+ create_success_user: 用戶已成功新增。。
dashboard: 儀表板
data: 資料數據
delete_language: 刪除語言
@@ -129,6 +138,7 @@ zh_tw:
editing_role: 編輯用戶身份
email: Email
enable_language: 啟用語言
+ enabled_for: 啟用
file_name: 檔名
file_size: 檔案大小
format: 格式
@@ -138,7 +148,8 @@ zh_tw:
intro: 簡介
is_published: 被出版
item: 網站架構
- key: 鍵值
+ key: 關鍵
+ keywords: 關鍵字
language: 語言
layout: 佈局
layout_name: 佈局名字
@@ -153,6 +164,7 @@ zh_tw:
list_infos: 用戶資料列表
list_roles: 用戶身份列表
member: 會員
+ menu_enabled_for: 選單啟用
module:
authorization: 模組授權
move_down: 往下移
@@ -186,7 +198,10 @@ zh_tw:
purchase: 購買
role: 身份
roles: 身份
+ site_description: 網站描述
+ site_footer: 網站頁尾
site_settings: 基本設定
+ site_title: 網站標題
setup_member: 成員設置
setup_translations: 語系設定
setup_designs: 版型設定
diff --git a/config/routes.rb b/config/routes.rb
index f560d819..f486581b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -25,7 +25,7 @@ Orbit::Application.routes.draw do
end
- match 'ad_banner/:id/preview' => 'ad_banners#realtime_preview',:as => :realtime_preview_ad_banner,:via => :put
+ match 'ad_banners/:id/preview' => 'ad_banners#realtime_preview',:as => :realtime_preview_ad_banner,:via => :put
resources :ad_banners do
collection do
match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get
@@ -37,6 +37,7 @@ Orbit::Application.routes.draw do
resources :designs do
collection do
get 'upload_package'
+ post 'delete'
post 'upload_package'
end
member do
@@ -92,7 +93,13 @@ Orbit::Application.routes.draw do
get 'add_sub_role'
get 'add_attribute_field'
end
- resources :sites
+ resources :sites do
+ get 'site_info'
+ get 'system_info'
+ get 'language'
+ get 'mail_setting'
+ get 'ui_theme'
+ end
resources :snippets
resources :tags
resources :translations
diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb
index 24b6c59f..0ebaf90b 100644
--- a/lib/parsers/parser_back_end.rb
+++ b/lib/parsers/parser_back_end.rb
@@ -28,6 +28,7 @@ module ParserBackEnd
parse_menu(body, page, true)
public_r_tags = parse_content_edits(body, page, id)
parse_images(body, page)
+ parse_footer(body, page, true)
public_r_tags.each do |tag|
send("parse_#{tag}s", body, page,id)
diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb
index 6e7fea47..41d57cbb 100644
--- a/lib/parsers/parser_common.rb
+++ b/lib/parsers/parser_common.rb
@@ -1,47 +1,36 @@
module ParserCommon
-
+ include ActionView::Helpers::TagHelper
+
def menu_level(page, current, menu, edit = false)
res = ''
- if menu.levels > 0 && current <= menu.levels
- if current != 0
- res << "
'
+ if page.ordered_and_visible_children.size > 0
+ res << ""
end
res
end
def menu_li(page, current, menu, i, edit)
res = ""
end
@@ -103,7 +92,7 @@ module ParserCommon
page_menu = body.css('.page_menu').first
home = get_homepage
menu = page.design.layout.menu
- fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, 0, menu, edit))
+ fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, 1, menu, edit))
page_menu.swap(fragment)
end
@@ -114,7 +103,7 @@ module ParserCommon
res << "
"
else
part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb
index 2d10dd75..566b0742 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb
@@ -1,7 +1,15 @@
class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendController
before_filter :authenticate_user!
+ before_filter :is_admin?
include AdminHelper
# layout 'admin'
+ def preview_and_approve
+ @bulletin = Bulletin.find params[:bulletin_id]
+ end
+
+ def approve
+
+ end
def setting
@bulletin_categorys = BulletinCategory.all
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
index 841dedf0..5c23ded5 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
@@ -1,5 +1,6 @@
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
- layout 'new_admin'
+
+ before_filter :for_app_manager,:except => [:index]
def index
@bulletin_categorys = BulletinCategory.all
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb
index 8677ef79..8ed6389a 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb
@@ -3,8 +3,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
layout 'new_admin'
before_filter :authenticate_user!
- before_filter :is_admin?
-
+# before_filter :for_admin_only,:only => [:]
+# before_filter :for_app_manager,:only => [:index,:show,]
+ before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
def index
# @bulletins = Bulletin.all
# @bulletins = Bulletin.desc("postdate desc")
@@ -44,6 +45,10 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@bulletin_file = BulletinFile.new
@file_url = panel_announcement_back_end_bulletins_path
+ @bulletins.delete_if{ |bulletin|
+ bulletin.is_pending == true && (!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || bulletin.create_user_id!=current_user.id)
+ }
+
respond_to do |format|
format.html # index.html.erb
format.js { }
@@ -81,14 +86,17 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# @bulletin.bulletin_files.build
# @bulletin.bulletin_files.new
-
- get_categorys
- get_tags
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @bulletin }
- end
+ if get_categorys.empty?
+ flash[:alert] = t("announcement.error.no_avilb_cate_for_posting")
+ redirect_to :action => :index
+ else
+ get_tags
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @bulletin }
+ end
+ end
end
# GET /bulletins/1/edit
@@ -312,10 +320,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
def get_categorys(id = nil)
@bulletin_categorys = []
+ @unit_list_for_anc = UnitListForAnc.all
if(is_manager? || is_admin?)
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
elsif is_sub_manager?
- @bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit_new')
+ @bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit')
end
end
@@ -323,87 +332,5 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc)
end
-
- def get_sorted_and_filtered_bulletins
- bulletins = Bulletin.all
- case params[:sort]
- when 'postdate', 'deadline'
- bulletins = bulletins.order_by([params[:sort], params[:direction]])
- when 'category'
- category_ids = bulletins.distinct(:bulletin_category_id)
- categories = BulletinCategory.find(category_ids) rescue nil
- if categories
- h = Hash.new
- categories.each { |category| h[category.i18n_variable[I18n.locale]] = category.id }
- sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
- sorted_categorys = sorted.collect {|a| bulletins.where(:bulletin_category_id => a[1]).entries }
- bulletins = sorted_categorys.flatten!
- end
- when 'title'
- h = Array.new
- bulletins.each { |bulletin| h << [bulletin.title[I18n.locale].downcase, bulletin] }
- sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
- bulletins = sorted.collect {|a| a[1] }
- when 'status'
- bulletins = bulletins.order_by(:is_top, params[:direction]).order_by(:is_hot, params[:direction]).order_by(:is_hidden, params[:direction]).order_by(:is_pending, params[:direction]).order_by(:is_checked, params[:direction]).order_by(:is_rejected, params[:direction])
- when 'update_user_id'
- user_ids = bulletins.distinct(:update_user_id)
- users = User.find(user_ids) rescue nil
- if users
- h = Array.new
- users.each { |user| h << [user.name, user.id] }
- sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
- sorted_users = sorted.collect {|a| bulletins.where(:update_user_id => a[1]).entries }
- bulletins = sorted_users.flatten
- end
- when 'tags'
- a = Array.new
- AnnouncementTag.all.order_by(I18n.locale, params[:direction]).each { |tag| a << tag.bulletins }
- a.flatten!
- a.uniq!
- tmp = Array.new
- bulletins.where(:tag_ids => []).each { |bulletin| tmp << [bulletin.title[I18n.locale].downcase, bulletin] }
- sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse!
- sorted_titles = sorted.collect {|a| a[1] }
- a = params[:direction].eql?('asc') ? (sorted_titles + a) : (a + sorted_titles)
- bulletins = a.flatten
- end
- if @filter
- @filter.each do |key, value|
- case key
- when 'status'
- a = Array.new
- bulletins.each do |bulletin|
- value.each do |v|
- case v
- when 'pending'
- a << bulletin if bulletin.is_checked.nil?
- when 'rejected'
- a << bulletin if bulletin.is_checked.eql?(false)
- else
- a << bulletin if bulletin[v]
- end
- end
- end
- bulletins = a.uniq
- when 'categories'
- a = Array.new
- bulletins.each do |bulletin|
- a << bulletin if value.include?(bulletin.bulletin_category.id.to_s)
- end
- bulletins = a.uniq
- when 'tags'
- a = Array.new
- bulletins.each do |bulletin|
- bulletin.tags.each do |tag|
- a << bulletin if value.include?(tag.id.to_s)
- end
- end
- bulletins = a.uniq
- end if value.size > 0
- end
- end
- Kaminari.paginate_array(bulletins).page(params[:page]).per(10)
- end
end
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
index e8f25163..d3efc5c6 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb
@@ -25,10 +25,20 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
end
def show
- @bulletin = Bulletin.can_display.where(_id: params[:id]).first
- get_categorys
+ if params[:preview] == "true"
+ preview_content
+ else
+ @bulletin = Bulletin.can_display.where(_id: params[:id]).first
+ get_categorys
+ end
+
end
+ def preview_content
+ @bulletin = Bulletin.find params[:id]
+ get_categorys
+ render :show
+ end
protected
diff --git a/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb b/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb
index 5dcf39d3..8e6b9bff 100644
--- a/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb
+++ b/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb
@@ -2,7 +2,7 @@ module Panel::Announcement::BackEnd::BulletinsHelper
def show_approval_link(bulletin)
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
- by_user = bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?
+ by_user = (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?)
by_bulletin and by_user
end
diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb
index 44882df3..008090f4 100644
--- a/vendor/built_in_modules/announcement/app/models/bulletin.rb
+++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb
@@ -33,6 +33,7 @@ class Bulletin
mount_uploader :image, ImageUploader
belongs_to :bulletin_category
+ belongs_to :unit_list_for_anc
# embeds_many :bulletin_links, :cascade_callbacks => true
# embeds_many :bulletin_files, :cascade_callbacks => true
diff --git a/vendor/built_in_modules/announcement/app/models/unit_list_for_anc.rb b/vendor/built_in_modules/announcement/app/models/unit_list_for_anc.rb
new file mode 100644
index 00000000..5261f6a2
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/models/unit_list_for_anc.rb
@@ -0,0 +1,12 @@
+class UnitListForAnc
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ field :order
+ field :ut_code
+ field :up_ut_code
+
+ has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true
+
+
+end
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_modal_approve.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_modal_approve.html.erb
new file mode 100644
index 00000000..35049b98
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_modal_approve.html.erb
@@ -0,0 +1,69 @@
+ <% if bulletin -%>
+
+
+
+
+
+<% end -%>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/preview_and_approve.js.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/preview_and_approve.js.erb
new file mode 100644
index 00000000..d0e4649d
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/preview_and_approve.js.erb
@@ -0,0 +1,5 @@
+$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_approve',:locals => {:bulletin => @bulletin})) %>");
+var start_modal_with_id = "bulletin-<%=@bulletin.id%>";
+$("#"+start_modal_with_id).css("width","1050px");
+$("#"+start_modal_with_id).css("height","768px");
+$("#"+start_modal_with_id).css("margin","-270px 0 0 -550px");
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb
index a75440e5..8ad4578e 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb
@@ -4,10 +4,13 @@
<%= bulletin_category.key %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb
index 4d31464f..26a88dab 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb
@@ -35,7 +35,7 @@
-
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb
index d171e0b3..b69def3b 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb
@@ -1,5 +1,9 @@
- <%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %> |
+
+ <% if (bulletin.create_user_id == current_user.id) || is_manager? %>
+ <%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %>
+ <% end -%>
+ |
@@ -27,27 +31,32 @@
<%= bulletin.bulletin_category.i18n_variable[I18n.locale] %> |
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
+
- <% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
- - <%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %>
- -
- <%= t(:quick_edit) %>
-
-
- <%#= debugger %>
- <%#= a=1 %>
- <% if show_approval_link(bulletin) %>
- - <%= link_to t('announcement.bulletin.approval'), edit_panel_announcement_back_end_bulletin_path(bulletin) %>
<%#= #TODO add ancher so user can quick access into that part %>
- <% end %>
+ <% if (bulletin.create_user_id == current_user.id) || is_manager? %>
+
+ <% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
+ - <%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %>
+ -
+ <%= t(:quick_edit) %>
+
+
+ <%#= debugger %>
+ <%#= a=1 %>
+
+ <% end %>
+ - <%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %>
+ <% end -%>
+ <% if show_approval_link(bulletin) %>
+ - <%= link_to t('announcement.bulletin.approval'), panel_announcement_back_end_bulletin_approval_preview_path(bulletin),:class => 'preview_trigger' %>
<%#= #TODO add ancher so user can quick access into that part %>
<% end %>
- - <%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %>
|
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
index 360cead2..59cfa538 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
@@ -105,28 +105,6 @@
-
-
-
- <% if is_manager? || @bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin? %>
-
- <%= f.label :approval_stat, t('announcement.bulletin.approval_stat') %>
- <%= content_tag :label,:class => "radio inline" do -%>
- <%= f.radio_button :is_checked, true , {:class => 'privacy'} %>
- <%= t('announcement.bulletin.approval_pass') %>
- <% end -%>
- <%= content_tag :label,:class => "radio inline" do -%>
- <%= f.radio_button :is_checked, false, (!@bulletin.is_checked ? {:checked => true, :class => 'privacy'} : {})%>
- <%= t('announcement.bulletin.approval_not_pass') %>
- <% end -%>
-
- <%= label :is_checked_false, t('announcement.bulletin.approval_not_pass_reason') %>
- <%= f.text_field :not_checked_reason %>
-
-
-
- <% end %>
-
<% elsif current_user.admin? %>
<%= f.hidden_field :is_checked,:value => true%>
@@ -139,13 +117,16 @@
+
+ <%= f.label :unit_list_for_anc%>
+ <%= f.select :unit_list_for_anc_id,@unit_list_for_anc.collect{|t| [ t.title[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
<%= f.label :category %>
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
<%# @site_valid_locales.each_with_index do |locale, i| %>
- <% site_valid_locales_default_head.each_with_index do |locale, i| %>
+ <% @site_valid_locales.each_with_index do |locale, i| %>
- ><%= I18nVariable.from_locale(locale) %>
<% end %>
@@ -153,7 +134,7 @@
<%# @site_valid_locales.each_with_index do |locale, i| %>
- <% site_valid_locales_default_head.each_with_index do |locale, i| %>
+ <% @site_valid_locales.each_with_index do |locale, i| %>
">
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb
index 563be190..c64035a5 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb
@@ -5,8 +5,11 @@
<% end %>
-
-
-
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "bulletin_form" %>
+ <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
+ <%= javascript_include_tag "inc/modal-preview" %>
<% end %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
index 2f37df9c..c6d0c06d 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
@@ -4,7 +4,7 @@
@@ -14,58 +14,18 @@
<%= @bulletin.text[I18n.locale].html_safe %>
+
+ <%= t('announcement.link') %>
+<% @bulletin.bulletin_links.each do | blink | %>
+ <%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %>
+<% end %>
+
+
+<%= t('announcement.file') %>
+<% @bulletin.bulletin_files.each do | bfile | %>
+<%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
+<% end %>
+
-
-
-<%#= link_back %>
diff --git a/vendor/built_in_modules/announcement/config/locales/en.yml b/vendor/built_in_modules/announcement/config/locales/en.yml
index 5f319340..1c4f51b0 100644
--- a/vendor/built_in_modules/announcement/config/locales/en.yml
+++ b/vendor/built_in_modules/announcement/config/locales/en.yml
@@ -59,6 +59,8 @@ en:
all_articles: List
add_new: Add
categories: Categories
+ error:
+ no_avilb_cate_for_posting: You need a category to submit your post,please contact admin
sure?: Sure?
campus_news: Campus News
more: more+
@@ -80,8 +82,9 @@ en:
approval_setting_window_title: 'Unit'
approval_user_list: 'Approval Users'
cate_auth: Category Authorization
+ submit_approval: Submit approval
tag_cloud: Tag cloud
-
+
# admin:
# action: Action
# add_language: Add language
diff --git a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml
index 11e79fcc..5cadd843 100644
--- a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml
+++ b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml
@@ -37,6 +37,8 @@ zh_tw:
announcement:
add_new: 新增
all_articles: 列表
+ error:
+ no_avilb_cate_for_posting: 您目前沒有分類可以刊登公告,請聯絡系統管理員為您開通分類
tags: 標籤
categories: 分類
status: 狀態
@@ -61,6 +63,7 @@ zh_tw:
approval_setting_window_title: '單位'
approval_user_list: '審核者'
cate_auth: '分類授權'
+ submit_approval: '提交審核'
tag_cloud: 標籤雲
bulletin:
diff --git a/vendor/built_in_modules/announcement/config/routes.rb b/vendor/built_in_modules/announcement/config/routes.rb
index 6e60960f..396ea8e4 100644
--- a/vendor/built_in_modules/announcement/config/routes.rb
+++ b/vendor/built_in_modules/announcement/config/routes.rb
@@ -7,6 +7,8 @@ Rails.application.routes.draw do
match 'approval_setting' => "approvals#update_setting" ,:as => :approval_setting,:via => :post
match 'approval_setting' => "approvals#user_list" ,:as => :approval_user_list,:via => :put
resources :bulletins do
+ match "approve/:bulletin_id" => "approvals#preview_and_approve",:as => :approval_preview,:via => :put
+ match "approve/:bulletin_id" => "approvals#approve",:as => :approve,:via => :post
match "link_quick_add/:bulletin_id" => "bulletins#link_quick_add" ,:as => :link_quick_add
match "link_quick_edit/:bulletin_id" => "bulletins#link_quick_edit" ,:as => :link_quick_edit
member do
@@ -32,7 +34,9 @@ Rails.application.routes.draw do
resources :tags
end
namespace :front_end do
- resources :bulletins
+ resources :bulletins # do
+ # match "preview" => "bulletins#preview_content",:as => :get_preview_content
+ # end
end
namespace :widget do
match "bulletins" => "bulletins#index"
diff --git a/vendor/built_in_modules/announcement/lib/tasks/data_for_ut_list_for_posting_anc.rake b/vendor/built_in_modules/announcement/lib/tasks/data_for_ut_list_for_posting_anc.rake
new file mode 100644
index 00000000..e5bd0be2
--- /dev/null
+++ b/vendor/built_in_modules/announcement/lib/tasks/data_for_ut_list_for_posting_anc.rake
@@ -0,0 +1,15 @@
+# encoding: utf-8
+
+namespace :nccu_data do
+ desc "load nccu data from csv"
+ task :setup_ut_list => :environment do
+ require 'csv'
+
+ CSV.foreach("vendor/built_in_modules/announcement/lib/ut_list_from_nccu_2012feb.csv") do |row|
+ new_unit = UnitListForAnc.new(:order => row[0], :ut_code => row[1], :up_ut_code => row[2], :created_at => Time.now,:updated_at => Time.now)
+ new_unit.build_title :en => row[4], :zh_tw => row[3]
+ new_unit.save
+ end
+
+ end
+end
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/lib/ut_list_from_nccu_2012feb.csv b/vendor/built_in_modules/announcement/lib/ut_list_from_nccu_2012feb.csv
new file mode 100644
index 00000000..548ad528
--- /dev/null
+++ b/vendor/built_in_modules/announcement/lib/ut_list_from_nccu_2012feb.csv
@@ -0,0 +1,186 @@
+order,ut_code,up_tu_code,ut_zh_tw,ut_en
+0100,H00,H00,校長室,Office of the President
+0110,H01,H01,副校長室一,Office of the Vice President
+0110,H03,H03,副校長室二,Office of the Vice President
+0200,100,100,文學院,College of Liberal Arts
+0210,101,100,中文系,Dept. of Chinese Literature
+0220,103,100,歷史系,Dept. of History
+0230,104,100,哲學系,Dept. of Philosophy
+0240,155,100,圖檔所,"Graduate Institute of Library, Informati"
+0250,156,100,宗教所,Graduate Institute of Religious Studies
+0260,158,100,台史所,Graduate Institute of Taiwan History
+0270,159,100,台文所,Graduate Institute of Taiwan Literatu
+0280,161,100,華文碩,Master's Program in Teaching Chinese as
+0290,160,100,華文博,Doctor's Program in Teaching Chinese as
+0294,913,100,圖資專班,E-learning Master Program of Library and
+0300,700,700,理學院,College of Science
+0310,701,700,應數系,Dept. of Mathematical Sciences
+0320,702,700,心理系,Dept. of Psychology
+0330,703,700,資科系,Dept. of Computer Science
+0340,754,700,神科所,The Graduate Institute of Neuroscience
+0350,755,700,應物所,Graduate Institute of Applied Physics
+0600,200,200,社科院,College of Social Sciences
+0605,202,200,政治系,Dept. of Political Science
+0610,204,200,社會系,Dept. of Sociology
+0615,205,200,財政系,Dept. of Public Finance
+0620,206,200,公行系,Dept. of Public Administration
+0625,207,200,地政系,Dept. of Land Economics
+0630,208,200,經濟系,Dept. of Economics
+0635,209,200,民族系,Dept. of Ethnology
+0640,261,200,國發所,GIDS
+0645,262,200,勞工所,Graduate Institute of Labor Research
+0650,264,200,社工所,Graduate Institute of Social Work
+0652,265,200,亞太博,International Doctor Program in Asia-Pac
+0700,600,600,法學院,College of Law
+0710,601,600,法律系,Dept. of Law
+0720,652,600,法科所,The Institute of Law and Inter-disciplin
+0800,300,300,商學院,College of Commerce
+0801,301,300,國貿系,Dept. of International Business
+0803,302,300,金融系,Dept. of Money and Banking
+0805,303,300,會計系,Dept. of Accounting
+0807,304,300,統計系,Dept. of Statistics
+0809,305,300,企管系,Dept. of Business Administration
+0811,306,300,資管系,Dept. of Management Information System
+0813,307,300,財管系,Dept. of Finance
+0815,308,300,風管系,Dept. of Risk Management and Insurance
+0817,359,300,科管所,Graduate Institute of Technology and Inn
+0819,361,300,智財所,Graduate Institute of Intellectual Prope
+0821,362,300,管理碩士學程,Advanced Master of Business Administrati
+0823,380,300,商管碩,Advanced Master of Business Administrati
+1100,500,500,外語學院,College of Foreign Languages
+1110,501,500,英文系,Dept. of English
+1120,502,500,阿文系,Dept. of Arabic Language and Literature
+1130,504,500,斯拉夫文系,Dept. of Slavic Languages and Literature
+1140,506,500,日文系,Dept. of Japanese
+1150,507,500,韓文系,Dept. of Korean Language and Cultur
+1160,508,500,土文系,Dept. of Turkish Language and Cultu
+1170,555,500,語言所,Graduate Institute of Linguistics
+1180,509,500,歐洲語文學程,Undergraduate Program in European Langua
+1190,5T1,500,外文中心,Foreign Languages Center
+1200,400,400,傳播學院,College of Communication
+1210,401,400,新聞系,Dept. of Journalism
+1220,402,400,廣告系,Dept. of Advertising
+1230,403,400,廣電系,Dept. of Radio and Television
+1240,461,400,國傳英語碩士學位學程,International Master's Program in Intern
+1250,404,400,傳播學程,College of Communication Undergraduate D
+1260,462,400,數位內容學程,DCT
+1270,781,700,數位內容與科技學士學位學程,數位內容與科技學士學位學程
+1280,4A1,400,實習廣播電台,NCCU Community Radio Station
+1300,800,800,國際事務學院,College of International Affairs
+1310,203,800,外交系,Dept. of Diplomacy
+1320,260,800,東亞所,Graduate Institute of East Asian Studies
+1330,263,800,俄研所,Graduate Institute of Russian Studies
+1340,861,800,日碩研,Master Program in Japan Studies
+1346,862,800,國際研究英語碩士學位學程(籌備處),International Master's Program in Intern
+1600,900,900,教育學院,College of Education
+1610,102,900,教育系,Dept. of Education
+1620,157,900,幼教所,Graduate Institute of Early Childhood Ed
+1630,171,900,教政所,Graduate Institute of Educational Admini
+1640,1T3,900,師培中心,Institute of Teacher Education
+1652,172,900,輔諮碩學程,MPCG
+1660,1T1,900,教研中心,The Teacher In-Service Education Center
+1700,L00,L00,國關中心,The Institute of International Relations
+1710,L01,L00,國關第一所,First Division
+1720,L02,L00,國關第二所,Second Division
+1730,L03,L00,國關第三所,Third Division
+1740,L04,L00,國關第四所,Fourth Division
+1750,L05,L00,國關合交組,The Institute of International Relations
+1760,L06,L00,國關編譯組,The Institute of International Relations
+1770,L07,L00,國關圖資組,The Institute of International Relations
+1780,L08,L00,國關秘書組,The Institute of International Relations
+1800,S00,S00,選研中心,Election Study Center
+1900,Z01,Z01,第三部門研究中心,Center for the Third Sector
+1910,Z02,Z02,創新創造力研究中心,CCIS
+1920,Z03,Z03,中國大陸研究中心,Center for China Studies
+1930,Z04,Z04,台灣研究中心,TSC
+1940,Z08,Z08,心腦學中心,"Reseach Center for Mind, Brain and Learn"
+1950,Z10,Z10,原民中心,Center for Aboriginal Studies
+1960,Z09,Z09,人文中心,Humanities Center
+2000,T00,T00,教務處,Office of Academic Affairs
+2010,T01,T00,教務處註冊組,Registration Section
+2020,T02,T00,教務處課務組,Instruction Resources Section
+2030,T03,T00,教務處綜合業務組,Admission Section
+2040,T04,T00,教務處通識教育中心,Center of General Education
+2100,M00,M00,學務處,Office of Student Affairs
+2110,M01,M00,學務處生僑組,Life Guidance and Overseas Chinese Stude
+2120,M02,M00,學務處課外組,Student Activities Section
+2130,M03,M00,學務處住宿組,Student Housing Service Section
+2150,M11,M00,學務處藝文中心,Art and Culture Center
+2155,M14,M00,學務處身心健康中心,Physical and Mental Health Center
+2160,M13,M00,學務處職涯中心,Center of Career Development
+2170,D00,M00,學務處軍訓室,Military Education Office
+2200,G00,G00,總務處,Office of General Affairs
+2210,G01,G00,總務處文書組,Document and postal section
+2220,G02,G00,總務處事務組,General Management Section
+2230,G05,G00,總務處出納組,Cashier Section
+2240,G04,G00,總務處營繕組,Construction and Maintenance Section
+2250,G03,G00,總務處財產組,Property Management SEction
+2260,G06,G00,總務處環保組,Environmental Protection Section
+2270,G08,G00,總務處規劃組,Campus Planning & Devel opment Section
+2280,G07,G00,總務處駐警隊,Campus Security National Chengchi Unive
+2300,R00,R00,研發處,Office of Research and Development
+2310,R01,R00,研發處企畫組,Planning Section
+2320,R02,R00,研發處學術推展組,Academic Development Section
+2330,R03,R00,研發處學評組,Academic Evaluation Section
+2400,Z05,Z05,國合處,Office of International Cooperation
+2410,Z06,Z05,國合處合作交流組,CES
+2420,Z07,Z05,國合處教育組,IES
+2430,Z14,Z05,國合處發展策劃組,DPS
+2500,Q00,Q00,秘書處,Secretariat
+2510,Q01,Q00,秘書處第一組,First Section
+2520,Q02,Q00,秘書處第二組,Second Section
+2530,Q03,Q00,秘書處第三組,Third Section
+2600,K00,K00,圖書館,Libraries
+2610,K06,K00,圖書館資訊組,System Information Section
+2620,K07,K00,圖書館採編組,Acquisition & Cataloging Section
+2630,K08,K00,圖書館典閱組,Circulation Section
+2640,K09,K00,圖書館推廣服務組,Reference Services Section
+2650,K10,K00,圖書館數位典藏組,Digital Preservation Section
+2660,K11,K00,圖書館行政組,Administration Section
+2670,K12,K00,圖書館圖書分館,Branch Libraries
+2700,B00,B00,體育室,Physical Education Office
+2710,B01,B00,體育教學組,Physical Education Office
+2720,B02,B00,體育活動組,Sport activities section
+2800,P00,P00,人事室,Personnel Office
+2810,P01,P00,人一組,First Section
+2820,P02,P00,人二組,Second Section
+2830,P03,P00,人三組,Third Section
+2840,P04,P00,人四組,Fourth Section
+2900,A00,A00,會計室,Accounting Office
+2910,A01,A00,會計室第一組,Budgeting Section
+2920,A02,A00,會計室第二組,Accounting Section
+2930,A03,A00,會計室第三組,Auditing Section
+3000,I00,I00,公企中心,Public and Business Administration Educa
+3010,I01,I00,公企諮詢組,Research and Consultation Section
+3020,I02,I00,公企職訓組,Training Section
+3030,I03,I00,公企語訓組,Language Training Section
+3040,I04,I00,公企總務組,General Affairs Section
+3050,I05,I00,公企中心圖資組,Library Resource Section
+3100,O00,O00,公教中心,Civil Service Education Center
+3110,O01,O00,公教教務組,Civil Service Education Center
+3120,O02,O00,公教輔導組,Civil Service Education Center
+3130,O03,O00,公教行政組,Civil Service Education Center
+3200,J00,J00,社資中心,Social Sciences Information Center
+3210,J03,J00,社資資料組,Reference Services Section
+3220,J04,J00,社資研發組,Section of Research & Development
+3300,C00,C00,電算中心,Computer Center
+3310,C01,C00,電算教研組,Teaching and Research Section
+3320,C02,C00,電算系統組,Application System Section
+3330,C03,C00,電算行政組,Administration and Counseling Section
+3340,C04,C00,電算網路組,Networking and Development Section
+3400,T05,T05,教學發展中心,Center for Teaching and Learning Develop
+3410,T06,T05,教發教學組,Teaching and Learning Division
+3420,T07,T05,教發數位組,E-Learning Division
+3430,T08,T05,教發規劃組,Planning and Research Division
+3500,162,162,華語文中心,Chinese Language Center
+3600,Z11,Z11,育成中心,Innovation Incubation Center
+3700,V00,V00,附設實小,The Experimental Elementary School
+3700,V01,V00,附設實小教務處,Office of Academic Affairs
+3700,V02,V00,附設實小學務處,Office of Student Affairs
+3700,V03,V00,附設實小輔導室,The Experimental Elementary School
+3700,V04,V00,附設實小總務處,Office of General Affairs
+3700,V06,V00,附設實小研究處,The Experimental Elementary School
+3710,V05,V00,附設實小幼稚園,The Experimental Elementary School
+3800,W00,W00,附中,The Affiliated High School
+3900,Z13,Z13,政大書院辦公室,Chengchi College Project Office
+4000,Z12,Z12,頂大辦公室,Office of NCCU Top University Program
\ No newline at end of file
diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb
index c6cb33ea..c6eda9d0 100644
--- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb
+++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb
@@ -1,7 +1,16 @@
class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController
before_filter :authenticate_user!
+ before_filter :is_admin?
include AdminHelper
+ def preview_and_approve
+ @bulletin = NewsBulletin.find params[:bulletin_id]
+ end
+
+ def approve
+
+ end
+
def setting
@news_bulletin_categorys = NewsBulletinCategory.all
if params.has_key?(:category_id)
diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb
index 83ca09f8..956e98dc 100644
--- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb
+++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb
@@ -1,5 +1,8 @@
class Panel::News::BackEnd::NewsBulletinCategorysController < OrbitBackendController
+ before_filter :for_app_manager,:except => [:index]
+
+
def index
@news_bulletin_categorys = NewsBulletinCategory.all
@news_bulletin_category = NewsBulletinCategory.new(:display => 'List')
diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb
index f5c2b5e6..e845cbd1 100644
--- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb
+++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb
@@ -1,7 +1,10 @@
class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
before_filter :authenticate_user!
- before_filter :is_admin?
+
+# before_filter :for_admin_only,:only => [:]
+# before_filter :for_app_manager,:only => [:index,:show,]
+ before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_news_bulletins]
def index
# @news_bulletins = NewsBulletin.all
@@ -39,6 +42,10 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
@news_bulletin_link = NewsBulletinLink.new
@link_url = panel_news_back_end_news_bulletins_path
+ @news_bulletins.delete_if{ |news_bulletin|
+ news_bulletin.is_pending == true && (!news_bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || news_bulletin.create_user_id!=current_user.id)
+ }
+
@news_bulletin_file = NewsBulletinFile.new
@file_url = panel_news_back_end_news_bulletins_path
@@ -75,17 +82,19 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
def new
@news_bulletin = NewsBulletin.new
- @link_url = panel_news_back_end_news_bulletins_path
+ @link_url = panel_news_back_end_news_bulletins_path
# @news_bulletin.news_bulletin_files.build
# @news_bulletin.news_bulletin_files.new
-
- get_categorys
- get_tags
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @news_bulletin }
+ if get_categorys.empty?
+ flash[:alert] = t("announcement.error.no_avilb_cate_for_posting")
+ redirect_to :action => :index
+ else
+ get_tags
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @news_bulletin }
+ end
end
end
@@ -311,10 +320,11 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
def get_categorys(id = nil)
@news_bulletin_categorys = []
+ @unit_list_for_anc = UnitListForAnc.all
if(is_manager? || is_admin?)
@news_bulletin_categorys = (id ? NewsBulletinCategory.find(id).to_a : NewsBulletinCategory.excludes('disabled' => true))
elsif is_sub_manager?
- @news_bulletin_categorys = NewsBulletinCategory.authed_for_user(current_user,'submit_new')
+ @news_bulletin_categorys = NewsBulletinCategory.authed_for_user(current_user,'submit')
end
end
@@ -323,86 +333,4 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
@tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc)
end
- def get_sorted_and_filtered_news_bulletins
- news_bulletins = NewsBulletin.all
- case params[:sort]
- when 'postdate', 'deadline'
- news_bulletins = news_bulletins.order_by([params[:sort], params[:direction]])
- when 'category'
- category_ids = news_bulletins.distinct(:news_bulletin_category_id)
- categories = NewsBulletinCategory.find(category_ids) rescue nil
- if categories
- h = Hash.new
- categories.each { |category| h[category.i18n_variable[I18n.locale]] = category.id }
- sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
- sorted_categorys = sorted.collect {|a| news_bulletins.where(:news_bulletin_category_id => a[1]).entries }
- news_bulletins = sorted_categorys.flatten!
- end
- when 'title'
- h = Array.new
- news_bulletins.each { |news_bulletin| h << [news_bulletin.title[I18n.locale].downcase, news_bulletin] }
- sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
- news_bulletins = sorted.collect {|a| a[1] }
- when 'status'
- news_bulletins = news_bulletins.order_by(:is_top, params[:direction]).order_by(:is_hot, params[:direction]).order_by(:is_hidden, params[:direction]).order_by(:is_pending, params[:direction]).order_by(:is_checked, params[:direction]).order_by(:is_rejected, params[:direction])
- when 'update_user_id'
- user_ids = news_bulletins.distinct(:update_user_id)
- users = User.find(user_ids) rescue nil
- if users
- h = Array.new
- users.each { |user| h << [user.name, user.id] }
- sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
- sorted_users = sorted.collect {|a| news_bulletins.where(:update_user_id => a[1]).entries }
- news_bulletins = sorted_users.flatten
- end
- when 'tags'
- a = Array.new
- NewsTag.all.order_by(I18n.locale, params[:direction]).each { |tag| a << tag.news_bulletins }
- a.flatten!
- a.uniq!
- tmp = Array.new
- news_bulletins.where(:tag_ids => []).each { |news_bulletin| tmp << [news_bulletin.title[I18n.locale].downcase, news_bulletin] }
- sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse!
- sorted_titles = sorted.collect {|a| a[1] }
- a = params[:direction].eql?('asc') ? (sorted_titles + a) : (a + sorted_titles)
- news_bulletins = a.flatten
- end
- if @filter
- @filter.each do |key, value|
- case key
- when 'status'
- a = Array.new
- news_bulletins.each do |news_bulletin|
- value.each do |v|
- case v
- when 'pending'
- a << news_bulletin if news_bulletin.is_checked.nil?
- when 'rejected'
- a << news_bulletin if news_bulletin.is_checked.eql?(false)
- else
- a << news_bulletin if news_bulletin[v]
- end
- end
- end
- news_bulletins = a.uniq
- when 'categories'
- a = Array.new
- news_bulletins.each do |news_bulletin|
- a << news_bulletin if value.include?(news_bulletin.news_bulletin_category.id.to_s)
- end
- news_bulletins = a.uniq
- when 'tags'
- a = Array.new
- news_bulletins.each do |news_bulletin|
- news_bulletin.tags.each do |tag|
- a << news_bulletin if value.include?(tag.id.to_s)
- end
- end
- news_bulletins = a.uniq
- end if value.size > 0
- end
- end
- Kaminari.paginate_array(news_bulletins).page(params[:page]).per(10)
- end
-
end
diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb
index 12d0cac6..bf51d308 100644
--- a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb
+++ b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb
@@ -24,10 +24,19 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController
end
def show
- @news_bulletin = NewsBulletin.can_display.where(_id: params[:id]).first
- get_categorys
+ if params[:preview] == "true"
+ preview_content
+ else
+ @news_bulletin = NewsBulletin.can_display.where(_id: params[:id]).first
+ get_categorys
+ end
end
+ def preview_content
+ @news_bulletins = NewsBulletin.find params[:id]
+ get_categorys
+ render :show
+ end
protected
diff --git a/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletin_categorys_helper.rb b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletin_categorys_helper.rb
new file mode 100644
index 00000000..8ad75108
--- /dev/null
+++ b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletin_categorys_helper.rb
@@ -0,0 +1,14 @@
+module Panel::News::BackEnd::NewsBulletinCategorysHelper
+include ActionView::Helpers::UrlHelper
+
+
+ def show_submit_permission_link(news_bulletin_category)
+ oa = news_bulletin_category.get_object_auth_by_title('submit')
+ if oa.nil?
+ news_bulletin_category.object_auths.new(title: 'submit' ).save
+ oa = news_bulletin_category.get_object_auth_by_title('submit')
+ end
+ link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa)
+ end
+
+end
\ No newline at end of file
diff --git a/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb
new file mode 100644
index 00000000..666bcf4e
--- /dev/null
+++ b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb
@@ -0,0 +1,9 @@
+module Panel::News::BackEnd::NewsBulletinsHelper
+
+ def news_show_approval_link(news_bulletin)
+ by_news_bulletin = (!news_bulletin.is_expired? and !news_bulletin.is_checked?)
+ by_user = news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?
+ by_news_bulletin and by_user
+ end
+
+end
\ No newline at end of file
diff --git a/vendor/built_in_modules/news/app/models/news_bulletin.rb b/vendor/built_in_modules/news/app/models/news_bulletin.rb
index 101ed5d2..538180dc 100644
--- a/vendor/built_in_modules/news/app/models/news_bulletin.rb
+++ b/vendor/built_in_modules/news/app/models/news_bulletin.rb
@@ -33,6 +33,7 @@ class NewsBulletin
mount_uploader :image, ImageUploader
belongs_to :news_bulletin_category
+ belongs_to :unit_list_for_anc
# embeds_many :news_bulletin_links, :cascade_callbacks => true
# embeds_many :news_bulletin_files, :cascade_callbacks => true
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_approve.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_approve.html.erb
new file mode 100644
index 00000000..83a7b38f
--- /dev/null
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_approve.html.erb
@@ -0,0 +1,69 @@
+ <% if news_bulletin -%>
+
+
+
+
+
+
+
+ <%# preview_block_ad_images_helper(news_bulletin).each do |ad_image| -%>
+ <%#= image_tag ad_image.file,:alt => (ad_image.title[locale] || " "),:time_to_next => news_bulletin.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || news_bulletin.context || " ")) %>
+ <%# end -%>
+
+
+
+
+
+
+
+
+
+
+
+<% end -%>
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/preview_and_approve.js.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/preview_and_approve.js.erb
new file mode 100644
index 00000000..4191ae04
--- /dev/null
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/preview_and_approve.js.erb
@@ -0,0 +1,5 @@
+$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_approve',:locals => {:news_bulletin => @news_bulletin})) %>");
+var start_modal_with_id = "news_bulletin-<%=@news_bulletin.id%>";
+$("#"+start_modal_with_id).css("width","1050px");
+$("#"+start_modal_with_id).css("height","768px");
+$("#"+start_modal_with_id).css("margin","-270px 0 0 -550px");
\ No newline at end of file
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/_news_bulletin_category.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/_news_bulletin_category.html.erb
index 01d58f98..377091bd 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/_news_bulletin_category.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/_news_bulletin_category.html.erb
@@ -4,8 +4,14 @@
<%= news_bulletin_category.key %>
- - <%= link_to t('news_bulletin_category.edit'), edit_panel_news_back_end_news_bulletin_category_path(news_bulletin_category), :remote => true %>
- - <%= link_to t('news_bulletin_category.delete'), panel_news_back_end_news_bulletin_category_path(news_bulletin_category), :confirm => t('news.sure?'), :method => :delete, :remote => true %>
+ <%if is_manager? || is_admin? %>
+ - <%= show_submit_permission_link(news_bulletin_category) %>
+ <% end %>
+ <% if is_admin?%>
+ - <%= link_to t('bulletin_category.edit'), edit_panel_news_back_end_news_bulletin_category_path(news_bulletin_category), :remote => true %>
+ - <%= link_to t('bulletin_category.delete'), panel_news_back_end_news_bulletin_category_path(news_bulletin_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %>
+ <% end %>
+
|
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/index.html.erb
index caa4981f..c876b6c8 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/index.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/index.html.erb
@@ -17,7 +17,7 @@
-<%= render :partial => "form" %>
+<%= render :partial => "form" if is_manager? %>
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb
index c7dfd155..38c2db31 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb
@@ -105,28 +105,6 @@
-
-
-
- <% if is_manager? || @news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin? %>
-
- <%= f.label :approval_stat, t('news.news_bulletin.approval_stat') %>
- <%= content_tag :label,:class => "radio inline" do -%>
- <%= f.radio_button :is_checked, true , {:class => 'privacy'} %>
- <%= t('news.news_bulletin.approval_pass') %>
- <% end -%>
- <%= content_tag :label,:class => "radio inline" do -%>
- <%= f.radio_button :is_checked, false, (!@news_bulletin.is_checked ? {:checked => true, :class => 'privacy'} : {})%>
- <%= t('news.news_bulletin.approval_not_pass') %>
- <% end -%>
-
- <%= label :is_checked_false, t('news.news_bulletin.approval_not_pass_reason') %>
- <%= f.text_field :not_checked_reason %>
-
-
-
- <% end %>
-
<% elsif current_user.admin? %>
<%= f.hidden_field :is_checked,:value => true%>
@@ -139,13 +117,16 @@
-
+
+ <%= f.label :unit_list_for_anc%>
+ <%= f.select :unit_list_for_anc_id,@unit_list_for_anc.collect{|t| [ t.title[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
+
<%= f.label :category %>
<%= f.select :news_bulletin_category_id, @news_bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
<%# @site_valid_locales.each_with_index do |locale, i| %>
- <% site_valid_locales_default_head.each_with_index do |locale, i| %>
+ <% @site_valid_locales.each_with_index do |locale, i| %>
- ><%= I18nVariable.from_locale(locale) %>
<% end %>
@@ -153,7 +134,7 @@
<%# @site_valid_locales.each_with_index do |locale, i| %>
- <% site_valid_locales_default_head.each_with_index do |locale, i| %>
+ <% @site_valid_locales.each_with_index do |locale, i| %>
">
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb
index c800bf18..b84e89b9 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb
@@ -1,5 +1,9 @@
- <%= check_box_tag 'to_delete[]', news_bulletin.id, false, :class => "checkbox_in_list" %> |
+
+ <% if (news_bulletin.create_user_id == current_user.id) || is_manager? %>
+ <%= check_box_tag 'to_delete[]', news_bulletin.id, false, :class => "checkbox_in_list" %>
+ <% end -%>
+ |
@@ -27,27 +31,33 @@
<%= news_bulletin.news_bulletin_category.i18n_variable[I18n.locale] %> |
<%= link_to news_bulletin.title[I18n.locale], panel_news_front_end_news_bulletin_path(news_bulletin, :category_id => news_bulletin.news_bulletin_category.id) rescue ''%>
+
- <% if current_user.admin? || (!news_bulletin.is_rejected? && !news_bulletin.is_checked?) %>
- - <%= link_to t('news_bulletin.edit'), edit_panel_news_back_end_news_bulletin_path(news_bulletin) %>
- -
- <%= t(:quick_edit) %>
-
-
- <%#= debugger %>
- <%#= a=1 %>
- <% if (news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !news_bulletin.is_expired? %>
- - <%= link_to t('news.news_bulletin.approval'), edit_panel_news_back_end_news_bulletin_path(news_bulletin) %>
<%#= #TODO add ancher so user can quick access into that part %>
- <% end %>
+ <% if (news_bulletin.create_user_id == current_user.id) || is_manager? %>
+
+ <% if current_user.admin? || (!news_bulletin.is_rejected? && !news_bulletin.is_checked?) %>
+ - <%= link_to t('news_bulletin.edit'), edit_panel_news_back_end_news_bulletin_path(news_bulletin) %>
+ -
+ <%= t(:quick_edit) %>
+
+
+ <%#= debugger %>
+ <%#= a=1 %>
+
+ <% end %>
+ - <%= link_to t('news_bulletin.delete'), panel_news_back_end_news_bulletin_path(news_bulletin), :confirm => t('news.sure?'), :method => :delete, :remote => true %>
<% end %>
- - <%= link_to t('news_bulletin.delete'), panel_news_back_end_news_bulletin_path(news_bulletin), :confirm => t('news.sure?'), :method => :delete, :remote => true %>
+ <% if news_show_approval_link(news_bulletin) %>
+ - <%= link_to t('news.news_bulletin.approval'), panel_news_back_end_news_bulletin_approval_preview_path(news_bulletin) %>
<%#= #TODO add ancher so user can quick access into that part %>
+ <% end %>
+
|
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/index.html.erb
index 78535138..742293fe 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/index.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/index.html.erb
@@ -5,8 +5,11 @@
<% end %>
-
-
-
- <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_news_back_end_news_bulletin_path, :class => 'btn btn-primary' %>
-
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "news_bulletin_form" %>
+ <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
+ <%= javascript_include_tag "inc/modal-preview" %>
<% end %>
diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb
index 37e3e1f3..14659c07 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb
@@ -4,7 +4,7 @@
@@ -14,58 +14,18 @@
<%= @news_bulletin.text[I18n.locale].html_safe %>
+
+ <%= t('announcement.link') %>
+<% @news_bulletin.bulletin_links.each do | blink | %>
+ <%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %>
+<% end %>
+
+
+<%= t('announcement.file') %>
+<% @news_bulletin.bulletin_files.each do | bfile | %>
+<%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %>
+<% end %>
+
-
-
-<%#= link_back %>
diff --git a/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/index.html.erb
index 756d7102..2103f997 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/index.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/widget/news_bulletins/index.html.erb
@@ -2,7 +2,20 @@
<% if @news_bulletins and !@news_bulletins.nil? %>
<%= t('news.campus_news')%>
- <%= link_to t('news.more'),panel_news_front_end_news_bulletins_path(), :class => "topic_note" %>
+ <%#= link_to t('news.more'),panel_news_front_end_news_bulletins_path(), :class => "topic_note" %>
+
previous page
next page
diff --git a/vendor/built_in_modules/news/config/routes.rb b/vendor/built_in_modules/news/config/routes.rb
index aaf68801..b7882d2d 100644
--- a/vendor/built_in_modules/news/config/routes.rb
+++ b/vendor/built_in_modules/news/config/routes.rb
@@ -6,6 +6,8 @@ Rails.application.routes.draw do
match 'update_setting' => "news_approvals#update_setting" ,:as => :news_approval_update_setting
resources :news_bulletins do
+ match "approve/:news_bulletin_id" => "approvals#preview_and_approve",:as => :approval_preview,:via => :put
+ match "approve/:news_bulletin_id" => "approvals#approve",:as => :approve,:via => :post
match "link_quick_add/:news_bulletin_id" => "news_bulletins#link_quick_add" ,:as => :link_quick_add
match "link_quick_edit/:news_bulletin_id" => "news_bulletins#link_quick_edit" ,:as => :link_quick_edit
member do
@@ -31,7 +33,9 @@ Rails.application.routes.draw do
resources :tags
end
namespace :front_end do
- resources :news_bulletins
+ resources :news_bulletins # do
+ # match "preview" => "news_bulletins#preview_content",:as => :get_preview_content
+ # end
end
namespace :widget do
match "news_bulletins" => "news_bulletins#index"
diff --git a/vendor/built_in_modules/page_content/app/controllers/panel/page_content/back_end/page_contexts_controller.rb b/vendor/built_in_modules/page_content/app/controllers/panel/page_content/back_end/page_contexts_controller.rb
index 87f3447c..6ae315fb 100644
--- a/vendor/built_in_modules/page_content/app/controllers/panel/page_content/back_end/page_contexts_controller.rb
+++ b/vendor/built_in_modules/page_content/app/controllers/panel/page_content/back_end/page_contexts_controller.rb
@@ -5,11 +5,12 @@ class Panel::PageContent::BackEnd::PageContextsController < OrbitBackendControll
def index
- @page_contexts = PageContext.where(:archived => false).desc(:updated_at).page(params[:page]).per(10)
+ @page_contexts = params[:sort] ? get_sorted_and_filtered("page_contexts", {:archived => false}) : PageContext.where(:archived => false).page(params[:page]).per(10)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @page_contexts }
+ format.js {}
end
end
diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_filter.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_filter.html.erb
new file mode 100644
index 00000000..02ba839b
--- /dev/null
+++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_filter.html.erb
@@ -0,0 +1,11 @@
+
+
+<% content_for :page_specific_javascript do %>
+ <%= javascript_include_tag "sort_header" %>
+<% end %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_sort_headers.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_sort_headers.html.erb
new file mode 100644
index 00000000..7a37d4a7
--- /dev/null
+++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_sort_headers.html.erb
@@ -0,0 +1,4 @@
+<%= render_sort_bar(false, ['name', 'page','span7', 'page_context.name'],
+ ['version', 'version', 'span2', 'page_context.version'],
+ ['update_time', 'updated_at', 'span2', 'page_context.update_time'],
+ ['last_modified', 'update_user_id', 'span2', 'page_context.last_modified']).html_safe %>
diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb
index a71c45eb..1ab0f27a 100644
--- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb
+++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb
@@ -1,22 +1,6 @@
<%= flash_messages %>
-
-
+<%= render 'filter' %>
@@ -27,13 +11,13 @@
|
-
+
<%= render :partial => 'page_context', :collection => @page_contexts %>
-<%= paginate @page_contexts %>
-
-
+
diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.js.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.js.erb
new file mode 100644
index 00000000..aba5dd93
--- /dev/null
+++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.js.erb
@@ -0,0 +1,3 @@
+$("#sort_headers").html("<%= j render 'sort_headers' %>");
+$("#tbody_page_contexts").html("<%= j render :partial => 'page_context', :collection => @page_contexts %>");
+$("#page_context_pagination").html("<%= j paginate @page_contexts, :params => {:direction => params[:direction], :sort => params[:sort]} %>");
\ No newline at end of file
diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb
index 25c41606..69aa8c1a 100644
--- a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb
+++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb
@@ -122,6 +122,13 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
format.js
end
end
+
+ def delete
+ if params[:to_delete]
+ web_links = WebLink.any_in(:_id => params[:to_delete]).delete_all
+ end
+ redirect_to panel_web_resource_back_end_web_links_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
+ end
protected
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_sort_headers.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_sort_headers.html.erb
index e405811c..8873ed20 100644
--- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_sort_headers.html.erb
+++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_sort_headers.html.erb
@@ -1,4 +1,4 @@
-<%= render_sort_bar(false, ['status', ['is_top', 'is_hot', 'is_hidden', 'is_pending', 'is_checked', 'is_rejected'], 'span1', 'bulletin.status'],
+<%= render_sort_bar(true, ['status', ['is_top', 'is_hot', 'is_hidden', 'is_pending', 'is_checked', 'is_rejected'], 'span1', 'bulletin.status'],
['category', 'bulletin_category', 'span2', 'bulletin.category'],
['name', 'name','span3', 'bulletin.title'],
['tags', 'tags', 'span2', 'bulletin.tags']).html_safe %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb
index ad8f5ade..457a05a8 100644
--- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb
+++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb
@@ -1,4 +1,9 @@
+
+ <% if (web_link.create_user_id == current_user.id) || is_manager? %>
+ <%= check_box_tag 'to_delete[]', web_link.id, false, :class => "checkbox_in_list" %>
+ <% end -%>
+ |
diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb
index aa867034..da1e287b 100644
--- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb
+++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb
@@ -1,17 +1,20 @@
-<%= render 'filter' %>
-
-
-
- |
- |
- |
- |
-
-
-
- <%= render :partial => 'web_link', :collection => @web_links %>
-
-
+<%= form_for :news_bulletins, :url => delete_panel_web_resource_back_end_web_links_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), :html => {:id => 'delete_all'}, :remote => true do %>
+ <%= render 'filter' %>
+
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+
+ <%= render :partial => 'web_link', :collection => @web_links %>
+
+
+<% end %>
| |