From 45c194e8703e8f35d9a68f711ade8fee04b0dc5f Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 15:15:36 +0800 Subject: [PATCH 1/7] Ray's changes in css --- app/assets/stylesheets/bootstrap.css.erb | 1 + app/assets/stylesheets/widgets.css | 2 +- .../back_end/bulletins/_form_bulletin_file.html.erb | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/bootstrap.css.erb b/app/assets/stylesheets/bootstrap.css.erb index e763d67e3..40b3afca2 100644 --- a/app/assets/stylesheets/bootstrap.css.erb +++ b/app/assets/stylesheets/bootstrap.css.erb @@ -66,6 +66,7 @@ textarea { margin: 0; font-size: 100%; vertical-align: middle; + margin-bottom: 10px; } button, input { *overflow: visible; diff --git a/app/assets/stylesheets/widgets.css b/app/assets/stylesheets/widgets.css index 5f36326de..80756ecb1 100644 --- a/app/assets/stylesheets/widgets.css +++ b/app/assets/stylesheets/widgets.css @@ -84,7 +84,7 @@ border-radius: 0 3px 3px 0; text-align: left; margin: 0; - width: 180px; + width: 193px; } .file-upload .upload { margin:0; diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb index 0f332069a..ea9774673 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb @@ -19,7 +19,7 @@
- <%= f.text_field locale, :id => "link-#{locale}", :class => "input-xlarge" %> + <%= f.text_field locale, :id => "link-#{locale}" %>
<% end %> @@ -43,7 +43,7 @@
- <%= f.text_field locale, :id => "link-#{locale}", :class => "input-xlarge" %> + <%= f.text_field locale, :id => "link-#{locale}" %>
<% end %> From d247f05d2e238650872865ffc6165710236d52c9 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 15:27:46 +0800 Subject: [PATCH 2/7] Add missing translations in announcement and change announcement behavior for passed and rejected --- .../back_end/bulletins_controller.rb | 2 +- .../back_end/bulletins/_bulletin.html.erb | 36 +++++++++---------- .../back_end/bulletins/_form.html.erb | 6 ++-- .../bulletins/_form_bulletin_file.html.erb | 1 + .../announcement/config/locales/en.yml | 14 ++++++++ .../announcement/config/locales/zh_tw.yml | 12 +++---- 6 files changed, 43 insertions(+), 28 deletions(-) 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 030c11bf2..f77e70b71 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 @@ -89,7 +89,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # GET /bulletins/1/edit def edit @bulletin = Bulletin.find(params[:id]) - if @bulletin.is_rejected? + if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?) redirect_to :action => :index else # @summary_variable = @bulletin.summary_variable 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 7db705936..c4e134cc9 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 @@ -14,7 +14,7 @@ <%= t(:pending) %> <% end %> <% if bulletin.is_checked? %> - <%= t(:checked) %> + <%= t(:passed) %> <% end %> <% if bulletin.is_rejected? %> <%= t(:rejected) %> @@ -25,23 +25,23 @@ <%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
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 d9c62078d..a8fb3587a 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 @@ -98,7 +98,7 @@ <% end %> <% end %>
- + <% if params[:action] != 'new' %>
@@ -208,7 +208,7 @@ @@ -253,7 +253,7 @@
<%= hidden_field_tag 'bulletin_file_field_count', @bulletin.bulletin_files.count %> - ADD/新增 + <%= t(:add) %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb index ea9774673..d391c80c2 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb @@ -4,6 +4,7 @@
<%= f.file_field :file %> + <%= form_bulletin_file.file.file ? ( link_to t(:view), form_bulletin_file.file.url, {:target => '_blank', :title => t(:view)} ) : '' %>
diff --git a/vendor/built_in_modules/announcement/config/locales/en.yml b/vendor/built_in_modules/announcement/config/locales/en.yml index 2af39968b..0d861af28 100644 --- a/vendor/built_in_modules/announcement/config/locales/en.yml +++ b/vendor/built_in_modules/announcement/config/locales/en.yml @@ -5,6 +5,12 @@ en: _locale: English + basic: Basic + picture: Piture + tags: Tag + link: Link + file: File + add: Add back: Back create: Create @@ -22,6 +28,14 @@ en: sure?: Are you sure? update: Update yes_: "Yes" + + hot: Hot + top: Top + hidden: Hidden + passed: Passed + pending: Pending + rejected: Rejected + clear: Clear announcement: sure?: Sure? 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 23ae38b8f..1d354f822 100644 --- a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml @@ -24,12 +24,12 @@ zh_tw: update: 更新 yes_: "Yes" - is_hot: 熱門 - is_top: 置頂 - is_hidden: 隱藏 - is_checked: 通過 - is_pending: 待審核 - is_rejected: 不通過 + hot: 熱門 + top: 置頂 + hidden: 隱藏 + passed: 通過 + pending: 待審核 + rejected: 不通過 clear: 清除 quick_edit: 快速編輯 From 291d5e3a03ba7da62ceb5e3b18012f0c9198dfba Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 16:24:50 +0800 Subject: [PATCH 3/7] Ray's changes in css --- app/assets/stylesheets/list.css | 2 +- app/assets/stylesheets/style.css.erb | 6 +++++- .../announcement/back_end/fact_checks/setting.html.erb | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/list.css b/app/assets/stylesheets/list.css index 60052ac24..6808e5331 100644 --- a/app/assets/stylesheets/list.css +++ b/app/assets/stylesheets/list.css @@ -161,6 +161,6 @@ legend { top: 10px; left: 5px; } -.list-remove { +#sort_headers .list-remove { padding: 8px 0 8px 16px !important; } \ No newline at end of file diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index e0a704ef2..ac151e906 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -109,7 +109,8 @@ text-indent: -9999px; padding:6px; } -#orbit-bar .nav > li.search { +#orbit-bar .nav > li.search { + background-image: none; overflow: hidden; width: 28px; position: relative; @@ -322,6 +323,9 @@ #main-wrap .breadcrumb li { font-size: 12px; color: #999; +} +.form-actions .btn { + margin-bottom: 0; } #sub-wiget { clear: right; diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb index 2325082f1..8bb86ad0c 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb @@ -2,7 +2,6 @@ <%= stylesheet_link_tag "inc/permission-checkbox" %> <% end %> <% content_for :page_specific_javascript do %> - <%= javascript_include_tag "bootstrap" %> <%= javascript_include_tag "inc/permission-checkbox" %> <%= javascript_include_tag "inc/search" %> <% end %> From 9f6c9156c6859691572cf3f09d09f2a8c44e2799 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 16:25:30 +0800 Subject: [PATCH 4/7] Spen patch for nccu --- .../bulletin_categorys/_bulletin_category.html.erb | 1 - .../back_end/bulletin_categorys/index.html.erb | 1 - .../panel/announcement/back_end/bulletins/_form.html.erb | 8 +++++--- .../page_content/back_end/page_contexts_controller.rb | 2 +- .../page_content/back_end/page_contexts/index.html.erb | 2 ++ .../panel/web_resource/back_end/web_links_controller.rb | 3 ++- .../panel/web_resource/back_end/web_links/index.html.erb | 2 ++ 7 files changed, 12 insertions(+), 7 deletions(-) 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 7f1b56268..e9396cba1 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 @@ -12,5 +12,4 @@ <% @site_valid_locales.each do |locale| %> <%= bulletin_category.i18n_variable[locale] rescue nil %> <% end %> - <%= bulletin_category.display %> 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 0a6e7f83b..28d2fde0c 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 @@ -8,7 +8,6 @@ <% @site_valid_locales.each do |locale| %> <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> <% end %> - <%= t('bulletin_category.display') %> 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 a8fb3587a..5cc031432 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 @@ -50,7 +50,7 @@
- <%= f.date_select :postdate, {:use_month_numbers => true, :prompt => { :month => 'Month', :day => 'Day', :year => 'Year'}, :order => [:day, :month, :year] }, {:class => 'input-small'} %> + <%= f.date_select :postdate, {:use_month_numbers => true, :order => [:day, :month, :year] }, {:class => 'input-small'} %>
@@ -144,14 +144,16 @@ <%= 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.each_with_index do |locale, i| %> + <% site_valid_locales_default_head.each_with_index do |locale, i| %>
"> 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 10a332366..87f3447c2 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,7 +5,7 @@ class Panel::PageContent::BackEnd::PageContextsController < OrbitBackendControll def index - @page_contexts = PageContext.where(:archived => false).desc(:updated_at) + @page_contexts = PageContext.where(:archived => false).desc(:updated_at).page(params[:page]).per(10) respond_to do |format| format.html # index.html.erb 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 3227dcd42..852697c77 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 @@ -17,4 +17,6 @@ +<%= paginate @page_contexts %> + 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 e2b681b94..c3fe0fbc8 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 @@ -7,7 +7,8 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController get_categorys(params[:web_link_category_id]) - @web_links = WebLink.search(params[:category_id]) + # @web_links = WebLink.search(params[:category_id]) + @web_links = WebLink.all.page(params[:page]).per(10) get_tags 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 301c1bbee..951fb4d9e 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 @@ -19,3 +19,5 @@ +<%= paginate @web_links %> + From db46803cda0887d785230bf1cc581d4e0885e659 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Tue, 24 Apr 2012 16:06:42 +0800 Subject: [PATCH 5/7] R4-Billingual --- app/views/layouts/_side_bar.html.erb | 22 +++--- config/locales/en.yml | 6 +- config/locales/zh_tw.yml | 8 +- .../back_end/approvals_controller.rb | 75 +++++++++++++++++++ .../approvals/_list_table.html.erb.can_del | 15 ++++ .../approvals/_privilege_user.html.erb | 26 +++++++ .../back_end/approvals/index.html.erb.can_del | 50 +++++++++++++ .../back_end/approvals/setting.html.erb | 41 ++++++++++ .../back_end/approvals/setting.js.erb | 1 + .../back_end/bulletins/_bulletin.html.erb | 4 +- .../back_end/bulletins/_form.html.erb | 8 +- .../announcement/config/locales/en.yml | 27 +++++-- .../announcement/config/locales/zh_tw.yml | 24 +++--- .../announcement/config/routes.rb | 4 +- 14 files changed, 267 insertions(+), 44 deletions(-) create mode 100644 vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb create mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_list_table.html.erb.can_del create mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_privilege_user.html.erb create mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/index.html.erb.can_del create mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.html.erb create mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.js.erb diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 4acaa0c19..887f09beb 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -1,6 +1,6 @@ -<%= content_tag :li, :class => active_for_controllers('purchases') do -%> - <%= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %> -<% end -%> +<%#= content_tag :li, :class => active_for_controllers('purchases') do -%> + <%#= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %> +<%# end -%> <%= content_tag :li, :class => active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'fact_checks') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %> @@ -9,14 +9,14 @@ <%= content_tag :li, link_to(t('announcement.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %> <%= content_tag :li, link_to(t('announcement.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %> <%= content_tag :li, link_to(t('announcement.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('/panel/announcement/back_end/tags', 'index') %> - <%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('fact_checks', 'setting') if (is_manager? rescue nil) %> + <%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_announcement_back_end_approval_setting_path), :class => active_for_action('fact_checks', 'setting') if (is_manager? rescue nil) %> <% end -%> <% end -%> -<%= content_tag :li, :class => active_for_controllers('users') do -%> - <%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %> -<% end -%> +<%#= content_tag :li, :class => active_for_controllers('users') do -%> + <%#= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %> +<%# end -%> <%= content_tag :li, :class => active_for_controllers('page_contexts') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), panel_page_content_back_end_page_contexts_path %> @@ -41,10 +41,10 @@ <%= content_tag :li, :class => active_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), panel_web_resource_back_end_web_links_path %> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%> - <%= content_tag :li, link_to(t('admin.announcement.all_articles'), panel_web_resource_back_end_web_links_path), :class => active_for_action('web_link', 'index') %> - <%= content_tag :li, link_to(t('admin.announcement.add_new'), new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_link', 'new') %> - <%= content_tag :li, link_to(t('admin.announcement.categories'), panel_web_resource_back_end_web_link_categorys_path), :class => active_for_action('web_link_categorys', 'index') %> - <%= content_tag :li, link_to(t('admin.announcement.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') %> + <%= content_tag :li, link_to(t('admin.all_articles'), panel_web_resource_back_end_web_links_path), :class => active_for_action('web_link', 'index') %> + <%= content_tag :li, link_to(t('announcement.add_new'), new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_link', 'new') %> + <%= content_tag :li, link_to(t('announcement.categories'), panel_web_resource_back_end_web_link_categorys_path), :class => active_for_action('web_link_categorys', 'index') %> + <%= content_tag :li, link_to(t('announcement.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') %> <% end -%> <% end -%> diff --git a/config/locales/en.yml b/config/locales/en.yml index 46c868254..8564c3647 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -62,6 +62,7 @@ en: add_drop_down_item: +Add Menu Item admin: Admin action: Action + all_articles: List announcement: Announcement asset: Asset assets: @@ -89,7 +90,7 @@ en: dashboard: Dashboard delete_language: Delete language description: Description - design: Design + design: Template disable_language: Disable language editing_home: Editing homepage editing_layout: Editing layout @@ -114,6 +115,7 @@ en: layout: Layout layout_name: Layout name links: Links + link: Links list_assets: Assets list list_designs: Designs list list_items: Items list @@ -156,7 +158,7 @@ en: setup_translations: Translations setup setup_designs: Designs setup site: Site - site_setting: Site Setting + site_settings: Site Setting super_pages: Super pages structure: Structure title: Title diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 4466caaed..af36d7bcd 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -58,6 +58,7 @@ zh_tw: add_language: 新增語言 add_drop_down_item: +增加Orbit選單 admin: 管理 + all_articles: 列表 announcement: 公告管理 asset: 資產 assets: @@ -89,7 +90,7 @@ zh_tw: data: 資料數據 delete_language: 刪除語言 description: 描述 - design: 網站版型 + design: 版型管理 disable_language: 禁用語言 editing_home: 編輯首頁 editing_layout: 編輯樣板 @@ -113,6 +114,7 @@ zh_tw: language: 語言 layout: 佈局 layout_name: 佈局名字 + link: 連結管理 links: 網路資源 list_assets: 資產列表 list_designs: 設計列表 @@ -145,13 +147,13 @@ zh_tw: non_multilingual: 非多種語言 options: 選項 orig_upload_file: 原上傳檔名 - page: Page + page: 頁面管理 position: 位置 published?: 發布? purchase: 購買 role: 角色 roles: 角色 - site_setting: 基本設定 + site_settings: 基本設定 setup_member: 成員設置 setup_translations: 語系設定 setup_designs: 版型設定 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 new file mode 100644 index 000000000..4bfc81365 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb @@ -0,0 +1,75 @@ +class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendController + before_filter :authenticate_user! + include AdminHelper + # layout 'admin' + + def setting + @bulletin_categorys = BulletinCategory.all + if params.has_key?(:category_id) + first_category = BulletinCategory.find params[:category_id] + if params[:commit] == 'Update' + privilege_users = params[:users].collect{|key,value| User.find key } rescue [] + preload_object_auth_ary = first_category.object_auths.where(title: 'fact_check') || (first_category.object_auths.create :title=> 'fact_check') + preload_object_auth = preload_object_auth_ary.first + preload_object_auth.privilege_users = privilege_users + preload_object_auth.save! + end + else + first_category = @bulletin_categorys.first + end + preload_object_auth = first_category.object_auths.where(title: 'fact_check').empty?? (first_category.object_auths.create! :title=> 'fact_check') : first_category.object_auths.where(title: 'fact_check') + @users_array = preload_object_auth.first.privilege_users rescue [] + respond_to do |format| + format.html + format.js + end + end + + def update_setting + + end + # def index + # get_categorys(params[:bulletin_category_id]) + # + # @bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all + # @bulletin_categories = BulletinCategory.all + # + # module_app = ModuleApp.first(:conditions => {:key => 'announcement'}) + # @tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc) + # + # respond_to do |format| + # format.html # index.html.erb + # format.js + # format.xml { render :xml => @bulletins } + # end + # end + # + # def new + # + # end + # + # def create + # + # end + # + # def update + # + # end + # + # def edit + # + # end + # + # def destroy + # + # end + protected + def get_categorys(id = nil) + @bulletin_categorys = [] + 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') + end + end +end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_list_table.html.erb.can_del b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_list_table.html.erb.can_del new file mode 100644 index 000000000..59bac03aa --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_list_table.html.erb.can_del @@ -0,0 +1,15 @@ +

