biovision 0.1.210414.0 → 0.12.211128.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +50 -40
  3. data/app/assets/stylesheets/biovision/admin/components/users.scss +4 -0
  4. data/app/assets/stylesheets/biovision/admin/components.scss +10 -0
  5. data/app/assets/stylesheets/biovision/admin/layout.scss +34 -8
  6. data/app/assets/stylesheets/biovision/biovision.scss +64 -26
  7. data/app/assets/stylesheets/biovision/components/carousel.scss +24 -24
  8. data/app/assets/stylesheets/biovision/components/filters.scss +39 -0
  9. data/app/assets/stylesheets/biovision/components/forms.scss +56 -10
  10. data/app/assets/stylesheets/biovision/components/quick_search.scss +24 -0
  11. data/app/assets/stylesheets/biovision/components.scss +1 -0
  12. data/app/assets/stylesheets/biovision/default.scss +4 -4
  13. data/app/assets/stylesheets/biovision/themes/default_theme/components/users/dashboard.scss +4 -0
  14. data/app/assets/stylesheets/biovision/themes/default_theme/components/users.scss +1 -0
  15. data/app/assets/stylesheets/biovision/themes/default_theme/layout/footer.scss +3 -0
  16. data/app/assets/stylesheets/biovision/themes/default_theme/layout/header.scss +12 -0
  17. data/app/assets/stylesheets/biovision/themes/default_theme/layout.scss +6 -3
  18. data/app/assets/stylesheets/biovision/themes/default_theme.scss +0 -1
  19. data/app/assets/stylesheets/biovision/vars.scss +5 -0
  20. data/app/controllers/admin/biovision_components_controller.rb +10 -0
  21. data/app/controllers/admin/components_controller.rb +33 -83
  22. data/app/controllers/admin/dynamic_pages_controller.rb +1 -1
  23. data/app/controllers/admin/index_controller.rb +8 -2
  24. data/app/controllers/admin/navigation_groups_controller.rb +31 -0
  25. data/app/controllers/admin/tokens_controller.rb +15 -0
  26. data/app/controllers/admin/users_controller.rb +35 -4
  27. data/app/controllers/admin_controller.rb +2 -9
  28. data/app/controllers/concerns/component_stories.rb +22 -0
  29. data/app/controllers/concerns/crud_entities.rb +23 -15
  30. data/app/controllers/concerns/my_crud_entities.rb +146 -0
  31. data/app/controllers/concerns/processed_forms.rb +28 -0
  32. data/app/controllers/concerns/restricted_access.rb +37 -0
  33. data/app/controllers/contact_controller.rb +1 -1
  34. data/app/controllers/errors_controller.rb +37 -0
  35. data/app/controllers/my/components_controller.rb +21 -0
  36. data/app/controllers/my/index_controller.rb +1 -3
  37. data/app/controllers/my/profiles_controller.rb +2 -0
  38. data/app/controllers/oembed_controller.rb +12 -0
  39. data/app/controllers/profile_controller.rb +2 -0
  40. data/app/controllers/users_controller.rb +2 -0
  41. data/app/helpers/biovision_components_helper.rb +7 -3
  42. data/app/helpers/biovision_helper.rb +33 -34
  43. data/app/helpers/entity_helper.rb +77 -0
  44. data/app/helpers/my_helper.rb +34 -0
  45. data/app/lib/biovision/components/base/component_parameters.rb +13 -2
  46. data/app/lib/biovision/components/base/component_privileges.rb +28 -18
  47. data/app/lib/biovision/components/base/component_settings.rb +8 -0
  48. data/app/lib/biovision/components/base/component_stories.rb +30 -0
  49. data/app/lib/biovision/components/base/entity_links.rb +38 -0
  50. data/app/lib/biovision/components/base/image_handling.rb +33 -0
  51. data/app/lib/biovision/components/base_component.rb +20 -49
  52. data/app/lib/biovision/components/contact_component.rb +5 -1
  53. data/app/lib/biovision/components/content/oembed/receiver.rb +98 -0
  54. data/app/lib/biovision/components/content/oembed/twitter_receiver.rb +20 -0
  55. data/app/lib/biovision/components/content/oembed/vimeo_receiver.rb +20 -0
  56. data/app/lib/biovision/components/content/oembed/youtube_receiver.rb +20 -0
  57. data/app/lib/biovision/components/content_component.rb +46 -9
  58. data/app/lib/biovision/components/track_component.rb +1 -1
  59. data/app/lib/biovision/components/users_component.rb +34 -2
  60. data/app/lib/biovision/helpers/data_helper.rb +70 -0
  61. data/app/lib/biovision/helpers/export_helper.rb +97 -0
  62. data/app/lib/biovision/migrations/component_migration.rb +56 -0
  63. data/app/lib/biovision/stories/component_story.rb +55 -0
  64. data/app/mailers/feedback_mailer.rb +14 -0
  65. data/app/models/biovision_component.rb +17 -1
  66. data/app/models/browser.rb +1 -1
  67. data/app/models/code.rb +5 -5
  68. data/app/models/concerns/checkable.rb +2 -1
  69. data/app/models/concerns/has_uploaded_file.rb +26 -0
  70. data/app/models/concerns/simple_tag.rb +30 -0
  71. data/app/models/concerns/toggleable.rb +2 -1
  72. data/app/models/concerns/tree_structure.rb +4 -1
  73. data/app/models/contact_method.rb +1 -1
  74. data/app/models/contact_type.rb +1 -1
  75. data/app/models/dynamic_block.rb +1 -1
  76. data/app/models/dynamic_page.rb +3 -1
  77. data/app/models/feedback_message.rb +7 -1
  78. data/app/models/feedback_response.rb +2 -2
  79. data/app/models/metric.rb +4 -0
  80. data/app/models/navigation_group.rb +11 -1
  81. data/app/models/oembed_domain.rb +25 -0
  82. data/app/models/oembed_link.rb +19 -0
  83. data/app/models/oembed_receiver.rb +15 -0
  84. data/app/models/role.rb +42 -12
  85. data/app/models/simple_image.rb +30 -3
  86. data/app/models/simple_image_tag.rb +1 -16
  87. data/app/models/token.rb +6 -2
  88. data/app/models/uploaded_file.rb +62 -0
  89. data/app/models/uploaded_file_tag.rb +15 -0
  90. data/app/models/uploaded_file_tag_file.rb +13 -0
  91. data/app/models/user.rb +35 -10
  92. data/app/models/user_role.rb +0 -1
  93. data/app/uploaders/simple_file_uploader.rb +2 -6
  94. data/app/uploaders/simple_image_uploader.rb +10 -21
  95. data/app/uploaders/uploaders/path_slug.rb +22 -0
  96. data/app/views/admin/agents/index.html.erb +1 -1
  97. data/app/views/admin/biovision_components/_nav_item.html.erb +6 -0
  98. data/app/views/admin/biovision_components/entity/_in_list.html.erb +12 -0
  99. data/app/views/admin/biovision_components/index.html.erb +11 -0
  100. data/app/views/admin/components/_list.html.erb +1 -1
  101. data/app/views/admin/components/entity/_links.html.erb +31 -21
  102. data/app/views/admin/components/links/_base.html.erb +1 -0
  103. data/app/views/admin/components/settings/_settings.html.erb +3 -3
  104. data/app/views/admin/components/settings.html.erb +2 -1
  105. data/app/views/admin/dynamic_blocks/_form.html.erb +1 -1
  106. data/app/views/admin/dynamic_blocks/entity/_in_list.html.erb +8 -6
  107. data/app/views/admin/dynamic_blocks/index.html.erb +6 -4
  108. data/app/views/admin/dynamic_blocks/show.html.erb +9 -7
  109. data/app/views/admin/dynamic_pages/_dynamic_page.jbuilder +18 -0
  110. data/app/views/admin/dynamic_pages/entity/_in_list.html.erb +6 -4
  111. data/app/views/admin/dynamic_pages/entity/_in_search.html.erb +7 -0
  112. data/app/views/admin/dynamic_pages/index.html.erb +6 -4
  113. data/app/views/admin/dynamic_pages/search.jbuilder +4 -0
  114. data/app/views/admin/dynamic_pages/show.html.erb +2 -2
  115. data/app/views/admin/index/index.html.erb +7 -5
  116. data/app/views/admin/ip_addresses/index.html.erb +2 -2
  117. data/app/views/admin/navigation_group_pages/entity/_in_list.html.erb +26 -0
  118. data/app/views/admin/navigation_groups/entity/_dynamic_pages.html.erb +38 -0
  119. data/app/views/admin/navigation_groups/entity/_in_list.html.erb +7 -5
  120. data/app/views/admin/navigation_groups/index.html.erb +6 -4
  121. data/app/views/admin/navigation_groups/show.html.erb +16 -3
  122. data/app/views/admin/tokens/_form.html.erb +31 -0
  123. data/app/views/admin/tokens/_nav_item.html.erb +6 -0
  124. data/app/views/admin/tokens/entity/_in_list.html.erb +27 -0
  125. data/app/views/admin/tokens/index.html.erb +11 -0
  126. data/app/views/admin/tokens/show.html.erb +26 -0
  127. data/app/views/admin/users/_user.jbuilder +18 -0
  128. data/app/views/admin/users/entity/_fields.html.erb +1 -1
  129. data/app/views/admin/users/entity/_in_list.html.erb +3 -3
  130. data/app/views/admin/users/entity/_in_search.html.erb +18 -0
  131. data/app/views/admin/users/index.html.erb +13 -4
  132. data/app/views/admin/users/roles/_component.html.erb +22 -0
  133. data/app/views/admin/users/roles.html.erb +23 -0
  134. data/app/views/admin/users/search.jbuilder +4 -0
  135. data/app/views/admin/users/show.html.erb +28 -10
  136. data/app/views/admin/widgets/_filters.html.erb +20 -0
  137. data/app/views/admin/widgets/_quick_search.html.erb +13 -0
  138. data/app/views/admin/widgets/filters/_flag.html.erb +15 -0
  139. data/app/views/admin/widgets/filters/_text.html.erb +7 -0
  140. data/app/views/application/unauthorized.html.erb +4 -1
  141. data/app/views/components/content/_dynamic_page.html.erb +6 -10
  142. data/app/views/components/content/_dynamic_page_content.html.erb +14 -0
  143. data/app/views/components/users/_login_form.html.erb +1 -0
  144. data/app/views/contact/_form.html.erb +1 -1
  145. data/app/views/errors/error.html.erb +1 -0
  146. data/app/views/feedback_mailer/new_feedback_request.html.erb +11 -0
  147. data/app/views/feedback_mailer/new_feedback_request.text.erb +6 -0
  148. data/app/views/index/index.html.erb +14 -0
  149. data/app/views/layouts/admin/_header.html.erb +7 -2
  150. data/app/views/layouts/admin.html.erb +0 -1
  151. data/app/views/layouts/application/_footer.html.erb +1 -1
  152. data/app/views/layouts/application/header/_authentication.html.erb +4 -1
  153. data/app/views/my/components/index.html.erb +25 -0
  154. data/app/views/my/components/show.html.erb +21 -0
  155. data/app/views/my/index/_cards.html.erb +15 -0
  156. data/app/views/my/index/_email.html.erb +14 -0
  157. data/app/views/my/index/_navigation.html.erb +33 -0
  158. data/app/views/my/index/index.html.erb +7 -26
  159. data/app/views/my/profiles/show.html.erb +13 -0
  160. data/app/views/{admin/components/links/extra/_content.html.erb → my/recoveries/show.html.erb} +0 -0
  161. data/app/views/shared/admin/_list.html.erb +10 -19
  162. data/app/views/shared/admin/_list_with_priority.html.erb +10 -19
  163. data/app/views/shared/admin/_priority.html.erb +6 -5
  164. data/app/views/shared/admin/_toggle.html.erb +5 -10
  165. data/app/views/shared/entity/_date_field.html.erb +6 -0
  166. data/app/views/shared/entity/_linked_entity.html.erb +2 -2
  167. data/app/views/shared/entity/_list.html.erb +22 -0
  168. data/app/views/shared/entity/_list_with_priority.html.erb +22 -0
  169. data/app/views/shared/entity/_parent.html.erb +1 -1
  170. data/app/views/shared/entity/_priority_icons.html.erb +8 -0
  171. data/app/views/shared/entity/_time_field.html.erb +6 -0
  172. data/app/views/shared/entity/_toggle.html.erb +12 -0
  173. data/app/views/shared/entity/_track.html.erb +12 -0
  174. data/app/views/shared/entity/_tree_caches.html.erb +8 -1
  175. data/app/views/shared/entity/edit.html.erb +10 -6
  176. data/app/views/shared/entity/new.html.erb +4 -2
  177. data/app/views/shared/forms/_field.html.erb +6 -2
  178. data/app/views/shared/forms/_field_with_search.html.erb +17 -0
  179. data/app/views/shared/forms/_meta_texts.html.erb +1 -1
  180. data/app/views/shared/forms/_simple_entity_link.html.erb +14 -0
  181. data/app/views/shared/forms/_simple_image.html.erb +12 -4
  182. data/app/views/shared/forms/_text_area.html.erb +1 -1
  183. data/app/views/shared/forms/_text_field.html.erb +1 -1
  184. data/app/views/shared/my/_list.html.erb +10 -19
  185. data/app/views/shared/my/_list_with_priority.html.erb +10 -19
  186. data/app/views/shared/my/entity/edit.html.erb +25 -0
  187. data/app/views/shared/my/entity/new.html.erb +18 -0
  188. data/app/views/simple_images/_simple_image.jbuilder +13 -0
  189. data/config/locales/biovision-ru.yml +18 -1
  190. data/config/locales/components-ru.yml +27 -4
  191. data/config/locales/contact-ru.yml +4 -0
  192. data/config/locales/content-ru.yml +12 -0
  193. data/config/locales/users-ru.yml +31 -6
  194. data/config/routes.rb +35 -4
  195. data/db/migrate/20191228000000_create_biovision_components.rb +2 -0
  196. data/db/migrate/20200224000000_create_track_component.rb +8 -12
  197. data/db/migrate/20200224000010_create_users_component.rb +8 -49
  198. data/db/migrate/20200404000000_create_simple_images.rb +1 -0
  199. data/db/migrate/20210405000000_create_acl.rb +15 -1
  200. data/db/migrate/{20200529000000_create_content_component.rb → 20210421000000_create_content_component.rb} +24 -18
  201. data/db/migrate/{20210401000000_create_contact_component.rb → 20210421000010_create_contact_component.rb} +1 -22
  202. data/db/migrate/20210616000000_create_uploaded_files.rb +52 -0
  203. data/db/migrate/amends/20210816060606_create_oembed_receivers.rb +21 -0
  204. data/db/migrate/amends/20210907070707_add_checksum_to_simple_images.rb +13 -0
  205. data/lib/biovision/base_methods.rb +8 -28
  206. data/lib/biovision/version.rb +1 -1
  207. data/lib/tasks/components.rake +51 -0
  208. metadata +90 -17
  209. data/app/lib/biovision/components/base/privilege_handler.rb +0 -79
  210. data/app/models/biovision_component_user.rb +0 -21
  211. data/app/views/admin/components/links/_content.html.erb +0 -9
  212. data/app/views/admin/components/links/_track.html.erb +0 -2
  213. data/app/views/admin/components/links/_users.html.erb +0 -4
  214. data/app/views/admin/components/privileges/_component_user.html.erb +0 -17
  215. data/app/views/admin/components/privileges/_links.html.erb +0 -17
  216. data/app/views/admin/components/privileges/_users.html.erb +0 -23
  217. data/app/views/admin/components/privileges.html.erb +0 -20
