Add show plugin profile action

This commit is contained in:
spen 2014-03-20 15:57:04 +08:00
parent 22c2942f8e
commit 15cce36f9a
5 changed files with 33 additions and 5 deletions

View File

@ -277,7 +277,13 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
respond_to do |format|
if @writing_journal.update_attributes(params[:writing_journal])
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|
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

View File

@ -1,5 +1,6 @@
<% # encoding: utf-8 %>
<div class="writing_detail">
<table>
<caption> <%= t("module_name.personal_journal") %> </caption>
<tbody>
@ -63,7 +64,9 @@
<tr><th><%= t("personal_journal.url")%></th><td><%= link_to t(:url), @writing_journal.url, {:target => '_blank', :title => @writing_journal.url} if !@writing_journal.url.blank? %></td></tr>
<% end %>
<tr><th><%= t("personal_journal.authors")%></th><td><%= "#{User.from_id(@writing_journal.create_user_id).name rescue ''},#{@writing_journal.authors rescue ''}"%></td></tr>
<% if !@writing_journal.authors.blank? %>
<tr><th><%= t("personal_journal.authors")%></th><td><%= "#{@writing_journal.authors rescue ''}"%></td></tr>
<% end %>
<% if @writing_journal.writing_journal_files.size > 0 %>
<tr><th><%= t("personal_journal.file")%></th>
@ -82,3 +85,4 @@
</tbody>
</table>
</div>

View File

@ -40,7 +40,7 @@
</div>
<% end -%>
<table class="table table-condensed table-striped">
<table class="table table-condensed table-striped main-list">
<thead>
<tr>
<% if is_admin? %>
@ -57,7 +57,7 @@
<% @writing_journals.each do |writing_journal| %>
<tr class="<%= writing_journal.is_hidden ? "checkHide" : "" %>">
<tr id="<%= dom_id writing_journal %>" class="<%= writing_journal.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', writing_journal.id.to_s, false, :class => "list-check" %>
@ -66,6 +66,16 @@
<td><%= writing_journal.year %></td>
<td>
<%= link_to writing_journal.create_link, panel_personal_journal_front_end_writing_journal_path(writing_journal) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<%if at_least_module_manager || writing_journal.writing_journal_category.cur_user_is_sub_manager_of(:edit)%>
<li><%= link_to t('edit'), edit_panel_personal_journal_back_end_writing_journal_path(writing_journal,:user_id => @user.id) %></li>
<li><%= link_to t(:delete_), panel_personal_journal_back_end_writing_journal_path(writing_journal,:user_id => @user.id), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<% end -%>
</ul>
</div>
</td>
<% if not @user%>
<td><%= writing_journal.authors %></td>

View File

@ -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"

View File

@ -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 : "總頁數"