diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb
index ab5981a8a..8518688a2 100644
--- a/app/views/layouts/_side_bar.html.erb
+++ b/app/views/layouts/_side_bar.html.erb
@@ -26,7 +26,7 @@
<%= 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_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('announcement.bulletin.approval_setting'), panel_news_back_end_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_for_app_auth('news') if (is_admin? rescue nil) %>
<% end -%>
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 e5c92023a..0177cd12f 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
@@ -31,9 +31,9 @@ class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendControlle
def update_setting
object_auth = update_setting_by_params
if object_auth.save!
- flash[:notice] = "Update Done"
+ flash[:notice] = t("admin.object_auth.update_done")
else
- flash[:notice] = "Update Failed"
+ flash[:notice] = t("admin.object_auth.update_failed")
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 f21c1a386..9fd97b9b9 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
@@ -38,7 +38,6 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
def preview_content
@bulletin = Bulletin.find params[:id]
get_categorys
- render :show
end
protected
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 9e6c7225e..57d3105b1 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
@@ -16,11 +16,9 @@
<%= select "category",'id',@options_from_collection_for_select_bulletin_categorys %>
<%= search_field_tag 'user_filter' %>
-
<%= link_to t("announcement.bulletin.approval_user_list"), panel_announcement_back_end_approval_user_list_path , :class=>'preview_trigger btn btn-success pull-right'%>
-
<%#= label_tag :role, t("admin.roles") %>
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 80838ec5e..20a3d3ebe 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
@@ -4,7 +4,7 @@ class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController
include AdminHelper
def preview_and_approve
- @bulletin = NewsBulletin.find params[:bulletin_id]
+ @news_bulletin = NewsBulletin.find params[:news_bulletin_id]
end
def approve
@@ -35,10 +35,27 @@ class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController
end
def update_setting
-
+ object_auth = update_setting_by_params
+ if object_auth.save!
+ flash[:notice] = t("admin.object_auth.update_done")
+ else
+ flash[:notice] = t("admin.object_auth.update_failed")
+ end
+ end
+
+ def user_list
+ @news_bulletin_category = NewsBulletinCategory.find params[:category_id]
end
protected
+ def update_setting_by_params
+ category = NewsBulletinCategory.find params[:category_id]
+ privilege_users = params[:users].collect{|key,value| User.find key } rescue []
+ object_auth_ary = category.object_auths.where(title: 'fact_check') || (category.object_auths.create :title=> 'fact_check')
+ object_auth = object_auth_ary.first
+ object_auth.privilege_users = privilege_users
+ object_auth
+ end
def get_categorys(id = nil)
@news_bulletin_categorys = []
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 50b9c2661..b4f5fc828 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
@@ -36,9 +36,8 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController
end
def preview_content
- @news_bulletins = NewsBulletin.find params[:id]
+ @news_bulletin = 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_bulletins_helper.rb b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb
index 666bcf4ea..8bf47a3d7 100644
--- 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
@@ -2,7 +2,7 @@ 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_user = (news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
by_news_bulletin and by_user
end
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_list.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_list.html.erb
new file mode 100644
index 000000000..9c9998306
--- /dev/null
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_list.html.erb
@@ -0,0 +1,44 @@
+<% if news_bulletin_category -%>
+
+
+
+
+
+ <% news_bulletin_category.get_object_auth_by_title('fact_check').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/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 d48bb8507..60c5a7823 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
@@ -6,7 +6,7 @@
<% user.sub_roles.each do |sr| %>
<%= sr.key %>
<% end %>
- <%= content_tag :div,:data=>{'original-title'=>t('news.news_bulletin.approval_setting_window_title'),:content => "#{user.sub_roles.collect{|sr| sr.key}.join(',')}"},:class=>"checkbox clear" do %>
+ <%= content_tag :div,:data=>{'original-title'=>t('news.news_bulletin.approval_setting_window_title'),:content => "#{user.sub_roles.collect{|sr| sr.i18n_variable[I18n.locale]}.join(',')}"},:class=>"checkbox clear" do %>
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/setting.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/setting.html.erb
index aca35fd0f..f611154d6 100644
--- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/setting.html.erb
+++ b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/setting.html.erb
@@ -4,11 +4,12 @@
<% 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("news.news_bulletin.fact_check_setting") %>
-<%= form_tag('', :remote => true) %>
-
-
+<%= form_tag('', :remote => true,:class => "prevent_enter_submit_form") %>
+
+
+ <%= link_to t("announcement.bulletin.approval_user_list"), panel_news_back_end_approval_user_list_path , :class=>'preview_trigger btn btn-success pull-right'%>
<%#= label_tag :role, t("admin.roles") %>
<%= content_tag :div do -%>
- <% form_tag :action => "update_setting" do %>
+ <% form_tag panel_news_back_end_approval_setting_path do %>
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
-