@@ -0,0 +1,12 @@
1
+ <%
2
+ view_scope = %i[admin my].include?(local_assigns[:scope].to_sym) ? "#{scope}/" : ''
3
+ model = entity.class
4
+ url = "/#{view_scope}#{model.table_name}/#{entity.id}/toggle"
5
+ %>
6
+ <div class="toggleable" data-url="<%= url %>">
7
+ <% model.toggleable_attributes.each do |flag| %>
8
+ <span class="<%= entity.attributes[flag.to_s] ? 'active' : 'inactive' %>" data-flag="<%= flag %>">
9
+ <%= model.human_attribute_name(flag) %>
10
+ </span>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,12 @@
1
+ <% unless entity.ip_address.blank? %>
2
+ <div>
3
+ <dt><%= entity.class.human_attribute_name(:ip_address) %></dt>
4
+ <dd><%= entity.ip_address.ip %></dd>
5
+ </div>
6
+ <% end %>
7
+ <% unless entity.agent.blank? %>
8
+ <div>
9
+ <dt><%= entity.class.human_attribute_name(:agent) %></dt>
10
+ <dd><%= entity.agent.name %></dd>
11
+ </div>
12
+ <% end %>
@@ -7,6 +7,13 @@
7
7
  <% unless entity.children_cache.blank? %>
