biovision-base 0.39.190804.1 → 0.41.190905.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/biovision/base/icons/key.svg +16 -0
- data/app/assets/javascripts/biovision/base/biovision.js +133 -2
- data/app/assets/stylesheets/biovision/base/admin/components.scss +40 -1
- data/app/assets/stylesheets/biovision/base/biovision.scss +1 -2
- data/app/controllers/admin/codes_controller.rb +9 -1
- data/app/controllers/admin/components_controller.rb +80 -10
- data/app/controllers/admin/editable_pages_controller.rb +6 -1
- data/app/controllers/admin/feedback_requests_controller.rb +10 -2
- data/app/controllers/admin/foreign_users_controller.rb +10 -4
- data/app/controllers/admin/login_attempts_controller.rb +14 -0
- data/app/controllers/admin/simple_blocks_controller.rb +6 -1
- data/app/controllers/admin/tokens_controller.rb +11 -5
- data/app/controllers/admin/users_controller.rb +11 -5
- data/app/controllers/admin_controller.rb +2 -2
- data/app/controllers/codes_controller.rb +12 -5
- data/app/controllers/editable_pages_controller.rb +6 -1
- data/app/controllers/foreign_users_controller.rb +12 -7
- data/app/controllers/simple_blocks_controller.rb +6 -1
- data/app/controllers/tokens_controller.rb +6 -1
- data/app/controllers/users_controller.rb +14 -9
- data/app/helpers/biovision_components_helper.rb +4 -1
- data/app/helpers/simple_image_helper.rb +43 -23
- data/app/models/biovision_component.rb +46 -1
- data/app/models/biovision_component_user.rb +2 -0
- data/app/models/concerns/checkable.rb +1 -1
- data/app/models/concerns/toggleable.rb +6 -2
- data/app/services/biovision/components/base_component.rb +44 -16
- data/app/services/biovision/components/contact_component.rb +4 -2
- data/app/services/biovision/components/content_component.rb +4 -2
- data/app/services/biovision/components/users_component.rb +6 -0
- data/app/uploaders/simple_image_uploader.rb +15 -1
- data/app/views/admin/codes/index.html.erb +2 -1
- data/app/views/admin/codes/show.html.erb +12 -10
- data/app/views/admin/components/entity/_links.html.erb +17 -2
- data/app/views/admin/components/links/_contact.html.erb +3 -1
- data/app/views/admin/components/links/_content.html.erb +4 -2
- data/app/views/admin/components/links/_users.html.erb +11 -7
- data/app/views/admin/components/privileges.html.erb +34 -0
- data/app/views/admin/components/privileges/_component_user.html.erb +67 -0
- data/app/views/admin/components/privileges/_new_user.html.erb +15 -0
- data/app/views/admin/components/privileges/_users.html.erb +23 -0
- data/app/views/admin/components/update_privileges.jbuilder +21 -0
- data/app/views/admin/editable_pages/index.html.erb +2 -1
- data/app/views/admin/editable_pages/show.html.erb +1 -0
- data/app/views/admin/feedback_requests/index.html.erb +2 -1
- data/app/views/admin/foreign_users/index.html.erb +2 -1
- data/app/views/admin/foreign_users/show.html.erb +1 -0
- data/app/views/admin/login_attempts/index.html.erb +2 -1
- data/app/views/admin/simple_blocks/index.html.erb +2 -1
- data/app/views/admin/simple_blocks/show.html.erb +1 -0
- data/app/views/admin/tokens/index.html.erb +2 -1
- data/app/views/admin/tokens/show.html.erb +12 -3
- data/app/views/admin/users/_search.html.erb +1 -1
- data/app/views/admin/users/codes.html.erb +4 -3
- data/app/views/admin/users/index.html.erb +2 -1
- data/app/views/admin/users/search.jbuilder +11 -9
- data/app/views/admin/users/show.html.erb +12 -6
- data/app/views/admin/users/tokens.html.erb +4 -3
- data/app/views/codes/edit.html.erb +4 -3
- data/app/views/codes/new.html.erb +3 -2
- data/app/views/editable_pages/edit.html.erb +1 -0
- data/app/views/editable_pages/new.html.erb +1 -0
- data/app/views/shared/entity/_attributes.html.erb +4 -0
- data/app/views/shared/entity/_timestamps.html.erb +8 -4
- data/app/views/shared/forms/_meta_texts.html.erb +54 -48
- data/app/views/simple_blocks/edit.html.erb +1 -0
- data/app/views/simple_blocks/new.html.erb +3 -2
- data/app/views/tokens/edit.html.erb +4 -3
- data/app/views/tokens/new.html.erb +3 -2
- data/config/locales/components-en.yml +2 -0
- data/config/locales/components-ru.yml +21 -0
- data/config/locales/users-ru.yml +2 -1
- data/config/routes.rb +6 -0
- data/db/migrate/20181217000000_create_biovision_components.rb +1 -0
- data/db/migrate/20181217000040_create_privileges.rb +1 -67
- data/db/migrate/20190826111111_add_priority_to_biovision_components.rb +14 -0
- data/db/migrate/{20190801111111_add_components.rb → 20190826121212_add_components.rb} +0 -0
- data/lib/biovision/base/base_methods.rb +13 -4
- data/lib/biovision/base/version.rb +1 -1
- metadata +11 -3
@@ -0,0 +1,23 @@
|
|
1
|
+
<section>
|
2
|
+
<h2><%= t('.heading') %></h2>
|
3
|
+
|
4
|
+
<% if collection.any? %>
|
5
|
+
<ul class="list-of-entities">
|
6
|
+
<% collection.each do |entity| %>
|
7
|
+
<li data-id="<%= entity.id %>">
|
8
|
+
<%=
|
9
|
+
render(
|
10
|
+
partial: 'admin/components/privileges/component_user',
|
11
|
+
locals: {
|
12
|
+
handler: handler,
|
13
|
+
entity: entity
|
14
|
+
}
|
15
|
+
)
|
16
|
+
%>
|
17
|
+
</li>
|
18
|
+
<% end %>
|
19
|
+
</ul>
|
20
|
+
<% else %>
|
21
|
+
<%= render 'shared/nothing_found' %>
|
22
|
+
<% end %>
|
23
|
+
</section>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
json.data do
|
2
|
+
json.id @entity.id
|
3
|
+
json.type @entity.class.table_name
|
4
|
+
json.attributes do
|
5
|
+
json.call(@entity, :user_id, :data)
|
6
|
+
end
|
7
|
+
json.relationships do
|
8
|
+
json.user do
|
9
|
+
json.data do
|
10
|
+
json.id @entity.user.id
|
11
|
+
json.type @entity.user.class.table_name
|
12
|
+
json.attributes do
|
13
|
+
json.call(@entity.user, :screen_name)
|
14
|
+
end
|
15
|
+
json.meta do
|
16
|
+
json.full_name @entity.user.full_name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% content_for :meta_title, t('.title') %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<span><%= t('admin.editable_pages.nav_item.text') %></span>
|
4
5
|
<% end %>
|
5
6
|
|
6
7
|
<article>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', name: @entity.name) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
3
4
|
<%= link_to(t('admin.editable_pages.nav_item.text'), admin_editable_pages_path) %>
|
4
5
|
<span><%= @entity.name %></span>
|
5
6
|
<% end %>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', page: current_page) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<span><%= t('admin.feedback_requests.nav_item.text') %></span>
|
4
5
|
<% end %>
|
5
6
|
|
6
7
|
<article>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', page: current_page) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<span><%= t('admin.foreign_users.nav_item.text') %></span>
|
4
5
|
<% end %>
|
5
6
|
|
6
7
|
<article>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', slug: @entity.long_slug) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
3
4
|
<%= link_to(t('admin.foreign_users.nav_item.text'), admin_foreign_users_path) %>
|
4
5
|
<span><%= @entity.long_slug %></span>
|
5
6
|
<% end %>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', page: current_page) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<span><%= t('admin.login_attempts.nav_item.text') %></span>
|
4
5
|
<% end %>
|
5
6
|
|
6
7
|
<article>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% content_for :meta_title, t('.title') %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<span><%= t('admin.simple_blocks.nav_item.text') %></span>
|
4
5
|
<% end %>
|
5
6
|
|
6
7
|
<article>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', slug: @entity.slug) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
3
4
|
<%= link_to(t('admin.simple_blocks.nav_item.text'), admin_simple_blocks_path) %>
|
4
5
|
<span><%= @entity.name %></span>
|
5
6
|
<% end %>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', page: current_page) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<span><%= t('admin.tokens.nav_item.text') %></span>
|
4
5
|
<% end %>
|
5
6
|
|
6
7
|
<article>
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', id: @entity.id) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
4
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<%= link_to t('admin.tokens.nav_item.text'), admin_tokens_path %>
|
5
|
+
<span><%= @entity.name %></span>
|
5
6
|
<% end %>
|
6
7
|
|
7
8
|
<article>
|
@@ -39,5 +40,13 @@
|
|
39
40
|
<% end %>
|
40
41
|
</dl>
|
41
42
|
|
42
|
-
<%=
|
43
|
+
<%=
|
44
|
+
render(
|
45
|
+
partial: 'shared/admin/toggleable',
|
46
|
+
locals: {
|
47
|
+
entity: @entity,
|
48
|
+
url: toggle_admin_token_path(id: @entity.id)
|
49
|
+
}
|
50
|
+
)
|
51
|
+
%>
|
43
52
|
</article>
|
@@ -1,8 +1,9 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', user: @entity.screen_name, page: current_page) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<%= link_to(t('admin.users.nav_item.text'), admin_users_path) %>
|
5
|
+
<%= admin_user_link(@entity) %>
|
6
|
+
<span><%= t('.heading') %></span>
|
6
7
|
<% end %>
|
7
8
|
|
8
9
|
<article>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', page: current_page) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<span><%= t('admin.users.nav_item.text') %></span>
|
4
5
|
<% end %>
|
5
6
|
|
6
7
|
<article>
|
@@ -1,12 +1,14 @@
|
|
1
|
-
json.data do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
json.name user.data.dig('profile', 'name')
|
7
|
-
end
|
8
|
-
else
|
9
|
-
json.users []
|
1
|
+
json.data @collection do |entity|
|
2
|
+
json.id entity.id
|
3
|
+
json.type entity.class.table_name
|
4
|
+
json.attributes do
|
5
|
+
json.call(entity, :slug, :email)
|
10
6
|
end
|
7
|
+
json.meta do
|
8
|
+
json.name entity.full_name
|
9
|
+
end
|
10
|
+
end
|
11
|
+
json.meta do
|
11
12
|
json.html render(partial: 'admin/users/search/results', formats: [:html], locals: { collection: @collection })
|
13
|
+
json.count t(:user_count, count: @collection.count)
|
12
14
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', name: @entity.profile_name) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
3
4
|
<%= link_to(t('admin.users.nav_item.text'), admin_users_path) %>
|
4
5
|
<span><%= @entity.profile_name %></span>
|
5
6
|
<% end %>
|
@@ -13,22 +14,27 @@
|
|
13
14
|
<li><%= back_icon(admin_users_path) %></li>
|
14
15
|
<% unless @entity.deleted? %>
|
15
16
|
<li><%= world_icon(user_profile_path(slug: @entity.slug)) %></li>
|
16
|
-
|
17
|
+
<% if component_handler.allow?('edit') %>
|
18
|
+
<li><%= edit_icon(edit_user_path(id: @entity.id)) %></li>
|
19
|
+
<% end %>
|
17
20
|
<% end %>
|
18
21
|
</ul>
|
19
22
|
|
20
23
|
<nav>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
<% if component_handler.administrator? %>
|
25
|
+
<%= link_to(t('admin.tokens.index.heading'), tokens_admin_user_path(id: @entity.id), class: 'button-nav') %>
|
26
|
+
<% end %>
|
27
|
+
<% if component_handler.allow?('manage_codes') %>
|
28
|
+
<%= link_to(t('admin.codes.index.heading'), codes_admin_user_path(id: @entity.id), class: 'button-nav') %>
|
29
|
+
<% end %>
|
24
30
|
<%= render partial: 'admin/users/entity/custom_nav', locals: { entity: @entity } %>
|
25
|
-
<%
|
31
|
+
<% if current_user.super_user? && @entity != current_user %>
|
26
32
|
<%=
|
27
33
|
link_to(
|
28
34
|
t('.authenticate'),
|
29
35
|
authenticate_admin_user_path(id: @entity.id),
|
30
36
|
method: :post,
|
31
|
-
class:
|
37
|
+
class: 'button-action'
|
32
38
|
)
|
33
39
|
%>
|
34
40
|
<% end %>
|
@@ -1,8 +1,9 @@
|
|
1
1
|
<% content_for :meta_title, t('.title', user: @entity.screen_name, page: current_page) %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<%= link_to(t('admin.users.nav_item.text'), admin_users_path) %>
|
5
|
+
<%= admin_user_link(@entity) %>
|
6
|
+
<span><%= t('.heading') %></span>
|
6
7
|
<% end %>
|
7
8
|
|
8
9
|
<article>
|
@@ -1,8 +1,9 @@
|
|
1
1
|
<% content_for :meta_title, t('.title') %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<%= link_to(t('admin.codes.nav_item.text'), admin_codes_path) %>
|
5
|
+
<%= admin_code_link(@entity) %>
|
6
|
+
<span><%= t(:edit) %></span>
|
6
7
|
<% end %>
|
7
8
|
|
8
9
|
<article>
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<% content_for :meta_title, t('.title') %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
4
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<%= link_to(t('admin.codes.nav_item.text'), admin_codes_path) %>
|
5
|
+
<span><%= t(:create) %></span>
|
5
6
|
<% end %>
|
6
7
|
|
7
8
|
<article>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<% content_for :meta_title, t('.title') %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
3
4
|
<%= link_to(t('admin.editable_pages.nav_item.text'), admin_editable_pages_path) %>
|
4
5
|
<%= admin_editable_page_link(@entity) %>
|
5
6
|
<span><%= t('.nav_text') %></span>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<% content_for :meta_title, t('.title') %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
3
4
|
<%= link_to(t('admin.editable_pages.nav_item.text'), admin_editable_pages_path) %>
|
4
5
|
<span><%= t('.nav_text') %></span>
|
5
6
|
<% end %>
|
@@ -1,9 +1,13 @@
|
|
1
1
|
<% unless entity.created_at.nil? %>
|
2
|
-
<
|
3
|
-
|
2
|
+
<div>
|
3
|
+
<dt><%= t(:created_at) %></dt>
|
4
|
+
<dd><%= time_tag(entity.created_at) %></dd>
|
5
|
+
</div>
|
4
6
|
<% end %>
|
5
7
|
|
6
8
|
<% unless entity.updated_at.nil? %>
|
7
|
-
<
|
8
|
-
|
9
|
+
<div>
|
10
|
+
<dt><%= t(:updated_at) %></dt>
|
11
|
+
<dd><%= time_tag(entity.updated_at) %></dd>
|
12
|
+
</div>
|
9
13
|
<% end %>
|
@@ -1,51 +1,57 @@
|
|
1
1
|
<% model_name = f.object.class.to_s.underscore %>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
2
|
+
<div>
|
3
|
+
<dt><%= f.label :meta_title %></dt>
|
4
|
+
<dd>
|
5
|
+
<%=
|
6
|
+
f.text_field(
|
7
|
+
:meta_title,
|
8
|
+
id: "#{model_name}_meta_title",
|
9
|
+
size: nil,
|
10
|
+
maxlength: 250,
|
11
|
+
data: {
|
12
|
+
check: :meta_title
|
13
|
+
}
|
14
|
+
)
|
15
|
+
%>
|
16
|
+
<div class="check-result-error" data-field="meta_title"></div>
|
17
|
+
<div class="guideline"><%= t('.guidelines.meta_title') %></div>
|
18
|
+
</dd>
|
19
|
+
</div>
|
18
20
|
|
19
|
-
<
|
20
|
-
<
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
21
|
+
<div>
|
22
|
+
<dt><%= f.label :meta_description %></dt>
|
23
|
+
<dd>
|
24
|
+
<%=
|
25
|
+
f.text_field(
|
26
|
+
:meta_description,
|
27
|
+
id: "#{model_name}_meta_description",
|
28
|
+
size: nil,
|
29
|
+
maxlength: 500,
|
30
|
+
data: {
|
31
|
+
check: :meta_description
|
32
|
+
}
|
33
|
+
)
|
34
|
+
%>
|
35
|
+
<div class="check-result-error" data-field="meta_description"></div>
|
36
|
+
<div class="guideline"><%= t('.guidelines.meta_description') %></div>
|
37
|
+
</dd>
|
38
|
+
</div>
|
35
39
|
|
36
|
-
<
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
40
|
+
<div>
|
41
|
+
<dt><%= f.label :meta_keywords %></dt>
|
42
|
+
<dd>
|
43
|
+
<%=
|
44
|
+
f.text_field(
|
45
|
+
:meta_keywords,
|
46
|
+
id: "#{model_name}_meta_keywords",
|
47
|
+
size: nil,
|
48
|
+
maxlength: 250,
|
49
|
+
data: {
|
50
|
+
check: :meta_keywords
|
51
|
+
}
|
52
|
+
)
|
53
|
+
%>
|
54
|
+
<div class="check-result-error" data-field="meta_keywords"></div>
|
55
|
+
<div class="guideline"><%= t('.guidelines.meta_keywords') %></div>
|
56
|
+
</dd>
|
57
|
+
</div>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<% content_for :meta_title, t('.title') %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
3
4
|
<%= link_to(t('admin.simple_blocks.nav_item.text'), admin_simple_blocks_path) %>
|
4
5
|
<%= admin_simple_block_link(@entity) %>
|
5
6
|
<span><%= t('.nav_text') %></span>
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<% content_for :meta_title, t('.title') %>
|
2
2
|
<% content_for :breadcrumbs do %>
|
3
|
-
|
4
|
-
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<%= link_to(t('admin.simple_blocks.nav_item.text'), admin_simple_blocks_path) %>
|
5
|
+
<span><%= t('.nav_text') %></span>
|
5
6
|
<% end %>
|
6
7
|
|
7
8
|
<article>
|