ydu announcement approval fix
This commit is contained in:
parent
51efaa6d6b
commit
bf1060d1eb
|
@ -95,7 +95,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
# GET /bulletins/1/edit
|
||||
def edit
|
||||
@bulletin = Bulletin.find(params[:id])
|
||||
if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?)
|
||||
# if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?)
|
||||
if (@bulletin.create_user_id != current_or_guest_user.id) and !is_manager?
|
||||
redirect_to :action => :index
|
||||
else
|
||||
# @summary_variable = @bulletin.summary_variable
|
||||
|
@ -137,11 +138,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
|
||||
@bulletin.create_user_id = current_user.id
|
||||
@bulletin.update_user_id = current_user.id
|
||||
if(is_manager? || is_admin?)
|
||||
# if(is_manager? || is_admin?)
|
||||
@bulletin.is_checked = true
|
||||
@bulletin.is_rejected = false
|
||||
@bulletin.de_pending
|
||||
end
|
||||
# end
|
||||
|
||||
respond_to do |format|
|
||||
if @bulletin.save
|
||||
|
@ -221,11 +222,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
respond_to do |format|
|
||||
|
||||
if @bulletin.update_attributes(params[:bulletin])
|
||||
if(is_manager? || is_admin?)
|
||||
# if(is_manager? || is_admin?)
|
||||
@bulletin.is_checked = true
|
||||
@bulletin.is_rejected = false
|
||||
@bulletin.de_pending!
|
||||
end
|
||||
# end
|
||||
# if (params[:bulletin][:is_checked] == "false")
|
||||
# @bulletin.is_rejected = true
|
||||
# @bulletin.save!
|
||||
|
@ -251,7 +252,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
# DELETE /bulletins/1
|
||||
# DELETE /bulletins/1.xml
|
||||
def destroy
|
||||
|
||||
@bulletin = Bulletin.find(params[:id])
|
||||
|
||||
# @bulletin.bulletin_files.destroy
|
||||
@bulletin.destroy
|
||||
|
||||
|
@ -261,6 +264,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
# format.xml { head :ok }
|
||||
format.js
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
# def top_edit
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if (bulletin.create_user_id == current_or_guest_user.id) || is_manager? %>
|
||||
<% if current_or_guest_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
|
||||
<%# if current_or_guest_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
|
||||
<li><%= link_to t(:edit), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<li><%#= link_to t(:file_), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
<%# end %>
|
||||
|
||||
<% end -%>
|
||||
<% if show_delete_link(bulletin) %>
|
||||
|
|
Loading…
Reference in New Issue