8
8
  <div>
9
9
  <dt><%= entity.class.human_attribute_name(:children_cache) %></dt>
10
- <dd><%= entity.children_cache.join(', ') %></dd>
10
+ <dd>
11
+ <details>
12
+ <summary><%= t(:object_count, count: entity.children_cache.count) %></summary>
13
+ <div class="secondary-data">
14
+ <%= entity.children_cache.join(', ') %>
15
+ </div>
16
+ </details>
17
+ </dd>
11
18
  </div>
12
19
  <% end %>
@@ -6,16 +6,20 @@
6
6
  <% content_for :breadcrumbs do %>
7
7
  <%= admin_biovision_component_link(component_handler.component) %>
8
8
  <%= link_to(t("#{prefix}.nav_item.text"), "/#{controller_path}") %>
9
- <%= admin_entity_link(@entity) %>
9
+ <%= admin_entity_link(@entity, handler: component_handler) %>
10
10
  <span><%= t('.nav_text') %></span>
11
11
  <% end %>
12
12
 
13
13
  <article>
14
- <h1><%= t("#{prefix}.edit.heading", default: default_title) %></h1>
14
+ <div class="content-wrapper">
15
+ <h1><%= t("#{prefix}.edit.heading", default: default_title) %></h1>
15
16
 
