biovision-base 0.17.180619 → 0.19.180703.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/biovision/base/icons/back.svg +18 -27
  3. data/app/assets/images/biovision/base/icons/create.svg +19 -1
  4. data/app/assets/images/biovision/base/icons/destroy.svg +8 -2
  5. data/app/assets/images/biovision/base/icons/gear.svg +9 -2
  6. data/app/assets/images/biovision/base/icons/lock-closed.svg +12 -1
  7. data/app/assets/images/biovision/base/icons/lock-open.svg +12 -1
  8. data/app/assets/images/biovision/base/icons/notice.svg +9 -1
  9. data/app/assets/images/biovision/base/icons/return.svg +25 -1
  10. data/app/assets/images/biovision/base/icons/warning.svg +31 -42
  11. data/app/assets/images/biovision/base/icons/world.svg +9 -2
  12. data/app/assets/images/biovision/base/placeholders/16x9.svg +5 -0
  13. data/app/assets/images/biovision/base/placeholders/3x2.svg +5 -0
  14. data/app/assets/javascripts/biovision/base/biovision.js +75 -17
  15. data/app/assets/stylesheets/biovision/base/admin.scss +1 -0
  16. data/app/assets/stylesheets/biovision/base/biovision.scss +10 -0
  17. data/app/controllers/admin/editable_blocks_controller.rb +27 -0
  18. data/app/controllers/admin/editable_pages_controller.rb +1 -1
  19. data/app/controllers/admin/link_block_items_controller.rb +23 -0
  20. data/app/controllers/admin/link_blocks_controller.rb +27 -0
  21. data/app/controllers/admin/privileges_controller.rb +0 -1
  22. data/app/controllers/concerns/removable_image.rb +33 -0
  23. data/app/controllers/editable_blocks_controller.rb +64 -0
  24. data/app/controllers/editable_pages_controller.rb +1 -1
  25. data/app/controllers/feedback_requests_controller.rb +1 -0
  26. data/app/controllers/link_block_items_controller.rb +68 -0
  27. data/app/controllers/link_blocks_controller.rb +64 -0
  28. data/app/helpers/editable_pages_helper.rb +19 -0
  29. data/app/helpers/link_blocks_helper.rb +18 -0
  30. data/app/models/editable_block.rb +49 -0
  31. data/app/models/link_block.rb +43 -0
  32. data/app/models/link_block_item.rb +81 -0
  33. data/app/models/privilege.rb +10 -2
  34. data/app/models/privilege_group.rb +5 -0
  35. data/app/models/user.rb +4 -0
  36. data/app/models/user_privilege.rb +8 -3
  37. data/app/services/user_profile_handler.rb +2 -2
  38. data/app/uploaders/editable_page_image_uploader.rb +5 -1
  39. data/app/uploaders/link_block_image_uploader.rb +17 -0
  40. data/app/views/admin/editable_blocks/_nav_item.html.erb +6 -0
  41. data/app/views/admin/editable_blocks/entity/_in_list.html.erb +29 -0
  42. data/app/views/admin/editable_blocks/index.html.erb +14 -0
  43. data/app/views/admin/editable_blocks/show.html.erb +72 -0
  44. data/app/views/admin/index/_biovision_base.html.erb +2 -1
  45. data/app/views/admin/index/dashboard/_biovision_links.html.erb +11 -0
  46. data/app/views/admin/index/dashboard/_editorial.html.erb +5 -6
  47. data/app/views/admin/link_block_items/entity/_in_list.html.erb +39 -0
  48. data/app/views/admin/link_block_items/show.html.erb +74 -0
  49. data/app/views/admin/link_blocks/_nav_item.html.erb +6 -0
  50. data/app/views/admin/link_blocks/entity/_in_list.html.erb +26 -0
  51. data/app/views/admin/link_blocks/entity/_items.html.erb +23 -0
  52. data/app/views/admin/link_blocks/index.html.erb +14 -0
  53. data/app/views/admin/link_blocks/show.html.erb +57 -0
  54. data/app/views/admin/metrics/show.html.erb +1 -1
  55. data/app/views/admin/privileges/entity/_groups.html.erb +1 -1
  56. data/app/views/admin/privileges/entity/_in_list.html.erb +8 -1
  57. data/app/views/admin/users/entity/_in_list.html.erb +3 -0
  58. data/app/views/admin/users/privileges.html.erb +3 -3
  59. data/app/views/editable_blocks/_entity.html.erb +36 -0
  60. data/app/views/editable_blocks/_form.html.erb +171 -0
  61. data/app/views/editable_blocks/edit.html.erb +17 -0
  62. data/app/views/editable_blocks/new.html.erb +15 -0
  63. data/app/views/link_block_items/_form.html.erb +158 -0
  64. data/app/views/link_block_items/_list.html.erb +32 -0
  65. data/app/views/link_block_items/edit.html.erb +18 -0
  66. data/app/views/link_block_items/new.html.erb +18 -0
  67. data/app/views/link_blocks/_entity.html.erb +34 -0
  68. data/app/views/link_blocks/_form.html.erb +97 -0
  69. data/app/views/link_blocks/edit.html.erb +17 -0
  70. data/app/views/link_blocks/new.html.erb +15 -0
  71. data/app/views/my/index/index/_dashboard.html.erb +1 -3
  72. data/app/views/privileges/_form.html.erb +2 -7
  73. data/app/views/shared/_counters.html.erb +3 -0
  74. data/app/views/shared/forms/_entity_flags.html.erb +5 -1
  75. data/app/views/shared/forms/_image_remover.html.erb +13 -0
  76. data/config/locales/common-en.yml +1 -0
  77. data/config/locales/common-ru.yml +1 -0
  78. data/config/locales/editable-pages-ru.yml +50 -0
  79. data/config/locales/links-ru.yml +95 -0
  80. data/config/locales/users-en.yml +1 -0
  81. data/config/locales/users-ru.yml +1 -0
  82. data/config/routes.rb +35 -0
  83. data/db/migrate/20170302000101_create_privileges.rb +1 -0
  84. data/db/migrate/20180622140000_create_link_blocks.rb +29 -0
  85. data/db/migrate/20180622140001_create_link_block_items.rb +23 -0
  86. data/db/migrate/20180627190000_create_editable_blocks.rb +39 -0
  87. data/db/migrate/20180703111111_add_fields_to_editable_blocks.rb +14 -0
  88. data/lib/biovision/base/version.rb +1 -1
  89. metadata +46 -2
