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,6 @@
1
+ <div>
2
+ <%= link_to t('.text'), admin_editable_blocks_path %>
3
+ </div>
4
+ <div class="description">
5
+ <%= t('.description') %>
6
+ </div>
@@ -0,0 +1,29 @@
1
+ <div class="data">
2
+ <div><%= admin_editable_block_link(entity) %></div>
3
+ <div class="info">
4
+ <%= entity.slug %>
5
+ <% unless entity.description.blank? %>
6
+ <div><%= entity.description %></div>
7
+ <% end %>
8
+ </div>
9
+ <% unless entity.language.nil? %>
10
+ <div class="secondary info">
11
+ <%= t('activerecord.attributes.editable_block.language') %>:
12
+ <%= language_name(entity.language) %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%=
17
+ render(
18
+ partial: 'shared/admin/toggleable',
19
+ locals: {
20
+ entity: entity,
21
+ url: toggle_admin_editable_block_path(id: entity.id)
22
+ }
23
+ )
24
+ %>
25
+
26
+ <ul class="actions">
27
+ <li><%= edit_icon(edit_editable_block_path(id: entity.id)) %></li>
28
+ </ul>
29
+ </div>
@@ -0,0 +1,14 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <span><%= t('admin.editable_blocks.nav_item.text') %></span>
4
+ <% end %>
5
+
6
+ <article>
7
+ <h1><%= t('.heading') %></h1>
8
+ <ul class="actions">
9
+ <li><%= back_icon(admin_path) %></li>
10
+ <li><%= create_icon(new_editable_block_path) %></li>
11
+ </ul>
12
+
13
+ <%= render partial: 'shared/admin/list', locals: { collection: @collection } %>
14
+ </article>
@@ -0,0 +1,72 @@
1
+ <% content_for :meta_title, t('.title', slug: @entity.slug) %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.editable_blocks.nav_item.text'), admin_editable_blocks_path) %>
4
+ <span><%= @entity.slug %></span>
5
+ <% end %>
6
+
7
+ <article>
8
+ <h1><%= @entity.slug %></h1>
9
+
10
+ <ul class="actions">
11
+ <li><%= back_icon(admin_editable_blocks_path) %></li>
12
+ <li><%= edit_icon(edit_editable_block_path(id: @entity.id)) %></li>
13
+ </ul>
14
+
15
+ <dl>
16
+ <% unless @entity.language.nil? %>
17
+ <dt><%= t('activerecord.attributes.editable_block.language') %></dt>
18
+ <dd><%= language_name(@entity.language) %></dd>
19
+ <% end %>
20
+
21
+ <dt><%= t('activerecord.attributes.editable_block.name') %></dt>
22
+ <dd><%= @entity.name %></dd>
23
+
24
+ <dt><%= t('activerecord.attributes.editable_block.slug') %></dt>
25
+ <dd><%= @entity.slug %></dd>
26
+
27
+ <% unless @entity.image.blank? %>
28
+ <dt><%= t('activerecord.attributes.link_block_item.image') %></dt>
29
+ <dd>
30
+ <figure role="group" class="preview">
31
+ <%= editable_block_image_medium(@entity) %>
32
+ </figure>
33
+ </dd>
34
+ <% end %>
35
+
36
+ <% unless @entity.title.blank? %>
37
+ <dt><%= t('activerecord.attributes.editable_block.title') %></dt>
38
+ <dd><%= @entity.title %></dd>
39
+ <% end %>
40
+
41
+ <% unless @entity.lead.blank? %>
42
+ <dt><%= t('activerecord.attributes.editable_block.lead') %></dt>
43
+ <dd><%= @entity.lead %></dd>
44
+ <% end %>
45
+
46
+ <% unless @entity.body.blank? %>
47
+ <dt><%= t('activerecord.attributes.editable_block.body') %></dt>
48
+ <dd><%= @entity.body %></dd>
49
+ <% end %>
50
+
51
+ <% unless @entity.footer.blank? %>
52
+ <dt><%= t('activerecord.attributes.editable_block.footer') %></dt>
53
+ <dd><%= @entity.footer %></dd>
54
+ <% end %>
55
+
56
+ <dt><%= t(:created_at) %></dt>
57
+ <dd><%= time_tag(@entity.created_at) %></dd>
58
+
59
+ <dt><%= t(:updated_at) %></dt>
60
+ <dd><%= time_tag(@entity.updated_at) %></dd>
61
+ </dl>
62
+
63
+ <%=
64
+ render(
65
+ partial: 'shared/admin/toggleable',
66
+ locals: {
67
+ entity: @entity,
68
+ url: toggle_admin_editable_block_path(id: @entity.id)
69
+ }
70
+ )
71
+ %>
72
+ </article>
@@ -1,8 +1,9 @@
1
1
  <%= render 'admin/index/dashboard/settings' %>