16
- <nav class="entity-actions">
17
- <%= destroy_icon(@entity) %>
18
- </nav>
17
+ <% if component_handler.permit?('edit', @entity) %>
18
+ <nav class="entity-actions">
19
+ <%= destroy_icon(@entity) %>
20
+ </nav>
21
+ <% end %>
19
22
 
20
- <%= render partial: "#{controller_path}/form", locals: { entity: @entity } %>
23
+ <%= render partial: "#{controller_path}/form", locals: { entity: @entity } %>
24
+ </div>
21
25
  </article>
@@ -10,7 +10,9 @@
10
10
  <% end %>
11
11
 
12
12
  <article>
13
- <h1><%= t("#{prefix}.new.heading", default: default_title) %></h1>
13
+ <div class="content-wrapper">
14
+ <h1><%= t("#{prefix}.new.heading", default: default_title) %></h1>
14
15
 
15
- <%= render partial: "#{controller_path}/form", locals: { entity: @entity } %>
16
+ <%= render partial: "#{controller_path}/form", locals: { entity: @entity } %>
17
+ </div>
16
18
  </article>
@@ -5,6 +5,7 @@
5
5
  validators = model.validators_on(field)
6
6
  length_options = validators.select { |v| v.kind == :length }.first&.options.to_h
7
7
  range_option = validators.select { |v| v.kind == :inclusion }.first&.options.to_h
8
+ # numericality = validators.select { |v| v.kind == :numericality }.first&.options.to_h
8
9
  options = {
9
10
  class: 'input-text',
10
11
  data: { check: field }.merge(local_assigns[:data].to_h),
@@ -13,7 +14,8 @@
13
14
  required: validators.select { |v| v.kind == :presence }.any?,
14
15
  size: nil
15
16
  }