@@ -0,0 +1,171 @@
1
+ <% model_name = entity.class.to_s.underscore %>
2
+ <%=
3
+ form_with(
4
+ model: entity,
5
+ html: {
6
+ id: "#{model_name}-form",
7
+ data: { check_url: check_editable_blocks_path }
8
+ }
9
+ ) do |f|
10
+ %>
11
+ <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
12
+
13
+ <dl>
14
+ <dt><%= f.label :language_id %></dt>
15
+ <dd><%= f.select :language_id, languages_for_select %></dd>
16
+
17
+ <dt><%= f.label :slug %></dt>
18
+ <dd>
19
+ <%=
20
+ f.text_field(
21
+ :slug,
22
+ id: "#{model_name}_slug",
23
+ size: nil,
24
+ maxlength: EditableBlock::SLUG_LIMIT,
25
+ pattern: EditableBlock::SLUG_PATTERN_HTML,
26
+ title: t('.guidelines.slug'),
27
+ required: true,
28
+ data: {
29
+ check: :slug
30
+ }
31
+ )
32
+ %>
33
+ <div class="check-result-error hidden" data-field="slug"></div>
34
+ <div class="guideline"><%= t('.guidelines.slug') %></div>
35
+ </dd>
36
+
37
+ <dt><%= f.label :name %></dt>
38
+ <dd>
39
+ <%=
40
+ f.text_field(
41
+ :name,
42
+ id: "#{model_name}_name",
43
+ size: nil,
44
+ maxlength: EditableBlock::TITLE_LIMIT,
45
+ required: true,
46
+ data: {
47
+ check: :name
48
+ }
49
+ )
50
+ %>
51
+ <div class="check-result-error hidden" data-field="name"></div>
52
+ <div class="guideline"><%= t('.guidelines.name') %></div>
53
+ </dd>
54
+
55
+ <dt><%= f.label :description %></dt>
56
+ <dd>
57
+ <%=
58
+ f.text_field(
59
+ :description,
60
+ id: "#{model_name}_description",
61
+ size: nil,
62
+ maxlength: EditableBlock::DESCRIPTION_LIMIT,
63
+ data: {
64
+ check: :description
65
+ }
66
+ )
67
+ %>
68
+ <div class="check-result-error hidden" data-field="description"></div>
69
+ <div class="guideline"><%= t('.guidelines.description') %></div>
70
+ </dd>
71
+
72
+ <dt><%= f.label :image %></dt>
73
+ <dd>
74
+ <figure class="preview" role="group" id="<%= model_name %>-image">
75
+ <% if entity.image.blank? %>
76
+ <%= f.label :image, image_tag('biovision/base/placeholders/16x9.svg') %>
77
+ <% else %>
78
+ <%= f.label :image, image_tag(entity.image.url) %>
79
+ <% end %>
80
+ <figcaption>
81
+ <%=
82
+ f.file_field(
83
+ :image,
84
+ id: "#{model_name}_image",
85
+ accept: 'image/jpeg,image/png',
86
+ data: { image: "#{model_name}-image" }
87
+ )
88
+ %>
89
+ </figcaption>
90
+ </figure>
91
+ <div class="guideline"><%= t('.guidelines.image') %></div>
92
+ </dd>
93
+
94
+ <dt><%= f.label :title %></dt>
95
+ <dd>
96
+ <%=
97
+ f.text_field(
98
+ :title,
99
+ id: "#{model_name}_title",
100
+ size: nil,
101
+ maxlength: EditableBlock::TITLE_LIMIT,
102
+ data: {
103
+ check: :title
104
+ }
105
+ )
106
+ %>
107
+ <div class="check-result-error hidden" data-field="title"></div>
108
+ <div class="guideline"><%= t('.guidelines.title') %></div>
109
+ </dd>
110
+
111
+ <dt><%= f.label :lead %></dt>
112
+ <dd>
113
+ <%=
114
+ f.text_area(
115
+ :lead,
116
+ id: "#{model_name}_lead",
117
+ cols: 80,
118
+ rows: 5,
119
+ max_length: EditableBlock::TEXT_LIMIT,
120
+ data: {
121
+ check: :lead
122
+ }
123
+ )
124
+ %>
125
+ <div class="check-result-error hidden" data-field="lead"></div>
126
+ <div class="guideline"><%= t('.guidelines.lead') %></div>
127
+ </dd>
128
+
129
+ <dt><%= f.label :body %></dt>
130
+ <dd>
131
+ <%=
132
+ f.text_area(
133
+ :body,
134
+ id: "#{model_name}_body",
135
+ cols: 80,
136
+ rows: 5,
137
+ max_length: EditableBlock::TEXT_LIMIT,
138
+ data: {
139
+ check: :body
140
+ }
141
+ )
142
+ %>
143
+ <div class="check-result-error hidden" data-field="body"></div>
144
+ <div class="guideline"><%= t('.guidelines.body') %></div>
145
+ </dd>
146
+
147
+ <dt><%= f.label :footer %></dt>
148
+ <dd>
149
+ <%=
150
+ f.text_area(
151
+ :footer,
152
+ id: "#{model_name}_footer",
153
+ cols: 80,
154
+ rows: 5,
155
+ max_length: EditableBlock::TEXT_LIMIT,
156
+ data: {
157
+ check: :footer
158
+ }
159
+ )
160
+ %>
161
+ <div class="check-result-error hidden" data-field="footer"></div>
162
+ <div class="guideline"><%= t('.guidelines.footer') %></div>
163
+ </dd>
164
+
165
+ <%= render(partial: 'shared/forms/entity_flags', locals: { f: f }) %>
166
+ </dl>
167
+
168
+ <div class="buttons">
169
+ <%= f.button t(:save), type: :submit, class: 'button-save' %>
170
+ </div>
171
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.editable_blocks.nav_item.text'), admin_editable_blocks_path) %>
4
+ <%= admin_editable_block_link(@entity) %>
5
+ <span><%= t('.nav_text') %></span>
6
+ <% end %>
7
+
8
+ <article>
9
+ <h1><%= t('.heading') %></h1>
10
+
11
+ <ul class="actions">
12
+ <li><%= return_icon(admin_editable_block_path(id: @entity.id)) %></li>
13
+ <li class="danger"><%= destroy_icon(@entity) %></li>
14
+ </ul>
15
+
16
+ <%= render partial: 'form', locals: { entity: @entity } %>
17
+ </article>
@@ -0,0 +1,15 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.editable_blocks.nav_item.text'), admin_editable_blocks_path) %>
4
+ <span><%= t('.nav_text') %></span>
5
+ <% end %>
6
+
7
+ <article>
8
+ <h1><%= t('.title') %></h1>
9
+
10
+ <ul class="actions">
11
+ <li><%= back_icon(admin_editable_blocks_path) %></li>
12
+ </ul>
13
+
14
+ <%= render partial: 'form', locals: { entity: @entity } %>
15
+ </article>
@@ -0,0 +1,158 @@
1
+ <% model_name = entity.class.to_s.underscore %>
2
+ <%=
3
+ form_with(
4
+ model: entity,
5
+ html: {
6
+ id: "#{model_name}-form",
7
+ data: { check_url: check_link_block_items_path }
8
+ }
9
+ ) do |f|
10
+ %>
11
+ <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
12
+
13
+ <dl>
14
+ <dt><%= f.label :priority %></dt>
15
+ <dd>
16
+ <%=
17
+ f.number_field(
18
+ :priority,
19
+ id: "#{model_name}_priority",
20
+ in: LinkBlockItem::PRIORITY_RANGE,
21
+ required: true
22
+ )
23
+ %>
24
+ </dd>
25
+
26
+ <dt><%= f.label :slug %></dt>
27
+ <dd>
28
+ <%=
29
+ f.text_field(
30
+ :slug,
31
+ id: "#{model_name}_slug",
32
+ size: nil,
33
+ maxlength: LinkBlockItem::SLUG_LIMIT,
34
+ data: {
35
+ check: :slug
36
+ }
37
+ )
38
+ %>
39
+ <div class="check-result-error hidden" data-field="slug"></div>
40
+ <div class="guideline"><%= t('.guidelines.slug') %></div>
41
+ </dd>
42
+
43
+ <dt><%= f.label :image %></dt>
44
+ <dd>
45
+ <figure class="preview" role="group" id="<%= model_name %>-image">
46
+ <% if entity.image.blank? %>
47
+ <%= f.label :image, image_tag('biovision/base/placeholders/image.svg') %>
48
+ <% else %>
49
+ <%= f.label :image, image_tag(entity.image.url) %>
50
+ <% end %>
51
+ <figcaption>
52
+ <%=
53
+ f.file_field(
54
+ :image,
55
+ id: "#{model_name}_image",
56
+ accept: 'image/jpeg,image/png,image/svg+xml',
57
+ data: { image: "#{model_name}-image" }
58
+ )
59
+ %>
60
+ </figcaption>
61
+ </figure>
62
+ <div class="guideline"><%= t('.guidelines.image') %></div>
63
+ </dd>
64
+
65
+ <dt><%= f.label :image_alt_text %></dt>
66
+ <dd>
67
+ <%=
68
+ f.text_field(
69
+ :image_alt_text,
70
+ id: "#{model_name}_image_alt_text",
71
+ size: nil,
72
+ maxlength: LinkBlockItem::META_LIMIT,
73
+ data: {
74
+ check: :image_alt_text
75
+ }
76
+ )
77
+ %>
78
+ <div class="check-result-error hidden" data-field="image_alt_text"></div>
79
+ <div class="guideline"><%= t('.guidelines.image_alt_text') %></div>
80
+ </dd>
81
+
82
+ <dt><%= f.label :title %></dt>
83
+ <dd>
84
+ <%=
85
+ f.text_field(
86
+ :title,
87
+ id: "#{model_name}_title",
88
+ size: nil,
89
+ maxlength: LinkBlockItem::TITLE_LIMIT,
90
+ data: {
91
+ check: :title
92
+ }
93
+ )
94
+ %>
95
+ <div class="check-result-error hidden" data-field="title"></div>
96
+ <div class="guideline"><%= t('.guidelines.title') %></div>
97
+ </dd>
98
+
99
+ <dt><%= f.label :body %></dt>
100
+ <dd>
101
+ <%=
102
+ f.text_area(
103
+ :body,
104
+ id: "#{model_name}_body",
105
+ cols: 80,
106
+ rows: 5,
107
+ data: {
108
+ check: :body
109
+ }
110
+ )
111
+ %>
112
+ <div class="check-result-error hidden" data-field="body"></div>
113
+ <div class="guideline"><%= t('.guidelines.body') %></div>
114
+ </dd>
115
+
116
+ <dt><%= f.label :button_text %></dt>
117
+ <dd>
118
+ <%=
119
+ f.text_field(
120
+ :button_text,
121
+ id: "#{model_name}_button_text",
122
+ size: nil,
123
+ maxlength: LinkBlockItem::BUTTON_TEXT_LIMIT,
124
+ data: {
125
+ check: :button_text
126
+ }
127
+ )
128
+ %>
129
+ <div class="check-result-error hidden" data-field="button_text"></div>
130
+ <div class="guideline"><%= t('.guidelines.button_text') %></div>
131
+ </dd>
132
+
133
+ <dt><%= f.label :button_url %></dt>
134
+ <dd>
135
+ <%=
136
+ f.text_field(
137
+ :button_url,
138
+ id: "#{model_name}_button_url",
139
+ size: nil,
140
+ maxlength: LinkBlockItem::URL_LIMIT,
141
+ data: {
142
+ check: :button_url
143
+ }
144
+ )
145
+ %>
146
+ <div class="check-result-error hidden" data-field="button_url"></div>
147
+ <div class="guideline"><%= t('.guidelines.button_url') %></div>
148
+ </dd>
149
+
150
+ <%= render partial: 'shared/forms/entity_flags', locals: { f: f } %>
151
+ </dl>
152
+
153
+ <div class="buttons">
154
+ <%= f.hidden_field :link_block_id if entity.id.nil? %>
155
+ <%= hidden_field_tag :entity_id, entity.id %>
156
+ <%= f.button t(:save), type: :submit, class: 'button-save' %>
157
+ </div>
158
+ <% end %>
@@ -0,0 +1,32 @@
1
+ <% if collection.any? %>
2
+ <ul class="items">
3
+ <% collection.each do |entity| %>
4
+ <li class="<%= entity.slug %>">
5
+ <% unless entity.image.blank? %>
6
+ <div class="image">
7
+ <%= link_block_image(entity) %>
8
+ </div>
9
+ <% end %>
10
+ <% unless entity.title.blank? %>
11
+ <div class="title"><%= entity.title %></div>
12
+ <% end %>
13
+ <% unless entity.body.blank? %>
14
+ <div class="body">
15
+ <%= simple_format(entity.body) %>
16
+ </div>
17
+ <% end %>
18
+ <% unless entity.button_url.blank? %>
19
+ <div class="item-button">
20
+ <%=
21
+ link_to(
22
+ entity.button_text.blank? ? t('.more') : entity.button_text,
23
+ entity.button_url,
24
+ class: 'button-nav'
25
+ )
26
+ %>
27
+ </div>
28
+ <% end %>
29
+ </li>
30
+ <% end %>
31
+ </ul>
32
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.link_blocks.nav_item.text'), admin_link_blocks_path) %>
4
+ <%= admin_link_block_link(@entity.link_block) %>
5
+ <%= admin_link_block_item_link(@entity) %>
6
+ <span><%= t('.nav_text') %></span>
7
+ <% end %>
8
+
9
+ <article>
10
+ <h1><%= t('.heading') %></h1>
11
+
12
+ <ul class="actions">
13
+ <li><%= return_icon(admin_link_block_item_path(id: @entity.id)) %></li>
14
+ <li class="danger"><%= destroy_icon(@entity) %></li>
15
+ </ul>
16
+
17
+ <%= render partial: 'form', locals: { entity: @entity } %>
18
+ </article>
@@ -0,0 +1,18 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.link_blocks.nav_item.text'), admin_link_blocks_path) %>
4
+ <% unless @entity.link_block.nil? %>
5
+ <%= admin_link_block_link(@entity.link_block) %>
6
+ <% end %>
7
+ <span><%= t('.nav_text') %></span>
8
+ <% end %>
9
+
10
+ <article>
11
+ <h1><%= t('.title') %></h1>
12
+
13
+ <ul class="actions">
14
+ <li><%= back_icon(admin_link_block_path(id: @entity.link_block_id)) %></li>
15
+ </ul>
16
+
17
+ <%= render partial: 'form', locals: { entity: @entity } %>
18
+ </article>
@@ -0,0 +1,34 @@
1
+ <% unless entity.nil? %>
2
+ <section id="link-block-<%= entity.slug %>" class="biovision-link-block">
3
+ <% unless entity.title.blank? %>
4
+ <h2><%= entity.title %></h2>
5
+ <% end %>
6
+
7
+ <% if entity.editable_by?(current_user) %>
8
+ <ul class="actions">
9
+ <li><%= gear_icon(admin_link_block_path(id: entity.id)) %></li>
10
+ </ul>
11
+ <% end %>
12
+
13
+ <% unless entity.lead.blank? %>
14
+ <div class="lead">
15
+ <%= simple_format(entity.lead) %>
16
+ </div>
17
+ <% end %>
18
+
19
+ <%=
20
+ render(
21
+ partial: 'link_block_items/list',
22
+ locals: {
23
+ collection: entity.link_block_items.list_for_visitors
24
+ }
25
+ )
26
+ %>
27
+
28
+ <% unless entity.footer_text.blank? %>
29
+ <footer>
30
+ <%= simple_format(entity.footer_text) %>
31
+ </footer>
32
+ <% end %>
33
+ </section>
34
+ <% end %>
@@ -0,0 +1,97 @@
1
+ <% model_name = entity.class.to_s.underscore %>
2
+ <%=
3
+ form_with(
4
+ model: entity,
5
+ html: {
6
+ id: "#{model_name}-form",
7
+ data: { check_url: check_link_blocks_path }
8
+ }
9
+ ) do |f|
10
+ %>
11
+ <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
12
+
13
+ <dl>
14
+ <dt><%= f.label :language_id %></dt>
15
+ <dd><%= f.select :language_id, languages_for_select %></dd>
16
+
17
+ <dt><%= f.label :slug %></dt>
18
+ <dd>
19
+ <%=
20
+ f.text_field(
21
+ :slug,
22
+ id: "#{model_name}_slug",
23
+ size: nil,
24
+ maxlength: LinkBlock::SLUG_LIMIT,
25
+ pattern: LinkBlock::SLUG_PATTERN_HTML,
26
+ title: t('.guidelines.slug'),
27
+ required: true,
28
+ data: {
29
+ check: :slug
30
+ }
31
+ )
32
+ %>
33
+ <div class="check-result-error hidden" data-field="slug"></div>
34
+ <div class="guideline"><%= t('.guidelines.slug') %></div>
35
+ </dd>
36
+
37
+ <dt><%= f.label :title %></dt>
38
+ <dd>
39
+ <%=
40
+ f.text_field(
41
+ :title,
42
+ id: "#{model_name}_title",
43
+ size: nil,
44
+ maxlength: LinkBlock::TITLE_LIMIT,
45
+ data: {
46
+ check: :title
47
+ }
48
+ )
49
+ %>
50
+ <div class="check-result-error hidden" data-field="title"></div>
51
+ <div class="guideline"><%= t('.guidelines.title') %></div>
52
+ </dd>
53
+
54
+ <dt><%= f.label :lead %></dt>
55
+ <dd>
56
+ <%=
57
+ f.text_area(
58
+ :lead,
59
+ id: "#{model_name}_lead",
60
+ cols: 80,
61
+ rows: 5,
62
+ max_length: LinkBlock::TEXT_LIMIT,
63
+ data: {
64
+ check: :lead
65
+ }
66
+ )
67
+ %>
68
+ <div class="check-result-error hidden" data-field="lead"></div>
69
+ <div class="guideline"><%= t('.guidelines.lead') %></div>
70
+ </dd>
71
+
72
+ <dt><%= f.label :footer_text %></dt>
73
+ <dd>
74
+ <%=
75
+ f.text_area(
76
+ :footer_text,
77
+ id: "#{model_name}_footer_text",
78
+ cols: 80,
79
+ rows: 5,
80
+ max_length: LinkBlock::TEXT_LIMIT,
81
+ data: {
82
+ check: :footer_text
83
+ }
84
+ )
85
+ %>
86
+ <div class="check-result-error hidden" data-field="footer_text"></div>
87
+ <div class="guideline"><%= t('.guidelines.footer_text') %></div>
88
+ </dd>
89
+
90
+ <%= render(partial: 'shared/forms/entity_flags', locals: { f: f }) %>
91
+ </dl>
92
+
93
+ <div class="buttons">
94
+ <%= hidden_field_tag :entity_id, entity.id %>
95
+ <%= f.button t(:save), type: :submit, class: 'button-save' %>
96
+ </div>
97
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.link_blocks.nav_item.text'), admin_link_blocks_path) %>
4
+ <%= admin_link_block_link(@entity) %>
5
+ <span><%= t('.nav_text') %></span>
6
+ <% end %>
7
+
8
+ <article>
9
+ <h1><%= t('.heading') %></h1>
10
+
11
+ <ul class="actions">
12
+ <li><%= return_icon(admin_link_block_path(id: @entity.id)) %></li>
13
+ <li class="danger"><%= destroy_icon(@entity) %></li>
14
+ </ul>
15
+
16
+ <%= render partial: 'form', locals: { entity: @entity } %>
17
+ </article>
@@ -0,0 +1,15 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.link_blocks.nav_item.text'), admin_link_blocks_path) %>
4
+ <span><%= t('.nav_text') %></span>
5
+ <% end %>
6
+
7
+ <article>
8
+ <h1><%= t('.title') %></h1>
9
+
10
+ <ul class="actions">
11
+ <li><%= back_icon(admin_link_blocks_path) %></li>
12
+ </ul>
13
+
14
+ <%= render partial: 'form', locals: { entity: @entity } %>
15
+ </article>
@@ -6,7 +6,5 @@
6
6
  <figcaption><%= current_user.profile_name %></figcaption>
