From 15cce36f9aaaa050f30f6b821371321714c6dd8e Mon Sep 17 00:00:00 2001 From: spen Date: Thu, 20 Mar 2014 15:57:04 +0800 Subject: [PATCH] Add show plugin profile action --- .../back_end/writing_journals_controller.rb | 16 ++++++++++++++-- .../front_end/writing_journals/show.html.erb | 6 +++++- .../personal_journal/plugin/_profile.html.erb | 14 ++++++++++++-- config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb b/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb index 1c3998f..0e22de0 100644 --- a/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb +++ b/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb @@ -277,7 +277,13 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC respond_to do |format| if @writing_journal.update_attributes(params[:writing_journal]) - format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) } + + if params[:writing_journal][:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_journal][:user_id],:show_plugin_profile=>"WritingJournal")) } + else + format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) } + end + # format.js { render 'toggle_enable' } format.xml { head :ok } else @@ -296,7 +302,13 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC @writing_journal.destroy respond_to do |format| - format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) } + + if params[:user_id] + format.html { redirect_to(admin_users_new_interface_url(:id=>[:user_id],:show_plugin_profile=>"WritingJournal")) } + else + format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) } + end + # format.xml { head :ok } format.js end diff --git a/app/views/panel/personal_journal/front_end/writing_journals/show.html.erb b/app/views/panel/personal_journal/front_end/writing_journals/show.html.erb index 716ff12..c05c58b 100644 --- a/app/views/panel/personal_journal/front_end/writing_journals/show.html.erb +++ b/app/views/panel/personal_journal/front_end/writing_journals/show.html.erb @@ -1,5 +1,6 @@ <% # encoding: utf-8 %> +
@@ -63,7 +64,9 @@ <% end %> - + <% if !@writing_journal.authors.blank? %> + + <% end %> <% if @writing_journal.writing_journal_files.size > 0 %> @@ -82,3 +85,4 @@
<%= t("module_name.personal_journal") %>
<%= t("personal_journal.url")%><%= link_to t(:url), @writing_journal.url, {:target => '_blank', :title => @writing_journal.url} if !@writing_journal.url.blank? %>
<%= t("personal_journal.authors")%><%= "#{User.from_id(@writing_journal.create_user_id).name rescue ''},#{@writing_journal.authors rescue ''}"%>
<%= t("personal_journal.authors")%><%= "#{@writing_journal.authors rescue ''}"%>
<%= t("personal_journal.file")%>
+
\ No newline at end of file diff --git a/app/views/panel/personal_journal/plugin/_profile.html.erb b/app/views/panel/personal_journal/plugin/_profile.html.erb index 9fa216d..7b91c3b 100644 --- a/app/views/panel/personal_journal/plugin/_profile.html.erb +++ b/app/views/panel/personal_journal/plugin/_profile.html.erb @@ -40,7 +40,7 @@ <% end -%> - +
<% if is_admin? %> @@ -57,7 +57,7 @@ <% @writing_journals.each do |writing_journal| %> - "> + "> <% if is_admin? %> <% if not @user%> diff --git a/config/locales/en.yml b/config/locales/en.yml index 32d9c7d..4c33300 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -11,6 +11,7 @@ en: isbn : "ISSN(ISBN)" vol_no : "Vol.No" issue_no : "Issue.No" + form_to: "From To" form_to_start : "From" form_to_end : "To" total_pages : "Total Pages" diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index ce89e26..02d69ef 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -11,6 +11,7 @@ zh_tw: isbn : "ISSN(ISBN)" vol_no : "卷數" issue_no : "期數" + form_to: "From To" form_to_start : "起" form_to_end : "訖" total_pages : "總頁數"
<%= check_box_tag 'to_change[]', writing_journal.id.to_s, false, :class => "list-check" %> @@ -66,6 +66,16 @@ <%= writing_journal.year %> <%= link_to writing_journal.create_link, panel_personal_journal_front_end_writing_journal_path(writing_journal) %> + +
+ +
+
<%= writing_journal.authors %>