Fix for NCCU 0430 all functions ok with two submanagers but different behavors
This commit is contained in:
1 parent
45e21f9569
commit
05ded8de03
14 files changed
+107
-27
No files matched your search
+1
@@ -1,5 +1,6 @@
|
||||
class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendController
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
include AdminHelper
|
||||
# layout 'admin'
|
||||
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
|
||||
|
||||
before_filter :for_app_manager,:except => [:index]
|
||||
|
||||
|
||||
def index
|
||||
@bulletin_categorys = BulletinCategory.all
|
||||
@bulletin_category = BulletinCategory.new(:display => 'List')
|
||||
|
||||
+18
-10
@@ -1,8 +1,9 @@
|
||||
class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
# before_filter :for_admin_only,:only => [:]
|
||||
# before_filter :for_app_manager,:only => [:index,:show,]
|
||||
before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
|
||||
def index
|
||||
# @bulletins = Bulletin.all
|
||||
# @bulletins = Bulletin.desc("postdate desc")
|
||||
@@ -42,6 +43,10 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
@bulletin_file = BulletinFile.new
|
||||
@file_url = panel_announcement_back_end_bulletins_path
|
||||
|
||||
@bulletins.delete_if{ |bulletin|
|
||||
bulletin.is_pending == true && (!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || bulletin.create_user_id!=current_user.id)
|
||||
}
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.js { }
|
||||
@@ -79,14 +84,17 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
|
||||
# @bulletin.bulletin_files.build
|
||||
# @bulletin.bulletin_files.new
|
||||
|
||||
get_categorys
|
||||
get_tags
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @bulletin }
|
||||
end
|
||||
if get_categorys.empty?
|
||||
flash[:notice] = "You dont have any permission for post on cate"
|
||||
redirect_to :action => :index
|
||||
else
|
||||
get_tags
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @bulletin }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# GET /bulletins/1/edit
|
||||
@@ -314,7 +322,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||
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')
|
||||
@bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+7
-4
@@ -4,10 +4,13 @@
|
||||
<%= bulletin_category.key %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t('bulletin_category.edit'), edit_panel_announcement_back_end_bulletin_category_path(bulletin_category), :remote => true %></li>
|
||||
<li><%= show_submit_permission_link(bulletin_category) %></li>
|
||||
<li><%= link_to t('bulletin_category.delete'), panel_announcement_back_end_bulletin_category_path(bulletin_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
|
||||
<%if is_manager? || is_admin? %>
|
||||
<li><%= show_submit_permission_link(bulletin_category) %></li>
|
||||
<% end %>
|
||||
<% if is_admin?%>
|
||||
<li><%= link_to t('bulletin_category.edit'), edit_panel_announcement_back_end_bulletin_category_path(bulletin_category), :remote => true %></li>
|
||||
<li><%= link_to t('bulletin_category.delete'), panel_announcement_back_end_bulletin_category_path(bulletin_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="form"><%= render :partial => "form" %></div>
|
||||
<div id="form"><%= render :partial => "form" if is_manager?%></div>
|
||||
|
||||
|
||||
|
||||
+12
-4
@@ -1,5 +1,8 @@
|
||||
<tr id="<%= dom_id bulletin %>" class="with_action">
|
||||
<td><%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %></td>
|
||||
<td>
|
||||
<% if (bulletin.create_user_id == current_user.id) || is_manager? %>
|
||||
<%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %>
|
||||
<% end -%>
|
||||
<td>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
@@ -27,8 +30,11 @@
|
||||
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||
<td>
|
||||
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
|
||||
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if (bulletin.create_user_id == current_user.id) || is_manager? %>
|
||||
|
||||
<% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
|
||||
<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
|
||||
<li class="dropdown">
|
||||
@@ -43,11 +49,13 @@
|
||||
</li>
|
||||
<%#= debugger %>
|
||||
<%#= a=1 %>
|
||||
<% if show_approval_link(bulletin) %>
|
||||
<li><%= link_to t('announcement.bulletin.approval'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
<% end -%>
|
||||
<% if show_approval_link(bulletin) %>
|
||||
<li><%= link_to t('announcement.bulletin.approval'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
['start_date', 'postdate', 'span1-2', 'bulletin.start_date'],
|
||||
['end_date', 'deadline', 'span1-2', 'bulletin.end_date'],
|
||||
['tags', 'tags', 'span1-2', 'bulletin.tags'],
|
||||
['last_modified', 'update_user_id','span1-3', 'bulletin.last_modified']).html_safe %>
|
||||
['last_modified', 'update_user_id','span1-3', 'bulletin.last_modified']).html_safe %>
|
||||
Reference in new issue
Block a user