Add show plugin profile action

This commit is contained in:
spen 2014-03-20 15:54:50 +08:00
parent 04a1cca4ce
commit db5d423b33
3 changed files with 28 additions and 6 deletions

View File

@ -110,7 +110,13 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
respond_to do |format|
if @diploma.update_attributes(params[:diploma])
format.html { redirect_to(panel_personal_diploma_back_end_diplomas_url) }
if params[:diploma][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:diploma][:user_id],:show_plugin_profile=>'Diploma')) }
else
format.html { redirect_to(panel_personal_diploma_back_end_diplomas_url) }
end
# format.js { render 'toggle_enable' }
format.xml { head :ok }
else
@ -128,7 +134,13 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
@diploma.destroy
respond_to do |format|
format.html { redirect_to(panel_personal_diploma_back_end_diplomas_url) }
if params[:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>'Diploma')) }
else
format.html { redirect_to(panel_personal_diploma_back_end_diplomas_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_diploma") %> </caption>
<tbody>
@ -28,11 +29,11 @@
<% end %>
<% if !@diploma.start_date.blank? %>
<tr><th><%= t("personal_diploma.start_date")%></th><td><%= @diploma.start_date %></td></tr>
<tr><th><%= t("personal_diploma.start_date")%></th><td><%= @diploma.start_date.strftime("%Y.%m") %></td></tr>
<% end %>
<% if !@diploma.end_date.blank? %>
<tr><th><%= t("personal_diploma.end_date")%></th><td><%= @diploma.end_date %></td></tr>
<tr><th><%= t("personal_diploma.end_date")%></th><td><%= @diploma.end_date.strftime("%Y.%m")%></td></tr>
<% end %>
<% if !@diploma.language.blank? %>
@ -43,3 +44,4 @@
</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 @@
<% @diplomas.each do |diploma| %>
<tr class="<%= diploma.is_hidden ? "checkHide" : "" %>">
<tr id="<%= dom_id diploma %>" class="<%= diploma.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', diploma.id.to_s, false, :class => "list-check" %>
@ -64,6 +64,14 @@
<td><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
<td>
<%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<%if at_least_module_manager || diploma.diploma_category.cur_user_is_sub_manager_of(:edit)%>
<li><%= link_to t('edit'), edit_panel_personal_diploma_back_end_diploma_path(diploma,:user_id => @user.id) %></li>
<li><%= link_to t(:delete_), panel_personal_diploma_back_end_diploma_path(diploma,:user_id => @user.id), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<% end -%>
</ul>
</div>
</td>
</tr>