mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Change locales structure (#144)
This commit is contained in:
committed by
GitHub
parent
881708c77c
commit
a6c630949a
@@ -51,7 +51,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
def user_not_authorized
|
||||
render json: {
|
||||
error: t('backend.errors.unauthorized')
|
||||
error: t('errors.unauthorized')
|
||||
}, status: :unauthorized
|
||||
end
|
||||
end
|
||||
|
||||
@@ -70,7 +70,7 @@ class BoardsController < ApplicationController
|
||||
render json: workflow_output
|
||||
else
|
||||
render json: {
|
||||
error: t("backend.errors.board.update_order")
|
||||
error: t("errors.board.update_order")
|
||||
}, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
@@ -66,7 +66,7 @@ class PostStatusesController < ApplicationController
|
||||
render json: workflow_output
|
||||
else
|
||||
render json: {
|
||||
error: t("backend.errors.post_status.update_order")
|
||||
error: t("errors.post_status.update_order")
|
||||
}, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module ApplicationHelper
|
||||
def check_user_signed_in
|
||||
unless user_signed_in?
|
||||
flash[:alert] = t('backend.errors.not_logged_in')
|
||||
flash[:alert] = t('errors.not_logged_in')
|
||||
redirect_to new_user_session_path
|
||||
|
||||
return false
|
||||
@@ -12,7 +12,7 @@ module ApplicationHelper
|
||||
return if check_user_signed_in == false
|
||||
|
||||
unless current_user.admin?
|
||||
flash[:alert] = t('backend.errors.not_enough_privileges')
|
||||
flash[:alert] = t('errors.not_enough_privileges')
|
||||
redirect_to root_path
|
||||
return
|
||||
end
|
||||
@@ -22,7 +22,7 @@ module ApplicationHelper
|
||||
return if check_user_signed_in == false
|
||||
|
||||
unless current_user.admin? or current_user.moderator?
|
||||
flash[:alert] = t('backend.errors.not_enough_privileges')
|
||||
flash[:alert] = t('errors.not_enough_privileges')
|
||||
redirect_to root_path
|
||||
return
|
||||
end
|
||||
|
||||
@@ -37,7 +37,7 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def inactive_message
|
||||
active? ? super : :blocked_or_deleted
|
||||
active? ? super : I18n.t('errors.user_blocked_or_deleted')
|
||||
end
|
||||
|
||||
# Override Devise::Confirmable#after_confirmation
|
||||
|
||||
Reference in New Issue
Block a user