Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warm_city
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mykhailo Makohin
warm_city
Commits
3a96c8d1
Commit
3a96c8d1
authored
Sep 18, 2019
by
Mykhailo Makohin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish to translate activeadmin
parent
939584b5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
132 additions
and
63 deletions
+132
-63
dashboard.rb
app/admin/dashboard.rb
+2
-0
users.rb
app/admin/users.rb
+64
-29
users_controller.rb
app/controllers/users_controller.rb
+3
-1
active_admin.en.yml
config/locales/active_admin/active_admin.en.yml
+29
-25
active_admin.uk.yml
config/locales/active_admin/active_admin.uk.yml
+34
-5
uk.yml
config/locales/uk.yml
+0
-3
No files found.
app/admin/dashboard.rb
View file @
3a96c8d1
...
@@ -9,6 +9,8 @@ ActiveAdmin.register_page "Dashboard" do
...
@@ -9,6 +9,8 @@ ActiveAdmin.register_page "Dashboard" do
end
end
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.
# Here is an example of a simple dashboard with columns and panels.
#
#
# columns do
# columns do
...
...
app/admin/users.rb
View file @
3a96c8d1
ActiveAdmin
.
register
User
do
ActiveAdmin
.
register
User
do
menu
label:
proc
{
I18n
.
t
"active_admin.models.user.other"
}
filter
:email
filter
:email
,
label:
I18n
.
t
(
"active_admin.attributes.user.email"
)
filter
:name
filter
:name
,
label:
I18n
.
t
(
"active_admin.attributes.user.name"
)
filter
:location
filter
:location
,
label:
I18n
.
t
(
"active_admin.attributes.user.location"
)
filter
:created_at
filter
:created_at
,
label:
I18n
.
t
(
"active_admin.attributes.user.created_at"
)
filter
:updated_at
filter
:updated_at
,
label:
I18n
.
t
(
"active_admin.attributes.user.updated_at"
)
filter
:role
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
selectable_column
id_column
id_column
column
:email
column
I18n
.
t
"active_admin.attributes.user.avatar"
do
|
u
|
column
:name
if
u
.
avatar?
column
:location
image_tag
u
.
avatar_url
,
height:
'50'
column
:created_at
end
column
:updated_at
end
column
:role
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
actions
end
end
show
title: :name
do
show
do
panel
"User Details"
do
attributes_table
do
attributes_table_for
user
,
:email
,
:name
,
:location
,
:created_at
,
row
:id
:updated_at
,
:role
row
I18n
.
t
"active_admin.attributes.user.name"
do
|
u
|
end
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
end
form
do
|
f
|
form
do
|
f
|
f
.
inputs
do
f
.
inputs
do
f
.
input
:email
f
.
input
:email
,
label:
"
#{
t
"active_admin.attributes.user.email"
}
"
f
.
input
:name
f
.
input
:name
,
label:
"
#{
t
"active_admin.attributes.user.name"
}
"
f
.
input
:location
f
.
input
:location
,
label:
"
#{
t
"active_admin.attributes.user.location"
}
"
f
.
input
:password
f
.
input
:password
,
label:
"
#{
t
"active_admin.attributes.user.password"
}
"
f
.
input
:password_confirmation
f
.
input
:password_confirmation
,
label:
"
#{
t
"active_admin.attributes.user.password_confirmation"
}
"
f
.
input
:role
f
.
input
:role
,
as: :select
,
collection:
User
.
roles
.
map
{
|
role
|
[
I18n
.
t
(
"active_admin.user/role.
#{
role
[
0
]
}
"
),
role
[
0
]]
},
f
.
input
:avatar
label:
(
t
"active_admin.attributes.user.role"
)
f
.
input
:avatar
,
label:
"
#{
t
"active_admin.attributes.user.avatar"
}
"
end
end
f
.
actions
f
.
actions
end
end
...
...
app/controllers/users_controller.rb
View file @
3a96c8d1
...
@@ -30,6 +30,7 @@ class UsersController < ApplicationController
...
@@ -30,6 +30,7 @@ class UsersController < ApplicationController
def
update
def
update
@user
=
resource
@user
=
resource
if
@user
.
update
(
user_params
)
if
@user
.
update
(
user_params
)
sign_in
@user
redirect_to
user_path
(
user:
@user
)
redirect_to
user_path
(
user:
@user
)
else
else
render
:edit
render
:edit
...
@@ -53,7 +54,7 @@ class UsersController < ApplicationController
...
@@ -53,7 +54,7 @@ class UsersController < ApplicationController
end
end
def
user_params
def
user_params
params
.
require
(
:user
).
permit
(
:email
,
:name
,
:location
,
:picture
,
:avatar
)
params
.
require
(
:user
).
permit
(
:email
,
:name
,
:location
,
:picture
,
:avatar
,
:role
)
end
end
end
end
\ No newline at end of file
config/locales/active_admin/active_admin.en.yml
View file @
3a96c8d1
en
:
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
:
models
:
comment
:
user
:
one
:
"
Comment"
one
:
"
User"
other
:
"
Comments"
other
:
"
Users"
active_admin/comment
:
one
:
"
Comment"
other
:
"
Comments"
attributes
:
attributes
:
active_admin/comment
:
user
:
author_type
:
"
Author
type"
email
:
"
Email"
body
:
"
Body"
name
:
"
Name"
location
:
"
Location"
created_at
:
"
Created"
created_at
:
"
Created"
namespace
:
"
Namespace"
resource_type
:
"
Resource
type"
updated_at
:
"
Updated"
updated_at
:
"
Updated"
active_admin
:
role
:
"
Role"
dashboard
:
"
Dashboard"
password
:
"
Password"
password_confirmation
:
"
Password
confirmation"
avatar
:
"
Avatar"
dashboard
:
Dashboard
dashboard_welcome
:
dashboard_welcome
:
welcome
:
"
Welcome
to
Active
Admin.
This
is
the
default
dashboard
page."
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/dashboard
s
.rb'"
view
:
"
View"
view
:
"
View"
edit
:
"
Edit"
edit
:
"
Edit"
delete
:
"
Delete"
delete
:
"
Delete"
...
@@ -37,7 +48,6 @@ en:
...
@@ -37,7 +48,6 @@ en:
has_many_new
:
"
Add
New
%{model}"
has_many_new
:
"
Add
New
%{model}"
has_many_delete
:
"
Delete"
has_many_delete
:
"
Delete"
has_many_remove
:
"
Remove"
has_many_remove
:
"
Remove"
move
:
"
Move"
filters
:
filters
:
buttons
:
buttons
:
filter
:
"
Filter"
filter
:
"
Filter"
...
@@ -49,12 +59,6 @@ en:
...
@@ -49,12 +59,6 @@ en:
ends_with
:
"
Ends
with"
ends_with
:
"
Ends
with"
greater_than
:
"
Greater
than"
greater_than
:
"
Greater
than"
less_than
:
"
Less
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
:
search_status
:
headline
:
"
Search
status:"
headline
:
"
Search
status:"
current_scope
:
"
Scope:"
current_scope
:
"
Scope:"
...
@@ -151,10 +155,10 @@ en:
...
@@ -151,10 +155,10 @@ en:
resend_confirmation_instructions
:
"
Resend
confirmation
instructions"
resend_confirmation_instructions
:
"
Resend
confirmation
instructions"
unsupported_browser
:
unsupported_browser
:
headline
:
"
Please
note
that
ActiveAdmin
no
longer
supports
Internet
Explorer
versions
8
or
less."
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
."
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-
us
/help/17471
\"
>turn
off
\"
Compatibility
View
\"
</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
:
access_denied
:
message
:
"
You
are
not
authori
z
ed
to
perform
this
action."
message
:
"
You
are
not
authori
s
ed
to
perform
this
action."
index_list
:
index_list
:
table
:
"
Table"
table
:
"
Table"
block
:
"
List"
block
:
"
List"
...
...
config/locales/active_admin/active_admin.uk.yml
View file @
3a96c8d1
uk
:
uk
:
user
:
"
Користувач"
admin
:
"
Адмін"
formtastic
:
actions
:
create
:
"
Створити"
update
:
"
Зберегти
зміни"
reset
:
"
Очистити
форму"
cancel
:
"
Назад"
dummie
:
"
Launch!"
time
:
formats
:
long
:
"
%Y-%m-%d
%H:%M:%S"
active_admin
:
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
:
"
Панель
керування"
dashboard_welcome
:
dashboard_welcome
:
welcome
:
"
Ласкаво
просимо
до
Active
Admin.
Це
стандартна
сторінка
керування
сайтом."
welcome
:
"
Ласкаво
просимо
до
Active
Admin.
Це
стандартна
сторінка
керування
сайтом."
...
@@ -8,9 +38,9 @@ uk:
...
@@ -8,9 +38,9 @@ uk:
edit
:
"
Змінити"
edit
:
"
Змінити"
delete
:
"
Видалити"
delete
:
"
Видалити"
delete_confirmation
:
"
Ви
впевнені,
що
хочете
це
видалити?"
delete_confirmation
:
"
Ви
впевнені,
що
хочете
це
видалити?"
new_model
:
"
Створити
%{model}
"
new_model
:
"
Створити"
edit_model
:
"
Змінити
%{model}
"
edit_model
:
"
Змінити"
delete_model
:
"
Видалити
%{model}
"
delete_model
:
"
Видалити"
details
:
"
%{model}
детальніше"
details
:
"
%{model}
детальніше"
cancel
:
"
Скасувати"
cancel
:
"
Скасувати"
empty
:
"
Пусто"
empty
:
"
Пусто"
...
@@ -135,4 +165,4 @@ uk:
...
@@ -135,4 +165,4 @@ uk:
table
:
"
Таблиця"
table
:
"
Таблиця"
block
:
"
Список"
block
:
"
Список"
grid
:
"
Сітка"
grid
:
"
Сітка"
blog
:
"
Блог"
blog
:
"
Блог"
\ No newline at end of file
config/locales/uk.yml
View file @
3a96c8d1
uk
:
uk
:
# header:
# platfform: 'про платформу'
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment