Keyrelay list on domain, translations refactor

This commit is contained in:
Martin Lensment 2014-12-19 18:28:24 +02:00
parent c15b4d48b9
commit ee060fca1a
56 changed files with 439 additions and 356 deletions

View file

@ -19,11 +19,11 @@ class Admin::DomainsController < AdminController
add_prefix_to_statuses
if @domain.update(domain_params)
flash[:notice] = I18n.t('shared.domain_updated')
flash[:notice] = I18n.t('domain_updated')
redirect_to [:admin, @domain]
else
@domain.domain_statuses.build if @domain.domain_statuses.empty?
flash.now[:alert] = I18n.t('shared.failed_to_update_domain')
flash.now[:alert] = I18n.t('failed_to_update_domain')
render 'edit'
end
end

View file

@ -15,10 +15,10 @@ class Admin::EppUsersController < AdminController
@epp_user = EppUser.new(epp_user_params)
if @epp_user.save
flash[:notice] = I18n.t('shared.record_created')
flash[:notice] = I18n.t('record_created')
redirect_to [:admin, @epp_user]
else
flash.now[:alert] = I18n.t('shared.failed_to_create_record')
flash.now[:alert] = I18n.t('failed_to_create_record')
render 'new'
end
end
@ -29,20 +29,20 @@ class Admin::EppUsersController < AdminController
def update
if @epp_user.update(epp_user_params)
flash[:notice] = I18n.t('shared.record_updated')
flash[:notice] = I18n.t('record_updated')
redirect_to [:admin, @epp_user]
else
flash.now[:alert] = I18n.t('shared.failed_to_update_record')
flash.now[:alert] = I18n.t('failed_to_update_record')
render 'edit'
end
end
def destroy
if @epp_user.destroy
flash[:notice] = I18n.t('shared.record_deleted')
flash[:notice] = I18n.t('record_deleted')
redirect_to admin_epp_users_path
else
flash.now[:alert] = I18n.t('shared.failed_to_delete_record')
flash.now[:alert] = I18n.t('failed_to_delete_record')
render 'show'
end
end

View file

@ -0,0 +1,7 @@
class Admin::KeyrelaysController < AdminController
load_and_authorize_resource
def show
end
end

View file

@ -18,10 +18,10 @@ class Admin::RegistrarsController < AdminController
@registrar = Registrar.new(registrar_params)
if @registrar.save
flash[:notice] = I18n.t('shared.registrar_added')
flash[:notice] = I18n.t('registrar_added')
redirect_to [:admin, @registrar]
else
flash.now[:alert] = I18n.t('shared.failed_to_add_registrar')
flash.now[:alert] = I18n.t('failed_to_add_registrar')
render 'new'
end
end
@ -30,20 +30,20 @@ class Admin::RegistrarsController < AdminController
def update
if @registrar.update(registrar_params)
flash[:notice] = I18n.t('shared.registrar_updated')
flash[:notice] = I18n.t('registrar_updated')
redirect_to [:admin, @registrar]
else
flash.now[:alert] = I18n.t('shared.failed_to_update_registrar')
flash.now[:alert] = I18n.t('failed_to_update_registrar')
render 'edit'
end
end
def destroy
if @registrar.destroy
flash[:notice] = I18n.t('shared.registrar_deleted')
flash[:notice] = I18n.t('registrar_deleted')
redirect_to admin_registrars_path
else
flash.now[:alert] = I18n.t('shared.failed_to_delete_registrar')
flash.now[:alert] = I18n.t('failed_to_delete_registrar')
render 'show'
end
end

View file

@ -11,7 +11,7 @@ class Admin::SettingsController < AdminController
Setting[k] = v
end
flash[:notice] = I18n.t('shared.records_updated')
flash[:notice] = I18n.t('records_updated')
redirect_to [:admin, :settings]
end
@ -19,10 +19,10 @@ class Admin::SettingsController < AdminController
def update
if @setting_group.update(setting_group_params)
flash[:notice] = I18n.t('shared.setting_updated')
flash[:notice] = I18n.t('setting_updated')
redirect_to [:admin, @setting_group]
else
flash[:alert] = I18n.t('shared.failed_to_update_setting')
flash[:alert] = I18n.t('failed_to_update_setting')
render 'show'
end
end

View file

@ -15,10 +15,10 @@ class Admin::UsersController < AdminController
@user = User.new(user_params)
if @user.save
flash[:notice] = I18n.t('shared.record_created')
flash[:notice] = I18n.t('record_created')
redirect_to [:admin, @user]
else
flash.now[:alert] = I18n.t('shared.failed_to_create_record')
flash.now[:alert] = I18n.t('failed_to_create_record')
render 'new'
end
end
@ -29,20 +29,20 @@ class Admin::UsersController < AdminController
def update
if @user.update(user_params)
flash[:notice] = I18n.t('shared.record_updated')
flash[:notice] = I18n.t('record_updated')
redirect_to [:admin, @user]
else
flash.now[:alert] = I18n.t('shared.failed_to_update_record')
flash.now[:alert] = I18n.t('failed_to_update_record')
render 'edit'
end
end
def destroy
if @user.destroy
flash[:notice] = I18n.t('shared.record_deleted')
flash[:notice] = I18n.t('record_deleted')
redirect_to admin_users_path
else
flash.now[:alert] = I18n.t('shared.failed_to_delete_record')
flash.now[:alert] = I18n.t('failed_to_delete_record')
render 'show'
end
end

View file

@ -11,10 +11,10 @@ class Admin::ZonefileSettingsController < ApplicationController
def update
if @zonefile_setting.update(zonefile_setting_params)
flash[:notice] = I18n.t('shared.record_updated')
flash[:notice] = I18n.t('record_updated')
redirect_to admin_zonefile_settings_path
else
flash.now[:alert] = I18n.t('shared.failed_to_update_record')
flash.now[:alert] = I18n.t('failed_to_update_record')
render 'edit'
end
end