Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Harry Bomrah | 100dea8f7b | |
spen | c969fbb851 | |
spen | 43cc51f7d3 |
|
@ -231,7 +231,13 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @writing_book.update_attributes(params[:writing_book])
|
if @writing_book.update_attributes(params[:writing_book])
|
||||||
format.html { redirect_to(panel_personal_book_back_end_writing_books_url) }
|
|
||||||
|
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.js { render 'toggle_enable' }
|
||||||
format.xml { head :ok }
|
format.xml { head :ok }
|
||||||
else
|
else
|
||||||
|
@ -251,7 +257,13 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
|
||||||
@writing_book.destroy
|
@writing_book.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to(panel_personal_book_back_end_writing_books_url) }
|
|
||||||
|
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.xml { head :ok }
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,8 +11,6 @@ class WritingBook
|
||||||
|
|
||||||
LANGUAGE_TYPES = [ "English", "Chinese" ]
|
LANGUAGE_TYPES = [ "English", "Chinese" ]
|
||||||
|
|
||||||
|
|
||||||
field :paper_title, localize: true
|
|
||||||
field :book_title, localize: true
|
field :book_title, localize: true
|
||||||
field :authors, localize: true
|
field :authors, localize: true
|
||||||
field :extracted_chapters, localize: true
|
field :extracted_chapters, localize: true
|
||||||
|
@ -45,8 +43,6 @@ class WritingBook
|
||||||
|
|
||||||
# before_save :clean_checkboxs
|
# before_save :clean_checkboxs
|
||||||
|
|
||||||
validates :paper_title, :at_least_one => true
|
|
||||||
|
|
||||||
before_validation :add_http
|
before_validation :add_http
|
||||||
|
|
||||||
after_save :save_writing_book_files
|
after_save :save_writing_book_files
|
||||||
|
@ -85,8 +81,6 @@ class WritingBook
|
||||||
def create_link
|
def create_link
|
||||||
title = []
|
title = []
|
||||||
title << self.authors if self.authors.present?
|
title << self.authors if self.authors.present?
|
||||||
|
|
||||||
# title << self.paper_title if self.paper_title.present?
|
|
||||||
title << self.book_title if self.book_title.present?
|
title << self.book_title if self.book_title.present?
|
||||||
title << self.publisher if self.publisher.present?
|
title << self.publisher if self.publisher.present?
|
||||||
title << self.isbn if self.isbn.present?
|
title << self.isbn if self.isbn.present?
|
||||||
|
@ -94,8 +88,6 @@ class WritingBook
|
||||||
if !self.publish_date.nil?
|
if !self.publish_date.nil?
|
||||||
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
|
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
|
||||||
title << pd[0]+"/"+pd[1]
|
title << pd[0]+"/"+pd[1]
|
||||||
elsif !self.year.blank?
|
|
||||||
title << self.year
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
||||||
|
|
|
@ -200,16 +200,6 @@
|
||||||
|
|
||||||
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
|
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
|
||||||
|
|
||||||
<!-- paper_title-->
|
|
||||||
<div class="control-group input-title">
|
|
||||||
<label class="control-label muted"><%= t("personal_book.paper_title") %></label>
|
|
||||||
<div class="controls">
|
|
||||||
<%= f.fields_for :paper_title_translations do |f| %>
|
|
||||||
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.paper_title"), value: (@writing_book.paper_title_translations[locale] rescue nil) %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- book_title-->
|
<!-- book_title-->
|
||||||
<div class="control-group input-title">
|
<div class="control-group input-title">
|
||||||
<label class="control-label muted"><%= t("personal_book.book_title") %></label>
|
<label class="control-label muted"><%= t("personal_book.book_title") %></label>
|
||||||
|
@ -255,7 +245,7 @@
|
||||||
<label class="control-label muted"><%= t("personal_book.authors") %></label>
|
<label class="control-label muted"><%= t("personal_book.authors") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :authors_translations do |f| %>
|
<%= 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 %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<% # encoding: utf-8 %>
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
|
<div class="writing_detail">
|
||||||
<table>
|
<table>
|
||||||
<caption> <%= t("module_name.personal_book") %> </caption>
|
<caption> <%= t("module_name.personal_book") %> </caption>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -11,10 +12,6 @@
|
||||||
<tr><th><%= t("personal_book.language")%></th><td><%= @writing_book.language %></td></tr>
|
<tr><th><%= t("personal_book.language")%></th><td><%= @writing_book.language %></td></tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !@writing_book.paper_title.blank? %>
|
|
||||||
<tr><th><%= t("personal_book.paper_title")%></th><td><%= @writing_book.paper_title %></td></tr>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !@writing_book.book_title.blank? %>
|
<% if !@writing_book.book_title.blank? %>
|
||||||
<tr><th><%= t("personal_book.book_title")%></th><td><%= @writing_book.book_title %></td></tr>
|
<tr><th><%= t("personal_book.book_title")%></th><td><%= @writing_book.book_title %></td></tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -59,7 +56,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>
|
<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 %>
|
<% 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 %>
|
<% if @writing_book.writing_book_files.size > 0 %>
|
||||||
<tr><th><%= t("personal_book.files")%></th>
|
<tr><th><%= t("personal_book.files")%></th>
|
||||||
|
@ -77,3 +76,4 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<table class="table table-condensed table-striped">
|
<table class="table table-condensed table-striped main-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
<% @writing_books.each do |writing_book| %>
|
<% @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? %>
|
<% if is_admin? %>
|
||||||
<td>
|
<td>
|
||||||
<%= check_box_tag 'to_change[]', writing_book.id.to_s, false, :class => "list-check" %>
|
<%= check_box_tag 'to_change[]', writing_book.id.to_s, false, :class => "list-check" %>
|
||||||
|
@ -64,6 +64,14 @@
|
||||||
<td><%= writing_book.year %></td>
|
<td><%= writing_book.year %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
|
<%= 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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
@ -75,9 +83,8 @@
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_book_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_book_back_end_personal_book_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_book_back_end_personal_book_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary' %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination pagination-centered">
|
<div class="pagination pagination-centered">
|
||||||
<%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
<%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||||
|
|
|
@ -16,6 +16,7 @@ en:
|
||||||
form_to_start : "From"
|
form_to_start : "From"
|
||||||
form_to_end : "To"
|
form_to_end : "To"
|
||||||
total_pages : "Total Pages"
|
total_pages : "Total Pages"
|
||||||
|
publishers : "Publishers"
|
||||||
keywords : "Keywords"
|
keywords : "Keywords"
|
||||||
abstract : "Abstract"
|
abstract : "Abstract"
|
||||||
publication_date : "Date of Publication"
|
publication_date : "Date of Publication"
|
||||||
|
|
|
@ -15,6 +15,7 @@ zh_tw:
|
||||||
issue_no : "期數"
|
issue_no : "期數"
|
||||||
form_to_start : "起"
|
form_to_start : "起"
|
||||||
form_to_end : "訖"
|
form_to_end : "訖"
|
||||||
|
publishers : "出版商"
|
||||||
total_pages : "總頁數"
|
total_pages : "總頁數"
|
||||||
keywords : "關鍵字"
|
keywords : "關鍵字"
|
||||||
abstract : "摘要"
|
abstract : "摘要"
|
||||||
|
|
Loading…
Reference in New Issue