<%= bulletin_category.key %>

+ + + + + + + + + + +<% bulletin_category.bulletins.each do |post| %> + <%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:fact_check_allow=>true} %> +<% end %> +
<%= t('bulletin.status') %><%= t('bulletin.category') %><%= t('bulletin.title') %><%= t('bulletin.postdate') %><%= t('bulletin.deadline') %><%= t('bulletin.action') %>
\ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_privilege_user.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_privilege_user.html.erb new file mode 100644 index 000000000..659fbc433 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_privilege_user.html.erb @@ -0,0 +1,26 @@ +<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%> +<% sys_users = User.all -%> + <% sys_users.each do |user| -%> + +
+ + <% user.sub_roles.each do |sr| %> + + <% end %> + <%= content_tag :div,:data=>{'original-title'=>t('announcement.bulletin.approval_setting_window_title'),:content => "#{user.sub_roles.collect{|sr| sr.key}.join(',')}"},:class=>"checkbox clear" do %> +
+
+
+ <% if user.avatar? %> + <%= image_tag(user.avatar.thumb.url,:class => "member-img") %> + <% else %> + <%= image_tag "person.png",:class => "member-img" %> + <% end %> +
+ <%= label_tag "lab-user-#{user.id}", (user.name rescue ''),:class=>"member-name",:id=>nil -%> + <%= check_box_tag "[users][#{user.id}]", 'true',users.include?(user),:class => "check" -%> + <%end -%> +
+ + <% end -%> +<% end -%> \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/index.html.erb.can_del b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/index.html.erb.can_del new file mode 100644 index 000000000..32f3d8207 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/index.html.erb.can_del @@ -0,0 +1,50 @@ +<%= render 'panel/announcement/back_end/bulletins/filter' %> + + <%= render 'panel/announcement/back_end/bulletins/bulletins' %> +
+
+ <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %> +
+ + \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.html.erb new file mode 100644 index 000000000..d1cf86edf --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.html.erb @@ -0,0 +1,41 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "inc/permission-checkbox" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "bootstrap" %> + <%#= javascript_include_tag "inc/permission-checkbox" %> + <%#= javascript_include_tag "inc/search" %> +<% end %> +<%#= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %> +<%= form_tag('', :remote => true) %> + +<%#= label_tag :role, t("admin.roles") %> +
+<%= content_tag :div do -%> + <% form_tag :action => "update_setting" do %> + <%= render :partial => "privilege_user", :locals => {:users => @users_array} %> +
+ <%= submit_tag "Update", :class => 'btn' %> +
+ <% end -%> +<% end -%> +
+ + \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.js.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.js.erb new file mode 100644 index 000000000..a01c9d6ab --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.js.erb @@ -0,0 +1 @@ +$("#users_checkbox_ary").replaceWith('<%= (render :partial => 'privilege_user', :locals => {:users => @users_array}).html_safe%>'); \ No newline at end of file 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 c4e134cc9..7a096ad0c 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 @@ -40,8 +40,8 @@ <%#= debugger %> <%#= a=1 %> <% if (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !bulletin.is_expired? %> -
  • <%= link_to t('bulletin.fact_check'), edit_panel_announcement_back_end_bulletin_path(bulletin) %>
  • <%#= #TODO add ancher so user can quick access into that part %> - <% end %> +
  • <%= 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 %> <% end %> 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 5cc031432..b8aa5d2af 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 @@ -110,17 +110,17 @@ <% if is_manager? || @bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin? %>
    - <%= f.label :fact_check_stat, t('announcement.bulletin.fact_check_stat') %> + <%= 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.fact_check_pass') %> + <%= 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.fact_check_not_pass') %> + <%= t('announcement.bulletin.approval_not_pass') %> <% end -%>
    - <%= label :is_checked_false, t('announcement.bulletin.fact_check_not_pass_reason') %> + <%= label :is_checked_false, t('announcement.bulletin.approval_not_pass_reason') %> <%= f.text_field :not_checked_reason %>
    diff --git a/vendor/built_in_modules/announcement/config/locales/en.yml b/vendor/built_in_modules/announcement/config/locales/en.yml index 0d861af28..c4d0dcde0 100644 --- a/vendor/built_in_modules/announcement/config/locales/en.yml +++ b/vendor/built_in_modules/announcement/config/locales/en.yml @@ -37,7 +37,18 @@ en: rejected: Rejected clear: Clear + hot: Hot + top: Top + hidden: Hidden + passed: Approved + pending: Pending + rejected: Rejected + clear: Clear + + announcement: + all_articles: List + add_new: Add sure?: Sure? campus_news: Campus News more: more+ @@ -49,14 +60,14 @@ en: list_lower: " list" title: Title postdate: Postdate - fact_check: Fact Check - fact_check_setting: Fact Check Setting - fact_check_stat: Fact Check Status - fact_check_not_pass: 'Not Pass' - fact_check_not_pass_reason: 'Reason' - fact_check_pending: 'Pending' - fact_check_pass: 'Pass' - fact_check_setting_window_title: 'Unit' + approval: Approval + approval_setting: Approval Setting + approval_stat: Fact Check Status + approval_not_pass: 'Not Pass' + approval_not_pass_reason: 'Reason' + approval_pending: 'Pending' + approval_pass: 'Pass' + approval_setting_window_title: 'Unit' # admin: # action: Action 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 1d354f822..27e92e303 100644 --- a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml @@ -27,16 +27,16 @@ zh_tw: hot: 熱門 top: 置頂 hidden: 隱藏 - passed: 通過 - pending: 待審核 + passed: 審核通過 + pending: 待審查 rejected: 不通過 clear: 清除 quick_edit: 快速編輯 announcement: - add_new: 新增公告 - all_articles: 公告列表 + add_new: 新增 + all_articles: 列表 tags: 標籤 categories: 分類 status: 狀態 @@ -51,14 +51,14 @@ zh_tw: list_lower: 列表 title: 標題 postdate: 張貼日期 - fact_check: 公告審核 - fact_check_setting: 審核設定 - fact_check_stat: 審核狀況 - fact_check_pending: 待審核 - fact_check_not_pass: '不通過' - fact_check_pass: '通過' - fact_check_not_pass_reason: '不通過原因' - fact_check_setting_window_title: '單位' + approval: 公告審核 + approval_setting: 審核設定 + approval_stat: 審核狀況 + approval_pending: 待審核 + approval_not_pass: '不通過' + approval_pass: '通過' + approval_not_pass_reason: '不通過原因' + approval_setting_window_title: '單位' bulletin: last_modified: 最後修改於 diff --git a/vendor/built_in_modules/announcement/config/routes.rb b/vendor/built_in_modules/announcement/config/routes.rb index 048926cb3..0d5e1b99c 100644 --- a/vendor/built_in_modules/announcement/config/routes.rb +++ b/vendor/built_in_modules/announcement/config/routes.rb @@ -3,8 +3,8 @@ Rails.application.routes.draw do namespace :announcement do namespace :back_end do match 'public' => "announcements#public",:as => :public - match 'fact_check_setting' => "fact_checks#setting" ,:as => :fact_checks_setting - match 'update_setting' => "fact_checks#update_setting" ,:as => :fact_checks_update_setting + match 'approval_setting' => "approvals#setting" ,:as => :approval_setting + match 'update_setting' => "approvals#update_setting" ,:as => :approval_update_setting resources :bulletins do match "link_quick_add/:bulletin_id" => "bulletins#link_quick_add" ,:as => :link_quick_add From 330874439683018d38396228f0c0101210183215 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 17:00:33 +0800 Subject: [PATCH 6/7] Fix side_bar after Matt's changes in translation --- app/views/layouts/_side_bar.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 887f09beb..e740fe7ba 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -2,14 +2,14 @@ <%#= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %> <%# end -%> -<%= content_tag :li, :class => active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'fact_checks') do -%> +<%= content_tag :li, :class => active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %> - <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'fact_checks')) do -%> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')) do -%> <%= content_tag :li, link_to(t('announcement.all_articles'), panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %> <%= content_tag :li, link_to(t('announcement.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %> <%= content_tag :li, link_to(t('announcement.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %> <%= content_tag :li, link_to(t('announcement.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('/panel/announcement/back_end/tags', 'index') %> - <%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_announcement_back_end_approval_setting_path), :class => active_for_action('fact_checks', 'setting') if (is_manager? rescue nil) %> + <%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_announcement_back_end_approval_setting_path), :class => active_for_action('approvals', 'setting') if (is_manager? rescue nil) %> <% end -%> <% end -%> From dc07964bc3a82121e290b5771470eb44bc42b1b6 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 17:10:23 +0800 Subject: [PATCH 7/7] Fix js bug after Matt's changes in 'approval' --- .../panel/announcement/back_end/approvals/setting.html.erb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.html.erb index d1cf86edf..8bb86ad0c 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/setting.html.erb @@ -2,9 +2,8 @@ <%= stylesheet_link_tag "inc/permission-checkbox" %> <% end %> <% content_for :page_specific_javascript do %> - <%= javascript_include_tag "bootstrap" %> - <%#= javascript_include_tag "inc/permission-checkbox" %> - <%#= javascript_include_tag "inc/search" %> + <%= javascript_include_tag "inc/permission-checkbox" %> + <%= javascript_include_tag "inc/search" %> <% end %> <%#= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %> <%= form_tag('', :remote => true) %>