Add show plugin profile action

This commit is contained in:
spen 2014-03-20 15:55:51 +08:00
parent 0595cc7dcb
commit bcbdfd2370
3 changed files with 27 additions and 5 deletions

View File

@ -176,7 +176,13 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController
respond_to do |format|
if @honor.update_attributes(params[:honor])
format.html { redirect_to(panel_personal_honor_back_end_honors_url) }
if params[:honor][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:honor][:user_id],:show_plugin_profile=>"Honor")) }
else
format.html { redirect_to(panel_personal_honor_back_end_honors_url) }
end
# format.js { render 'toggle_enable' }
format.xml { head :ok }
else
@ -195,7 +201,13 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController
@honor.destroy
respond_to do |format|
format.html { redirect_to(panel_personal_honor_back_end_honors_url) }
if params[:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"Honor")) }
else
format.html { redirect_to(panel_personal_honor_back_end_honors_url) }
end
# format.xml { head :ok }
format.js
end

View File

@ -1,5 +1,6 @@
<% # encoding: utf-8 %>
<div class="writing_detail">
<table>
<caption> <%= t("module_name.personal_honor") %> </caption>
<tbody>
@ -30,3 +31,4 @@
<tr><th><%= t("personal_honor.award_winner")%></th><td><%= User.from_id(@honor.create_user_id).name rescue '' %></td></tr>
</tbody>
</table>
</div>

View File

@ -41,7 +41,7 @@
</div>
<% end -%>
<table class="table table-condensed table-striped">
<table class="table table-condensed table-striped main-list">
<thead>
<tr>
<% if is_admin? %>
@ -55,7 +55,7 @@
<% @honors.each do |honor| %>
<tr class="<%= honor.is_hidden ? "checkHide" : "" %>">
<tr id="<%= dom_id honor %>" class="<%= honor.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', honor.id.to_s, false, :class => "list-check" %>
@ -63,7 +63,15 @@
<% end -%>
<td><%= honor.year %></td>
<td>
<%= link_to honor.award_name, panel_personal_honor_front_end_honor_path(honor) %>
<%= link_to honor.award_name, panel_personal_honor_front_end_honor_path(honor) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<%if at_least_module_manager || honor.honor_category.cur_user_is_sub_manager_of(:edit)%>
<li><%= link_to t('edit'), edit_panel_personal_honor_back_end_honor_path(honor,:user_id => @user.id) %></li>
<li><%= link_to t(:delete_), panel_personal_honor_back_end_honor_path(honor,:user_id => @user.id), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<% end -%>
</ul>
</div>
</td>
</tr>