From 99a5cf6329678731f39e5ac0e3aed18730dcd699 Mon Sep 17 00:00:00 2001 From: spen Date: Thu, 20 Mar 2014 15:51:05 +0800 Subject: [PATCH] Add show plugin profile action --- .../back_end/researchs_controller.rb | 16 ++++++++++++++-- .../front_end/researchs/show.html.erb | 8 ++++++-- .../personal_research/plugin/_profile.html.erb | 12 ++++++++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/app/controllers/panel/personal_research/back_end/researchs_controller.rb b/app/controllers/panel/personal_research/back_end/researchs_controller.rb index 0460a07..e5d753a 100644 --- a/app/controllers/panel/personal_research/back_end/researchs_controller.rb +++ b/app/controllers/panel/personal_research/back_end/researchs_controller.rb @@ -101,7 +101,13 @@ class Panel::PersonalResearch::BackEnd::ResearchsController < OrbitBackendContro respond_to do |format| 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.xml { head :ok } else @@ -119,7 +125,13 @@ class Panel::PersonalResearch::BackEnd::ResearchsController < OrbitBackendContro @research.destroy 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.js end diff --git a/app/views/panel/personal_research/front_end/researchs/show.html.erb b/app/views/panel/personal_research/front_end/researchs/show.html.erb index 971f9df..b874dc0 100644 --- a/app/views/panel/personal_research/front_end/researchs/show.html.erb +++ b/app/views/panel/personal_research/front_end/researchs/show.html.erb @@ -1,5 +1,6 @@ <% # encoding: utf-8 %> +
@@ -20,14 +21,16 @@ <% end %> <% if !@research.publish_date.blank? %> - + <% end %> <% if !@research.url.blank? %> <% end %> - + <% if !@research.authors.blank? %> + + <% end %> <% if @research.research_files.size > 0 %> @@ -45,3 +48,4 @@ <% end %>
<%= t("module_name.personal_research") %>
<%= t("personal_research.publication_date")%><%= @research.publish_date %>
<%= t("personal_research.publication_date")%><%= @research.publish_date.strftime("%Y.%m") %>
<%= t("personal_research.url")%><%= link_to t(:url), @research.url, {:target => '_blank', :title => @research.url} if !@research.url.blank? %>
<%= t("personal_research.authors")%><%= "#{User.from_id(@research.create_user_id).name rescue ''},#{@research.authors rescue ''}"%>
<%= t("personal_research.authors")%><%= "#{@research.authors rescue ''}"%>
<%= t("personal_research.file")%>
+
diff --git a/app/views/panel/personal_research/plugin/_profile.html.erb b/app/views/panel/personal_research/plugin/_profile.html.erb index 16891f5..dd1fa58 100644 --- a/app/views/panel/personal_research/plugin/_profile.html.erb +++ b/app/views/panel/personal_research/plugin/_profile.html.erb @@ -41,7 +41,7 @@ <% end -%> - +
<% if is_admin? %> @@ -55,7 +55,7 @@ <% @researchs.each do |research| %> - "> + "> <% if is_admin? %>
<%= check_box_tag 'to_change[]', research.id.to_s, false, :class => "list-check" %> @@ -64,6 +64,14 @@ <%= research.publish_date.strftime("%Y.%m") %> <%= link_to research.research_title, panel_personal_research_front_end_research_path(research) %> +
+ +