From 8b42c595b3d6c301ec594bf3fcdcae6cd1ea29d6 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Thu, 10 May 2012 14:43:05 +0800 Subject: [PATCH] Don't display admin in any premission select. Fix not necessary header for UT data --- app/controllers/admin/new_interface_module_apps_controller.rb | 2 +- .../panel/announcement/back_end/approvals_controller.rb | 1 + .../back_end/bulletin_category_setting_controller.rb | 1 + .../announcement/back_end/approvals/_privilege_user.html.erb | 3 +-- .../bulletin_category_setting/_privilege_user.html.erb | 3 +-- .../lib/tasks/data_for_ut_list_for_posting_anc.rake | 2 +- .../announcement/lib/ut_list_from_nccu_2012feb.csv | 1 - .../panel/news/back_end/news_approvals_controller.rb | 1 + .../news/back_end/news_bulletin_category_setting_controller.rb | 1 + .../news/back_end/news_approvals/_privilege_user.html.erb | 3 +-- .../news_bulletin_category_setting/_privilege_user.html.erb | 3 +-- 11 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/controllers/admin/new_interface_module_apps_controller.rb b/app/controllers/admin/new_interface_module_apps_controller.rb index 6603334ca..8cf77e5e9 100644 --- a/app/controllers/admin/new_interface_module_apps_controller.rb +++ b/app/controllers/admin/new_interface_module_apps_controller.rb @@ -6,7 +6,7 @@ class Admin::NewInterfaceModuleAppsController < ApplicationController layout "new_admin" def setting - @sys_users = User.all + @sys_users = User.all(conditions: {admin: false}) @module_app = ModuleApp.find(params[:module_app_id]) @options_from_collection_for_select_bulletin_categorys = [@module_app].collect{|ma| [ma.title,ma.id] } # if params.has_key? :category 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 9f63a8ab8..e5c92023a 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 @@ -12,6 +12,7 @@ class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendControlle # end def setting + @sys_users = User.all(conditions: {admin: false}) @bulletin_categorys = BulletinCategory.all @options_from_collection_for_select_bulletin_categorys = @bulletin_categorys.collect{|bc| [bc.i18n_variable[I18n.locale],bc.id] } if params.has_key? :category diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_category_setting_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_category_setting_controller.rb index 4be5f6bc8..8903adb2a 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_category_setting_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_category_setting_controller.rb @@ -12,6 +12,7 @@ class Panel::Announcement::BackEnd::BulletinCategorySettingController < OrbitBac # end def setting + @sys_users = User.all(conditions: {admin: false}) @bulletin_categorys = [] @bulletin_categorys << BulletinCategory.find(params[:bulletin_category_id]) @options_from_collection_for_select_bulletin_categorys = @bulletin_categorys.collect{|bc| [bc.i18n_variable[I18n.locale],bc.id] } 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 index c36941dea..90f5cb65b 100644 --- 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 @@ -1,6 +1,5 @@ <%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%> -<% sys_users = User.all -%> - <% sys_users.each do |sys_user| -%> + <% @sys_users.each do |sys_user| -%>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_category_setting/_privilege_user.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_category_setting/_privilege_user.html.erb index c36941dea..90f5cb65b 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_category_setting/_privilege_user.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_category_setting/_privilege_user.html.erb @@ -1,6 +1,5 @@ <%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%> -<% sys_users = User.all -%> - <% sys_users.each do |sys_user| -%> + <% @sys_users.each do |sys_user| -%>
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 index e5bd0be22..9b8b05e57 100644 --- 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 @@ -4,9 +4,9 @@ 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) + # order,ut_code,up_tu_code,ut_zh_tw,ut_en new_unit.build_title :en => row[4], :zh_tw => row[3] new_unit.save end 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 index 548ad5281..806d0b9a4 100644 --- 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 @@ -1,4 +1,3 @@ -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 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 c6eda9d04..80838ec5e 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 @@ -12,6 +12,7 @@ class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController end def setting + @sys_users = User.all(conditions: {admin: false}) @news_bulletin_categorys = NewsBulletinCategory.all if params.has_key?(:category_id) first_category = NewsBulletinCategory.find params[:category_id] diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_category_setting_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_category_setting_controller.rb index 6b92195f1..6ac769732 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_category_setting_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_category_setting_controller.rb @@ -12,6 +12,7 @@ class Panel::News::BackEnd::NewsBulletinCategorySettingController < OrbitBackend # end def setting + @sys_users = User.all(conditions: {admin: false}) @bulletin_categorys = [] @bulletin_categorys << NewsBulletinCategory.find(params[:news_bulletin_category_id]) @options_from_collection_for_select_bulletin_categorys = @bulletin_categorys.collect{|bc| [bc.i18n_variable[I18n.locale],bc.id] } diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_privilege_user.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_privilege_user.html.erb index 87d4d78e0..d48bb8507 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_privilege_user.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_privilege_user.html.erb @@ -1,6 +1,5 @@ <%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%> -<% sys_users = User.all -%> - <% sys_users.each do |user| -%> + <% @sys_users.each do |user| -%>
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_category_setting/_privilege_user.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_category_setting/_privilege_user.html.erb index c36941dea..90f5cb65b 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_category_setting/_privilege_user.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_category_setting/_privilege_user.html.erb @@ -1,6 +1,5 @@ <%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%> -<% sys_users = User.all -%> - <% sys_users.each do |sys_user| -%> + <% @sys_users.each do |sys_user| -%>