2
- <%= render 'admin/index/dashboard/biovision_track' %>
2
+ <%#= render 'admin/index/dashboard/biovision_track' %>
3
3
  <%= render 'admin/index/dashboard/biovision_regions' if Gem.loaded_specs.key?('biovision-regions') %>
4
4
  <%= render 'admin/index/dashboard/biovision_user' %>
5
5
  <%= render 'admin/index/dashboard/editorial' %>
6
+ <%= render 'admin/index/dashboard/biovision_links' %>
6
7
  <%= render 'admin/index/dashboard/biovision_post' if Gem.loaded_specs.key?('biovision-post') %>
7
8
  <%= render 'admin/index/dashboard/biovision_vote' if Gem.loaded_specs.key?('biovision-vote') %>
8
9
  <%= render 'admin/index/dashboard/biovision_poll' if Gem.loaded_specs.key?('biovision-poll') %>
@@ -0,0 +1,11 @@
1
+ <% if current_user_has_privilege?(:content_manager) %>
2
+ <nav>
3
+ <div class="heading" id="biovision-links-heading">
4
+ <%= t('.heading') %>
5
+ </div>
6
+
7
+ <ul aria-describedby="biovision-links-heading">
8
+ <li><%= render 'admin/link_blocks/nav_item' %></li>
9
+ </ul>
10
+ </nav>
11
+ <% end %>
@@ -1,12 +1,11 @@
1
- <% if current_user_in_group?(:editors) %>
1
+ <% if current_user_has_privilege?(:content_manager) %>
2
2
  <nav>
3
3
  <div class="heading"><%= t('.heading') %></div>
4
4
  <ul>
5
- <% if current_user_has_privilege?(:chief_editor) %>
6
- <li><%= render 'admin/editable_pages/nav_item' %></li>
7
- <% end %>
8
- <li><%= render 'admin/media_folders/nav_item' %></li>
9
- <li><%= render 'admin/media_files/nav_item' %></li>
5
+ <li><%= render 'admin/editable_pages/nav_item' %></li>
6
+ <li><%= render 'admin/editable_blocks/nav_item' %></li>
7
+ <!-- <li><%#= render 'admin/media_folders/nav_item' %></li>-->
8
+ <!-- <li><%#= render 'admin/media_files/nav_item' %></li>-->
10
9
  </ul>
11
10
  </nav>
12
11
  <% end %>
