From 58051caac1e5d481691d40a95b7e4a10e9b9a02e 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 --- .../admin/import_data_controller.rb | 20 +++---------------- config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + .../personal_book/plugin/_profile.html.erb | 5 +++-- .../plugin/_profile.html.erb | 5 +++-- .../personal_journal/plugin/_profile.html.erb | 5 +++-- 6 files changed, 14 insertions(+), 23 deletions(-) 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 index c7f91ff4..354afafe 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -351,6 +351,7 @@ en: brief_intro : "Brief Intro." complete_list : "Complete List" frontend_page : "Frontend Page" + sync_data: "Synchronize" phone_number: "Phone Number" picture: Picture placeholder: Field Hint diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index d0e2d70a..2323f3c4 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -354,6 +354,7 @@ zh_tw: brief_intro : "摘要" complete_list : "完整列表" frontend_page : "前台呈現" + sync_data: "同步資料" phone_number: "電話" picture: 圖片 placeholder: 欄位提示文字 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 index d9df9f31..ee6aa786 100644 --- 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,8 +75,9 @@ <% if is_admin? %>
- <%= 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' %>