diff --git a/app/controllers/admin/.designs_controller.rb.swp b/app/controllers/admin/.designs_controller.rb.swp deleted file mode 100644 index 5131583d..00000000 Binary files a/app/controllers/admin/.designs_controller.rb.swp and /dev/null differ diff --git a/app/controllers/admin/designs_controller.rb b/app/controllers/admin/designs_controller.rb index a3824950..913520fa 100644 --- a/app/controllers/admin/designs_controller.rb +++ b/app/controllers/admin/designs_controller.rb @@ -101,7 +101,6 @@ class Admin::DesignsController < OrbitBackendController def create @design = Design.new(params[:design]) if @design.save - flash[:notice] = "Successfully created design and tasks." redirect_to admin_designs_url else render :action => 'new' diff --git a/app/controllers/admin/purchases_controller.rb b/app/controllers/admin/purchases_controller.rb index 116d18f3..f4d1ae2a 100644 --- a/app/controllers/admin/purchases_controller.rb +++ b/app/controllers/admin/purchases_controller.rb @@ -112,7 +112,7 @@ class Admin::PurchasesController < ApplicationController log = Logger.new(STDOUT) log.level = Logger::WARN - log.warn("App unzip procress is finished,please restart the server to apply effect") + log.warn(t(:unzip_app)) #TODO Perform touch tmp/restart to restart in production env end @@ -159,7 +159,7 @@ class Admin::PurchasesController < ApplicationController log = Logger.new(STDOUT) log.level = Logger::WARN - log.warn("App unzip procress is finished,please restart the server to apply effect") + log.warn(t(:unzip_app)) } temp_file.close diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb deleted file mode 100644 index e0c8a8f9..00000000 --- a/app/controllers/admin/users_controller.rb +++ /dev/null @@ -1,78 +0,0 @@ -class Admin::UsersController < ApplicationController - - layout "admin" - before_filter :authenticate_user! - before_filter :set_attribute, :only => [:index, :show, :new, :edit] - - def index - @users = User.all.entries - end - - def show - @user = User.find(params[:id]) - get_info_and_roles - end - - def new - @user = User.new - get_info_and_roles - end - - def create - puts params.to_yaml - @user = User.new(params[:user]) - if @user.save - flash[:notice] = t('create.success.user') - redirect_to :action => :index - else - render :action => :new - end - end - - def edit - @user = User.find(params[:id]) - get_info_and_roles - end - - def update - @user = User.find(params[:id]) - - # Update changes to the avatar - @user.remove_avatar! if params[:file] - @user.avatar = params[:file] if params[:file] - - if @user.id.to_s.eql?(session['warden.user.user.key'][1].to_s) && @user.admin != params[:user][:admin].to_i.to_b - flash.now[:error] = t(:cant_revoke_self_admin) - end - if !flash[:error] && @user.update_attributes(params[:user]) - flash[:notice] = t('update.success.user') - redirect_to :action => :index - else - get_info_and_roles - render :action => :edit - end - end - - def destroy - if params[:id].eql?(session['warden.user.user.key'][1].to_s) - flash[:error] = t(:cant_delete_self) - else - @user = User.find(params[:id]) - @user.destroy - end - - redirect_to :action => :index - end - - protected - - def get_info_and_roles - @infos = Info.excludes('disabled' => true) - @roles = Role.excludes('disabled' => true) - end - - def set_attribute - @class = 'users' - end - -end diff --git a/app/controllers/desktop/co_authors_controller.rb b/app/controllers/desktop/co_authors_controller.rb index d41e2348..261184fc 100644 --- a/app/controllers/desktop/co_authors_controller.rb +++ b/app/controllers/desktop/co_authors_controller.rb @@ -37,7 +37,7 @@ class Desktop::CoAuthorsController < ApplicationController @co_author.name_id= current_user.id if @co_author.save - render json: {success:true, msg: "Co-author successfully saved!"}.to_json + render json: {success:true, msg: t('create.sucess.co_author')}.to_json else error_msg = @co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -48,7 +48,7 @@ class Desktop::CoAuthorsController < ApplicationController @co_author = CoAuthor.find(params[:id]) if @co_author.update_attributes(params[:co_author]) - render json: {success:true, msg: "Co-author successfully update!"}.to_json + render json: {success:true, msg: t('update.sucess.co_author')}.to_json else error_msg = @co_author.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json diff --git a/app/controllers/desktop/journal_pages_controller.rb b/app/controllers/desktop/journal_pages_controller.rb index 69334a5b..5b9310cc 100644 --- a/app/controllers/desktop/journal_pages_controller.rb +++ b/app/controllers/desktop/journal_pages_controller.rb @@ -44,7 +44,7 @@ class Desktop::JournalPagesController < ApplicationController @writing_journal = WritingJournal.new(params[:writing_journal]) if @writing_journal.save - render json: {success: true, msg: "Paper successfully saved!"}.to_json + render json: {success: true, msg: t('create.success.paper')}.to_json else error_msg = @writing_journal.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -56,7 +56,7 @@ class Desktop::JournalPagesController < ApplicationController @writing_journal= WritingJournal.find(params[:id]) respond_to do |format| if @writing_journal.update_attributes(params[:writing_journal]) - render json: {success: true, msg: "Paper successfully saved!"}.to_json + render json: {success: true, msg: t('update.success.paper')}.to_json else error_msg = @writing_journal.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json @@ -76,7 +76,7 @@ class Desktop::JournalPagesController < ApplicationController def destroy @writing_journal = WritingJournal.find(params[:id]) @writing_journal.destroy - render :json => {success: true, msg: "Paper deleted successfully!"} + render :json => {success: true, msg: t('delete.success.paper')} end def get_journals_json diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 4c3084dd..6e00b859 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -10,7 +10,7 @@ class PagesController < ApplicationController impressionist(@item) render_page else - render :text => 'You need a home page' + render :text => t(:need_home) end end diff --git a/app/helpers/admin/items_helper.rb b/app/helpers/admin/items_helper.rb index 6763cff2..948df59c 100644 --- a/app/helpers/admin/items_helper.rb +++ b/app/helpers/admin/items_helper.rb @@ -18,7 +18,7 @@ module Admin::ItemsHelper ret << (link_to t(:edit), eval("edit_admin_#{node.class.to_s.downcase}_path(node)"), :class => 'js_history') if node.class.to_s.eql?('Page') ret << (link_to t('new.page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page js_history') if node.class.to_s.eql?('Page') ret << (link_to t('new.link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link js_history') if node.class.to_s.eql?('Page') - ret << (link_to t(:delete), eval("delete_admin_#{node.class.to_s.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete js_history') + ret << (link_to t(:delete_), eval("delete_admin_#{node.class.to_s.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete js_history') ret << "" ret << "" ret << render_children(node) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6f6bd13b..068f6ab7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -44,13 +44,6 @@ module ApplicationHelper User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id]) end - - - - def colorize_in_use_locale(locale) - @site_in_use_locales.include?(locale)? 'green' : 'red' - end - def flash_messages return unless messages = flash.keys.select{|k| FLASH_NOTICE_KEYS.include?(k)} formatted_messages = messages.map do |type| diff --git a/app/helpers/attribute_fields_helper.rb b/app/helpers/attribute_fields_helper.rb index 270a5516..2705dc8f 100644 --- a/app/helpers/attribute_fields_helper.rb +++ b/app/helpers/attribute_fields_helper.rb @@ -228,7 +228,7 @@ protected temp_field_name = get_basic_field_name_base + '[temp]' add_more = content_tag :div,:class=> 'controls' do content_tag :span,:class=> 'help-block' do - content = link_to (content_tag :i,I18n.t("admin.infos.add"),:class=>"icon-plus-sign"),"#",:class=>'addinput' + content = link_to (content_tag :i,I18n.t(:add),:class=>"icon-plus-sign"),"#",:class=>'addinput' content << hidden_field_tag("#{temp_field_name}[count]",@attribute_value.add_more_counter ,:class=>"list_count") content << hidden_field_tag("#{temp_field_name}[count]",get_basic_field_name_base,:class=>"field_name") content diff --git a/app/helpers/attribute_values_helper.rb b/app/helpers/attribute_values_helper.rb index eede44fb..2bc31432 100644 --- a/app/helpers/attribute_values_helper.rb +++ b/app/helpers/attribute_values_helper.rb @@ -33,7 +33,7 @@ module AttributeValuesHelper end year_str = "" unless date.year == 1912 - m_year = (date.year - 1912).abs.to_s + I18n.t("admin.infos.date.minguo_calendar.year") + m_year = (date.year - 1912).abs.to_s + I18n.t("date.minguo_calendar.year") year_str = minguo_format_year(m_year) end get_minguo_year + minguo_m_y_d_time @@ -42,15 +42,15 @@ module AttributeValuesHelper def get_minguo_year date = get_date m_year = (date.year - 1911).abs - year_end = I18n.t("admin.infos.date.minguo_calendar.year") + year_end = I18n.t("date.minguo_calendar.year") case when date.year <1912 - I18n.t("admin.infos.date.minguo_calendar.before") + (m_year+1).to_s + year_end + I18n.t("date.minguo_calendar.before") + (m_year+1).to_s + year_end when date.year ==1912 - I18n.t("admin.infos.date.minguo_calendar.first_year") + I18n.t("date.minguo_calendar.first_year") when date.year >1912 - I18n.t("admin.infos.date.minguo_calendar.after")+ (m_year).to_s + year_end - end # of case tw_claendar year + I18n.t("date.minguo_calendar.after")+ (m_year).to_s + year_end + end # of case tw_calendar year end def minguo_m_y_d_time @@ -61,7 +61,7 @@ module AttributeValuesHelper when 'format2' # Y/M/D date.strftime(" %m/%d") when 'format3' # Y/M - date.strftime(" %m#{I18n.t("admin.infos.date.minguo_calendar.month")}") + date.strftime(" %m#{I18n.t("date.minguo_calendar.month")}") when 'format4' # Y '' end # of case @@ -71,11 +71,11 @@ module AttributeValuesHelper case I18n.locale when :zh_tw case - when self.attribute_field["typeC"]["claendar"] == "west_claendar" + when self.attribute_field["typeC"]["calendar"] == "west_calendar" show_west_calender(from_to) - when self.attribute_field["typeC"]["claendar"] == "tw_claendar" + when self.attribute_field["typeC"]["calendar"] == "tw_calendar" show_minguo_calendar(from_to) - end #case self.attribute_field["typeC"]["claendar"] + end #case self.attribute_field["typeC"]["calendar"] when :en show_west_calender(from_to) end diff --git a/app/models/.user.rb.swp b/app/models/.user.rb.swp deleted file mode 100644 index 7149c0ea..00000000 Binary files a/app/models/.user.rb.swp and /dev/null differ diff --git a/app/models/user/attribute_field.rb b/app/models/user/attribute_field.rb index 76ee9394..c0aabb9c 100644 --- a/app/models/user/attribute_field.rb +++ b/app/models/user/attribute_field.rb @@ -12,7 +12,7 @@ class AttributeField field :to_delete,:type=> Boolean,:default => false field :typeA,:type=> Hash,:default=>{:cross_lang=>false} field :typeB,:type=> Hash,:default=>{} - field :typeC,:type=> Hash,:default=>{:claendar=>"west_claendar",:format=>"format3"} + field :typeC,:type=> Hash,:default=>{:calendar=>"west_calendar",:format=>"format3"} field :typeD,:type=> Hash,:default=>{:cross_lang=>false} field :typeE,:type=> Hash,:default=>{} field :title, localize: true diff --git a/app/views/.swp b/app/views/.swp deleted file mode 100644 index a9dcf2b1..00000000 Binary files a/app/views/.swp and /dev/null differ diff --git a/app/views/admin/ad_banners/_ad_banner_tab.html.erb b/app/views/admin/ad_banners/_ad_banner_tab.html.erb index 56160931..ac5c1ae0 100644 --- a/app/views/admin/ad_banners/_ad_banner_tab.html.erb +++ b/app/views/admin/ad_banners/_ad_banner_tab.html.erb @@ -22,7 +22,7 @@ <%if (at_least_module_manager || ad_banner_tab.cur_user_is_sub_manager_of(:edit) )%> <%= content_tag :div ,:class=>'adbanner-action' do%> <%= link_to t("ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%> - <%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.id) , :class=>'preview_trigger btn btn-success'%> + <%= link_to t(:preview), admin_realtime_preview_ad_banner_path(ad_banner_tab.id) , :class=>'preview_trigger btn btn-success'%> <% end -%> <% end -%> <% if at_least_module_manager %> <%= show_ad_banner_permission_link ad_banner_tab%> - <%= link_to t(:delete),admin_ad_banner_path(ad_banner_tab),:class => 'btn',:method => :delete,:confirm => t('sure?') %> + <%= link_to t(:delete_),admin_ad_banner_path(ad_banner_tab),:class => 'btn',:method => :delete,:confirm => t('sure?') %> <% end -%> <%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %> diff --git a/app/views/admin/ad_banners/_ad_image_update.html.erb b/app/views/admin/ad_banners/_ad_image_update.html.erb index 15bb75d0..281d0753 100644 --- a/app/views/admin/ad_banners/_ad_image_update.html.erb +++ b/app/views/admin/ad_banners/_ad_image_update.html.erb @@ -7,7 +7,7 @@ <%if at_least_module_manager || sub_manager?(ad_image.ad_banner) %>

