Changes for i18n yml
This commit is contained in:
1 parent
a04e1fd10b
commit
bdd5a1a047
170 files changed
+1213
-3715
No files matched your search
@@ -41,7 +41,7 @@ class Admin::AdImagesController < OrbitBackendController
|
||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||
@ad_image = @ad_banner.ad_images.find params[:id]
|
||||
if @ad_image.destroy
|
||||
flash[:notice] = t('admin.success_destroy_ad_image')
|
||||
flash[:notice] = t('ad.success_destroy_ad_image')
|
||||
redirect_to admin_ad_banner_path @ad_banner
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ class Admin::AssetCategoriesController < OrbitBackendController
|
||||
|
||||
respond_to do |format|
|
||||
if @asset_category.save
|
||||
format.html { redirect_to(admin_asset_categories_url, :notice => t('announcement.create_asset_category_success')) }
|
||||
format.html { redirect_to(admin_asset_categories_url, :notice => t('create.success.asset_category')) }
|
||||
format.js
|
||||
else
|
||||
format.html { render :action => "new" }
|
||||
@@ -41,8 +41,8 @@ class Admin::AssetCategoriesController < OrbitBackendController
|
||||
|
||||
respond_to do |format|
|
||||
if @asset_category.update_attributes(params[:asset_category])
|
||||
# format.html { redirect_to(panel_announcement_back_end_asset_category_url(@asset_category), :notice => t('asset_category.update_asset_category_success')) }
|
||||
# format.html { redirect_to(panel_announcement_back_end_asset_categories_url, :notice => t('asset_category.update_asset_category_success')) }
|
||||
# format.html { redirect_to(panel_announcement_back_end_asset_category_url(@asset_category), :notice => t('create.success')) }
|
||||
# format.html { redirect_to(panel_announcement_back_end_asset_categories_url, :notice => t('create.success')) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
else
|
||||
|
||||
@@ -44,7 +44,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||
# render :json=>{"url"=>@asset.data.url,"title"=>"xxx","desc"=>"sss"}.to_json
|
||||
render :layout=>false
|
||||
else
|
||||
flash[:error] = t(:create_fail)
|
||||
flash[:error] = t('create.fail')
|
||||
@asset_categories = AssetCategory.all
|
||||
@tags = AssetTag.all
|
||||
respond_to do |format|
|
||||
@@ -67,7 +67,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||
format.js { render 'js/remove_pop_up_and_reload_content', :locals => {:function => 'replaceWith', :id => "asset_#{@asset.id}", :value => @asset, :values => nil, :partial => 'admin/assets/asset', :locals => nil} }
|
||||
end
|
||||
else
|
||||
flash[:error] = t(:update_fail)
|
||||
flash[:error] = t('update.fail')
|
||||
@asset_categories = AssetCategory.all
|
||||
@tags = AssetTag.all
|
||||
respond_to do |format|
|
||||
|
||||
@@ -4,7 +4,6 @@ class Admin::ItemsController < ApplicationController
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :find_parent_item
|
||||
before_filter :find_snippets, :only => :index
|
||||
before_filter :is_admin?
|
||||
before_filter :set_current_item
|
||||
|
||||
@@ -22,10 +21,4 @@ class Admin::ItemsController < ApplicationController
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def find_snippets
|
||||
@snippets = Snippet.where( { :parent_id => @parent_item.id } ) rescue nil
|
||||
end
|
||||
|
||||
end
|
||||
@@ -23,7 +23,7 @@ class Admin::LinksController < ApplicationController
|
||||
@item = Link.new(params[:link])
|
||||
|
||||
if @item.save
|
||||
flash.now[:notice] = t('admin.create_success_link')
|
||||
flash.now[:notice] = t('create.success.link')
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_link_url(@item)
|
||||
@@ -31,7 +31,7 @@ class Admin::LinksController < ApplicationController
|
||||
format.js {}
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.create_error_link')
|
||||
flash.now[:error] = t('create.error.link')
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
@@ -40,7 +40,7 @@ class Admin::LinksController < ApplicationController
|
||||
@item = Link.find(params[:id])
|
||||
|
||||
if @item.update_attributes(params[:link])
|
||||
flash.now[:notice] = t('admin.update_success_link')
|
||||
flash.now[:notice] = t('update.success.link')
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_link_url(@item)
|
||||
@@ -48,7 +48,7 @@ class Admin::LinksController < ApplicationController
|
||||
format.js {}
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.update_error_link')
|
||||
flash.now[:error] = t('update.error.link')
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,14 +58,14 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
def assign_sub_manager
|
||||
unless @assign_to_user.nil? || @assign_to_user.admin?
|
||||
if @module_app.assign_sub_manager(@assign_to_user,current_user)
|
||||
flash[:notice] = t('admin.app_auth.assigning_manager.add_sub_manager_ok')
|
||||
flash[:notice] = t('app_auth.assigning_manager.add_manager_ok')
|
||||
else
|
||||
flash[:notice] = t('admin.app_auth.assigning_manager.add_sub_manager_fail')
|
||||
flash[:notice] = t('app_auth.assigning_manager.add_manager_fail')
|
||||
end
|
||||
else
|
||||
flash[:notice] = t('admin.app_auth.assigning_manager.failed_no_user')
|
||||
flash[:notice] = t('app_auth.failed_no_user')
|
||||
end
|
||||
flash[:notice] = t('admin.app_auth.can_not_add_this_user')
|
||||
flash[:notice] = t('app_auth.can_not_add_this_user')
|
||||
redirect_to :action => "edit"
|
||||
end
|
||||
|
||||
@@ -73,14 +73,14 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
def assign_manager
|
||||
unless @assign_to_user.nil? || @assign_to_user.admin?
|
||||
if @module_app.assign_manager(@assign_to_user,current_user)
|
||||
flash[:notice] = t('admin.app_auth.assigning_sub_manager.add_manager_ok')
|
||||
flash[:notice] = t('app_auth.assigning_sub_manager.add_sub_manager_ok')
|
||||
else
|
||||
flash[:notice] = t('admin.app_auth.assigning_sub_manager.add_manager_fail')
|
||||
flash[:notice] = t('app_auth.assigning_sub_manager.add_sub_manager_fail')
|
||||
end
|
||||
else
|
||||
flash[:notice] = t('admin.app_auth.assigning_sub_manager.failed_no_user')
|
||||
flash[:notice] = t('app_auth.failed_no_user')
|
||||
end
|
||||
flash[:notice] = t('admin.app_auth.can_not_add_this_user')
|
||||
flash[:notice] = t('app_auth.can_not_add_this_user')
|
||||
redirect_to :action => "edit"
|
||||
end
|
||||
|
||||
@@ -88,9 +88,9 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
def remove_manager
|
||||
@app_manager = AppManager.find(params[:app_manager_id])
|
||||
if @module_app.remove_manager(@app_manager.user)
|
||||
flash[:notice] = t('admin.app_auth.delete_manager.success')
|
||||
flash[:notice] = t('app_auth.delete_manager.success')
|
||||
else
|
||||
flash[:notice] = t('admin.app_auth.delete_manager.fail')
|
||||
flash[:notice] = t('app_auth.delete_manager.fail')
|
||||
end
|
||||
redirect_to :action => "edit"
|
||||
end
|
||||
@@ -99,9 +99,9 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
def remove_sub_manager
|
||||
@app_sub_manager = AppManager.find(params[:app_sub_manager_id])
|
||||
if @module_app.remove_sub_manager(@app_sub_manager.user)
|
||||
flash[:notice] = t('admin.app_auth.delete_sub_manager.success')
|
||||
flash[:notice] = t('app_auth.delete_sub_manager.success')
|
||||
else
|
||||
flash[:notice] = t('admin.app_auth.delete_sub_manager.fail')
|
||||
flash[:notice] = t('app_auth.delete_sub_manager.fail')
|
||||
end
|
||||
redirect_to :action => "edit"
|
||||
end
|
||||
@@ -115,7 +115,7 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
return
|
||||
end
|
||||
#user is not permited to do that
|
||||
flash[:notice] = t('admin.app_auth.operation_not_permitted')
|
||||
flash[:notice] = t('app_auth.operation_not_permitted')
|
||||
render :nothing => true, :status => 403
|
||||
end
|
||||
|
||||
@@ -127,7 +127,7 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
return
|
||||
end
|
||||
#user is not permited to do that
|
||||
flash[:notice] = t('admin.app_auth.operation_not_permitted')
|
||||
flash[:notice] = t('app_auth.operation_not_permitted')
|
||||
render :nothing => true, :status => 403
|
||||
end
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ class Admin::ModuleAppsNewInterfaceController < OrbitBackendController
|
||||
def update_setting
|
||||
module_app = update_setting_by_params
|
||||
if module_app.save!
|
||||
flash[:notice] = t("admin.object_auth.update_done")
|
||||
flash[:notice] = t('update.success_')
|
||||
else
|
||||
flash[:notice] = t("admin.object_auth.update_failed")
|
||||
flash[:notice] = t('update.fail')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class Admin::ObjectAuthsController < ApplicationController
|
||||
if @object_auth.save
|
||||
redirect_to edit_admin_object_auth_path(@object_auth)
|
||||
else
|
||||
flash[:error] = t('admin.object.a_object_must_have_only_one_object_auth_profile_for_each_action')
|
||||
flash[:error] = t('object.a_object_must_have_only_one_object_auth_profile_for_each_action')
|
||||
redirect_to (:back)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,9 +18,9 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
def update_setting
|
||||
ob_auth = update_setting_by_params
|
||||
if ob_auth.save!
|
||||
flash[:notice] = t("admin.object_auth.update_done")
|
||||
flash[:notice] = t('update.success_')
|
||||
else
|
||||
flash[:notice] = t("admin.object_auth.update_failed")
|
||||
flash[:notice] = t('update.fail')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class Admin::PagePartsController < ApplicationController
|
||||
@part = PagePart.find(params[:id])
|
||||
if @part.update_attributes(params[:page_part])
|
||||
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
|
||||
flash.now[:notice] = t('admin.update_success_content')
|
||||
flash.now[:notice] = t('update.success.content')
|
||||
|
||||
if @part.page.name == 'home'
|
||||
expire_page '/'
|
||||
|
||||
@@ -56,7 +56,7 @@ class Admin::PagesController < ApplicationController
|
||||
end
|
||||
|
||||
if @item.save
|
||||
flash.now[:notice] = t('admin.create_success_page')
|
||||
flash.now[:notice] = t('create.success.page')
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_page_url(@item)
|
||||
@@ -64,7 +64,7 @@ class Admin::PagesController < ApplicationController
|
||||
format.js {}
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.create_error_page')
|
||||
flash.now[:error] = t('create.error.page')
|
||||
@apps = ModuleApp.all
|
||||
@designs = Design.all.entries
|
||||
@design = Design.first
|
||||
@@ -80,7 +80,7 @@ class Admin::PagesController < ApplicationController
|
||||
end
|
||||
|
||||
if @item.update_attributes(params[:page])
|
||||
flash[:notice] = t('admin.update_success_page')
|
||||
flash[:notice] = t('update.success.page')
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_page_url(@item)
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
class Admin::TranslationsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
def index
|
||||
set_variables
|
||||
end
|
||||
|
||||
def edit
|
||||
set_variables
|
||||
end
|
||||
|
||||
# Update either the i18n_variables or the languages
|
||||
def update
|
||||
begin
|
||||
case params[:id]
|
||||
# Update the i18n_variables
|
||||
when 'all'
|
||||
params[:i18n_variables].each do |id, var|
|
||||
i18n_variable = I18nVariable.find(id)
|
||||
i18n_variable.update_attributes(var)
|
||||
end
|
||||
# Add a language
|
||||
when 'add'
|
||||
site = Site.find(session[:site])
|
||||
if !site.valid_locales.include?(params[:language])
|
||||
site.valid_locales << params[:language]
|
||||
site.save
|
||||
I18nVariable.create({:key => params[:language], :document_class => 'language'})
|
||||
end
|
||||
# Enable a language
|
||||
when 'enable'
|
||||
site = Site.find(session[:site])
|
||||
if !site.in_use_locales.include?(params[:enable_language])
|
||||
site.in_use_locales << params[:enable_language]
|
||||
site.save
|
||||
end
|
||||
# Disable a language
|
||||
when 'disable'
|
||||
site = Site.find(session[:site])
|
||||
if site.in_use_locales.include?(params[:disable_language])
|
||||
site.in_use_locales.delete(params[:disable_language])
|
||||
site.save
|
||||
end
|
||||
# Delete a language and the corresponding i18n_variables
|
||||
when 'delete'
|
||||
site = Site.find(session[:site])
|
||||
site.in_use_locales.delete(params[:delete_language])
|
||||
site.valid_locales.delete(params[:delete_language])
|
||||
site.save
|
||||
I18nVariable.destroy_all(:conditions => {:document_class => 'language', :key => params[:delete_language]})
|
||||
end
|
||||
redirect_to admin_translations_url
|
||||
rescue
|
||||
set_variables
|
||||
render :action => :edit
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# Get the i18n_variables and languages
|
||||
def set_variables
|
||||
@i18n_variables = I18nVariable.all.entries
|
||||
@language_i18n_variables = @i18n_variables.inject([]) do |result, var|
|
||||
result << var if var.document_class.eql?('language')
|
||||
result
|
||||
end
|
||||
@role_i18n_variables = @i18n_variables.inject([]) do |result, var|
|
||||
result << var if var.document_class.eql?('Role')
|
||||
result
|
||||
end
|
||||
@info_i18n_variables = @i18n_variables.inject([]) do |result, var|
|
||||
result << var if var.document_class.eql?('UserInfoModel')
|
||||
result
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -22,7 +22,7 @@ class Admin::UsersController < ApplicationController
|
||||
puts params.to_yaml
|
||||
@user = User.new(params[:user])
|
||||
if @user.save
|
||||
flash[:notice] = t('admin.create_success_user')
|
||||
flash[:notice] = t('create.success.user')
|
||||
redirect_to :action => :index
|
||||
else
|
||||
render :action => :new
|
||||
@@ -42,10 +42,10 @@ class Admin::UsersController < ApplicationController
|
||||
@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('admin.cant_revoke_self_admin')
|
||||
flash.now[:error] = t(:cant_revoke_self_admin)
|
||||
end
|
||||
if !flash[:error] && @user.update_attributes(params[:user])
|
||||
flash[:notice] = t('admin.update_success_user')
|
||||
flash[:notice] = t('update.success.user')
|
||||
redirect_to :action => :index
|
||||
else
|
||||
get_info_and_roles
|
||||
@@ -55,7 +55,7 @@ class Admin::UsersController < ApplicationController
|
||||
|
||||
def destroy
|
||||
if params[:id].eql?(session['warden.user.user.key'][1].to_s)
|
||||
flash[:error] = t('admin.cant_delete_self')
|
||||
flash[:error] = t(:cant_delete_self)
|
||||
else
|
||||
@user = User.find(params[:id])
|
||||
@user.destroy
|
||||
|
||||
@@ -61,7 +61,7 @@ class ApplicationController < ActionController::Base
|
||||
if is_admin?
|
||||
true
|
||||
else
|
||||
flash[:error] = t("admin.access.denied.not_admin")
|
||||
flash[:error] = t("access.denied.not_admin")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
@@ -70,7 +70,7 @@ class ApplicationController < ActionController::Base
|
||||
if is_manager?
|
||||
true
|
||||
else
|
||||
flash[:error] = t("admin.access.denied.app.not_manager")
|
||||
flash[:error] = t("access.denied.app.not_manager")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
@@ -79,7 +79,7 @@ class ApplicationController < ActionController::Base
|
||||
if (@module_app.sub_managing_users.include?(current_user) || is_manager?)
|
||||
true
|
||||
else
|
||||
flash[:error] = t("admin.access.denied.app.not_sub_manager")
|
||||
flash[:error] = t("access.denied.app.not_sub_manager")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
@@ -88,13 +88,13 @@ class ApplicationController < ActionController::Base
|
||||
if (@module_app.app_auth.auth_users.include?(current_user) || for_app_sub_manager )
|
||||
true
|
||||
else
|
||||
flash[:error] = t("admin.access.denied.app.not_authed_user")
|
||||
flash[:error] = t("access.denied.app.not_authed_user")
|
||||
auth_failed_in_backend
|
||||
end
|
||||
end
|
||||
|
||||
def check_object_premission(obj,title)
|
||||
flash[:error] = t("admin.access.denied.object")
|
||||
flash[:error] = t("access.denied.object")
|
||||
auth_failed_in_backend unless (obj.get_object_auth_by_title(title).auth_users.include?(current_user) || is_manager? || is_admin? )
|
||||
end
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class SessionsController < Devise::SessionsController
|
||||
result = false
|
||||
ldap_filter = "(uid=#{login_uid})"
|
||||
if /@rulingcom.com$/.match(login_uid).nil?
|
||||
MiddleSiteConnection.establish
|
||||
# MiddleSiteConnection.establish
|
||||
NccuLdapConnection.establish
|
||||
|
||||
if ($nccu_ldap_connection.bind rescue false)
|
||||
|
||||
Reference in new issue
Block a user