From 671257992ae69887148cbf51d445f41de5f9c9bb Mon Sep 17 00:00:00 2001 From: Manson Wang Date: Thu, 5 Dec 2013 10:26:19 +0800 Subject: [PATCH] Added sync button in personal plugin back_end Conflicts: config/locales/en.yml config/locales/zh_tw.yml vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/plugin/_profile.html.erb vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/plugin/_profile.html.erb --- .../admin/import_data_controller.rb | 20 +++---------------- config/locales/en.yml | 3 ++- config/locales/zh_tw.yml | 3 ++- .../personal_book/plugin/_profile.html.erb | 7 +++---- .../plugin/_profile.html.erb | 9 +++------ .../personal_journal/plugin/_profile.html.erb | 7 +++---- 6 files changed, 16 insertions(+), 33 deletions(-) mode change 100644 => 100755 config/locales/en.yml mode change 100644 => 100755 config/locales/zh_tw.yml mode change 100644 => 100755 vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb mode change 100644 => 100755 vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/plugin/_profile.html.erb mode change 100644 => 100755 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/plugin/_profile.html.erb diff --git a/app/controllers/admin/import_data_controller.rb b/app/controllers/admin/import_data_controller.rb index 800c96b0..7ae3b265 100644 --- a/app/controllers/admin/import_data_controller.rb +++ b/app/controllers/admin/import_data_controller.rb @@ -322,12 +322,8 @@ def sync_conference_data puts "No conference by Teacher" end end - respond_to do |format| - - format.html - format.json { render json: {"success"=>true}.to_json} - end + redirect_to request.referer end @@ -400,12 +396,7 @@ def sync_conference_data end end - respond_to do |format| - - format.html - format.json { render json: {"success"=>true}.to_json} - - end + redirect_to request.referer end def sync_book_data @@ -449,12 +440,7 @@ def sync_book_data end end end - respond_to do |format| - - format.html - format.json { render json: {"success"=>true}.to_json} - - end + redirect_to request.referer end diff --git a/config/locales/en.yml b/config/locales/en.yml old mode 100644 new mode 100755 index 187d6df4..042bc311 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -353,7 +353,8 @@ en: brief_intro : "Brief Intro." complete_list : "Complete List" frontend_page : "Frontend Page" - phone_number: "Phone Number" + phone_number: "Phone Number" + sync_data: "Synchronize" picture: Picture placeholder: Field Hint plugins: Plugins diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml old mode 100644 new mode 100755 index f9c0f8f4..36f547af --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -356,7 +356,8 @@ zh_tw: brief_intro : "摘要" complete_list : "完整列表" frontend_page : "前台呈現" - phone_number: "電話" + phone_number: "電話" + sync_data: "同步資料" picture: 圖片 placeholder: 欄位提示文字 plugins: 學術資訊 diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb old mode 100644 new mode 100755 index 25213aa4..ee6aa786 --- a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb +++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/plugin/_profile.html.erb @@ -75,10 +75,9 @@ <% if is_admin? %>
- <%= 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('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.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('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary' %>