From 316d72d4a56ed3393a526b5b2c7cff73f0605de3 Mon Sep 17 00:00:00 2001 From: spen Date: Thu, 20 Mar 2014 15:53:58 +0800 Subject: [PATCH] Add show plugin profile action --- .../back_end/writing_conferences_controller.rb | 16 ++++++++++++++-- .../front_end/writing_conferences/show.html.erb | 6 +++++- .../personal_conference/plugin/_profile.html.erb | 12 ++++++++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/app/controllers/panel/personal_conference/back_end/writing_conferences_controller.rb b/app/controllers/panel/personal_conference/back_end/writing_conferences_controller.rb index 0ef42ba..c740ac9 100644 --- a/app/controllers/panel/personal_conference/back_end/writing_conferences_controller.rb +++ b/app/controllers/panel/personal_conference/back_end/writing_conferences_controller.rb @@ -226,7 +226,13 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa respond_to do |format| if @writing_conference.update_attributes(params[:writing_conference]) - format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) } + + if params[:writing_conference][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_conference][:user_id],:show_plugin_profile=>'WritingConference')) } + else + format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) } + end + # format.js { render 'toggle_enable' } format.xml { head :ok } else @@ -246,7 +252,13 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa @writing_conference.destroy respond_to do |format| - format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) } + + if params[:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>'WritingConference')) } + else + format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) } + end + # format.xml { head :ok } format.js end diff --git a/app/views/panel/personal_conference/front_end/writing_conferences/show.html.erb b/app/views/panel/personal_conference/front_end/writing_conferences/show.html.erb index b4828d8..f117f33 100644 --- a/app/views/panel/personal_conference/front_end/writing_conferences/show.html.erb +++ b/app/views/panel/personal_conference/front_end/writing_conferences/show.html.erb @@ -1,5 +1,6 @@ <% # encoding: utf-8 %> +
@@ -55,7 +56,9 @@ <% end %> - + <% if !@writing_conference.authors.blank? %> + + <% end %> <% if @writing_conference.writing_conference_files.size > 0 %> @@ -73,3 +76,4 @@ <% end %>
<%= t("module_name.personal_conference") %>
<%= t("personal_conference.url")%><%= link_to t(:url), @writing_conference.url, {:target => '_blank', :title => @writing_conference.url} if !@writing_conference.url.blank? %>
<%= t("personal_conference.authors")%><%= "#{User.from_id(@writing_conference.create_user_id).name rescue ''},#{@personal_conference.authors rescue ''}"%>
<%= t("personal_conference.authors")%><%= "#{@writing_conference.authors rescue ''}"%>
<%= t("personal_conference.file")%>
+
diff --git a/app/views/panel/personal_conference/plugin/_profile.html.erb b/app/views/panel/personal_conference/plugin/_profile.html.erb index e7efa7f..a27e49c 100644 --- a/app/views/panel/personal_conference/plugin/_profile.html.erb +++ b/app/views/panel/personal_conference/plugin/_profile.html.erb @@ -41,7 +41,7 @@ <% end -%> - +
<% if is_admin? %> @@ -55,7 +55,7 @@ <% @writing_conferences.each do |writing_conference| %> - "> + "> <% if is_admin? %>
<%= check_box_tag 'to_change[]', writing_conference.id.to_s, false, :class => "list-check" %> @@ -64,6 +64,14 @@ <%= writing_conference.year %> <%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %> +
+ +