16
- guide_key = "#{controller_path.gsub('/', '.')}.form.guidelines.#{field}"
17
+ legacy_guide_key = "#{controller_path.gsub('/', '.')}.form.guidelines.#{field}"
18
+ guide_key = "guidelines.#{model.to_s.underscore}.#{field}"
17
19
  %>
18
20
  <div>
19
21
  <dt><%= f.label field %></dt>
@@ -28,7 +30,7 @@
28
30
  <% when :date %>
29
31
  <%= f.date_field(field, options.merge(local_assigns[:options].to_h)) %>
30
32
  <% when :datetime %>
31
- <%= f.datetime_field(field, options.merge(local_assigns[:options].to_h)) %>
33
+ <%= f.datetime_field(field, options.merge(local_assigns[:options].to_h).merge(step: 1)) %>
32
34
  <% when :url %>
33
35
  <%= f.url_field(field, options.merge(local_assigns[:options].to_h)) %>
34
36
  <% when :email %>
@@ -41,6 +43,8 @@
41
43
  <div class="check-result-error" data-field="<%= field %>"></div>
42
44
  <% if I18n.exists?(guide_key) %>
43
45
  <div class="guideline"><%= t(guide_key) %></div>
46
+ <% elsif I18n.exists?(legacy_guide_key) %>
47
+ <div class="guideline"><%= t(legacy_guide_key) %></div>
44
48
  <% end %>
45
49
  </dd>
46
50
  </div>
@@ -0,0 +1,17 @@
1
+ <% placeholder ||= t('.search') %>
2
+ <div>
3
+ <dt><%= f.label field %></dt>
4
+ <dd class="js-searchable-list searchable-list" data-url="<%= endpoint %>">
5
+ <div class="current">
6
+ <%= f.hidden_field field %>
7
+ <span class="text"><%= local_assigns[:current] %></span>
8
+ </div>
9
+ <div class="search">
10
+ <label class="floating-label">
11
+ <input placeholder="<%= placeholder %>" type="search" class="input-text"/>
12
+ <span><%= placeholder %></span>
13
+ </label>
14
+ <ul class="results"></ul>
15
+ </div>
16
+ </dd>
17
+ </div>
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <dt><%= t('.name') %></dt>
4
4
  <dd>
5
- <ul class="flags">
5
+ <ul class="meta-texts">
6
6
  <% entity.class.meta_keys.each do |key| %>
7
7
  <li>
8
8
  <label class="floating-label" title="<%= key %>">
@@ -0,0 +1,14 @@
1
+ <% preset = local_assigns[:blank] ? [[t(:not_set), '']] : [] %>
2
+ <div>
3
+ <dt><%= f.label(field) %></dt>
4
+ <dd>
5
+ <%=
6
+ f.select(
7
+ field,
8
+ preset + linked_model.list_for_administration.map { |e| [e.text_for_link, e.id ]},
9
+ class: 'input-select',
10
+ required: local_assigns[:required]
11
+ )
12
+ %>
13
+ </dd>
14
+ </div>
@@ -23,15 +23,23 @@
23
23
  </figure>
24
24
  <div class="js-change" data-url="<%= handler_url %>">
25
25
  <div class="buttons">
26
- <button class="button button-ghost js-new-image" type="button">
27
- <%= t('.new_image') %>
28
- </button>
26
+ <label class="button button-ghost js-new-image">
27
+ <%=
28
+ file_field_tag(
29
+ nil,
30
+ accept: 'image/jpeg,image/png,image/svg+xml',
31
+ class: 'input-text visually-hidden'
32
+ )
33
+ %>
34
+ <span><%= t('.new_image') %></span>
35
+ </label>
36
+
29
37
  <button class="button button-ghost js-select-image" type="button">
30
38
  <%= t('.select') %>
31
39
  </button>
32
40
  </div>
33
41
  <%= render 'shared/forms/simple_image/browse' %>
34
- <%= render 'shared/forms/simple_image/load_image' %>
42
+ <%#= render 'shared/forms/simple_image/load_image' %>
35
43
  </div>
36
44
  <%= f.hidden_field(:simple_image_id) %>
37
45
  </div>
