Add show plugin profile action

This commit is contained in:
spen 2014-03-20 15:53:26 +08:00
parent 67880045c4
commit 43cc51f7d3
4 changed files with 30 additions and 6 deletions

View File

@ -231,7 +231,13 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
respond_to do |format|
if @writing_book.update_attributes(params[:writing_book])
if params[:writing_book][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_book][:user_id],:show_plugin_profile=>"WritingBook")) }
else
format.html { redirect_to(panel_personal_book_back_end_writing_books_url) }
end
# format.js { render 'toggle_enable' }
format.xml { head :ok }
else
@ -251,7 +257,13 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
@writing_book.destroy
respond_to do |format|
if params[:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"WritingBook")) }
else
format.html { redirect_to(panel_personal_book_back_end_writing_books_url) }
end
# format.xml { head :ok }
format.js
end

View File

@ -255,7 +255,7 @@
<label class="control-label muted"><%= t("personal_book.authors") %></label>
<div class="controls">
<%= f.fields_for :authors_translations do |f| %>
<%= f.text_area locale, rows: 2, class: "input-block-level", value: (@writing_book.authors_translations[locale] rescue nil) %>
<%= f.text_field locale, rows: 2, class: "input-block-level", value: (@writing_book.authors_translations[locale] rescue nil) %>
<% end %>
</div>
</div>

View File

@ -1,5 +1,6 @@
<% # encoding: utf-8 %>
<div class="writing_detail">
<table>
<caption> <%= t("module_name.personal_book") %> </caption>
<tbody>
@ -59,7 +60,9 @@
<tr><th><%= t("personal_book.url")%></th><td><%= link_to t(:url), @writing_book.url, {:target => '_blank', :title => @writing_book.url} if !@writing_book.url.blank? %></td></tr>
<% end %>
<tr><th><%= t("personal_book.authors")%></th><td><%= "#{User.from_id(@writing_book.create_user_id).name rescue ''},#{@writing_book.authors rescue ''}"%></td></tr>
<% if !@writing_book.authors.blank? %>
<tr><th><%= t("personal_book.authors")%></th><td><%= "#{@writing_book.authors rescue ''}"%></td></tr>
<% end %>
<% if @writing_book.writing_book_files.size > 0 %>
<tr><th><%= t("personal_book.files")%></th>
@ -77,3 +80,4 @@
<% end %>
</tbody>
</table>
</div>

View File

@ -41,7 +41,7 @@
</div>
<% end -%>
<table class="table table-condensed table-striped">
<table class="table table-condensed table-striped main-list">
<thead>
<tr>
<% if is_admin? %>
@ -55,7 +55,7 @@
<% @writing_books.each do |writing_book| %>
<tr class="<%= writing_book.is_hidden ? "checkHide" : "" %>">
<tr id="<%= dom_id writing_book %>" class="<%= writing_book.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', writing_book.id.to_s, false, :class => "list-check" %>
@ -64,6 +64,14 @@
<td><%= writing_book.year %></td>
<td>
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<%if at_least_module_manager || writing_book.writing_book_category.cur_user_is_sub_manager_of(:edit)%>
<li><%= link_to t('edit'), edit_panel_personal_book_back_end_writing_book_path(writing_book,:user_id => @user.id) %></li>
<li><%= link_to t(:delete_), panel_personal_book_back_end_writing_book_path(writing_book,:user_id => @user.id), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<% end -%>
</ul>
</div>
</td>
</tr>