7
7
  </figure>
8
8
 
9
- <nav>
10
-
11
- </nav>
9
+ <%= render 'my/index/dashboard/biovision_post' if Gem.loaded_specs.key?('biovision-post') %>
12
10
  </section>
@@ -33,14 +33,9 @@
33
33
  <%= f.text_area :description, cols: 50, rows: 3, maxlength: Privilege::DESCRIPTION_LIMIT %>
34
34
  <div class="guideline"><%= t('.guidelines.description') %></div>
35
35
  </dd>
36
- </dl>
37
36
 
38
- <ul class="flags">
39
- <li>
40
- <%= f.check_box :regional %>
41
- <%= f.label :regional %>
42
- </li>
43
- </ul>
37
+ <%= render partial: 'shared/forms/entity_flags', locals: { f: f } %>
38
+ </dl>
44
39
 
45
40
  <div class="buttons">
46
41
  <%= f.hidden_field :parent_id if entity.id.nil? %>
@@ -0,0 +1,3 @@
1
+ <!-- editable block: counters -->
2
+ <% entity = EditableBlock.localized_block('counters', locale) %>
3
+ <%= raw(entity.body) unless entity.nil? %>
@@ -1,9 +1,13 @@
1
+ <%
2
+ entity = f.object
3
+ model_name = entity.class.to_s.underscore
4
+ %>
1
5
  <dt><%= t(:flags) %></dt>