<%= link_to t('edit'),edit_admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn btn-primary' %> - <%= link_to t('delete'),admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn',:method => :delete,:confirm => t('sure?') %> + <%= link_to t(:delete_),admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn',:method => :delete,:confirm => t('sure?') %>

<% end -%> \ No newline at end of file diff --git a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb index dc77bc5f..dc35a704 100644 --- a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb +++ b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb @@ -25,7 +25,7 @@
<%= f.label :best_size, t('ad.best_size'),:class => "control-label" %>
- <%= f.text_field :best_size %> Ex: 500px x 300px + <%= f.text_field :best_size %> <%= t('ad.best_size_example') %>
diff --git a/app/views/admin/ad_banners/_modal_preview.html.erb b/app/views/admin/ad_banners/_modal_preview.html.erb index 3dc98521..adf84adb 100644 --- a/app/views/admin/ad_banners/_modal_preview.html.erb +++ b/app/views/admin/ad_banners/_modal_preview.html.erb @@ -3,7 +3,7 @@ diff --git a/vendor/built_in_modules/personal_research/init.rb b/vendor/built_in_modules/personal_research/init.rb index 18bc59f6..ca9cd058 100644 --- a/vendor/built_in_modules/personal_research/init.rb +++ b/vendor/built_in_modules/personal_research/init.rb @@ -16,7 +16,7 @@ end # :active_for_controllers=> ['news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals'], # :active_for_ob_auths_object => ['NewsBulletinCategory'], # :head_link => panel_news_back_end_news_bulletins_path , -# :head_label=> I18n.t('admin.news') +# :head_label=> I18n.t(:news) # context_link :link=>new_panel_news_back_end_news_bulletin_path , # :priority=>1,:label=>I18n.t('announcement.add_new'), diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_writing_seminar.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_writing_seminar.html.erb index 0814f76d..b9571826 100644 --- a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_writing_seminar.html.erb +++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_writing_seminar.html.erb @@ -11,7 +11,7 @@ diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/writing_seminars/_writing_seminar.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/writing_seminars/_writing_seminar.html.erb index be2d983d..8d001c47 100644 --- a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/writing_seminars/_writing_seminar.html.erb +++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/writing_seminars/_writing_seminar.html.erb @@ -11,7 +11,7 @@ diff --git a/vendor/built_in_modules/personal_seminar/init.rb b/vendor/built_in_modules/personal_seminar/init.rb index 1bd9e9d0..6cb9829f 100644 --- a/vendor/built_in_modules/personal_seminar/init.rb +++ b/vendor/built_in_modules/personal_seminar/init.rb @@ -16,7 +16,7 @@ end # :active_for_controllers=> ['news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals'], # :active_for_ob_auths_object => ['NewsBulletinCategory'], # :head_link => panel_news_back_end_news_bulletins_path , -# :head_label=> I18n.t('admin.news') +# :head_label=> I18n.t(:news) # context_link :link=>new_panel_news_back_end_news_bulletin_path , # :priority=>1,:label=>I18n.t('announcement.add_new'), diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb index 2e4ef99d..7032d761 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb @@ -26,7 +26,7 @@