@@ -0,0 +1,39 @@
1
+ <div class="image">
2
+ <%= link_block_image(entity) %>
3
+ </div>
4
+ <div class="data">
5
+ <div><%= admin_link_block_item_link(entity) %></div>
6
+ <% unless entity.slug.blank? %>
7
+ <div class="info">
8
+ <%= entity.slug %>
9
+ </div>
10
+ <% end %>
11
+ <% unless entity.button_url.blank? %>
12
+ <div class="secondary info">
13
+ <%= t('activerecord.attributes.link_block_item.button_url') %>:
14
+ <%= entity.button_url %>
15
+ </div>
16
+ <% end %>
17
+
18
+ <%=
19
+ render(
20
+ partial: 'shared/admin/toggleable',
21
+ locals: {
22
+ entity: entity,
23
+ url: toggle_admin_link_block_item_path(id: entity.id)
24
+ }
25
+ )
26
+ %>
27
+
28
+ <ul class="actions">
29
+ <li><%= edit_icon(edit_link_block_item_path(id: entity.id)) %></li>
30
+ <%=
31
+ render(
32
+ partial: 'shared/actions/priority_changer',
33
+ locals: {
34
+ path: priority_admin_link_block_item_path(id: entity.id)
35
+ }
36
+ )
37
+ %>
38
+ </ul>
39
+ </div>
@@ -0,0 +1,74 @@
1
+ <% content_for :meta_title, t('.title', title: @entity.text_for_link) %>
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
+ <span><%= @entity.text_for_link %></span>
6
+ <% end %>
7
+
8
+ <article>
9
+ <h1><%= @entity.text_for_link %></h1>
10
+
11
+ <ul class="actions">
12
+ <li><%= return_icon(admin_link_block_path(id: @entity.link_block_id)) %></li>
13
+ <li><%= edit_icon(edit_link_block_item_path(id: @entity.id)) %></li>
14
+ </ul>
15
+
16
+ <dl>
17
+ <dt><%= t('activerecord.attributes.link_block_item.link_block') %></dt>
18
+ <dd><%= admin_link_block_link(@entity.link_block) %></dd>
19
+
20
+ <dt><%= t('activerecord.attributes.link_block_item.priority') %></dt>
21
+ <dd><%= @entity.priority %></dd>
22
+
23
+ <% unless @entity.image.blank? %>
24
+ <dt><%= t('activerecord.attributes.link_block_item.image') %></dt>
25
+ <dd>
26
+ <figure role="group" class="preview">
27
+ <%= link_block_image(@entity) %>
28
+ <figcaption><%= @entity.image_alt_text %></figcaption>
29
+ </figure>
30
+ </dd>
31
+ <% end %>
32
+
33
+ <% unless @entity.slug.blank? %>
34
+ <dt><%= t('activerecord.attributes.link_block_item.slug') %></dt>
35
+ <dd><%= @entity.slug %></dd>
36
+ <% end %>
37
+
38
+ <% unless @entity.title.blank? %>
39
+ <dt><%= t('activerecord.attributes.link_block_item.title') %></dt>
40
+ <dd><%= @entity.title %></dd>
41
+ <% end %>
42
+
43
+ <% unless @entity.body.blank? %>
44
+ <dt><%= t('activerecord.attributes.link_block_item.body') %></dt>
45
+ <dd><%= simple_format(@entity.body) %></dd>
46
+ <% end %>
47
+
48
+ <% unless @entity.button_text.blank? %>
49
+ <dt><%= t('activerecord.attributes.link_block_item.button_text') %></dt>
50
+ <dd><%= @entity.button_text %></dd>
51
+ <% end %>
52
+
53
+ <% unless @entity.button_url.blank? %>
54
+ <dt><%= t('activerecord.attributes.link_block_item.button_url') %></dt>
55
+ <dd><%= @entity.button_url %></dd>
56
+ <% end %>
57
+
58
+ <dt><%= t(:created_at) %></dt>
59
+ <dd><%= time_tag(@entity.created_at) %></dd>
60
+
61
+ <dt><%= t(:updated_at) %></dt>
62
+ <dd><%= time_tag(@entity.updated_at) %></dd>
63
+ </dl>
64
+
65
+ <%=
66
+ render(
67
+ partial: 'shared/admin/toggleable',
68
+ locals: {
69
+ entity: @entity,
70
+ url: toggle_admin_link_block_item_path(id: @entity.id)
71
+ }
72
+ )
73
+ %>
74
+ </article>
@@ -0,0 +1,6 @@
1
+ <div>
2
+ <%= link_to t('.text'), admin_link_blocks_path %>
3
+ </div>
4
+ <div class="description">
5
+ <%= t('.description') %>
6
+ </div>
@@ -0,0 +1,26 @@
1
+ <div class="data">
2
+ <div><%= admin_link_block_link(entity) %></div>
3
+ <div class="info">
4
+ <%= entity.slug %>
5
+ </div>
6
+ <% unless entity.language.nil? %>
7
+ <div class="secondary info">
8
+ <%= t('activerecord.attributes.link_block.language') %>:
9
+ <%= language_name(entity.language) %>
10
+ </div>
11
+ <% end %>
12
+
13
+ <%=
14
+ render(
15
+ partial: 'shared/admin/toggleable',
16
+ locals: {
17
+ entity: entity,
18
+ url: toggle_admin_link_block_path(id: entity.id)
19
+ }
20
+ )
21
+ %>
22
+
23
+ <ul class="actions">
24
+ <li><%= edit_icon(edit_link_block_path(id: entity.id)) %></li>
25
+ </ul>
26
+ </div>
@@ -0,0 +1,23 @@
1
+ <section>
2
+ <h2><%= t('.heading') %></h2>
3
+
4
+ <%=
5
+ render(
6
+ partial: 'shared/admin/list_with_priority',
7
+ locals: {
8
+ collection: entity.link_block_items.list_for_administration
9
+ }
10
+ )
11
+ %>
12
+ </section>
13
+
14
+ <section>
15
+ <h2><%= t('.new_item') %></h2>
16
+
17
+ <%=
18
+ render(
19
+ partial: 'link_block_items/form',
20
+ locals: { entity: entity.link_block_items.new }
21
+ )
22
+ %>
23
+ </section>
@@ -0,0 +1,14 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <span><%= t('admin.link_blocks.nav_item.text') %></span>
4
+ <% end %>
5
+
6
+ <article>
7
+ <h1><%= t('.heading') %></h1>
8
+ <ul class="actions">
9
+ <li><%= back_icon(admin_path) %></li>
10
+ <li><%= create_icon(new_link_block_path) %></li>
11
+ </ul>
12
+
13
+ <%= render partial: 'shared/admin/list', locals: { collection: @collection } %>
14
+ </article>
@@ -0,0 +1,57 @@
1
+ <% content_for :meta_title, t('.title', slug: @entity.slug) %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.link_blocks.nav_item.text'), admin_link_blocks_path) %>
4
+ <span><%= @entity.slug %></span>
5
+ <% end %>
6
+
7
+ <article>
8
+ <h1><%= @entity.slug %></h1>
9
+
10
+ <ul class="actions">
11
+ <li><%= back_icon(admin_link_blocks_path) %></li>
12
+ <li><%= edit_icon(edit_link_block_path(id: @entity.id)) %></li>
13
+ </ul>
14
+
15
+ <dl>
16
+ <% unless @entity.language.nil? %>
17
+ <dt><%= t('activerecord.attributes.link_block.language') %></dt>
18
+ <dd><%= language_name(@entity.language) %></dd>
19
+ <% end %>
20
+
21
+ <dt><%= t('activerecord.attributes.link_block.slug') %></dt>
22
+ <dd><%= @entity.slug %></dd>
23
+
24
+ <% unless @entity.title.blank? %>
25
+ <dt><%= t('activerecord.attributes.link_block.title') %></dt>
26
+ <dd><%= @entity.title %></dd>
27
+ <% end %>
28
+
29
+ <% unless @entity.lead.blank? %>
30
+ <dt><%= t('activerecord.attributes.link_block.lead') %></dt>
31
+ <dd><%= simple_format(@entity.lead) %></dd>
32
+ <% end %>
33
+
34
+ <% unless @entity.footer_text.blank? %>
35
+ <dt><%= t('activerecord.attributes.link_block.footer_text') %></dt>
36
+ <dd><%= simple_format(@entity.footer_text) %></dd>
37
+ <% end %>
38
+
39
+ <dt><%= t(:created_at) %></dt>
40
+ <dd><%= time_tag(@entity.created_at) %></dd>
41
+
42
+ <dt><%= t(:updated_at) %></dt>
43
+ <dd><%= time_tag(@entity.updated_at) %></dd>
44
+ </dl>
45
+
46
+ <%=
47
+ render(
48
+ partial: 'shared/admin/toggleable',
49
+ locals: {
50
+ entity: @entity,
51
+ url: toggle_admin_link_block_path(id: @entity.id)
52
+ }
53
+ )
54
+ %>
55
+
56
+ <%= render partial: 'admin/link_blocks/entity/items', locals: { entity: @entity } %>
57
+ </article>
@@ -24,7 +24,7 @@
24
24
  document.addEventListener('DOMContentLoaded', function () {
25
25
  const canvas = document.getElementById('metric-chart');
26
26
  const url = canvas.getAttribute('data-source');
27
- const request = Biovision.new_ajax_request('GET', url, function () {
27
+ const request = Biovision.newAjaxRequest('GET', url, function () {
28
28
  const response = JSON.parse(this.responseText);
29
29
 
30
30
  if (response.hasOwnProperty('data')) {
@@ -20,7 +20,7 @@
20
20
  element.addEventListener('click', function () {
21
21
  const url = this.closest('li').getAttribute('data-url');
22
22
  const method = this.checked ? 'put' : 'delete';
23
- const request = Biovision.new_ajax_request(method, url, function() {
23
+ const request = Biovision.newAjaxRequest(method, url, function() {
24
24
  console.log(JSON.parse(this.responseText));
25
25
  });
26
26
 
@@ -14,7 +14,14 @@
14
14
  <li class="lockable <%= entity.locked? ? 'hidden' : '' %>">
15
15
  <%= edit_icon(edit_privilege_path(id: entity.id)) %>
16
16
  </li>
17
- <%= render partial: 'shared/actions/priority_changer', locals: { path: priority_admin_privilege_path(id: entity.id) } %>
17
+ <%=
18
+ render(
19
+ partial: 'shared/actions/priority_changer',
20
+ locals: {
21
+ path: priority_admin_privilege_path(id: entity.id)
22
+ }
23
+ )
24
+ %>
18
25
  <%= render partial: 'shared/actions/locks', locals: { entity: entity, path: lock_admin_privilege_path(id: entity.id) } %>
19
26
  </ul>
20
27
 
@@ -6,6 +6,9 @@
6
6
  <% unless entity.notice.blank? %>
7
7
  <div><%= entity.notice %></div>
8
8
  <% end %>
9
+ <div class="info">
10
+ <%= entity.screen_name %>
11
+ </div>
9
12
  <% unless entity.email.blank? %>
10
13
  <div class="info">
11
14
  <%= t('activerecord.attributes.user.email') %>: <%= entity.email %>
@@ -30,7 +30,7 @@
30
30
  const method = this.checked ? 'put' : 'delete';
31
31
  const region_id = this.getAttribute('data-region-id');
32
32
  const data = region_id > 0 ? {region_id: region_id} : {};
33
- const request = Biovision.new_ajax_request(method, url);
33
+ const request = Biovision.newAjaxRequest(method, url);
34
34
 
35
35
  request.setRequestHeader("Content-Type", "application/json");
36
36
  request.send(JSON.stringify(data));
@@ -44,7 +44,7 @@
44
44
  if (element.matches('button.add_regions')) {
45
45
  const container = element.closest('ul');
46
46
  const url = container.getAttribute('data-url');
47
- const request = Biovision.new_ajax_request('GET', url, function () {
47
+ const request = Biovision.newAjaxRequest('GET', url, function () {
48
48
  const response = JSON.parse(this.responseText);
49
49
  const li = element.closest('li');
50
50
 
@@ -71,7 +71,7 @@
71
71
  const data = {region_id: element.value};
72
72
  const list = li.querySelector('ul.regions');
73
73
 
74
- const request = Biovision.new_ajax_request('put', url, function() {
74
+ const request = Biovision.newAjaxRequest('put', url, function() {
75
75
  if (list) {
76
76
  list.parentNode.removeChild(list);
77
77
  }
@@ -0,0 +1,36 @@
1
+ <% unless entity.nil? %>
2
+ <% style = 'background-image: url("' + entity.image.large.url + '")' %>
3
+ <section
4
+ id="editable-block-<%= entity.slug %>"
5
+ style="<%= entity.image.blank? ? '' : style %>"
6
+ class="biovision-editable-block"
7
+ >
8
+ <% unless entity.title.blank? %>
9
+ <h2><%= raw(entity.title) %></h2>
10
+ <% end %>
11
+
12
+ <% if entity.editable_by?(current_user) %>
13
+ <ul class="actions">
14
+ <li><%= gear_icon(admin_editable_block_path(id: entity.id)) %></li>
15
+ </ul>
16
+ <% end %>
17
+
18
+ <% unless entity.lead.blank? %>
19
+ <div class="lead">
20
+ <%= entity.raw_output? ? raw(entity.lead) : entity.lead %>
21
+ </div>
22
+ <% end %>
23
+
24
+ <% unless entity.body.blank? %>
25
+ <div class="body">
26
+ <%= entity.raw_output? ? raw(entity.body) : entity.body %>
27
+ </div>
28
+ <% end %>
29
+
30
+ <% unless entity.footer.blank? %>
31
+ <footer>
32
+ <%= entity.raw_output? ? raw(entity.footer) : entity.footer %>
33
+ </footer>
34
+ <% end %>
35
+ </section>
36
+ <% end %>