2
6
  <dd>
3
7
  <ul class="flags">
4
8
  <% entity.class.toggleable_attributes.each do |flag| %>
5
9
  <li>
6
- <%= f.check_box flag, id: "#{model_name}_flag" %>
10
+ <%= f.check_box flag, id: "#{model_name}_#{flag}" %>
7
11
  <%= f.label flag %>
8
12
  </li>
9
13
  <% end %>
@@ -0,0 +1,13 @@
1
+ <div>
2
+ <%=
3
+ button_tag(
4
+ t(:remove_image),
5
+ type: :button,
6
+ class: 'button-destroy remove-image-button',
7
+ data: {
8
+ url: url,
9
+ text: t(:are_you_sure)
10
+ }
11
+ )
12
+ %>
13
+ </div>
@@ -81,6 +81,7 @@ en:
81
81
  not_set: "Not send"
82
82
  nothing_found: "Nothing was found"
83
83
  page: "Page"
84
+ remove_image: "Remove image"
84
85
  save: "Save"
85
86
  submit: "Submit"
86
87
  unlocked: "Editing is allowed"
@@ -82,6 +82,7 @@ ru:
82
82
  not_set: "Не задано"
83
83
  nothing_found: "Ничего не нашлось"
84
84
  page: "Страница"
85
+ remove_image: "Удалить картинку"
85
86
  save: "Сохранить"
86
87
  submit: "Отправить"
87
88
  unlocked: "Редактирование разрешено"