Add show plugin profile action

This commit is contained in:
spen 2014-03-20 15:51:05 +08:00
parent 43a34f0b9f
commit 99a5cf6329
3 changed files with 30 additions and 6 deletions

View File

@ -101,7 +101,13 @@ class Panel::PersonalResearch::BackEnd::ResearchsController < OrbitBackendContro
respond_to do |format| respond_to do |format|
if @research.update_attributes(params[:research]) if @research.update_attributes(params[:research])
format.html { redirect_to(panel_personal_research_back_end_researchs_url) }
if params[:research][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:research][:user_id],:show_plugin_profile=>"Research")) }
else
format.html { redirect_to(panel_personal_research_back_end_researchs_url) }
end
# format.js { render 'toggle_enable' } # format.js { render 'toggle_enable' }
format.xml { head :ok } format.xml { head :ok }
else else
@ -119,7 +125,13 @@ class Panel::PersonalResearch::BackEnd::ResearchsController < OrbitBackendContro
@research.destroy @research.destroy
respond_to do |format| respond_to do |format|
format.html { redirect_to(panel_personal_research_back_end_researchs_url) }
if params[:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"Research")) }
else
format.html { redirect_to(panel_personal_research_back_end_researchs_url) }
end
# format.xml { head :ok } # format.xml { head :ok }
format.js format.js
end end

View File

@ -1,5 +1,6 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<div class="writing_detail">
<table> <table>
<caption> <%= t("module_name.personal_research") %> </caption> <caption> <%= t("module_name.personal_research") %> </caption>
<tbody> <tbody>
@ -20,14 +21,16 @@
<% end %> <% end %>
<% if !@research.publish_date.blank? %> <% if !@research.publish_date.blank? %>
<tr><th><%= t("personal_research.publication_date")%></th><td><%= @research.publish_date %></td></tr> <tr><th><%= t("personal_research.publication_date")%></th><td><%= @research.publish_date.strftime("%Y.%m") %></td></tr>
<% end %> <% end %>
<% if !@research.url.blank? %> <% if !@research.url.blank? %>
<tr><th><%= t("personal_research.url")%></th><td><%= link_to t(:url), @research.url, {:target => '_blank', :title => @research.url} if !@research.url.blank? %></td></tr> <tr><th><%= t("personal_research.url")%></th><td><%= link_to t(:url), @research.url, {:target => '_blank', :title => @research.url} if !@research.url.blank? %></td></tr>
<% end %> <% end %>
<tr><th><%= t("personal_research.authors")%></th><td><%= "#{User.from_id(@research.create_user_id).name rescue ''},#{@research.authors rescue ''}"%></td></tr> <% if !@research.authors.blank? %>
<tr><th><%= t("personal_research.authors")%></th><td><%= "#{@research.authors rescue ''}"%></td></tr>
<% end %>
<% if @research.research_files.size > 0 %> <% if @research.research_files.size > 0 %>
<tr><th><%= t("personal_research.file")%></th> <tr><th><%= t("personal_research.file")%></th>
@ -45,3 +48,4 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
</div>

View File

@ -41,7 +41,7 @@
</div> </div>
<% end -%> <% end -%>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped main-list">
<thead> <thead>
<tr> <tr>
<% if is_admin? %> <% if is_admin? %>
@ -55,7 +55,7 @@
<% @researchs.each do |research| %> <% @researchs.each do |research| %>
<tr class="<%= research.is_hidden ? "checkHide" : "" %>"> <tr id="<%= dom_id research %>"class="<%= research.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %> <% if is_admin? %>
<td> <td>
<%= check_box_tag 'to_change[]', research.id.to_s, false, :class => "list-check" %> <%= check_box_tag 'to_change[]', research.id.to_s, false, :class => "list-check" %>
@ -64,6 +64,14 @@
<td><%= research.publish_date.strftime("%Y.%m") %></td> <td><%= research.publish_date.strftime("%Y.%m") %></td>
<td> <td>
<%= link_to research.research_title, panel_personal_research_front_end_research_path(research) %> <%= link_to research.research_title, panel_personal_research_front_end_research_path(research) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<%if at_least_module_manager || research.research_category.cur_user_is_sub_manager_of(:edit)%>
<li><%= link_to t('edit'), edit_panel_personal_research_back_end_research_path(research,:user_id => @user.id) %></li>
<li><%= link_to t(:delete_), panel_personal_research_back_end_research_path(research,:user_id => @user.id), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<% end -%>
</ul>
</div>
</td> </td>
</tr> </tr>