Commit 3a96c8d1 by Mykhailo Makohin

finish to translate activeadmin

parent 939584b5
......@@ -9,6 +9,8 @@ ActiveAdmin.register_page "Dashboard" do
end
end
# menu priority: 2, label: proc { I18n.t("active_admin.models.user.other") }
# Here is an example of a simple dashboard with columns and panels.
#
# columns do
......
ActiveAdmin.register User do
menu label: proc{ I18n.t "active_admin.models.user.other" }
filter :email
filter :name
filter :location
filter :created_at
filter :updated_at
filter :role
filter :email, label: I18n.t("active_admin.attributes.user.email")
filter :name, label: I18n.t("active_admin.attributes.user.name")
filter :location, label: I18n.t("active_admin.attributes.user.location")
filter :created_at, label: I18n.t("active_admin.attributes.user.created_at")
filter :updated_at, label: I18n.t("active_admin.attributes.user.updated_at")
filter :role, label: I18n.t("active_admin.attributes.user.role")
permit_params :email, :role, :name, :location, :avatar
permit_params :email, :role, :name, :location, :avatar, :password, :password_confirmation, :role
index do
index title: proc{ I18n.t "active_admin.models.user.other" } do
selectable_column
id_column
column :email
column :name
column :location
column :created_at
column :updated_at
column :role
column I18n.t "active_admin.attributes.user.avatar" do |u|
if u.avatar?
image_tag u.avatar_url, height: '50'
end
end
column I18n.t "active_admin.attributes.user.name" do |u|
u.name
end
column I18n.t "active_admin.attributes.user.email" do |u|
u.email
end
column I18n.t "active_admin.attributes.user.location" do |u|
u.location
end
column I18n.t "active_admin.attributes.user.created_at" do |u|
u.created_at
end
column I18n.t "active_admin.attributes.user.updated_at" do |u|
u.updated_at
end
column I18n.t "active_admin.attributes.user.role" do |u|
(t "active_admin.attributes.user/role.#{u.role}")
end
actions
end
show title: :name do
panel "User Details" do
attributes_table_for user, :email, :name, :location, :created_at,
:updated_at, :role
show do
attributes_table do
row :id
row I18n.t "active_admin.attributes.user.name" do |u|
u.name
end
row I18n.t "active_admin.attributes.user.email" do |u|
u.email
end
row I18n.t "active_admin.attributes.user.location" do |u|
u.location
end
row I18n.t "active_admin.attributes.user.role" do |u|
(t "active_admin.attributes.user/role.#{u.role}")
end
row I18n.t "active_admin.attributes.user.created_at" do |u|
u.created_at
end
row I18n.t "active_admin.attributes.user.updated_at" do |u|
u.updated_at
end
end
end
form do |f|
f.inputs do
f.input :email
f.input :name
f.input :location
f.input :password
f.input :password_confirmation
f.input :role
f.input :avatar
f.input :email, label: "#{t "active_admin.attributes.user.email"}"
f.input :name, label: "#{t "active_admin.attributes.user.name"}"
f.input :location, label: "#{t "active_admin.attributes.user.location"}"
f.input :password, label: "#{t "active_admin.attributes.user.password"}"
f.input :password_confirmation, label: "#{t "active_admin.attributes.user.password_confirmation"}"
f.input :role, as: :select, collection: User.roles.map { |role| [I18n.t("active_admin.user/role.#{role[0]}"), role[0]] },
label: (t "active_admin.attributes.user.role")
f.input :avatar, label: "#{t "active_admin.attributes.user.avatar"}"
end
f.actions
end
......
......@@ -30,6 +30,7 @@ class UsersController < ApplicationController
def update
@user = resource
if @user.update(user_params)
sign_in @user
redirect_to user_path(user: @user)
else
render :edit
......@@ -53,7 +54,7 @@ class UsersController < ApplicationController
end
def user_params
params.require(:user).permit(:email, :name, :location, :picture, :avatar)
params.require(:user).permit(:email, :name, :location, :picture, :avatar, :role)
end
end
\ No newline at end of file
en:
activerecord:
user: "User"
admin: "Admin"
formtastic:
actions:
create: "Create my %{model}"
update: "Save changes"
reset: "Reset form"
cancel: "Cancel and go back"
dummie: "Launch!"
active_admin:
user/role:
admin: "Admin"
user: "User"
models:
comment:
one: "Comment"
other: "Comments"
active_admin/comment:
one: "Comment"
other: "Comments"
user:
one: "User"
other: "Users"
attributes:
active_admin/comment:
author_type: "Author type"
body: "Body"
user:
email: "Email"
name: "Name"
location: "Location"
created_at: "Created"
namespace: "Namespace"
resource_type: "Resource type"
updated_at: "Updated"
active_admin:
dashboard: "Dashboard"
role: "Role"
password: "Password"
password_confirmation: "Password confirmation"
avatar: "Avatar"
dashboard: Dashboard
dashboard_welcome:
welcome: "Welcome to Active Admin. This is the default dashboard page."
call_to_action: "To add dashboard sections, checkout 'app/admin/dashboard.rb'"
call_to_action: "To add dashboard sections, checkout 'app/admin/dashboards.rb'"
view: "View"
edit: "Edit"
delete: "Delete"
......@@ -37,7 +48,6 @@ en:
has_many_new: "Add New %{model}"
has_many_delete: "Delete"
has_many_remove: "Remove"
move: "Move"
filters:
buttons:
filter: "Filter"
......@@ -49,12 +59,6 @@ en:
ends_with: "Ends with"
greater_than: "Greater than"
less_than: "Less than"
gteq_datetime: "Greater or equal to"
lteq_datetime: "Lesser or equal to"
from: "From"
to: "To"
scopes:
all: "All"
search_status:
headline: "Search status:"
current_scope: "Scope:"
......@@ -151,10 +155,10 @@ en:
resend_confirmation_instructions: "Resend confirmation instructions"
unsupported_browser:
headline: "Please note that ActiveAdmin no longer supports Internet Explorer versions 8 or less."
recommendation: "We recommend that you <a href=\"http://browsehappy.com/\">upgrade your browser</a> to improve your experience."
turn_off_compatibility_view: "If you are using IE 9 or later, make sure you <a href=\"https://support.microsoft.com/en-us/help/17471\">turn off \"Compatibility View\"</a>."
recommendation: "We recommend upgrading to the latest <a href=\"http://windows.microsoft.com/ie\">Internet Explorer</a>, <a href=\"https://chrome.google.com/\">Google Chrome</a>, or <a href=\"https://mozilla.org/firefox/\">Firefox</a>."
turn_off_compatibility_view: "If you are using IE 9 or later, make sure you <a href=\"https://support.microsoft.com/en-gb/help/17471\">turn off \"Compatibility View\"</a>."
access_denied:
message: "You are not authorized to perform this action."
message: "You are not authorised to perform this action."
index_list:
table: "Table"
block: "List"
......
uk:
user: "Користувач"
admin: "Адмін"
formtastic:
actions:
create: "Створити"
update: "Зберегти зміни"
reset: "Очистити форму"
cancel: "Назад"
dummie: "Launch!"
time:
formats:
long: "%Y-%m-%d %H:%M:%S"
active_admin:
models:
user:
one: "Користувач"
other: "Користувачі"
user/role:
admin: "Адмін"
user: "Користувач"
attributes:
user:
email: "Email"
name: "Ім'я"
location: "Місце проживання"
created_at: "Створений"
updated_at: "Оновлений"
role: "Роль"
password: "Пароль"
password_confirmation: "Підтвердження паролю"
avatar: "Аватар"
dashboard: "Панель керування"
dashboard_welcome:
welcome: "Ласкаво просимо до Active Admin. Це стандартна сторінка керування сайтом."
......@@ -8,9 +38,9 @@ uk:
edit: "Змінити"
delete: "Видалити"
delete_confirmation: "Ви впевнені, що хочете це видалити?"
new_model: "Створити %{model}"
edit_model: "Змінити %{model}"
delete_model: "Видалити %{model}"
new_model: "Створити"
edit_model: "Змінити"
delete_model: "Видалити"
details: "%{model} детальніше"
cancel: "Скасувати"
empty: "Пусто"
......
uk:
# header:
# platfform: 'про платформу'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment