ntu_cph sync

This commit is contained in:
Manson Wang 2014-02-10 10:23:22 +08:00
parent 7198ca2111
commit 3ad405936c
5 changed files with 23 additions and 16 deletions

View File

@ -93,6 +93,16 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t
}); });
} }
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){
o.notify(data.msg,"success"); o.notify(data.msg,"success");

View File

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

View File

@ -84,18 +84,11 @@ 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.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

View File

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

View File

@ -75,8 +75,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} %>