@@ -5,7 +5,7 @@
5
5
  options = {
6
6
  class: 'input-text',
7
7
  data: { check: field }.merge(local_assigns[:data].to_h),
8
- manlength: length_options[:maximum],
8
+ maxlength: length_options[:maximum],
9
9
  minlength: length_options[:minimum],
10
10
  required: validators.select { |v| v.kind == :presence }.any?,
11
11
  rows: 10,
@@ -5,7 +5,7 @@
5
5
  options = {
6
6
  class: 'input-text',
7
7
  data: { check: field }.merge(local_assigns[:data].to_h),
8
- manlength: length_options[:maximum],
8
+ maxlength: length_options[:maximum],
9
9
  minlength: length_options[:minimum],
10
10
  required: validators.select { |v| v.kind == :presence }.any?,
11
11
  size: nil
@@ -1,19 +1,10 @@
1
- <% use_pagination = collection.respond_to?(:current_page) %>
2
- <%= paginate collection if use_pagination %>
3
- <% if collection.any? %>
4
- <ul class="list-of-entities">
5
- <% collection.each do |entity| %>
6
- <li data-id="<%= entity.id %>">
7
- <%=
8
- render(
9
- partial: "my/#{entity.class.table_name}/entity/in_list",
10
- locals: { entity: entity, handler: local_assigns[:handler] }
11
- )
12
- %>
13
- </li>
14
- <% end %>
15
- </ul>
16
- <%= paginate collection if use_pagination %>
17
- <% else %>
18
- <%= render 'shared/nothing_found' %>
19
- <% end %>
1
+ <%=
2
+ render(
3
+ partial: 'shared/entity/list',
4
+ locals: {
5
+ collection: collection,
6
+ handler: local_assigns[:handler],
7
+ scope: :my
8
+ }
9
+ )
10
+ %>
@@ -1,19 +1,10 @@
1
- <% use_pagination = collection.respond_to?(:current_page) %>
2
- <%= paginate collection if use_pagination %>
3
- <% if collection.any? %>
4
- <ol class="list-of-entities">
5
- <% collection.each do |entity| %>
6
- <li data-id="<%= entity.id %>" data-number="<%= entity.priority %>">
7
- <%=
8
- render(
9
- partial: "my/#{entity.class.table_name}/entity/in_list",
10
- locals: { entity: entity, handler: local_assigns[:handler] }
11
- )
12
- %>
13
- </li>
14
- <% end %>
15
- </ol>
16
- <%= paginate collection if use_pagination %>
17
- <% else %>
18
- <%= render 'shared/nothing_found' %>
19
- <% end %>
1
+ <%=
2
+ render(
3
+ partial: 'shared/entity/list_with_priority',
4
+ locals: {
5
+ collection: collection,
6
+ handler: local_assigns[:handler],
7
+ scope: :my
8
+ }
9
+ )
10
+ %>
@@ -0,0 +1,25 @@
1
+ <%
2
+ prefix = controller_path.gsub('/', '.')
3
+ default_title = "#{@entity.class.model_name.human}: #{t('shared.entity.edit.nav_text')}"
4
+ %>
5
+ <% content_for :meta_title, t("#{prefix}.edit.title", default: default_title) %>
6
+ <% content_for :breadcrumbs do %>
7
+ <%= my_home_link %>
8
+ <%= link_to(t("#{prefix}.index.nav_text"), "/#{controller_path}") %>
9
+ <%= my_entity_link(@entity, handler: component_handler) %>
10
+ <span><%= t('shared.entity.edit.nav_text') %></span>
11
+ <% end %>
12
+
13
+ <article>
14
+ <div class="content-wrapper">
15
+ <h1><%= t("#{prefix}.edit.heading", default: default_title) %></h1>
16
+
17
+ <% if component_handler.permit?('edit', @entity) %>
18
+ <nav class="entity-actions">
19
+ <%= destroy_icon(@entity) %>
20
+ </nav>
21
+ <% end %>
22
+
23
+ <%= render partial: "#{controller_path}/form", locals: { entity: @entity } %>
24
+ </div>
25
+ </article>
@@ -0,0 +1,18 @@
1
+ <%
2
+ prefix = controller_path.gsub('/', '.')
3
+ default_title = "#{@entity.class.model_name.human}: #{t('shared.entity.new.nav_text')}"
4
+ %>
5
+ <% content_for :meta_title, t("#{prefix}.new.title", default: default_title) %>
6
+ <% content_for :breadcrumbs do %>
7
+ <%= my_home_link %>
8
+ <%= link_to(t("#{prefix}.index.nav_text"), "/#{controller_path}") %>
9
+ <span><%= t('shared.entity.new.nav_text') %></span>
10
+ <% end %>
11
+
12
+ <article>
13
+ <div class="content-wrapper">
14
+ <h1><%= t("#{prefix}.new.heading", default: default_title) %></h1>
15
+
16
+ <%= render partial: "#{controller_path}/form", locals: { entity: @entity } %>
17
+ </div>
18
+ </article>
@@ -0,0 +1,13 @@
1
+ json.id simple_image.uuid
2
+ json.type SimpleImage.table_name
3
+ json.attributes do
4
+ json.call(simple_image, *SimpleImage.json_attributes)
5
+ end
6
+ json.meta do
7
+ json.hd_url simple_image.image.hd_url
8
+ json.large_url simple_image.image.large_url
9
+ json.medium_url simple_image.image.medium_url
10
+ json.small_url simple_image.image.small_url
11
+ json.preview_url simple_image.image.preview_url
12
+ json.tiny_url simple_image.image.tiny_url
13
+ end
@@ -27,6 +27,7 @@ ru:
27
27
  keywords: "Ключевые слова"
28
28
  title: "Заголовок окна (title)"
29
29
  name: "Название"
30
+ nav_text: "Текст для ссылки"
30
31
  object_count: "Количество объектов"
31
32
  parent: "Родитель"
32
33
  parent_id: "Родитель"
@@ -69,16 +70,18 @@ ru:
69
70
  previous: "←"
70
71
  next: "→"
71
72
  truncate: "…"
72
- copyright: "2020 example.com"
73
+ copyright: "2021 example.com"
73
74
  home: "Главная"
74
75
  application:
75
76
  errors:
77
+ bad_request: "Плохой запрос (400)."
76
78
  forbidden: "Запрещено (403)."
77
79
  internal_server_error: "Внутренняя ошибка сервера (500)."
78
80
  not_found: "Страница не найдена (404)."
79
81
  restricted_access: "Доступ к странице ограничен (401)."
80
82
  service_unavailable: "Сервис временно недоступен (503)."
81
83
  unauthorized: "Не хватает прав для просмотра страницы (401)."
84
+ unprocessable_entity: "Сущность нельзя обработать (422)."
82
85
  unauthorized:
83
86
  title: "Доступ ограничен"
84
87
  heading: "Доступ ограничен"
@@ -93,11 +96,23 @@ ru:
93
96
  unauthorized:
94
97
  heading: "Не хватает прав"
95
98
  message: "У вас не хватает прав для просмотра этой страницы"
99
+ missing_role: "У вас не хватает роли %{role} для просмотра этой страницы"
96
100
  index:
97
101
  index:
98
102
  nav_text: "Администрирование"
99
103
  title: "Администрирование"
100
104
  heading: "Администрирование"
105
+ widgets:
106
+ quick_search:
107
+ heading: "Быстрый поиск"
108
+ search_string: "Строка поиска"
109
+ filters:
110
+ apply: "Применить"
111
+ flag:
112
+ any: "Неважно"
113
+ set: "Да"
114
+ unset: "Нет"
115
+ heading: "Фильтры"
101
116
  layouts:
102
117
  admin:
103
118
  footer:
@@ -130,6 +145,8 @@ ru:
130
145
  saving: "Сохранение…"
131
146
  meta_texts:
132
147
  name: "Метаданные"
148
+ field_with_search:
149
+ search: "Поиск"
133
150
  entity:
134
151
  edit:
135
152
  nav_text: "Редактировать"
@@ -17,6 +17,9 @@ ru:
17
17
  simple_image: "Простое изображение"
18
18
  simple_image_tag: "Метка простого изображения"
19
19
  simple_image_tag_image: "Связь метки и простого изображения"
20
+ uploaded_file: "Загруженный файл"
21
+ uploaded_file_tag: "Метка загруженного файла"
22
+ uploaded_file_tag_file: "Связь метки и загруженного файла"
20
23
  user_group: "Пользователь в группе доступа"
21
24
  user_role: "Роль доступа для пользователя"
22
25
  attributes:
@@ -52,8 +55,8 @@ ru:
52
55
  simple_image_tag_image:
53
56
  simple_image_tag: "Метка"
54
57
  simple_image_tag_id: "Метка"
55
- user_role:
56
- inclusive: "Инклюзивно"
58
+ uploaded_file:
59
+ attachment: "Приложение"
57
60
  attributes:
58
61
  biovision_component: "Компонент"
59
62
  biovision_component_id: "Компонент"
@@ -63,6 +66,8 @@ ru:
63
66
  role_id: "Роль доступа"
64
67
  simple_image: "Изображение"
65
68
  simple_image_id: "Изображение"
69
+ uploaded_file: "Загруженный файл"
70
+ uploaded_file_id: "Загруженный файл"
66
71
  languages:
67
72
  english: "Английский"
68
73
  russian: "Русский"
@@ -71,8 +76,6 @@ ru:
71
76
  privileges:
72
77
  nav_text: "Привилегии"
73
78
  title: "Привилении компонента «%{slug}»"
74
- users:
75
- heading: "Привилегии"
76
79
  settings:
77
80
  nav_text: "Настройки"
78
81
  title: "Настройки компонента «%{slug}»"
@@ -95,6 +98,13 @@ ru:
95
98
  heading: "Компоненты"
96
99
  show:
97
100
  title: "Компонент «%{slug}»"
101
+ biovision_components:
102
+ index:
103
+ title: "Компоненты CMS"
104
+ heading: "Компоненты"
105
+ nav_item:
106
+ text: "Компоненты CMS"
107
+ description: "Управление списком компонентов CMS"
98
108
  shared:
99
109
  forms:
100
110
  simple_image:
@@ -107,3 +117,16 @@ ru:
107
117
  select: "Выбрать"
108
118
  browse:
109
119
  filter: "Фильтр по названию или имени файла"
120
+ biovision:
121
+ components:
122
+ base:
123
+ name: "Базовый компонент"
124
+ my:
125
+ components:
126
+ index:
127
+ title: "Сводка"
128
+ nav_text: "Сводка"
129
+ heading: "Сводка"
130
+ show:
131
+ title: "%{component}: сводка"
132
+ no_view: "Для этого компонента нет представления"
@@ -104,3 +104,7 @@ ru:
104
104
  index:
105
105
  nav_text: "Контакты"
106
106
  title: "Контакты"
107
+ feedback_mailer:
108
+ new_feedback_request:
109
+ subject: "Новый запрос обратной связи"
110
+ title: "Поступил новый запрос на обратную связь"
@@ -11,6 +11,9 @@ ru:
11
11
  dynamic_page: "Динамическая страница"
12
12
  navigation_group: "Группа навигации"
13
13
  navigation_group_page: "Страница в группе навигации"
14
+ oembed_domain: "Домен для ссылок OEmbed"
15
+ oembed_link: "Ссылка в oembed"
16
+ oembed_receiver: "Обработчик ссылок oembed"
14
17
  attributes:
15
18
  dynamic_block:
16
19
  body: "Содержимое"
@@ -24,6 +27,11 @@ ru:
24
27
  navigation_group_page:
25
28
  navigation_group: "Группа навигации"
26
29
  dynamic_page: "Динамическая страница"
30
+ oembed_domain:
31
+ oembed_receiver_id: "Обработчик"
32
+ oembed_link:
33
+ code: "Код для вставки"
34
+ url: "URL"
27
35
  admin:
28
36
  dynamic_blocks:
29
37
  destroy:
@@ -82,6 +90,10 @@ ru:
82
90
  title: "Добавление группы навигации"
83
91
  nav_text: "Создать"
84
92
  heading: "Новая группа навигации"
93
+ entity:
94
+ dynamic_pages:
95
+ heading: "Ссылки"
96
+ add: "Добавить страницу"
85
97
  biovision:
86
98
  components:
87
99
  content:
@@ -109,11 +109,14 @@ ru:
109
109
  bounce_count: "Максимальное количество неудачных попыток входа"
110
110
  bounce_timeout: "Тайм-аут для запрета повторных попыток входа"
111
111
  confirm_email: "Отправлять письмо для подтверждения почты"
112
+ confirm_phone: "Отправлять SMS для подтверждения телефона"
112
113
  email_as_login: "Использовать электронную почту в качестве логина"
113
114
  invite_count: "Количество кодов приглашения после регистрации"
114
115
  invite_only: "Только по приглашениям"
116
+ phone_as_login: "Использовать телефон в качестве логина"
115
117
  registration_open: "Регистрация открыта"
116
118
  require_email: "Электронная почта обязательна при регистрации"
119
+ require_phone: "Телефон обязателен при регистрации"
117
120
  use_invites: "Использовать приглашения"
118
121
  use_phone: "Использовать номер телефона"
119
122
  anonymous: "Анонимно"
@@ -163,11 +166,12 @@ ru:
163
166
  sensitive_parameters_require_password: "Это связанные с безопасностью параметры. Для их изменения нужно ввести текущий пароль."
164
167
  new_password: "Новый пароль"
165
168
  index:
169
+ email:
170
+ email_is_not_confirmed: "Ваш адрес электронной почты не подтверждён."
166
171
  index:
167
172
  title: "Личный кабинет"
168
173
  nav_text: "Личный кабинет"
169
174
  heading: "Личный кабинет"
170
- email_is_not_confirmed: "Ваш адрес электронной почты не подтверждён."
171
175
  confirmations:
172
176
  show:
173
177
  nav_text: "Подтвердить email"
@@ -224,18 +228,39 @@ ru:
224
228
  use_invites: "Использовать пришлашения"
225
229
  use_phone: "Использовать телефон"
226
230
  admin:
227
- users:
231
+ tokens:
232
+ destroy:
233
+ success: "Жетон пользователя удалён"
234
+ index:
235
+ title: "Жетоны пользователей, страница %{page}"
236
+ heading: "Жетоны пользователей"
228
237
  nav_item:
229
- description: "Управление пользователями сайта"
230
- text: "Список пользователей"
238
+ description: "Управление жетонами пользователей сайта"
239
+ text: "Жетоны доступа (сессии)"
240
+ show:
241
+ title: "Жетон доступа №%{id}"
242
+ users:
243
+ destroy:
244
+ success: "Пользователь удалён"
231
245
  index:
232
246
  title: "Пользователи, страница %{page}"
233
247
  heading: "Пользователи"
248
+ nav_item:
249
+ description: "Управление пользователями сайта"
250
+ text: "Список пользователей"
251
+ roles:
252
+ nav_text: "Роли"
253
+ title: "Роли пользователя %{user}"
254
+ heading: "Роли и группы в компонентах"
234
255
  show:
235
256
  title: "Пользователь %{name}"
236
257
  deleted: "Пользователь удалён"
237
- destroy:
238
- success: "Пользователь удалён"
258
+ tokens:
259
+ nav_text: "Жетоны"
260
+ title: "Жетоны доступа пользователя %{user}"
261
+ heading: "Жетоны доступа"
262
+ authenticate:
263
+ nav_text: "Войти как этот пользователь"
239
264
  users:
240
265
  profile:
241
266
  registration_date: "Дата регистрации"