+
+<% end -%>
\ No newline at end of file
diff --git a/app/views/admin/module_apps_new_interface/_privilege_user.html.erb b/app/views/admin/module_apps_new_interface/_privilege_user.html.erb
new file mode 100644
index 000000000..90f5cb65b
--- /dev/null
+++ b/app/views/admin/module_apps_new_interface/_privilege_user.html.erb
@@ -0,0 +1,25 @@
+<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%>
+ <% @sys_users.each do |sys_user| -%>
+
+
+
+ <% end -%>
+<% end -%>
\ No newline at end of file
diff --git a/app/views/admin/module_apps_new_interface/setting.html.erb b/app/views/admin/module_apps_new_interface/setting.html.erb
new file mode 100644
index 000000000..7d1179f0d
--- /dev/null
+++ b/app/views/admin/module_apps_new_interface/setting.html.erb
@@ -0,0 +1,56 @@
+<% content_for :page_specific_css do %>
+ <%= stylesheet_link_tag "inc/permission-checkbox" %>
+<% end %>
+<% content_for :page_specific_javascript do %>
+ <%= javascript_include_tag "inc/permission-checkbox" %>
+ <%= javascript_include_tag "inc/search" %>
+ <%= javascript_include_tag "inc/modal-preview" %>
+<% end %>
+<%#= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %>
+<%= form_tag('', :remote => true,:class => "prevent_enter_submit_form") %>
+
+<%= content_tag :div do -%>
+ <% form_tag admin_module_app_manager_auth_proc_path do %>
+ <%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
+
+ <% end -%>
+<% end -%>
+
+
+
\ No newline at end of file
diff --git a/app/views/admin/module_apps_new_interface/setting.js.erb b/app/views/admin/module_apps_new_interface/setting.js.erb
new file mode 100644
index 000000000..0ca148da1
--- /dev/null
+++ b/app/views/admin/module_apps_new_interface/setting.js.erb
@@ -0,0 +1,2 @@
+$("#users_checkbox_ary").replaceWith('<%= escape_javascript(render :partial => "privilege_user", :locals => {:users => @users_array})%>');
+permissionCheckbox();
\ No newline at end of file
diff --git a/app/views/admin/module_apps_new_interface/update_setting.js.erb b/app/views/admin/module_apps_new_interface/update_setting.js.erb
new file mode 100644
index 000000000..7486000a2
--- /dev/null
+++ b/app/views/admin/module_apps_new_interface/update_setting.js.erb
@@ -0,0 +1 @@
+alert( "<% flash.each do |key, msg| %><%= msg %><% end%>");
\ No newline at end of file
diff --git a/app/views/admin/module_apps_new_interface/user_list.js.erb b/app/views/admin/module_apps_new_interface/user_list.js.erb
new file mode 100644
index 000000000..7caf1e395
--- /dev/null
+++ b/app/views/admin/module_apps_new_interface/user_list.js.erb
@@ -0,0 +1,2 @@
+$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_list',:locals => {:module_app => @module_app})) %>");
+var start_modal_with_id = "module_app-<%=@module_app.id%>"
\ No newline at end of file
diff --git a/app/views/admin/object_auths_new_interface/_modal_list.html.erb b/app/views/admin/object_auths_new_interface/_modal_list.html.erb
new file mode 100644
index 000000000..04f46511f
--- /dev/null
+++ b/app/views/admin/object_auths_new_interface/_modal_list.html.erb
@@ -0,0 +1,42 @@
+<% if ob_auth -%>
+
+
+
+
+
+ <% ob_auth.auth_users.each do |user| %>
+
+
+ <% 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 -%>
+
+ <% end -%>
+
+
+
+
+
+
+
+
+
+<% end -%>
\ No newline at end of file
diff --git a/app/views/admin/object_auths_new_interface/_privilege_user.html.erb b/app/views/admin/object_auths_new_interface/_privilege_user.html.erb
new file mode 100644
index 000000000..90f5cb65b
--- /dev/null
+++ b/app/views/admin/object_auths_new_interface/_privilege_user.html.erb
@@ -0,0 +1,25 @@
+<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%>
+ <% @sys_users.each do |sys_user| -%>
+
+
+
+ <% sys_user.sub_roles.each do |sr| %>
+
<%= sr.key %>
+ <% end %>
+ <%= content_tag :div,:data=>{'original-title'=>t('announcement.bulletin.approval_setting_window_title'),:content => "#{sys_user.sub_roles.collect{|sr| sr.i18n_variable[I18n.locale]}.join(',')}"},:class=>"checkbox clear" do %>
+
+
+
+ <% if sys_user.avatar? %>
+ <%= image_tag(sys_user.avatar.thumb.url,:class => "member-img") %>
+ <% else %>
+ <%= image_tag "person.png",:class => "member-img" %>
+ <% end %>
+
+ <%= label_tag "lab-user-#{sys_user.id}", (sys_user.name rescue ''),:class=>"member-name",:id=>nil -%>
+ <%= check_box_tag "[users][#{sys_user.id}]", 'true',users.include?(sys_user),:class => "check" -%>
+ <%end -%>
+
+
+ <% end -%>
+<% end -%>
\ No newline at end of file
diff --git a/app/views/admin/object_auths_new_interface/setting.html.erb b/app/views/admin/object_auths_new_interface/setting.html.erb
new file mode 100644
index 000000000..ae5096ba4
--- /dev/null
+++ b/app/views/admin/object_auths_new_interface/setting.html.erb
@@ -0,0 +1,57 @@
+<% content_for :page_specific_css do %>
+ <%= stylesheet_link_tag "inc/permission-checkbox" %>
+<% end %>
+<% content_for :page_specific_javascript do %>
+ <%= javascript_include_tag "inc/permission-checkbox" %>
+ <%= javascript_include_tag "inc/search" %>
+ <%= javascript_include_tag "inc/modal-preview" %>
+<% end %>
+<%#= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %>
+<%= form_tag('', :remote => true,:class => "prevent_enter_submit_form") %>
+
+
+ -
+
+ <%= label_tag :object, @ob_auth.auth_obj.class %>
+ <%= label_tag :module,"::" %>
+ <%= select "ob_auth",'id',@options_from_collection_for_select_ob_auth %>
+ <%= search_field_tag 'user_filter' %>
+
+
+
+
+ <%= link_to t("admin.object_auth.list_title_of_users",:auth_title => @ob_auth.title), admin_object_auth_ob_auth_show_path , :class=>'preview_trigger btn btn-success pull-right'%>
+
+
+<%#= label_tag :role, t("admin.roles") %>
+
+<%= content_tag :div do -%>
+ <% form_tag admin_object_auth_ob_auth_path do %>
+ <%#= render :partial => "privilege_user", :locals => {:users => @users_array} %>
+
+ <% end -%>
+<% end -%>
+
+
+
\ No newline at end of file
diff --git a/app/views/admin/object_auths_new_interface/setting.js.erb b/app/views/admin/object_auths_new_interface/setting.js.erb
new file mode 100644
index 000000000..0ca148da1
--- /dev/null
+++ b/app/views/admin/object_auths_new_interface/setting.js.erb
@@ -0,0 +1,2 @@
+$("#users_checkbox_ary").replaceWith('<%= escape_javascript(render :partial => "privilege_user", :locals => {:users => @users_array})%>');
+permissionCheckbox();
\ No newline at end of file
diff --git a/app/views/admin/object_auths_new_interface/update_setting.js.erb b/app/views/admin/object_auths_new_interface/update_setting.js.erb
new file mode 100644
index 000000000..7486000a2
--- /dev/null
+++ b/app/views/admin/object_auths_new_interface/update_setting.js.erb
@@ -0,0 +1 @@
+alert( "<% flash.each do |key, msg| %><%= msg %><% end%>");
\ No newline at end of file
diff --git a/app/views/admin/object_auths_new_interface/user_list.js.erb b/app/views/admin/object_auths_new_interface/user_list.js.erb
new file mode 100644
index 000000000..ebb088cc0
--- /dev/null
+++ b/app/views/admin/object_auths_new_interface/user_list.js.erb
@@ -0,0 +1,2 @@
+$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_list',:locals => {:ob_auth => @ob_auth})) %>");
+var start_modal_with_id = "ob_auth-<%=@ob_auth.id%>"
\ No newline at end of file
diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb
index e808427af..7a9bcf4ee 100644
--- a/app/views/layouts/_side_bar.html.erb
+++ b/app/views/layouts/_side_bar.html.erb
@@ -5,29 +5,29 @@
<%= javascript_include_tag "/static/kernel.js" %>
<% end %>
-<%= content_tag :li, :class => (active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') || active_sys_call_for_app('new_interface_module_apps','setting','Announcement',:module_app_id) ) do -%>
+<%= content_tag :li, :class => (active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') || active_for_app_auth('Announcement') || active_for_ob_auths_object("BulletinCategory") ) 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', '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') || active_for_action('bulletin_category_setting', 'setting')) %>
+ <%= content_tag :li, link_to(t('announcement.categories'), panel_announcement_back_end_bulletin_categorys_path), :class =>( active_for_action('bulletin_categorys', 'index') || active_for_ob_auths_object("BulletinCategory") ) %>
<%= 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('approvals', 'setting') if (is_manager? rescue nil) %>
- <%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "Announcement"}))), :class => active_sys_call_for_app('new_interface_module_apps','setting','Announcement',:module_app_id) if (is_admin? rescue nil) %>
+ <%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "Announcement"}))), :class => active_for_app_auth('Announcement') if (is_admin? rescue nil) %>
<% end -%>
<% end -%>
-<%= content_tag :li, :class =>( active_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')|| active_sys_call_for_app('new_interface_module_apps','setting','news',:module_app_id)) do -%>
+<%= content_tag :li, :class =>( active_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')|| active_for_app_auth('news') || active_for_ob_auths_object("NewsBulletinCategory")) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.news'), panel_news_back_end_news_bulletins_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')) do -%>
<%= content_tag :li, link_to(t('announcement.all_articles'), panel_news_back_end_news_bulletins_path), :class => active_for_action('news_bulletins', 'index') %>
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') %>
- <%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => (active_for_action('news_bulletin_categorys', 'index') || active_for_action('news_bulletin_category_setting', 'setting'))%>
+ <%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') || active_for_ob_auths_object("NewsBulletinCategory") %>
<%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %>
<%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_news_back_end_news_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %>
- <%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_sys_call_for_app('new_interface_module_apps','setting','news',:module_app_id) if (is_admin? rescue nil) %>
+ <%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_for_app_auth('news') if (is_admin? rescue nil) %>
<% end -%>
<% end -%>
@@ -47,14 +47,14 @@
<%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %>
<% end -%>
-<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') || active_sys_call_for_app('module_apps','edit','ad_banners') do -%>
+<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') || active_for_app_auth('ad_banners') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.ad_banner'), admin_ad_banners_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images') ) do -%>
<%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %>
<%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %>
<%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %>
- <%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "ad_banners"}))), :class => active_sys_call_for_app('new_interface_module_apps','setting','ad_banners',:module_app_id) if (is_admin? rescue nil) %>
+ <%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "ad_banners"}))), :class => active_for_app_auth('ad_banners') if (is_admin? rescue nil) %>
<% end -%>
<% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 0d0707cc5..374b3b33c 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -197,6 +197,10 @@ en:
new_role: New user role
news: News
non_multilingual: Non multilingual
+ object_auth:
+ list_title_of_users: %{auth_title} Auth List
+ update_done: Update done,reulst showing in list
+ update_failed: Update failed
options: Options
orig_upload_file: Original filename
page: Page
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index b4d644c7b..feb8e83a3 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -191,7 +191,11 @@ zh_tw:
new_info: 新增用戶資料
new_role: 新增用戶身份
news: 新聞
- non_multilingual: 非多種語言
+ non_multilingual:
+ object_auth:
+ list_title_of_users: 授權清單-%{auth_title}
+ update_done: 更新完成,結果顯示於清單
+ update_failed: 更新失敗
options: 選項
orig_upload_file: 原上傳檔名
page: 頁面管理
diff --git a/lib/orbit_core_lib.rb b/lib/orbit_core_lib.rb
index b92f4eca5..281654a76 100644
--- a/lib/orbit_core_lib.rb
+++ b/lib/orbit_core_lib.rb
@@ -19,6 +19,10 @@ module OrbitCoreLib
end
+ def pp_object
+ "Object Auth method 'pp_object' need to be defined for class #{self.class}"
+ end
+
def get_object_auth_by_title(title)
self.object_auths.where({title: title }).first
end
diff --git a/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletin_categorys_helper.rb b/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletin_categorys_helper.rb
index 1fccbbe14..926049854 100644
--- a/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletin_categorys_helper.rb
+++ b/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletin_categorys_helper.rb
@@ -10,7 +10,7 @@ include ActionView::Helpers::UrlHelper
oa = bulletin_category.get_object_auth_by_title(type)
end
# link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa)
- link_to t('announcement.bulletin.cate_auth'),panel_announcement_back_end_bulletin_category_setting_path(bulletin_category)
+ link_to t('announcement.bulletin.cate_auth'),admin_object_auth_ob_auth_path(oa)
end
end
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/models/bulletin_category.rb b/vendor/built_in_modules/announcement/app/models/bulletin_category.rb
index 7daaf6db0..955d5f18d 100644
--- a/vendor/built_in_modules/announcement/app/models/bulletin_category.rb
+++ b/vendor/built_in_modules/announcement/app/models/bulletin_category.rb
@@ -18,6 +18,10 @@ class BulletinCategory
has_many :bulletins
+ def pp_object
+ i18n_variable[I18n.locale]
+ end
+
def self.from_id(id)
BulletinCategory.find(id) rescue nil
end
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
index 74905640b..4b8965551 100644
--- 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
@@ -10,7 +10,7 @@ include ActionView::Helpers::UrlHelper
oa = news_bulletin_category.get_object_auth_by_title(type)
end
# link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa)
-link_to t('announcement.bulletin.cate_auth'),panel_news_back_end_news_bulletin_category_setting_path(news_bulletin_category)
+ link_to t('announcement.bulletin.cate_auth'),admin_object_auth_ob_auth_path(oa)
end
diff --git a/vendor/built_in_modules/news/app/models/news_bulletin_category.rb b/vendor/built_in_modules/news/app/models/news_bulletin_category.rb
index 45576589f..b3dd7bc46 100644
--- a/vendor/built_in_modules/news/app/models/news_bulletin_category.rb
+++ b/vendor/built_in_modules/news/app/models/news_bulletin_category.rb
@@ -18,6 +18,10 @@ class NewsBulletinCategory
has_many :news_bulletins
+ def pp_object
+ i18n_variable[I18n.locale]
+ end
+
def self.from_id(id)
NewsBulletinCategory.find(id) rescue nil
end