biovision-base 0.37.190607.0 → 0.39.190804.1
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/components/content.svg +20 -0
- data/app/assets/images/biovision/base/icons/components/users.svg +21 -0
- data/app/assets/javascripts/biovision/base/biovision.js +68 -108
- data/app/assets/stylesheets/biovision/base/admin/components.scss +85 -95
- data/app/assets/stylesheets/biovision/base/admin.scss +0 -36
- data/app/assets/stylesheets/biovision/base/biovision.scss +49 -0
- data/app/assets/stylesheets/biovision/base/default.scss +1 -0
- data/app/assets/stylesheets/biovision/base/default_admin.scss +1 -0
- data/app/controllers/admin/components_controller.rb +60 -0
- data/app/controllers/feedback_requests_controller.rb +1 -1
- data/app/helpers/biovision_components_helper.rb +11 -0
- data/app/mailers/feedback_mailer.rb +1 -1
- data/app/models/biovision_component.rb +21 -4
- data/app/models/biovision_component_user.rb +17 -0
- data/app/models/feedback_request.rb +25 -4
- data/app/models/metric.rb +39 -4
- data/app/models/metric_value.rb +12 -5
- data/app/models/user.rb +1 -2
- data/app/services/biovision/components/base_component.rb +65 -11
- data/app/services/biovision/components/contact_component.rb +24 -0
- data/app/services/biovision/components/content_component.rb +12 -0
- data/app/services/biovision/components/registration_component.rb +12 -6
- data/app/services/biovision/components/users_component.rb +12 -0
- data/app/views/admin/components/entity/_links.html.erb +20 -0
- data/app/views/admin/{settings → components}/index.html.erb +5 -5
- data/app/views/admin/components/links/_contact.html.erb +1 -0
- data/app/views/admin/components/links/_content.html.erb +2 -0
- data/app/views/admin/components/links/_users.html.erb +7 -0
- data/app/views/admin/components/settings/_new_parameter.html.erb +46 -0
- data/app/views/admin/components/settings/_parameters.html.erb +20 -0
- data/app/views/admin/{settings/component → components/settings}/_setting.html.erb +0 -0
- data/app/views/admin/{settings/component → components/settings}/_settings.html.erb +2 -2
- data/app/views/admin/components/settings.html.erb +44 -0
- data/app/views/admin/components/show.html.erb +22 -0
- data/app/views/admin/feedback_requests/entity/_in_list.html.erb +12 -1
- data/app/views/admin/index/_components.html.erb +17 -8
- data/app/views/admin/index/index.html.erb +8 -2
- data/app/views/admin/users/entity/_in_list.html.erb +8 -0
- data/app/views/admin/users/entity/in_list/_additional_data.html.erb +0 -0
- data/app/views/admin/users/show.html.erb +9 -1
- data/app/views/authentication/_form.html.erb +4 -1
- data/app/views/editable_pages/entity/_content.html.erb +1 -0
- data/app/views/feedback_requests/_form.html.erb +19 -8
- data/app/views/layouts/admin/_footer.html.erb +2 -2
- data/app/views/shared/entity/_metadata.html.erb +1 -1
- data/app/views/users/_form.html.erb +9 -1
- data/config/locales/common-en.yml +1 -1
- data/config/locales/common-ru.yml +1 -1
- data/config/locales/common-sv.yml +1 -1
- data/config/locales/components-en.yml +36 -0
- data/config/locales/components-ru.yml +19 -16
- data/config/locales/components-sv.yml +36 -0
- data/config/routes.rb +8 -6
- data/db/migrate/20181217000000_create_biovision_components.rb +15 -3
- data/db/migrate/20181217000200_create_feedback_requests.rb +1 -0
- data/db/migrate/20190326120000_create_simple_blocks.rb +3 -1
- data/db/migrate/20190610141414_add_user_to_feedback_requests.rb +14 -0
- data/db/migrate/20190730000000_create_biovision_component_users.rb +24 -0
- data/db/migrate/20190731222222_add_biovision_component_to_metrics.rb +14 -0
- data/db/migrate/20190801111111_add_components.rb +27 -0
- data/db/{migrate → obsolete_migrations}/20181217121211_add_uuid_to_users.rb +0 -0
- data/db/{migrate → obsolete_migrations}/20181217121212_update_fields181217.rb +0 -0
- data/db/{migrate → obsolete_migrations}/20190311121212_convert_json_columns.rb +0 -0
- data/lib/biovision/base/version.rb +1 -1
- metadata +42 -24
- data/app/controllers/admin/settings_controller.rb +0 -47
- data/app/views/admin/index/_biovision_base.html.erb +0 -9
- data/app/views/admin/index/dashboard/_biovision_feedback.html.erb +0 -9
- data/app/views/admin/index/dashboard/_biovision_links.html.erb +0 -11
- data/app/views/admin/index/dashboard/_biovision_track.html.erb +0 -8
- data/app/views/admin/index/dashboard/_biovision_user.html.erb +0 -14
- data/app/views/admin/index/dashboard/_editorial.html.erb +0 -11
- data/app/views/admin/index/dashboard/_settings.html.erb +0 -9
- data/app/views/admin/settings/component/_new_parameter.html.erb +0 -54
- data/app/views/admin/settings/component/_parameters.html.erb +0 -37
- data/app/views/admin/settings/show.html.erb +0 -42
@@ -1,9 +1,18 @@
|
|
1
|
-
<section>
|
2
|
-
|
3
|
-
<%
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
<section class="biovision-components-index">
|
2
|
+
<% collection.each do |component| %>
|
3
|
+
<%
|
4
|
+
handler = Biovision::Components::BaseComponent.handler(component, current_user)
|
5
|
+
next unless handler.allow?
|
6
|
+
%>
|
7
|
+
<section class="<%= component.slug %>">
|
8
|
+
<h2><%= handler.name %></h2>
|
9
|
+
|
10
|
+
<%=
|
11
|
+
render(
|
12
|
+
partial: 'admin/components/entity/links',
|
13
|
+
locals: { handler: handler }
|
14
|
+
)
|
15
|
+
%>
|
16
|
+
</section>
|
17
|
+
<% end %>
|
9
18
|
</section>
|
@@ -3,10 +3,16 @@
|
|
3
3
|
<article>
|
4
4
|
<h1><%= t('.heading') %></h1>
|
5
5
|
|
6
|
-
<%=
|
6
|
+
<%=
|
7
|
+
render(
|
8
|
+
partial: 'admin/index/components',
|
9
|
+
locals: {
|
10
|
+
collection: BiovisionComponent.list_for_administration
|
11
|
+
}
|
12
|
+
)
|
13
|
+
%>
|
7
14
|
|
8
15
|
<div class="dashboard">
|
9
|
-
<%= render 'admin/index/biovision_base' %>
|
10
16
|
<%= render 'admin/index/custom_dashboard' %>
|
11
17
|
</div>
|
12
18
|
</article>
|
File without changes
|
@@ -68,7 +68,15 @@
|
|
68
68
|
<dt><%= t('activerecord.attributes.user.balance') %></dt>
|
69
69
|
<dd><%= @entity.balance %></dd>
|
70
70
|
|
71
|
-
<%=
|
71
|
+
<%=
|
72
|
+
render(
|
73
|
+
partial: 'admin/users/entity/profile',
|
74
|
+
locals: {
|
75
|
+
data: @entity.data['profile'],
|
76
|
+
entity: @entity
|
77
|
+
}
|
78
|
+
)
|
79
|
+
%>
|
72
80
|
|
73
81
|
<% unless @entity.ip.blank? %>
|
74
82
|
<dt><%= t('activerecord.attributes.user.ip') %></dt>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
<% component = Biovision::Components::BaseComponent.handler(:registration, current_user) %>
|
1
2
|
<%= form_with url: login_path, local: true, html: { class: 'login' } do %>
|
2
3
|
<div class="fields">
|
3
4
|
<div>
|
@@ -11,6 +12,8 @@
|
|
11
12
|
</div>
|
12
13
|
<div class="actions">
|
13
14
|
<%= button_tag t('.log_in'), type: 'submit', class: 'button-action' %>
|
14
|
-
|
15
|
+
<% if component.settings['open'] %>
|
16
|
+
<%= link_to t('my.profiles.new.title'), new_my_profile_path, class: 'button-nav' %>
|
17
|
+
<% end %>
|
15
18
|
</div>
|
16
19
|
<% end %>
|
@@ -2,6 +2,7 @@
|
|
2
2
|
prefix ||= 'feedback_request'
|
3
3
|
form_id ||= "#{prefix}-form"
|
4
4
|
entity ||= FeedbackRequest.new
|
5
|
+
required_fields ||= %i[name phone email comment]
|
5
6
|
%>
|
6
7
|
<%=
|
7
8
|
form_with(
|
@@ -13,7 +14,7 @@
|
|
13
14
|
) do |f|
|
14
15
|
%>
|
15
16
|
<div class="fields state-1">
|
16
|
-
<div class="name">
|
17
|
+
<div class="name <%= required_fields.include?(:name) ? 'required' : '' %>">
|
17
18
|
<%=
|
18
19
|
f.text_field(
|
19
20
|
:name,
|
@@ -24,12 +25,13 @@
|
|
24
25
|
aria: {
|
25
26
|
label: t('activerecord.attributes.feedback_request.name')
|
26
27
|
},
|
27
|
-
required:
|
28
|
+
required: required_fields.include?(:name)
|
28
29
|
)
|
29
30
|
%>
|
31
|
+
<span class="icon"></span>
|
30
32
|
</div>
|
31
33
|
<% unless local_assigns[:hide_phone] %>
|
32
|
-
<div class="phone">
|
34
|
+
<div class="phone <%= required_fields.include?(:phone) ? 'required' : '' %>">
|
33
35
|
<%=
|
34
36
|
f.phone_field(
|
35
37
|
:phone,
|
@@ -40,13 +42,14 @@
|
|
40
42
|
aria: {
|
41
43
|
label: t('activerecord.attributes.feedback_request.phone')
|
42
44
|
},
|
43
|
-
required:
|
45
|
+
required: required_fields.include?(:phone)
|
44
46
|
)
|
45
47
|
%>
|
48
|
+
<span class="icon"></span>
|
46
49
|
</div>
|
47
50
|
<% end %>
|
48
51
|
<% unless local_assigns[:hide_email] %>
|
49
|
-
<div class="email">
|
52
|
+
<div class="email <%= required_fields.include?(:email) ? 'required' : '' %>">
|
50
53
|
<%=
|
51
54
|
f.email_field(
|
52
55
|
:email,
|
@@ -57,13 +60,14 @@
|
|
57
60
|
aria: {
|
58
61
|
label: t('activerecord.attributes.feedback_request.email')
|
59
62
|
},
|
60
|
-
required:
|
63
|
+
required: required_fields.include?(:email)
|
61
64
|
)
|
62
65
|
%>
|
66
|
+
<span class="icon"></span>
|
63
67
|
</div>
|
64
68
|
<% end %>
|
65
69
|
<% unless local_assigns[:hide_comment] %>
|
66
|
-
<div class="comment">
|
70
|
+
<div class="comment <%= required_fields.include?(:comment) ? 'required' : '' %>">
|
67
71
|
<%= f.text_area(
|
68
72
|
:comment,
|
69
73
|
id: "#{prefix}_comment",
|
@@ -73,9 +77,16 @@
|
|
73
77
|
placeholder: t('activerecord.attributes.feedback_request.comment'),
|
74
78
|
aria: {
|
75
79
|
label: t('activerecord.attributes.feedback_request.comment')
|
76
|
-
}
|
80
|
+
},
|
81
|
+
class: 'auto-expand',
|
82
|
+
data: {
|
83
|
+
min_rows: 5,
|
84
|
+
max_rows: 20
|
85
|
+
},
|
86
|
+
required: required_fields.include?(:comment)
|
77
87
|
)
|
78
88
|
%>
|
89
|
+
<span class="icon"></span>
|
79
90
|
</div>
|
80
91
|
<% end %>
|
81
92
|
<div class="consent">
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% content_for(:meta_title, entity.meta_title) unless entity.meta_title.blank? %>
|
3
3
|
<% content_for(:meta_keywords, entity.meta_keywords) unless entity.meta_keywords.blank? %>
|
4
4
|
<% content_for(:meta_description, entity.meta_description) unless entity.meta_description.blank? %>
|
5
|
-
<%
|
5
|
+
<% if entity.respond_to?(:image) && !entity.image.blank? %>
|
6
6
|
<% content_for :meta_image, (request.protocol + request.host_with_port + entity.image.url) %>
|
7
7
|
<% content_for :meta_image_alt, entity.image_alt_text if entity.respond_to?(:image_alt_text) %>
|
8
8
|
<% end %>
|
@@ -111,7 +111,15 @@
|
|
111
111
|
</dd>
|
112
112
|
<% end %>
|
113
113
|
|
114
|
-
<%=
|
114
|
+
<%=
|
115
|
+
render(
|
116
|
+
partial: 'users/form/profile_data',
|
117
|
+
locals: {
|
118
|
+
data: entity.data['profile'].to_h,
|
119
|
+
entity: entity
|
120
|
+
}
|
121
|
+
)
|
122
|
+
%>
|
115
123
|
|
116
124
|
<dt><%= f.label :notice %></dt>
|
117
125
|
<dd>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
en:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
biovision_component: "Component"
|
5
|
+
biovision_parameter: "Parameter"
|
6
|
+
attributes:
|
7
|
+
biovision_component:
|
8
|
+
slug: "Slug"
|
9
|
+
admin:
|
10
|
+
components:
|
11
|
+
index:
|
12
|
+
title: "Компоненты"
|
13
|
+
nav_text: "Компоненты"
|
14
|
+
heading: "Компоненты"
|
15
|
+
show:
|
16
|
+
title: "Компонент %{slug}"
|
17
|
+
biovision:
|
18
|
+
components:
|
19
|
+
contact:
|
20
|
+
name: "Контакты"
|
21
|
+
parameters:
|
22
|
+
feedback_receiver: "На этот адрес приходят сообщения из формы обратной связи"
|
23
|
+
email: "Этот адрес отображается в контактной информации"
|
24
|
+
phone: "Этот телефон отображается в контактной информации"
|
25
|
+
address: "Этот адрес отображается в контактной информации"
|
26
|
+
registration:
|
27
|
+
name: "Регистрация"
|
28
|
+
settings:
|
29
|
+
confirm_email: "Отправлять письмо для подтверждения почты сразу"
|
30
|
+
email_as_login: "Использовать электронную почту в качестве логина"
|
31
|
+
invite_count: "Количество кодов приглашения после регистрации"
|
32
|
+
invite_only: "Только по приглашениям"
|
33
|
+
open: "Открыта"
|
34
|
+
require_email: "Электронная почта обязательна при регистрации"
|
35
|
+
use_invites: "Использовать приглашения"
|
36
|
+
invalid_code: "is invalid"
|
@@ -7,36 +7,37 @@ ru:
|
|
7
7
|
biovision_component:
|
8
8
|
slug: "Идентификатор"
|
9
9
|
admin:
|
10
|
-
|
10
|
+
components:
|
11
11
|
index:
|
12
|
-
|
13
|
-
nav_text: "
|
14
|
-
|
12
|
+
title: "Компоненты"
|
13
|
+
nav_text: "Компоненты"
|
14
|
+
heading: "Компоненты"
|
15
15
|
show:
|
16
|
-
title: "
|
17
|
-
|
16
|
+
title: "Компонент %{slug}"
|
17
|
+
settings:
|
18
|
+
nav_text: "Настройки"
|
19
|
+
title: "Настройки компонента «%{slug}»"
|
18
20
|
settings:
|
19
21
|
heading: "Настройки"
|
20
22
|
parameters:
|
21
23
|
heading: "Параметры"
|
22
24
|
new_parameter:
|
23
|
-
heading: "
|
25
|
+
heading: "Добавить параметр"
|
26
|
+
parameter_slug: "Идентификатор"
|
27
|
+
parameter_value: "Значение"
|
24
28
|
guidelines:
|
25
29
|
slug: "Только латинские буквы, цифры, дефис и подчёркивание (кроме начала и конца)."
|
26
30
|
value: "Произвольная строка"
|
27
|
-
|
28
|
-
|
29
|
-
update:
|
30
|
-
success: "Настройки компонента обновлены"
|
31
|
+
update_settings:
|
32
|
+
success: "Настройки компонента успешно изменены"
|
31
33
|
biovision:
|
32
34
|
components:
|
33
35
|
contact:
|
34
36
|
name: "Контакты"
|
35
|
-
|
36
|
-
feedback_receiver: "
|
37
|
-
|
38
|
-
|
39
|
-
address: "Этот адрес отображается в контактной информации"
|
37
|
+
settings:
|
38
|
+
feedback_receiver: "Адрес для сообщений через форму обратной связи"
|
39
|
+
content:
|
40
|
+
name: "Контент"
|
40
41
|
registration:
|
41
42
|
name: "Регистрация"
|
42
43
|
settings:
|
@@ -48,3 +49,5 @@ ru:
|
|
48
49
|
require_email: "Электронная почта обязательна при регистрации"
|
49
50
|
use_invites: "Использовать приглашения"
|
50
51
|
invalid_code: "указан неверно"
|
52
|
+
users:
|
53
|
+
name: "Пользователи"
|
@@ -0,0 +1,36 @@
|
|
1
|
+
sv:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
biovision_component: "Component"
|
5
|
+
biovision_parameter: "Parameter"
|
6
|
+
attributes:
|
7
|
+
biovision_component:
|
8
|
+
slug: "Slug"
|
9
|
+
admin:
|
10
|
+
components:
|
11
|
+
index:
|
12
|
+
title: "Компоненты"
|
13
|
+
nav_text: "Компоненты"
|
14
|
+
heading: "Компоненты"
|
15
|
+
show:
|
16
|
+
title: "Компонент %{slug}"
|
17
|
+
biovision:
|
18
|
+
components:
|
19
|
+
contact:
|
20
|
+
name: "Контакты"
|
21
|
+
parameters:
|
22
|
+
feedback_receiver: "На этот адрес приходят сообщения из формы обратной связи"
|
23
|
+
email: "Этот адрес отображается в контактной информации"
|
24
|
+
phone: "Этот телефон отображается в контактной информации"
|
25
|
+
address: "Этот адрес отображается в контактной информации"
|
26
|
+
registration:
|
27
|
+
name: "Регистрация"
|
28
|
+
settings:
|
29
|
+
confirm_email: "Отправлять письмо для подтверждения почты сразу"
|
30
|
+
email_as_login: "Использовать электронную почту в качестве логина"
|
31
|
+
invite_count: "Количество кодов приглашения после регистрации"
|
32
|
+
invite_only: "Только по приглашениям"
|
33
|
+
open: "Открыта"
|
34
|
+
require_email: "Электронная почта обязательна при регистрации"
|
35
|
+
use_invites: "Использовать приглашения"
|
36
|
+
invalid_code: "is invalid"
|
data/config/routes.rb
CHANGED
@@ -77,12 +77,14 @@ Rails.application.routes.draw do
|
|
77
77
|
namespace :admin do
|
78
78
|
get '/' => 'index#index'
|
79
79
|
|
80
|
-
scope :
|
81
|
-
get '/' => :index, as: :
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
80
|
+
scope :components, controller: :components do
|
81
|
+
get '/' => :index, as: :components
|
82
|
+
scope ':slug' do
|
83
|
+
get '/' => :show, as: :component
|
84
|
+
get 'settings' => :settings, as: :component_settings
|
85
|
+
patch 'settings' => :update_settings, as: nil
|
86
|
+
patch 'parameters' => :update_parameter, as: :component_parameters
|
87
|
+
end
|
86
88
|
end
|
87
89
|
|
88
90
|
resources :agents, :browsers, only: %i[index show], concerns: %i[lock toggle]
|
@@ -28,7 +28,8 @@ class CreateBiovisionComponents < ActiveRecord::Migration[5.2]
|
|
28
28
|
def seed_items
|
29
29
|
create_registration_component
|
30
30
|
create_contact_component
|
31
|
-
|
31
|
+
create_users_component
|
32
|
+
create_content_component
|
32
33
|
end
|
33
34
|
|
34
35
|
def create_registration_component
|
@@ -46,12 +47,23 @@ class CreateBiovisionComponents < ActiveRecord::Migration[5.2]
|
|
46
47
|
|
47
48
|
def create_contact_component
|
48
49
|
parameters = {
|
49
|
-
feedback_receiver: 'info@example.com',
|
50
50
|
email: 'info@example.com',
|
51
51
|
phone: '',
|
52
52
|
address: ''
|
53
53
|
}
|
54
54
|
|
55
|
-
|
55
|
+
settings = {
|
56
|
+
feedback_receiver: 'info@example.com'
|
57
|
+
}
|
58
|
+
|
59
|
+
BiovisionComponent.create!(slug: 'contact', parameters: parameters, settings: settings)
|
60
|
+
end
|
61
|
+
|
62
|
+
def create_users_component
|
63
|
+
BiovisionComponent.create!(slug: 'users')
|
64
|
+
end
|
65
|
+
|
66
|
+
def create_content_component
|
67
|
+
BiovisionComponent.create!(slug: 'content')
|
56
68
|
end
|
57
69
|
end
|