Clean up code , cache other auths. Fix sidebar
This commit is contained in:
parent
3e60b34491
commit
20eb8b4d15
|
@ -6,7 +6,7 @@ class Admin::ModuleAppsNewInterfaceController < OrbitBackendController
|
|||
layout "new_admin"
|
||||
|
||||
def setting
|
||||
@sys_users = User.all(conditions: {admin: false})
|
||||
@sys_users = User.all(conditions: {admin: false}).includes(:avatar)
|
||||
@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
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%>
|
||||
<% @sys_users.each do |sys_user| -%>
|
||||
|
||||
<div class="checkblock">
|
||||
|
||||
<% sys_user.sub_roles.each do |sr| %>
|
||||
<div class="for_unit" style="display:none;"> <%= sr.key %></div>
|
||||
<% 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 %>
|
||||
<div class="check-icon">
|
||||
</div>
|
||||
<div class='member-avatar'>
|
||||
<% if sys_user.avatar? %>
|
||||
<%= image_tag(sys_user.avatar.thumb.url,:class => "member-img") %>
|
||||
<% else %>
|
||||
<%= image_tag "person.png",:class => "member-img" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= 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 -%>
|
||||
</div>
|
||||
|
||||
<% end -%>
|
||||
<% end -%>
|
|
@ -26,7 +26,7 @@
|
|||
<div class="clear">
|
||||
<%= content_tag :div do -%>
|
||||
<% form_tag admin_module_app_manager_auth_proc_path do %>
|
||||
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
|
||||
<%= render :partial => "layouts/users_checkbox_ary" %>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= submit_tag "Update", :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do %>
|
||||
<% @sys_users.each do |sys_user| %>
|
||||
<div class="checkblock">
|
||||
<div class="for_unit" style="display:none;"> <%= sys_user.cache_dept[I18n.locale.to_s] %></div>
|
||||
<%= content_tag :div,:data=>{'original-title'=>t('announcement.bulletin.approval_setting_window_title'),:content => sys_user.cache_dept[I18n.locale.to_s]},:class=>"checkbox clear" do %>
|
||||
<div class="check-icon">
|
||||
</div>
|
||||
<div class='member-avatar'>
|
||||
<% if sys_user.avatar? %>
|
||||
<%= image_tag(sys_user.avatar.thumb.url,:class => "member-img") %>
|
||||
<% else %>
|
||||
<%= image_tag "person.png",:class => "member-img" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -27,8 +27,8 @@
|
|||
<div class="clear">
|
||||
<%= content_tag :div do -%>
|
||||
<% form_tag admin_object_auth_ob_auth_path do %>
|
||||
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= render :partial => "layouts/users_checkbox_ary" %>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= submit_tag "Update", :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<%= 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 :ul, :class => ("nav nav-list " + (visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')||active_for_ob_auths_object("BulletinCategory"))) 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_ob_auths_object("BulletinCategory") ) %>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do %>
|
||||
<%= render :partial => "shared/privilege_user",:collection =>@sys_users,:as=>:user ,:locals =>{ :chosen_users=> @users_array } %>
|
||||
<%end -%>
|
|
@ -0,0 +1,16 @@
|
|||
<div class="checkblock">
|
||||
<div class="for_unit" style="display:none;"> <%= user.cache_dept[I18n.locale.to_s] %></div>
|
||||
<%= content_tag :div,:data=>{'original-title'=>t('announcement.bulletin.approval_setting_window_title'),:content => user.cache_dept[I18n.locale.to_s]},:class=>"checkbox clear" do %>
|
||||
<div class="check-icon">
|
||||
</div>
|
||||
<div class='member-avatar'>
|
||||
<% if user.avatar? %>
|
||||
<%= image_tag(user.avatar.thumb.url,:class => "member-img") %>
|
||||
<% else %>
|
||||
<%= image_tag "person.png",:class => "member-img" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= label_tag "lab-user-#{user.id}", (user.name rescue ''),:class=>"member-name",:id=>nil -%>
|
||||
<%= check_box_tag "[users][#{user.id}]", 'true',chosen_users.include?(user),:class => "check" -%>
|
||||
<%end %>
|
||||
</div>
|
|
@ -12,7 +12,7 @@ class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendControlle
|
|||
# end
|
||||
|
||||
def setting
|
||||
@sys_users = User.all(conditions: {admin: false})
|
||||
@sys_users = User.all(conditions: {admin: false}).includes(:avatar)
|
||||
@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
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%>
|
||||
<% @sys_users.each do |sys_user| -%>
|
||||
|
||||
<div class="checkblock">
|
||||
|
||||
<% sys_user.sub_roles.each do |sr| %>
|
||||
<div class="for_unit" style="display:none;"> <%= sr.key %></div>
|
||||
<% 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 %>
|
||||
<div class="check-icon">
|
||||
</div>
|
||||
<div class='member-avatar'>
|
||||
<% if sys_user.avatar? %>
|
||||
<%= image_tag(sys_user.avatar.thumb.url,:class => "member-img") %>
|
||||
<% else %>
|
||||
<%= image_tag "person.png",:class => "member-img" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= 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 -%>
|
||||
</div>
|
||||
|
||||
<% end -%>
|
||||
<% end -%>
|
|
@ -24,7 +24,7 @@
|
|||
<div class="clear">
|
||||
<%= content_tag :div do -%>
|
||||
<% form_tag panel_announcement_back_end_approval_setting_path do %>
|
||||
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
|
||||
<%= render :partial => "layouts/users_checkbox_ary" %>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= submit_tag "Update", :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
$("#users_checkbox_ary").replaceWith('<%= escape_javascript(render :partial => "privilege_user", :locals => {:users => @users_array})%>');
|
||||
$("#users_checkbox_ary").replaceWith('<%= escape_javascript(render :partial=> "layouts/users_checkbox_ary" )%>');
|
||||
permissionCheckbox();
|
|
@ -12,7 +12,7 @@ class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController
|
|||
end
|
||||
|
||||
def setting
|
||||
@sys_users = User.all(conditions: {admin: false})
|
||||
@sys_users = User.all(conditions: {admin: false}).includes(:avatar)
|
||||
@news_bulletin_categorys = NewsBulletinCategory.all
|
||||
@options_from_collection_for_select_news_bulletin_categorys = @news_bulletin_categorys.collect{|bc| [bc.i18n_variable[I18n.locale],bc.id] }
|
||||
if params.has_key? :news_category
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%>
|
||||
<% @sys_users.each do |user| -%>
|
||||
|
||||
<div class="checkblock">
|
||||
|
||||
<% user.sub_roles.each do |sr| %>
|
||||
<div class="for_unit" style="display:none;"> <%= sr.key %></div>
|
||||
<% end %>
|
||||
<%= 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 %>
|
||||
<div class="check-icon">
|
||||
</div>
|
||||
<div class='member-avatar'>
|
||||
<% if user.avatar? %>
|
||||
<%= image_tag(user.avatar.thumb.url,:class => "member-img") %>
|
||||
<% else %>
|
||||
<%= image_tag "person.png",:class => "member-img" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= 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 -%>
|
||||
</div>
|
||||
|
||||
<% end -%>
|
||||
<% end -%>
|
|
@ -24,7 +24,7 @@
|
|||
<div class="clear">
|
||||
<%= content_tag :div do -%>
|
||||
<% form_tag panel_news_back_end_approval_setting_path do %>
|
||||
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
|
||||
<%= render :partial => "layouts/users_checkbox_ary" %>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= submit_tag "Update", :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
$("#users_checkbox_ary").replaceWith('<%= escape_javascript(render :partial => "privilege_user", :locals => {:users => @users_array})%>');
|
||||
$("#users_checkbox_ary").replaceWith('<%= escape_javascript(render :partial=> "layouts/users_checkbox_ary" )%>');
|
||||
permissionCheckbox();
|
Reference in New Issue