Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
spen | 6c06d0f457 | |
Manson Wang | 3ad405936c |
|
@ -92,6 +92,16 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t
|
||||||
width: $(".overview").width() - 20
|
width: $(".overview").width() - 20
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.initializePersonalBook.syncComplete = function(){
|
||||||
|
o.notify("Sync Complete","success");
|
||||||
|
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.initializePersonalBook.syncComplete = function(){
|
||||||
|
o.notify("Sync Complete","success");
|
||||||
|
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
||||||
|
}
|
||||||
|
|
||||||
this.initializePersonalBook.coAuthorformCallback = function(data){
|
this.initializePersonalBook.coAuthorformCallback = function(data){
|
||||||
if(data.success){
|
if(data.success){
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
||||||
page ||= 1
|
page ||= 1
|
||||||
|
|
||||||
@per_column = 5
|
@per_column = 5
|
||||||
|
@userid = current_user.id
|
||||||
case @view_by
|
case @view_by
|
||||||
when "abstract"
|
when "abstract"
|
||||||
@per_column = 1
|
@per_column = 1
|
||||||
|
@ -70,4 +70,4 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
|
||||||
def books_window
|
def books_window
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,6 +11,8 @@ 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
|
||||||
|
@ -43,6 +45,8 @@ 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
|
||||||
|
@ -80,18 +84,13 @@ class WritingBook
|
||||||
|
|
||||||
def create_link
|
def create_link
|
||||||
title = []
|
title = []
|
||||||
title << self.authors if self.authors.present?
|
# title = ["#{self.extracted_chapters}"] if self.extracted_chapters.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.pages if self.pages.present?
|
||||||
|
|
||||||
if !self.publish_date.nil?
|
|
||||||
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
|
|
||||||
title << pd[0]+"/"+pd[1]
|
|
||||||
end
|
|
||||||
|
|
||||||
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
||||||
title.join(', ')
|
title.join(', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -200,6 +200,16 @@
|
||||||
|
|
||||||
<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>
|
||||||
|
|
|
@ -57,6 +57,9 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="hh1 hp sdm">
|
||||||
|
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_book_data_path(:user_id=>@userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Books</a></div>
|
||||||
|
</div>
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,4 +70,4 @@
|
||||||
<%= publication_record w, @view_by%>
|
<%= publication_record w, @view_by%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
<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 %>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" /></th>
|
<th><input type="checkbox" class="list-check" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_book.year') %></th>
|
<th class="span1"><%= t('personal_book.year') %></th>
|
||||||
<th><%= t('personal_book.book_title') %></th>
|
<th><%= t('personal_book.book_title') %></th>
|
||||||
|
@ -83,8 +83,9 @@
|
||||||
<% 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.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.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('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('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' %>
|
||||||
</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,7 +16,6 @@ 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,7 +15,6 @@ 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