biovision-base 0.5.170614
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +42 -0
- data/Rakefile +26 -0
- data/app/assets/config/biovision_base_manifest.js +0 -0
- data/app/assets/images/biovision/base/icons/alert.svg +15 -0
- data/app/assets/images/biovision/base/icons/back.svg +28 -0
- data/app/assets/images/biovision/base/icons/create.svg +1 -0
- data/app/assets/images/biovision/base/icons/destroy.svg +3 -0
- data/app/assets/images/biovision/base/icons/edit.svg +22 -0
- data/app/assets/images/biovision/base/icons/exit.svg +1 -0
- data/app/assets/images/biovision/base/icons/foreign/facebook.svg +1 -0
- data/app/assets/images/biovision/base/icons/gear.svg +4 -0
- data/app/assets/images/biovision/base/icons/lock-closed.svg +1 -0
- data/app/assets/images/biovision/base/icons/lock-open.svg +1 -0
- data/app/assets/images/biovision/base/icons/notice.svg +1 -0
- data/app/assets/images/biovision/base/icons/return.svg +1 -0
- data/app/assets/images/biovision/base/icons/warning.svg +43 -0
- data/app/assets/images/biovision/base/icons/world.svg +4 -0
- data/app/assets/images/biovision/base/placeholders/image.svg +19 -0
- data/app/assets/images/biovision/base/placeholders/photo.svg +23 -0
- data/app/assets/images/biovision/base/placeholders/user.svg +21 -0
- data/app/assets/javascripts/biovision/base/biovision.js +238 -0
- data/app/assets/stylesheets/biovision/base/admin.scss +58 -0
- data/app/assets/stylesheets/biovision/base/biovision.scss +472 -0
- data/app/assets/stylesheets/biovision/base/buttons.scss +90 -0
- data/app/assets/stylesheets/biovision/base/default.scss +45 -0
- data/app/assets/stylesheets/biovision/base/filters.scss +53 -0
- data/app/assets/stylesheets/biovision/base/fonts.scss +9 -0
- data/app/assets/stylesheets/biovision/base/message-box.scss +60 -0
- data/app/assets/stylesheets/biovision/base/pagination.scss +42 -0
- data/app/assets/stylesheets/biovision/base/tootik.scss +385 -0
- data/app/assets/stylesheets/biovision/base/track.scss +28 -0
- data/app/controllers/admin/agents_controller.rb +30 -0
- data/app/controllers/admin/browsers_controller.rb +30 -0
- data/app/controllers/admin/codes_controller.rb +25 -0
- data/app/controllers/admin/editable_pages_controller.rb +25 -0
- data/app/controllers/admin/index_controller.rb +5 -0
- data/app/controllers/admin/metrics_controller.rb +29 -0
- data/app/controllers/admin/privilege_groups_controller.rb +48 -0
- data/app/controllers/admin/privileges_controller.rb +5 -0
- data/app/controllers/admin/tokens_controller.rb +28 -0
- data/app/controllers/admin/users_controller.rb +87 -0
- data/app/controllers/admin_controller.rb +10 -0
- data/app/controllers/agents_controller.rb +67 -0
- data/app/controllers/authentication_controller.rb +70 -0
- data/app/controllers/browsers_controller.rb +63 -0
- data/app/controllers/codes_controller.rb +60 -0
- data/app/controllers/concerns/authentication.rb +19 -0
- data/app/controllers/concerns/biovision/admin/privileges.rb +34 -0
- data/app/controllers/concerns/entity_priority.rb +7 -0
- data/app/controllers/concerns/lockable_entity.rb +23 -0
- data/app/controllers/concerns/toggleable_entity.rb +7 -0
- data/app/controllers/editable_pages_controller.rb +60 -0
- data/app/controllers/index_controller.rb +5 -0
- data/app/controllers/metrics_controller.rb +33 -0
- data/app/controllers/my/confirmations_controller.rb +37 -0
- data/app/controllers/my/index_controller.rb +7 -0
- data/app/controllers/my/profiles_controller.rb +81 -0
- data/app/controllers/my/recoveries_controller.rb +68 -0
- data/app/controllers/privilege_groups_controller.rb +57 -0
- data/app/controllers/privileges_controller.rb +74 -0
- data/app/controllers/profiles_controller.rb +22 -0
- data/app/controllers/tokens_controller.rb +60 -0
- data/app/controllers/users_controller.rb +57 -0
- data/app/helpers/biovision_helper.rb +81 -0
- data/app/helpers/biovision_users_helper.rb +52 -0
- data/app/helpers/codes_helper.rb +10 -0
- data/app/helpers/editable_pages_helper.rb +20 -0
- data/app/helpers/privileges_helper.rb +11 -0
- data/app/helpers/tracking_helper.rb +17 -0
- data/app/jobs/application_job.rb +7 -0
- data/app/jobs/clean_tokens_job.rb +8 -0
- data/app/mailers/code_sender.rb +15 -0
- data/app/models/agent.rb +38 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/browser.rb +22 -0
- data/app/models/code.rb +58 -0
- data/app/models/code_type.rb +11 -0
- data/app/models/concerns/biovision/privilege_base.rb +143 -0
- data/app/models/concerns/biovision/user_base.rb +124 -0
- data/app/models/concerns/biovision/user_privilege_base.rb +46 -0
- data/app/models/concerns/has_owner.rb +19 -0
- data/app/models/concerns/required_unique_name.rb +13 -0
- data/app/models/concerns/required_unique_slug.rb +12 -0
- data/app/models/concerns/toggleable.rb +29 -0
- data/app/models/editable_page.rb +30 -0
- data/app/models/foreign_site.rb +75 -0
- data/app/models/foreign_user.rb +26 -0
- data/app/models/metric.rb +67 -0
- data/app/models/metric_value.rb +15 -0
- data/app/models/privilege.rb +3 -0
- data/app/models/privilege_group.rb +50 -0
- data/app/models/privilege_group_privilege.rb +6 -0
- data/app/models/token.rb +75 -0
- data/app/models/user.rb +3 -0
- data/app/models/user_privilege.rb +3 -0
- data/app/services/canonizer.rb +29 -0
- data/app/services/code_manager.rb +16 -0
- data/app/services/code_manager/confirmation.rb +26 -0
- data/app/services/code_manager/invitation.rb +27 -0
- data/app/services/code_manager/recovery.rb +31 -0
- data/app/uploaders/avatar_uploader.rb +62 -0
- data/app/uploaders/editable_page_image_uploader.rb +38 -0
- data/app/views/admin/agents/_filter.html.erb +16 -0
- data/app/views/admin/agents/_list.html.erb +17 -0
- data/app/views/admin/agents/_nav_item.html.erb +6 -0
- data/app/views/admin/agents/_toggleable.html.erb +7 -0
- data/app/views/admin/agents/entity/_in_list.html.erb +13 -0
- data/app/views/admin/agents/index.html.erb +17 -0
- data/app/views/admin/agents/show.html.erb +28 -0
- data/app/views/admin/browsers/_list.html.erb +17 -0
- data/app/views/admin/browsers/_nav_item.html.erb +6 -0
- data/app/views/admin/browsers/_toggleable.html.erb +7 -0
- data/app/views/admin/browsers/agents/_add.html.erb +79 -0
- data/app/views/admin/browsers/entity/_in_list.html.erb +13 -0
- data/app/views/admin/browsers/index.html.erb +17 -0
- data/app/views/admin/browsers/show.html.erb +29 -0
- data/app/views/admin/codes/_list.html.erb +11 -0
- data/app/views/admin/codes/_nav_item.html.erb +6 -0
- data/app/views/admin/codes/entity/_in_list.html.erb +24 -0
- data/app/views/admin/codes/index.html.erb +16 -0
- data/app/views/admin/codes/show.html.erb +51 -0
- data/app/views/admin/editable_pages/_list.html.erb +11 -0
- data/app/views/admin/editable_pages/_nav_item.html.erb +6 -0
- data/app/views/admin/editable_pages/entity/_in_list.html.erb +13 -0
- data/app/views/admin/editable_pages/index.html.erb +14 -0
- data/app/views/admin/editable_pages/show.html.erb +47 -0
- data/app/views/admin/index/index.html.erb +25 -0
- data/app/views/admin/metrics/_list.html.erb +26 -0
- data/app/views/admin/metrics/_nav_item.html.erb +6 -0
- data/app/views/admin/metrics/data.jbuilder +6 -0
- data/app/views/admin/metrics/index.html.erb +14 -0
- data/app/views/admin/metrics/show.html.erb +52 -0
- data/app/views/admin/privilege_groups/_list.html.erb +11 -0
- data/app/views/admin/privilege_groups/_nav_item.html.erb +6 -0
- data/app/views/admin/privilege_groups/entity/_in_list.html.erb +10 -0
- data/app/views/admin/privilege_groups/index.html.erb +14 -0
- data/app/views/admin/privilege_groups/show.html.erb +31 -0
- data/app/views/admin/privileges/_list.html.erb +15 -0
- data/app/views/admin/privileges/_nav_item.html.erb +6 -0
- data/app/views/admin/privileges/entity/_groups.html.erb +34 -0
- data/app/views/admin/privileges/entity/_in_list.html.erb +25 -0
- data/app/views/admin/privileges/index.html.erb +20 -0
- data/app/views/admin/privileges/show.html.erb +66 -0
- data/app/views/admin/privileges/users.html.erb +24 -0
- data/app/views/admin/tokens/_filter.html.erb +17 -0
- data/app/views/admin/tokens/_list.html.erb +11 -0
- data/app/views/admin/tokens/_nav_item.html.erb +6 -0
- data/app/views/admin/tokens/_toggleable.html.erb +7 -0
- data/app/views/admin/tokens/entity/_in_list.html.erb +25 -0
- data/app/views/admin/tokens/index.html.erb +19 -0
- data/app/views/admin/tokens/show.html.erb +43 -0
- data/app/views/admin/users/_filter.html.erb +22 -0
- data/app/views/admin/users/_list.html.erb +17 -0
- data/app/views/admin/users/_nav_item.html.erb +6 -0
- data/app/views/admin/users/_search.html.erb +5 -0
- data/app/views/admin/users/_toggleable.html.erb +7 -0
- data/app/views/admin/users/codes.html.erb +24 -0
- data/app/views/admin/users/entity/_in_list.html.erb +24 -0
- data/app/views/admin/users/entity/_privilege.html.erb +10 -0
- data/app/views/admin/users/entity/_privilege_tree.html.erb +17 -0
- data/app/views/admin/users/index.html.erb +19 -0
- data/app/views/admin/users/privileges.html.erb +35 -0
- data/app/views/admin/users/search.jbuilder +10 -0
- data/app/views/admin/users/search/_results.html.erb +11 -0
- data/app/views/admin/users/show.html.erb +94 -0
- data/app/views/admin/users/tokens.html.erb +24 -0
- data/app/views/agents/_agent.jbuilder +20 -0
- data/app/views/agents/_filter.html.erb +53 -0
- data/app/views/agents/_form.html.erb +33 -0
- data/app/views/agents/edit.html.erb +17 -0
- data/app/views/agents/index.jbuilder +5 -0
- data/app/views/agents/new.html.erb +15 -0
- data/app/views/agents/show.jbuilder +3 -0
- data/app/views/application/not_found.html.erb +9 -0
- data/app/views/application/not_found.jbuilder +3 -0
- data/app/views/application/service_unavailable.html.erb +9 -0
- data/app/views/application/unauthorized.html.erb +11 -0
- data/app/views/application/unauthorized.jbuilder +3 -0
- data/app/views/authentication/_form.html.erb +16 -0
- data/app/views/authentication/_info.html.erb +8 -0
- data/app/views/authentication/new.html.erb +10 -0
- data/app/views/browsers/_form.html.erb +28 -0
- data/app/views/browsers/edit.html.erb +17 -0
- data/app/views/browsers/new.html.erb +15 -0
- data/app/views/code_sender/email.text.erb +9 -0
- data/app/views/code_sender/password.text.erb +10 -0
- data/app/views/codes/_form.html.erb +49 -0
- data/app/views/codes/edit.html.erb +17 -0
- data/app/views/codes/new.html.erb +15 -0
- data/app/views/editable_pages/_form.html.erb +63 -0
- data/app/views/editable_pages/edit.html.erb +17 -0
- data/app/views/editable_pages/form/_ckeditor.html.erb +11 -0
- data/app/views/editable_pages/new.html.erb +15 -0
- data/app/views/index/index.html.erb +5 -0
- data/app/views/layouts/admin.html.erb +23 -0
- data/app/views/layouts/admin/_footer.html.erb +0 -0
- data/app/views/layouts/admin/_header.html.erb +11 -0
- data/app/views/layouts/admin/header/_logo.html.erb +3 -0
- data/app/views/metrics/_form.html.erb +41 -0
- data/app/views/metrics/edit.html.erb +17 -0
- data/app/views/metrics/index.jbuilder +7 -0
- data/app/views/metrics/show.jbuilder +3 -0
- data/app/views/my/confirmations/show.html.erb +30 -0
- data/app/views/my/index/index.html.erb +17 -0
- data/app/views/my/profiles/edit.html.erb +10 -0
- data/app/views/my/profiles/edit/_form.html.erb +70 -0
- data/app/views/my/profiles/new.html.erb +7 -0
- data/app/views/my/profiles/new/_form.html.erb +34 -0
- data/app/views/my/profiles/show.html.erb +3 -0
- data/app/views/my/recoveries/show.html.erb +39 -0
- data/app/views/privilege_groups/_form.html.erb +25 -0
- data/app/views/privilege_groups/edit.html.erb +17 -0
- data/app/views/privilege_groups/new.html.erb +15 -0
- data/app/views/privileges/_form.html.erb +42 -0
- data/app/views/privileges/edit.html.erb +21 -0
- data/app/views/privileges/new.html.erb +14 -0
- data/app/views/profiles/_profile.html.erb +48 -0
- data/app/views/profiles/show.html.erb +4 -0
- data/app/views/shared/_flash_messages.html.erb +7 -0
- data/app/views/shared/_list_of_errors.html.erb +11 -0
- data/app/views/shared/_meta_texts.html.erb +17 -0
- data/app/views/shared/_nothing_found.html.erb +1 -0
- data/app/views/shared/_track.html.erb +10 -0
- data/app/views/shared/actions/_locks.html.erb +4 -0
- data/app/views/shared/actions/_priority_changer.html.erb +4 -0
- data/app/views/shared/admin/_breadcrumbs.html.erb +6 -0
- data/app/views/shared/editable_pages/_body.html.erb +12 -0
- data/app/views/shared/filter/_flag.html.erb +17 -0
- data/app/views/tokens/_form.html.erb +30 -0
- data/app/views/tokens/edit.html.erb +17 -0
- data/app/views/tokens/new.html.erb +15 -0
- data/app/views/users/_form.html.erb +78 -0
- data/app/views/users/edit.html.erb +18 -0
- data/app/views/users/new.html.erb +15 -0
- data/config/initializers/carrierwave.rb +22 -0
- data/config/initializers/pluralization.rb +2 -0
- data/config/locales/common-ru.yml +96 -0
- data/config/locales/editable-pages-ru.yml +43 -0
- data/config/locales/plurals.rb +17 -0
- data/config/locales/track-ru.yml +102 -0
- data/config/locales/users-ru.yml +324 -0
- data/config/routes.rb +92 -0
- data/db/migrate/20170301000001_create_metrics.rb +23 -0
- data/db/migrate/20170301000002_create_metric_values.rb +19 -0
- data/db/migrate/20170301000101_create_browsers.rb +22 -0
- data/db/migrate/20170301000102_create_agents.rb +22 -0
- data/db/migrate/20170302000001_create_users.rb +52 -0
- data/db/migrate/20170302000002_create_tokens.rb +23 -0
- data/db/migrate/20170302000003_create_code_types.rb +20 -0
- data/db/migrate/20170302000004_create_codes.rb +24 -0
- data/db/migrate/20170302000101_create_privileges.rb +34 -0
- data/db/migrate/20170302000102_create_user_privileges.rb +17 -0
- data/db/migrate/20170302000103_create_privilege_groups.rb +23 -0
- data/db/migrate/20170302000104_create_privilege_group_privileges.rb +24 -0
- data/db/migrate/20170320000000_create_editable_pages.rb +22 -0
- data/db/migrate/20170425000001_create_foreign_sites.rb +18 -0
- data/db/migrate/20170425000002_create_foreign_users.rb +23 -0
- data/lib/biovision/base.rb +9 -0
- data/lib/biovision/base/base_methods.rb +96 -0
- data/lib/biovision/base/engine.rb +17 -0
- data/lib/biovision/base/privilege_methods.rb +35 -0
- data/lib/biovision/base/version.rb +5 -0
- data/lib/tasks/biovision/agents.rake +38 -0
- data/lib/tasks/biovision/base_tasks.rake +4 -0
- data/lib/tasks/biovision/browsers.rake +38 -0
- data/lib/tasks/biovision/codes.rake +49 -0
- data/lib/tasks/biovision/tokens.rake +54 -0
- data/lib/tasks/biovision/users.rake +67 -0
- metadata +467 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
<% content_for :meta_title, t('.title', page: current_page) %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<span><%= t('admin.privilege_groups.nav_item.text') %></span>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<article class="entity-page">
|
7
|
+
<h1><%= t('.heading') %></h1>
|
8
|
+
<ul class="actions">
|
9
|
+
<li><%= back_icon(admin_path) %></li>
|
10
|
+
<li><%= create_icon(new_privilege_group_path) %></li>
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
<%= render partial: 'list', locals: { collection: @collection } %>
|
14
|
+
</article>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% content_for :meta_title, t('.title', name: @entity.name) %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<%= link_to t('admin.privilege_groups.nav_item.text'), admin_privilege_groups_path %>
|
4
|
+
<span><%= @entity.name %></span>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<article class="entity-page">
|
8
|
+
<h1><%= @entity.name %></h1>
|
9
|
+
|
10
|
+
<ul class="actions">
|
11
|
+
<li><%= return_icon(admin_privilege_groups_path) %></li>
|
12
|
+
<li><%= edit_icon(edit_privilege_group_path(@entity.id)) %></li>
|
13
|
+
<li class="danger"><%= destroy_icon(@entity) %></li>
|
14
|
+
</ul>
|
15
|
+
|
16
|
+
<p><%= @entity.description %></p>
|
17
|
+
|
18
|
+
<section>
|
19
|
+
<h2><%= t('.privileges') %></h2>
|
20
|
+
|
21
|
+
<% if @collection.any? %>
|
22
|
+
<ol>
|
23
|
+
<% @collection.each do |privilege| %>
|
24
|
+
<li><%= admin_privilege_link(privilege) %></li>
|
25
|
+
<% end %>
|
26
|
+
</ol>
|
27
|
+
<% else %>
|
28
|
+
<%= render 'shared/nothing_found' %>
|
29
|
+
<% end %>
|
30
|
+
</section>
|
31
|
+
</article>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% if collection.any? %>
|
2
|
+
<ol class="list-of-entities">
|
3
|
+
<% collection.each do |entity| %>
|
4
|
+
<% if entity.deleted? %>
|
5
|
+
<li class="deleted"><%= t(:deleted_entity) %>, id: <%= entity.id %> [<%= entity.name %>]</li>
|
6
|
+
<% else %>
|
7
|
+
<li data-number="<%= entity.priority %>" data-id="<%= entity.id %>">
|
8
|
+
<%= render partial: 'admin/privileges/entity/in_list', locals: { entity: entity } %>
|
9
|
+
</li>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
</ol>
|
13
|
+
<% else %>
|
14
|
+
<%= render 'shared/nothing_found' %>
|
15
|
+
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<section>
|
2
|
+
<h2><%= t('.heading') %></h2>
|
3
|
+
|
4
|
+
<% if PrivilegeGroup.count > 0 %>
|
5
|
+
<ul class="list-of-entities privilege-groups">
|
6
|
+
<% PrivilegeGroup.page_for_administration.each do |privilege_group| %>
|
7
|
+
<li data-url="<%= privilege_admin_privilege_group_path(id: privilege_group.id, privilege_id: privilege.id) %>">
|
8
|
+
<% element_id = "privilege_group_#{privilege_group.id}" %>
|
9
|
+
<%= check_box_tag element_id, 1, privilege_group.has_privilege?(privilege) %>
|
10
|
+
<%= label_tag element_id, privilege_group.name %>
|
11
|
+
</li>
|
12
|
+
<% end %>
|
13
|
+
</ul>
|
14
|
+
|
15
|
+
<script>
|
16
|
+
'use strict';
|
17
|
+
$(function () {
|
18
|
+
$('ul.privilege-groups input[type=checkbox]').on('click', function () {
|
19
|
+
var url = $(this).closest('li').data('url');
|
20
|
+
var method = $(this).is(':checked') ? 'put' : 'delete';
|
21
|
+
|
22
|
+
$.ajax(url, {
|
23
|
+
method: method,
|
24
|
+
success: function (response) {
|
25
|
+
console.log(response);
|
26
|
+
}
|
27
|
+
}).fail(handle_ajax_failure);
|
28
|
+
});
|
29
|
+
});
|
30
|
+
</script>
|
31
|
+
<% else %>
|
32
|
+
<%= render 'shared/nothing_found' %>
|
33
|
+
<% end %>
|
34
|
+
</section>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="data">
|
2
|
+
<div><%= admin_privilege_link(entity) %></div>
|
3
|
+
<div class="secondary info">
|
4
|
+
<div><%= entity.description %></div>
|
5
|
+
</div>
|
6
|
+
<div class="info">
|
7
|
+
<div><%= entity.slug %></div>
|
8
|
+
<div><%= entity.privilege_groups.map(&:name).join(', ') %></div>
|
9
|
+
<div><%= link_to t(:user_count, count: entity.users_count), users_admin_privilege_path(entity.id) %></div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<ul class="actions">
|
13
|
+
<li class="lockable <%= entity.locked? ? 'hidden' : '' %>">
|
14
|
+
<%= edit_icon(edit_privilege_path(entity.id)) %>
|
15
|
+
</li>
|
16
|
+
<%= render partial: 'shared/actions/priority_changer', locals: { path: priority_admin_privilege_path(entity.id) } %>
|
17
|
+
<%= render partial: 'shared/actions/locks', locals: { entity: entity, path: lock_admin_privilege_path(entity.id) } %>
|
18
|
+
</ul>
|
19
|
+
|
20
|
+
<% if entity.children.any? %>
|
21
|
+
<div class="children">
|
22
|
+
<%= render partial: 'admin/privileges/list', locals: { collection: Privilege.for_tree(entity.id) } %>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% content_for :meta_title, t('.title') %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<span><%= t('admin.privileges.nav_item.text') %></span>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<article class="entity-page">
|
7
|
+
<h1><%= t('.heading') %></h1>
|
8
|
+
|
9
|
+
<ul class="actions">
|
10
|
+
<li><%= back_icon(admin_path) %></li>
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
<%= render partial: 'list', locals: { collection: @collection } %>
|
14
|
+
|
15
|
+
<section>
|
16
|
+
<h2><%= t('privileges.new.title') %></h2>
|
17
|
+
|
18
|
+
<%= render partial: 'privileges/form', locals: { entity: Privilege.new } %>
|
19
|
+
</section>
|
20
|
+
</article>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<% content_for :meta_title, t('.title', name: @entity.name) %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<%= link_to(t('admin.privileges.nav_item.text'), admin_privileges_path) %>
|
4
|
+
<% @entity.parents.each do |parent| %>
|
5
|
+
<%= admin_privilege_link(parent) %>
|
6
|
+
<% end %>
|
7
|
+
<span><%= @entity.name %></span>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<article class="entity-page">
|
11
|
+
<h1><%= @entity.name %></h1>
|
12
|
+
|
13
|
+
<ul class="actions">
|
14
|
+
<li><%= return_icon(admin_privileges_path) %></li>
|
15
|
+
<% unless @entity.locked? %>
|
16
|
+
<li><%= edit_icon(edit_privilege_path(@entity.id)) %></li>
|
17
|
+
<% end %>
|
18
|
+
</ul>
|
19
|
+
|
20
|
+
<dl>
|
21
|
+
<% unless @entity.parent.nil? %>
|
22
|
+
<dt><%= t('activerecord.attributes.privilege.parent_id') %></dt>
|
23
|
+
<dd><%= link_to @entity.parent.name, admin_privilege_path(@entity.parent_id) %></dd>
|
24
|
+
<% end %>
|
25
|
+
<dt><%= t('activerecord.attributes.privilege.slug') %></dt>
|
26
|
+
<dd><%= @entity.slug %></dd>
|
27
|
+
|
28
|
+
<dt><%= t('activerecord.attributes.privilege.priority') %></dt>
|
29
|
+
<dd><%= @entity.priority %></dd>
|
30
|
+
|
31
|
+
<% unless @entity.description.blank? %>
|
32
|
+
<dt><%= t('activerecord.attributes.privilege.description') %></dt>
|
33
|
+
<dd><%= simple_format(@entity.description) %></dd>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<% unless @entity.parents_cache.blank? %>
|
37
|
+
<dt><%= t('activerecord.attributes.privilege.parents_cache') %></dt>
|
38
|
+
<dd><%= @entity.parents_cache %></dd>
|
39
|
+
<% end %>
|
40
|
+
|
41
|
+
<% unless @entity.children_cache.blank? %>
|
42
|
+
<dt><%= t('activerecord.attributes.privilege.children_cache') %></dt>
|
43
|
+
<dd><%= @entity.children_cache.join(', ') %></dd>
|
44
|
+
<% end %>
|
45
|
+
</dl>
|
46
|
+
|
47
|
+
<nav>
|
48
|
+
<ul>
|
49
|
+
<li><%= link_to t(:user_count, count: @entity.users_count), users_admin_privilege_path(@entity.id) %></li>
|
50
|
+
</ul>
|
51
|
+
</nav>
|
52
|
+
|
53
|
+
<%= render partial: 'admin/privileges/entity/groups', locals: { privilege: @entity } %>
|
54
|
+
|
55
|
+
<section>
|
56
|
+
<h2><%= t('.children') %></h2>
|
57
|
+
|
58
|
+
<%= render partial: 'admin/privileges/list', locals: { collection: Privilege.for_tree(@entity.id) } %>
|
59
|
+
</section>
|
60
|
+
|
61
|
+
<section>
|
62
|
+
<h2><%= t('.add_child') %></h2>
|
63
|
+
|
64
|
+
<%= render partial: 'privileges/form', locals: { entity: Privilege.new(parent: @entity) } %>
|
65
|
+
</section>
|
66
|
+
</article>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% content_for :meta_title, t('.title', privilege: @entity.full_title, page: current_page) %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<%= link_to(t('admin.privileges.nav_item.text'), admin_privileges_path) %>
|
4
|
+
<% @entity.parents.each do |parent| %>
|
5
|
+
<%= admin_privilege_link(parent) %>
|
6
|
+
<% end %>
|
7
|
+
<%= admin_privilege_link(@entity) %>
|
8
|
+
<span><%= t('.heading') %></span>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<article class="entity-page">
|
12
|
+
<h1><%= @entity.full_title %></h1>
|
13
|
+
<ul class="actions">
|
14
|
+
<li><%= return_icon(admin_privilege_path(@entity)) %></li>
|
15
|
+
</ul>
|
16
|
+
|
17
|
+
<section>
|
18
|
+
<h2><%= t('.heading') %></h2>
|
19
|
+
|
20
|
+
<%= paginate @collection %>
|
21
|
+
<%= render partial: 'admin/users/list', locals: { collection: @collection } %>
|
22
|
+
<%= paginate @collection %>
|
23
|
+
</section>
|
24
|
+
</article>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_tag url_for, method: :get, class: :filter do %>
|
2
|
+
<fieldset>
|
3
|
+
<legend><%= t(:filter) %></legend>
|
4
|
+
|
5
|
+
<div>
|
6
|
+
<div><%= label_tag 'filter_user_id', t('activerecord.attributes.token.user_id') %></div>
|
7
|
+
<div>
|
8
|
+
<%= number_field_tag 'filter[user_id]', filter[:user_id], in: User.ids_range %>
|
9
|
+
<%= render partial: 'admin/users/search', locals: { target_id: 'filter_user_id' } %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<%= render partial: 'shared/filter/flag', locals: { title: t('activerecord.attributes.token.active'), name: :active, state: filter[:active] } %>
|
14
|
+
|
15
|
+
<div class="button"><%= button_tag t(:submit), type: :submit, name: '' %></div>
|
16
|
+
</fieldset>
|
17
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if collection.any? %>
|
2
|
+
<ul class="list-of-entities">
|
3
|
+
<% collection.each do |entity| %>
|
4
|
+
<li data-id="<%= entity.id %>">
|
5
|
+
<%= render partial: 'admin/tokens/entity/in_list', locals: { entity: entity } %>
|
6
|
+
</li>
|
7
|
+
<% end %>
|
8
|
+
</ul>
|
9
|
+
<% else %>
|
10
|
+
<%= render 'shared/nothing_found' %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="toggleable" data-url="<%= toggle_admin_token_path(entity.id) %>">
|
2
|
+
<% Token.toggleable_attributes.each do |flag| %>
|
3
|
+
<span class="<%= entity.attributes[flag.to_s] ? 'active' : 'inactive' %>" data-flag="<%= flag %>">
|
4
|
+
<%= t("activerecord.attributes.token.#{flag}") %>
|
5
|
+
</span>
|
6
|
+
<% end %>
|
7
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="image">
|
2
|
+
<%= profile_avatar(entity.user) %>
|
3
|
+
</div>
|
4
|
+
<div class="data">
|
5
|
+
<div><%= admin_token_link(entity) %></div>
|
6
|
+
<div class="info">
|
7
|
+
<% unless entity.last_used.nil? %>
|
8
|
+
<div>
|
9
|
+
<%= t('activerecord.attributes.token.last_used') %>
|
10
|
+
<%= time_tag entity.last_used %>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
<div class="secondary info">
|
15
|
+
<div><%= entity.ip %></div>
|
16
|
+
<% unless entity.agent.blank? %>
|
17
|
+
<div class="truncate"><%= entity.agent.name %></div>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
<%= render partial: 'admin/tokens/toggleable', locals: { entity: entity } %>
|
21
|
+
|
22
|
+
<ul class="actions">
|
23
|
+
<li><%= edit_icon edit_token_path(entity) %></li>
|
24
|
+
</ul>
|
25
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% content_for :meta_title, t('.title', page: current_page) %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<span><%= t('admin.tokens.nav_item.text') %></span>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<article class="entity-page">
|
7
|
+
<h1><%= t('.heading') %></h1>
|
8
|
+
|
9
|
+
<ul class="actions">
|
10
|
+
<li><%= back_icon(admin_path) %></li>
|
11
|
+
<li><%= create_icon(new_token_path) %></li>
|
12
|
+
</ul>
|
13
|
+
|
14
|
+
<%= render partial: 'admin/tokens/filter', locals: { filter: @filter } %>
|
15
|
+
|
16
|
+
<%= paginate @collection %>
|
17
|
+
<%= render partial: 'list', locals: { collection: @collection } %>
|
18
|
+
<%= paginate @collection %>
|
19
|
+
</article>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<% content_for :meta_title, t('.title', id: @entity.id) %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<%= link_to t('admin.tokens.nav_item.text'), admin_tokens_path %>
|
4
|
+
<span><%= @entity.name %></span>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<article class="entity-page">
|
8
|
+
<h1><%= @entity.token %></h1>
|
9
|
+
|
10
|
+
<ul class="actions">
|
11
|
+
<li><%= return_icon(admin_tokens_path) %></li>
|
12
|
+
<li><%= edit_icon(edit_token_path(@entity)) %></li>
|
13
|
+
<li class="danger"><%= destroy_icon(@entity) %></li>
|
14
|
+
</ul>
|
15
|
+
|
16
|
+
<dl>
|
17
|
+
<dt><%= t('activerecord.attributes.token.user') %></dt>
|
18
|
+
<dd><%= admin_user_link(@entity.user) %></dd>
|
19
|
+
|
20
|
+
<% unless @entity.last_used.nil? %>
|
21
|
+
<dt><%= t('activerecord.attributes.token.last_used') %></dt>
|
22
|
+
<dd><%= time_tag @entity.last_used %></dd>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<dt><%= t(:created_at) %></dt>
|
26
|
+
<dd><%= time_tag @entity.created_at %></dd>
|
27
|
+
|
28
|
+
<dt><%= t(:updated_at) %></dt>
|
29
|
+
<dd><%= time_tag @entity.updated_at %></dd>
|
30
|
+
|
31
|
+
<% unless @entity.ip.blank? %>
|
32
|
+
<dt><%= t('tracking.ip') %></dt>
|
33
|
+
<dd><%= @entity.ip %></dd>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<% unless @entity.agent.blank? %>
|
37
|
+
<dt><%= t('tracking.agent') %></dt>
|
38
|
+
<dd><%= @entity.agent.name %></dd>
|
39
|
+
<% end %>
|
40
|
+
</dl>
|
41
|
+
|
42
|
+
<%= render partial: 'admin/tokens/toggleable', locals: { entity: @entity } %>
|
43
|
+
</article>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%= form_tag url_for, method: :get, class: :filter do %>
|
2
|
+
<fieldset>
|
3
|
+
<legend><%= t(:filter) %></legend>
|
4
|
+
|
5
|
+
<div>
|
6
|
+
<div><%= label_tag 'filter_screen_name', t('activerecord.attributes.user.screen_name') %></div>
|
7
|
+
<div><%= search_field_tag 'filter[screen_name]', filter[:screen_name], size: 30, results: 5, autosave: 'screen_name' %></div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div>
|
11
|
+
<div><%= label_tag 'filter_name', t('activerecord.attributes.user.name') %></div>
|
12
|
+
<div><%= search_field_tag 'filter[name]', filter[:name], size: 30, results: 5, autosave: 'name' %></div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div>
|
16
|
+
<div><%= label_tag 'filter_email', t('activerecord.attributes.user.email') %></div>
|
17
|
+
<div><%= search_field_tag 'filter[email]', filter[:email], size: 30, results: 5, autosave: 'email' %></div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="button"><%= button_tag t(:submit), type: :submit, name: '' %></div>
|
21
|
+
</fieldset>
|
22
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% if collection.any? %>
|
2
|
+
<ul class="list-of-entities">
|
3
|
+
<% collection.each do |entity| %>
|
4
|
+
<% if entity.deleted? %>
|
5
|
+
<li class="deleted">
|
6
|
+
<%= "#{t(:deleted_entity)} #{entity.screen_name} (#{entity.profile_name})" %>, id: <%= entity.id %>
|
7
|
+
</li>
|
8
|
+
<% else %>
|
9
|
+
<li data-id="<%= entity.id %>">
|
10
|
+
<%= render partial: 'admin/users/entity/in_list', locals: { entity: entity } %>
|
11
|
+
</li>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
</ul>
|
15
|
+
<% else %>
|
16
|
+
<%= render 'shared/nothing_found' %>
|
17
|
+
<% end %>
|