From 5de7fcfaf6e542a37838ded4b4290f4e0f3d777d Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 26 Sep 2013 22:26:19 +0800 Subject: [PATCH] added sync for journal paper books and conference.. and also disabled the icons Conflicts: app/assets/javascripts/desktop/orbitdesktop.js app/controllers/admin/import_data_controller.rb Conflicts: vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/index.html.erb vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb --- .../admin/import_data_controller.rb | 19 ++++++++++++++++++- .../personal_book/desktop/personal_books.js | 5 +++++ .../desktop/personal_books_controller.rb | 3 +-- .../desktop/personal_books/index.html.erb | 10 ++++------ .../desktop/conference_pages.js | 1 - .../desktop/conference_pages/index.html.erb | 7 +++---- .../personal_journal/desktop/journal_pages.js | 4 ++-- .../desktop/journal_pages_controller.rb | 1 - .../desktop/journal_pages/index.html.erb | 7 +++---- 9 files changed, 36 insertions(+), 21 deletions(-) diff --git a/app/controllers/admin/import_data_controller.rb b/app/controllers/admin/import_data_controller.rb index 7ae3b265..ae33d4da 100644 --- a/app/controllers/admin/import_data_controller.rb +++ b/app/controllers/admin/import_data_controller.rb @@ -322,8 +322,12 @@ def sync_conference_data puts "No conference by Teacher" end end + respond_to do |format| + + format.html { redirect_to request.referer } + format.json { render json: {"success"=>true}.to_json} - redirect_to request.referer + end end @@ -509,6 +513,13 @@ end else puts "No conference by Teacher" end + + end + respond_to do |format| + + format.html + format.json { render json: {"success"=>true}.to_json} + end end end @@ -631,6 +642,12 @@ def sync_book_data_auto end end end + respond_to do |format| + + format.html + format.json { render json: {"success"=>true}.to_json} + + end end end diff --git a/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js b/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js index 42f1ec0f..2006c0de 100644 --- a/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js +++ b/vendor/built_in_modules/personal_book/app/assets/javascripts/personal_book/desktop/personal_books.js @@ -98,6 +98,11 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t 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){ if(data.success){ o.notify(data.msg,"success"); diff --git a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb index 65699fba..a324a96c 100644 --- a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb +++ b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/desktop/personal_books_controller.rb @@ -7,7 +7,6 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl page ||= 1 @per_column = 5 - @userid = current_user.id case @view_by when "abstract" @@ -71,4 +70,4 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl def books_window render :layout => false end -end \ No newline at end of file +end diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/index.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/index.html.erb index ba485b78..d893e3c9 100644 --- a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/index.html.erb +++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/desktop/personal_books/index.html.erb @@ -57,11 +57,9 @@ - -
- -
- +
+ +
@@ -72,4 +70,4 @@ <%= publication_record w, @view_by%> <% end %> - \ No newline at end of file + diff --git a/vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js b/vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js index 87583f6a..ceb2cd8d 100644 --- a/vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js +++ b/vendor/built_in_modules/personal_conference/app/assets/javascripts/personal_conference/desktop/conference_pages.js @@ -46,7 +46,6 @@ orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){ o.notify("Sync Complete","success"); o.sub_menu_item($("div[content-type=menu] a").eq(0)); } - var uploadFiles = function(){ $('#add_plugin_file a.add').click(function(){ var new_id = $(this).prev().attr('value'); diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb index 64e6bff8..80de024c 100644 --- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb +++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/desktop/conference_pages/index.html.erb @@ -60,10 +60,9 @@
- -
- -
+ +
+
diff --git a/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js b/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js index 4e123540..3fee6f71 100644 --- a/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js +++ b/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js @@ -42,10 +42,10 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ // this.initializeJournalPapers.cancelpaper = function(){ o.highlight_sub_menu_item(0); } - this.initializeJournalPapers.syncComplete = function(){ + this.initializeJournalPapers.syncComplete = function(){ o.notify("Sync Complete","success"); o.sub_menu_item($("div[content-type=menu] a").eq(0)); - } + } var uploadFiles = function(){ $('#add_plugin_file a.add').click(function(){ diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb index ca892afc..5a7c5e88 100644 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb +++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/desktop/journal_pages_controller.rb @@ -7,7 +7,6 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr page ||= 1 @per_column = 5 - @userid = current_user.id case @view_by when "abstract" diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb index 218cdddc..41b7924a 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb @@ -59,9 +59,8 @@
- -
- +
Sync Books
+
@@ -72,4 +71,4 @@ <%= publication_record w, @view_by%> <% end %> - \ No newline at end of file +