aerogel-admin 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +13 -0
- data/Rakefile +1 -0
- data/aerogel-admin.gemspec +31 -0
- data/app/helpers/admin.rb +54 -0
- data/app/helpers/decorators.rb +29 -0
- data/app/helpers/icons.rb +11 -0
- data/app/helpers/table_builder.rb +8 -0
- data/app/helpers/tabs_builder.rb +7 -0
- data/app/routes/admin.rb +37 -0
- data/app/routes/users.rb +71 -0
- data/app/routes/users_access.rb +54 -0
- data/app/routes/users_roles.rb +53 -0
- data/assets/fonts/aerogel-icons.css +28 -0
- data/assets/fonts/aerogel-icons.eot +0 -0
- data/assets/fonts/aerogel-icons.svg +11 -0
- data/assets/fonts/aerogel-icons.ttf +0 -0
- data/assets/fonts/aerogel-icons.woff +0 -0
- data/assets/javascripts/.gitkeep +0 -0
- data/assets/javascripts/controllers/admin-modal.js.coffee +7 -0
- data/assets/javascripts/controllers/admin-modal/admin-modal-form-buttons.js.coffee +56 -0
- data/assets/javascripts/controllers/admin.js.coffee +13 -0
- data/assets/javascripts/controllers/admin/selectize-inputs.js.coffee +7 -0
- data/assets/javascripts/controllers/admin/top-menu-shadow.js.coffee +9 -0
- data/assets/javascripts/utils/ajax-spinner.js.coffee +26 -0
- data/assets/javascripts/utils/ajax-watcher.js.coffee +18 -0
- data/assets/javascripts/utils/bootstrap-modal-reload.js.coffee +8 -0
- data/assets/javascripts/utils/form-data-async.js.coffee +27 -0
- data/assets/javascripts/utils/i18n.js.coffee +27 -0
- data/assets/javascripts/utils/on-future-elements.js.coffee +15 -0
- data/assets/stylesheets/admin/bootstrap-settings.css.scss +33 -0
- data/assets/stylesheets/admin/global.css.scss +61 -0
- data/assets/stylesheets/admin/styles/ajax-indicator.css.scss +26 -0
- data/assets/stylesheets/admin/styles/bootstrap-modal.css.scss +24 -0
- data/assets/stylesheets/admin/styles/language-selector.css.scss +5 -0
- data/assets/stylesheets/admin/styles/page-header.css.scss +7 -0
- data/assets/stylesheets/admin/styles/sticky-footer-navbar.css.scss +34 -0
- data/assets/stylesheets/admin/styles/table.css.scss +3 -0
- data/assets/stylesheets/admin/styles/top-menu.css.scss +3 -0
- data/assets/stylesheets/admin/utils/center-absolutely.css.scss +5 -0
- data/assets/stylesheets/controllers/admin.css.scss +14 -0
- data/assets/vendor/bootstrap-datetimepicker.css.scss +1 -0
- data/assets/vendor/bootstrap-datetimepicker.js.coffee +1 -0
- data/assets/vendor/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css +5 -0
- data/assets/vendor/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js +1 -0
- data/assets/vendor/bootstrap-datetimepicker/bootstrap-datetimepicker.ru.js +163 -0
- data/assets/vendor/moment.js.coffee +1 -0
- data/assets/vendor/momentjs/moment-with-langs.min.js +9 -0
- data/assets/vendor/selectize.css.scss +2 -0
- data/assets/vendor/selectize.js.coffee +1 -0
- data/assets/vendor/selectize/selectize.bootstrap3.css +385 -0
- data/assets/vendor/selectize/selectize.css +311 -0
- data/assets/vendor/selectize/selectize.default.css +381 -0
- data/assets/vendor/selectize/selectize.js +3345 -0
- data/assets/vendor/smart-list-table.css.scss +42 -0
- data/assets/vendor/smart-list-table.js.coffee +1 -0
- data/assets/vendor/smart-list-table/smart-list-table-row.js.coffee +63 -0
- data/assets/vendor/smart-list-table/smart-list-table.css.scss +54 -0
- data/assets/vendor/smart-list-table/smart-list-table.js.coffee +133 -0
- data/assets/vendor/smart-tree-table.css.scss +42 -0
- data/assets/vendor/smart-tree-table.js.coffee +1 -0
- data/assets/vendor/smart-tree-table/smart-tree-table-drag-n-drop.js.coffee +190 -0
- data/assets/vendor/smart-tree-table/smart-tree-table-row.js.coffee +78 -0
- data/assets/vendor/smart-tree-table/smart-tree-table.css.scss +54 -0
- data/assets/vendor/smart-tree-table/smart-tree-table.js.coffee +267 -0
- data/assets/vendor/spin.js +353 -0
- data/config/README.md +3 -0
- data/config/development/.keep +0 -0
- data/config/production/.keep +0 -0
- data/db/model/README.md +1 -0
- data/db/model/admin/user_new_form.rb +40 -0
- data/db/model/user.rb +26 -0
- data/db/seed/01_admin_roles.seed +8 -0
- data/db/seed/02_admin_access.seed +24 -0
- data/db/seed/development/.keep +0 -0
- data/db/seed/development/20_users.seed +45 -0
- data/db/seed/development/admin_users.seed +38 -0
- data/db/seed/production/.keep +0 -0
- data/lib/aerogel/admin.rb +25 -0
- data/lib/aerogel/admin/core.rb +14 -0
- data/lib/aerogel/admin/menu.rb +38 -0
- data/lib/aerogel/admin/table_builder.rb +100 -0
- data/lib/aerogel/admin/tabs_builder.rb +69 -0
- data/lib/aerogel/admin/version.rb +5 -0
- data/locales/actions.en.yml +27 -0
- data/locales/actions.ru.yml +28 -0
- data/locales/admin.en.yml +14 -0
- data/locales/admin.ru.yml +14 -0
- data/locales/models.en.yml +8 -0
- data/locales/models.ru.yml +8 -0
- data/locales/views.en.yml +46 -0
- data/locales/views.ru.yml +46 -0
- data/public/README.md +1 -0
- data/rake/README.md +3 -0
- data/views/admin/index.html.erb +3 -0
- data/views/admin/table_builder/standard/_table_column.html.erb +3 -0
- data/views/admin/table_builder/standard/_table_row.html.erb +7 -0
- data/views/admin/table_builder/standard/table.html.erb +10 -0
- data/views/admin/tabs_builder/standard/_tab.html.erb +3 -0
- data/views/admin/tabs_builder/standard/tabs.html.erb +3 -0
- data/views/admin/users/_tabs.html.erb +8 -0
- data/views/admin/users/access/delete.html.erb +12 -0
- data/views/admin/users/access/edit.html.erb +9 -0
- data/views/admin/users/access/index.html.erb +23 -0
- data/views/admin/users/access/new.html.erb +9 -0
- data/views/admin/users/delete.html.erb +12 -0
- data/views/admin/users/edit.html.erb +46 -0
- data/views/admin/users/index.html.erb +31 -0
- data/views/admin/users/new.html.erb +11 -0
- data/views/admin/users/roles/delete.html.erb +12 -0
- data/views/admin/users/roles/edit.html.erb +9 -0
- data/views/admin/users/roles/index.html.erb +21 -0
- data/views/admin/users/roles/new.html.erb +7 -0
- data/views/form_builder/standard/field_multiselect.erb +14 -0
- data/views/form_builder/standard/field_select.erb +17 -0
- data/views/layouts/admin.html.erb +63 -0
- data/views/layouts/admin/_ajax_indicator.html.erb +4 -0
- data/views/layouts/admin/_alerts.html.erb +22 -0
- data/views/layouts/admin/_menu.html.erb +50 -0
- data/views/layouts/admin/_menu_item.html.erb +5 -0
- data/views/layouts/admin/_modals.html.erb +8 -0
- data/views/layouts/admin/modal.html.erb +38 -0
- metadata +280 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
en:
|
2
|
+
aerogel:
|
3
|
+
admin:
|
4
|
+
actions:
|
5
|
+
delete: Delete
|
6
|
+
logout: Log out
|
7
|
+
view_current_user: Account details
|
8
|
+
|
9
|
+
users:
|
10
|
+
create: Create new user
|
11
|
+
delete: Delete user
|
12
|
+
created: User %{name} created
|
13
|
+
updated: User %{name} updated
|
14
|
+
deleted: User %{name} deleted
|
15
|
+
failed_to_delete_self: "No, you cannot delete self"
|
16
|
+
users_roles:
|
17
|
+
create: Create new role
|
18
|
+
delete: Delete role
|
19
|
+
created: Role %{name} created
|
20
|
+
updated: Role %{name} updated
|
21
|
+
deleted: Role %{name} deleted
|
22
|
+
users_access:
|
23
|
+
create: Create new access rule
|
24
|
+
delete: Delete access rule
|
25
|
+
created: Access rule %{name} created
|
26
|
+
updated: Åccess rule %{name} updated
|
27
|
+
deleted: Access rule %{name} deleted
|
@@ -0,0 +1,28 @@
|
|
1
|
+
ru:
|
2
|
+
aerogel:
|
3
|
+
admin:
|
4
|
+
actions:
|
5
|
+
delete: Удалить
|
6
|
+
logout: Выйти
|
7
|
+
view_current_user: Учётная запись
|
8
|
+
|
9
|
+
users:
|
10
|
+
create: Создать нового пользователя
|
11
|
+
delete: Удалить пользователя
|
12
|
+
created: Пользователь <b>%{name}</b> создан
|
13
|
+
updated: Пользователь <b>%{name}</b> обновлён
|
14
|
+
deleted: Пользователь <b>%{name}</b> удалён
|
15
|
+
failed_to_delete_self: "Нет, вы не можете удалить самого себя"
|
16
|
+
users_roles:
|
17
|
+
create: Создать новую роль
|
18
|
+
delete: Удалить роль
|
19
|
+
created: Роль <b>%{name}</b> создана
|
20
|
+
updated: Роль <b>%{name}</b> обновлена
|
21
|
+
deleted: Роль <b>%{name}</b> удалена
|
22
|
+
users_access:
|
23
|
+
create: Создать новое правило доступа
|
24
|
+
delete: Удалить правило доступа
|
25
|
+
created: Правило доступа <b>%{name}</b> создано
|
26
|
+
updated: Правило доступа <b>%{name}</b> обновлено
|
27
|
+
deleted: Правило доступа <b>%{name}</b> удалено
|
28
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
ru:
|
2
|
+
aerogel:
|
3
|
+
admin:
|
4
|
+
homepage: Главная страница
|
5
|
+
panes:
|
6
|
+
users: Пользователи
|
7
|
+
users_roles: Роли
|
8
|
+
users_access: Правила доступа
|
9
|
+
|
10
|
+
decorators:
|
11
|
+
confirmed: подтверждён
|
12
|
+
not_confirmed: не подтверждён
|
13
|
+
|
14
|
+
warning_permanent_action: Это действие необратимо.
|
@@ -0,0 +1,46 @@
|
|
1
|
+
en:
|
2
|
+
aerogel:
|
3
|
+
admin:
|
4
|
+
views:
|
5
|
+
dashboard:
|
6
|
+
title: Dashboard
|
7
|
+
text: |
|
8
|
+
<p>
|
9
|
+
#dashboard
|
10
|
+
</p>
|
11
|
+
|
12
|
+
users:
|
13
|
+
create:
|
14
|
+
title: Create new user
|
15
|
+
edit:
|
16
|
+
title: Edit user
|
17
|
+
delete:
|
18
|
+
title: Delete user?
|
19
|
+
text: |
|
20
|
+
<p>
|
21
|
+
Do you really want to delete <b>%{name}</b>?
|
22
|
+
</p>
|
23
|
+
|
24
|
+
users_roles:
|
25
|
+
create:
|
26
|
+
title: Create new role
|
27
|
+
edit:
|
28
|
+
title: Edit role
|
29
|
+
delete:
|
30
|
+
title: Delete role?
|
31
|
+
text: |
|
32
|
+
<p>
|
33
|
+
Do you really want to delete <b>%{name}</b>?
|
34
|
+
</p>
|
35
|
+
|
36
|
+
users_access:
|
37
|
+
create:
|
38
|
+
title: Create new access rule
|
39
|
+
edit:
|
40
|
+
title: Edit access rule
|
41
|
+
delete:
|
42
|
+
title: Delete access rule?
|
43
|
+
text: |
|
44
|
+
<p>
|
45
|
+
Do you really want to delete <b>%{name}</b>?
|
46
|
+
</p>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
ru:
|
2
|
+
aerogel:
|
3
|
+
admin:
|
4
|
+
views:
|
5
|
+
dashboard:
|
6
|
+
title: Панель управления
|
7
|
+
text: |
|
8
|
+
<p>
|
9
|
+
#dashboard по-русски
|
10
|
+
</p>
|
11
|
+
|
12
|
+
users:
|
13
|
+
create:
|
14
|
+
title: Создать нового пользователя
|
15
|
+
edit:
|
16
|
+
title: Редактировать пользователя
|
17
|
+
delete:
|
18
|
+
title: Удалить пользователя?
|
19
|
+
text: |
|
20
|
+
<p>
|
21
|
+
Вы действительно хотите удалить <b>%{name}</b>?
|
22
|
+
</p>
|
23
|
+
|
24
|
+
users_roles:
|
25
|
+
create:
|
26
|
+
title: Создать новую роль
|
27
|
+
edit:
|
28
|
+
title: Редактировать роль
|
29
|
+
delete:
|
30
|
+
title: Удалить роль?
|
31
|
+
text: |
|
32
|
+
<p>
|
33
|
+
Вы действительно хотите удалить <b>%{name}</b>?
|
34
|
+
</p>
|
35
|
+
|
36
|
+
users_access:
|
37
|
+
create:
|
38
|
+
title: Создать новое правило доступа
|
39
|
+
edit:
|
40
|
+
title: Редактировать правило доступа
|
41
|
+
delete:
|
42
|
+
title: Удалить правило доступа?
|
43
|
+
text: |
|
44
|
+
<p>
|
45
|
+
Вы действительно хотите удалить <b>%{name}</b>?
|
46
|
+
</p>
|
data/public/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
A place for static files.
|
data/rake/README.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
<table class="table table-striped" <%= table.html_params %> >
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<%= partial table.template("table_column"), locals: { table: table }, collection: table.columns %>
|
5
|
+
</tr>
|
6
|
+
</thead>
|
7
|
+
<tbody>
|
8
|
+
<%= partial table.template("table_row"), locals: { table: table }, collection: table.object %>
|
9
|
+
</tbody>
|
10
|
+
</table>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% page_title t.aerogel.admin.views.users_access.delete.title %>
|
2
|
+
|
3
|
+
<% form @access, action: "/admin/users/access/#{@access.id}/delete" do %>
|
4
|
+
|
5
|
+
<%= t.aerogel.admin.views.users_access.delete.text name: "#{object.path}:#{object.access}:#{object.role}" %>
|
6
|
+
|
7
|
+
<p class="alert alert-warning">
|
8
|
+
<%= icon_warning %> <%= t.aerogel.admin.warning_permanent_action %>
|
9
|
+
</p>
|
10
|
+
<%= button :cancel, url: '/admin/users/access/' %>
|
11
|
+
<%= button :danger_submit, label: t.aerogel.admin.actions.users_access.delete %>
|
12
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% page_title t.aerogel.admin.views.users_access.edit.title %>
|
2
|
+
|
3
|
+
<% form @access, action: "/admin/users/access/#{@access.id}/edit" do %>
|
4
|
+
<%= field :path %>
|
5
|
+
<%= field :access, as: :radio_buttons, values: %w(R RW), labels: ['Read', 'Read & Write'] %>
|
6
|
+
<%= field :role, as: :select, from: Role, values: :slug, labels: :name %>
|
7
|
+
<%= button :cancel, url: '/admin/users/access/' %>
|
8
|
+
<%= button :save %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% page_title t.aerogel.admin.panes.users_access %>
|
2
|
+
|
3
|
+
<%= partial "admin/users/tabs" %>
|
4
|
+
|
5
|
+
<%
|
6
|
+
table Access.all do
|
7
|
+
column :path do |row|
|
8
|
+
link_to_modal_if_can "#{row.id}/edit", h( row.path )
|
9
|
+
end
|
10
|
+
column :access
|
11
|
+
column :role
|
12
|
+
column :actions, label: '' do |row|
|
13
|
+
link_to_modal_if_can "#{row.id}/delete", icon_delete
|
14
|
+
end
|
15
|
+
end
|
16
|
+
%>
|
17
|
+
|
18
|
+
|
19
|
+
<div class="table-actions">
|
20
|
+
<%= link_to_modal_if_can 'new',
|
21
|
+
icon("fa-plus")+" "+t.aerogel.admin.actions.users_access.create.to_s, class: "btn btn-default"
|
22
|
+
%>
|
23
|
+
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% page_title t.aerogel.admin.views.users_access.create.title %>
|
2
|
+
|
3
|
+
<% form @access, action: "/admin/users/access/new" do %>
|
4
|
+
<%= field :path %>
|
5
|
+
<%= field :access, as: :radio_buttons, values: %w(R RW), labels: ['Read', 'Read & Write'] %>
|
6
|
+
<%= field :role, as: :select, from: Role, values: :slug, labels: :name %>
|
7
|
+
<%= button :cancel, url: '/admin/users/access/' %>
|
8
|
+
<%= button :create %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% page_title t.aerogel.admin.views.users.delete.title %>
|
2
|
+
|
3
|
+
<% form @user, action: "/admin/users/#{@user.id}/delete" do %>
|
4
|
+
|
5
|
+
<%= t.aerogel.admin.views.users.delete.text name: h( object.full_name ) %>
|
6
|
+
|
7
|
+
<p class="alert alert-warning">
|
8
|
+
<%= icon_warning %> <%= t.aerogel.admin.warning_permanent_action %>
|
9
|
+
</p>
|
10
|
+
<%= button :cancel, url: '/admin/users/' %>
|
11
|
+
<%= button :danger_submit, label: t.aerogel.admin.actions.users.delete %>
|
12
|
+
<% end %>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<% page_title t.aerogel.admin.views.users.edit.title %>
|
2
|
+
|
3
|
+
<% form @user, action: "/admin/users/#{@user.id}/edit" do %>
|
4
|
+
<%= field :full_name %>
|
5
|
+
<% table object.emails do
|
6
|
+
column :email
|
7
|
+
column :confirmed, label: '' do |e|
|
8
|
+
user_email_confirmed_as_label( e )
|
9
|
+
end
|
10
|
+
column :confirmation_link, label: '' do |e|
|
11
|
+
e.confirmed ? '' : link_to(
|
12
|
+
"#request_email_confirmation",
|
13
|
+
t.aerogel.admin.actions.user_email.request_confirmation.to_s
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
%>
|
18
|
+
<% table object.authentications do
|
19
|
+
column :provider, label: object.model_name.human do |a|
|
20
|
+
auth_provider_as_icon( a.provider )+" #{auth_provider_as_text a.provider}"
|
21
|
+
end
|
22
|
+
column :uid
|
23
|
+
end
|
24
|
+
%>
|
25
|
+
<%= field :roles, as: :multiselect, from: Role, values: :slug, labels: :name %>
|
26
|
+
|
27
|
+
<p>
|
28
|
+
<em>
|
29
|
+
<%= User.human_attribute_name :created_at %>
|
30
|
+
<%= l object.created_at, default: :never, format: :short %>
|
31
|
+
</em><br/>
|
32
|
+
<em>
|
33
|
+
<%= User.human_attribute_name :updated_at %>
|
34
|
+
<%= l object.updated_at, default: :never, format: :short %>
|
35
|
+
</em><br/>
|
36
|
+
<em>
|
37
|
+
<%= User.human_attribute_name :authenticated_at %>
|
38
|
+
<%= l object.authenticated_at, default: :never, format: :short %>
|
39
|
+
</em><br/>
|
40
|
+
</p>
|
41
|
+
|
42
|
+
<%= button :cancel, url: '/admin/users/' %>
|
43
|
+
<%= button :save %>
|
44
|
+
|
45
|
+
|
46
|
+
<% end %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% page_title t.aerogel.admin.panes.users %>
|
2
|
+
|
3
|
+
<%= partial "admin/users/tabs" %>
|
4
|
+
|
5
|
+
|
6
|
+
<%
|
7
|
+
table User.all do
|
8
|
+
column :authentications, label: '' do |u|
|
9
|
+
u.authentications.map{|a| auth_provider_as_icon a.provider }.join
|
10
|
+
end
|
11
|
+
column :full_name do |u|
|
12
|
+
link_to_modal_if_can "#{u.id}/edit", h( u.full_name )
|
13
|
+
end
|
14
|
+
column :email do |u|
|
15
|
+
email = u.emails.first
|
16
|
+
h( email.email)+" "+user_email_confirmed_as_icon( email )
|
17
|
+
end
|
18
|
+
column :roles do |u|
|
19
|
+
u.roles.map{|v| v.to_s}.join(", ")
|
20
|
+
end
|
21
|
+
column :actions, label: '' do |u|
|
22
|
+
link_to_modal "#{u.id}/delete", icon_delete
|
23
|
+
end
|
24
|
+
end
|
25
|
+
%>
|
26
|
+
|
27
|
+
<div class="table-actions">
|
28
|
+
<%= link_to_modal_if_can 'new',
|
29
|
+
icon("fa-plus")+" "+t.aerogel.admin.actions.users.create.to_s, class: "btn btn-default"
|
30
|
+
%>
|
31
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% page_title t.aerogel.admin.views.users.create.title %>
|
2
|
+
|
3
|
+
<% form @admin_user_new_form, action: "/admin/users/new" do %>
|
4
|
+
<%= field :full_name %>
|
5
|
+
<%= field :email %>
|
6
|
+
<%= field :roles, as: :multiselect, from: Role, values: :slug, labels: :name %>
|
7
|
+
|
8
|
+
|
9
|
+
<%= button :cancel, url: '/admin/users/' %>
|
10
|
+
<%= button :create %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% page_title t.aerogel.admin.views.users_roles.delete.title %>
|
2
|
+
|
3
|
+
<% form @role, action: "/admin/users/roles/#{@role.id}/delete" do %>
|
4
|
+
|
5
|
+
<%= t.aerogel.admin.views.users_roles.delete.text name: h( object.name ) %>
|
6
|
+
|
7
|
+
<p class="alert alert-warning">
|
8
|
+
<%= icon_warning %> <%= t.aerogel.admin.warning_permanent_action %>
|
9
|
+
</p>
|
10
|
+
<%= button :cancel, url: '/admin/users/roles/' %>
|
11
|
+
<%= button :danger_submit, label: t.aerogel.admin.actions.users_roles.delete %>
|
12
|
+
<% end %>
|