biovision-post 0.21.190513.0 → 0.26.191013.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/biovision_post_manifest.js +1 -0
  3. data/app/assets/images/biovision/post/icons/comment.svg +9 -0
  4. data/app/assets/javascripts/biovision/post/biovision-posts.js +21 -28
  5. data/app/assets/stylesheets/biovision/post/posts.scss +6 -0
  6. data/app/controllers/admin/editorial_members_controller.rb +9 -4
  7. data/app/controllers/admin/featured_posts_controller.rb +9 -4
  8. data/app/controllers/admin/post_categories_controller.rb +12 -6
  9. data/app/controllers/admin/post_group_categories_controller.rb +9 -4
  10. data/app/controllers/admin/post_group_tags_controller.rb +9 -4
  11. data/app/controllers/admin/post_groups_controller.rb +9 -4
  12. data/app/controllers/admin/post_illustrations_controller.rb +9 -4
  13. data/app/controllers/admin/post_images_controller.rb +9 -4
  14. data/app/controllers/admin/post_links_controller.rb +9 -4
  15. data/app/controllers/admin/post_tags_controller.rb +9 -4
  16. data/app/controllers/admin/post_types_controller.rb +13 -4
  17. data/app/controllers/admin/posts_controller.rb +6 -8
  18. data/app/controllers/articles_controller.rb +16 -6
  19. data/app/controllers/authors_controller.rb +9 -4
  20. data/app/controllers/blog_posts_controller.rb +16 -6
  21. data/app/controllers/editorial_members_controller.rb +9 -4
  22. data/app/controllers/featured_posts_controller.rb +6 -1
  23. data/app/controllers/my/posts_controller.rb +35 -38
  24. data/app/controllers/news_controller.rb +16 -6
  25. data/app/controllers/post_attachments_controller.rb +36 -0
  26. data/app/controllers/post_categories_controller.rb +6 -1
  27. data/app/controllers/post_groups_controller.rb +9 -4
  28. data/app/controllers/post_illustrations_controller.rb +6 -1
  29. data/app/controllers/post_images_controller.rb +9 -8
  30. data/app/controllers/post_links_controller.rb +5 -2
  31. data/app/controllers/post_tags_controller.rb +9 -4
  32. data/app/controllers/posts_controller.rb +39 -17
  33. data/app/helpers/biovision_posts_helper.rb +28 -27
  34. data/app/jobs/post_body_parser_job.rb +1 -1
  35. data/app/models/concerns/post_child_with_priority.rb +2 -1
  36. data/app/models/editorial_member.rb +10 -1
  37. data/app/models/post.rb +39 -11
  38. data/app/models/post_attachment.rb +49 -0
  39. data/app/models/post_category.rb +6 -0
  40. data/app/models/post_group_category.rb +1 -1
  41. data/app/models/post_illustration.rb +2 -1
  42. data/app/models/post_image.rb +2 -1
  43. data/app/models/post_type.rb +15 -0
  44. data/app/services/biovision/components/posts_component.rb +65 -0
  45. data/app/views/admin/components/links/_posts.html.erb +33 -0
  46. data/app/views/admin/editorial_members/index.html.erb +2 -1
  47. data/app/views/admin/editorial_members/show.html.erb +1 -0
  48. data/app/views/admin/featured_posts/index.html.erb +1 -0
  49. data/app/views/admin/post_categories/entity/_in_list.html.erb +10 -0
  50. data/app/views/admin/post_categories/show.html.erb +11 -0
  51. data/app/views/admin/post_groups/index.html.erb +2 -1
  52. data/app/views/admin/post_groups/show.html.erb +1 -0
  53. data/app/views/admin/post_illustrations/index.html.erb +1 -0
  54. data/app/views/admin/post_illustrations/show.html.erb +1 -0
  55. data/app/views/admin/post_images/index.html.erb +2 -1
  56. data/app/views/admin/post_images/show.html.erb +1 -0
  57. data/app/views/admin/post_tags/index.html.erb +2 -1
  58. data/app/views/admin/post_tags/posts.html.erb +4 -3
  59. data/app/views/admin/post_tags/show.html.erb +3 -2
  60. data/app/views/admin/post_types/authors.html.erb +1 -0
  61. data/app/views/admin/post_types/index.html.erb +2 -1
  62. data/app/views/admin/post_types/new_post.html.erb +13 -4
  63. data/app/views/admin/post_types/post_categories.html.erb +1 -0
  64. data/app/views/admin/post_types/post_tags.html.erb +4 -3
  65. data/app/views/admin/post_types/show.html.erb +3 -2
  66. data/app/views/admin/posts/entity/_in_list.html.erb +3 -3
  67. data/app/views/admin/posts/images.html.erb +1 -0
  68. data/app/views/admin/posts/index.html.erb +2 -1
  69. data/app/views/admin/posts/search.html.erb +10 -1
  70. data/app/views/admin/posts/show.html.erb +6 -7
  71. data/app/views/authors/show.html.erb +1 -1
  72. data/app/views/blog_posts/index.html.erb +4 -2
  73. data/app/views/editorial_members/edit.html.erb +1 -0
  74. data/app/views/editorial_members/new.html.erb +3 -2
  75. data/app/views/my/index/dashboard/_biovision_post.html.erb +5 -4
  76. data/app/views/my/posts/_form.html.erb +40 -194
  77. data/app/views/my/posts/_post.html.erb +2 -3
  78. data/app/views/my/posts/articles.html.erb +1 -1
  79. data/app/views/my/posts/blog_posts.html.erb +1 -1
  80. data/app/views/my/posts/index/_navigation.html.erb +3 -3
  81. data/app/views/my/posts/new.html.erb +9 -1
  82. data/app/views/my/posts/news_index.html.erb +1 -1
  83. data/app/views/posts/_breadcrumbs.html.erb +1 -6
  84. data/app/views/posts/_form.html.erb +9 -2
  85. data/app/views/posts/_post.html.erb +7 -11
  86. data/app/views/posts/_preview.html.erb +7 -1
  87. data/app/views/posts/edit.html.erb +9 -1
  88. data/app/views/posts/post_type/_category.html.erb +4 -2
  89. data/app/views/posts/post_type/_post_page.html.erb +7 -1
  90. data/app/views/posts/post_type/_posts.html.erb +11 -2
  91. data/app/views/posts/post_type/_tagged.html.erb +4 -4
  92. data/app/views/posts/rss.xml.erb +1 -1
  93. data/app/views/posts/show.html.erb +0 -5
  94. data/app/views/posts/zen.xml.erb +3 -3
  95. data/config/locales/posts-ru.yml +11 -1
  96. data/config/routes.rb +3 -0
  97. data/db/{migrate → amends}/20190202232323_add_spam_to_posts.rb +0 -0
  98. data/db/{migrate → amends}/20190224212121_add_data_to_posts.rb +0 -0
  99. data/db/{migrate → amends}/20190224212122_rename_post_image_source.rb +0 -0
  100. data/db/{migrate → amends}/20190224212123_add_uuid_to_post_images.rb +0 -0
  101. data/db/{migrate → amends}/20190313141414_convert_json_post_columns.rb +0 -0
  102. data/db/amends/20190925181818_add_search_index_to_posts.rb +24 -0
  103. data/db/migrate/20170930000001_create_post_types.rb +4 -13
  104. data/db/migrate/20170930000010_create_posts.rb +26 -3
  105. data/db/migrate/20190715141414_add_data_to_post_categories.rb +14 -0
  106. data/db/migrate/20190801161616_add_posts_component.rb +14 -0
  107. data/db/migrate/20190822121212_create_post_attachments.rb +20 -0
  108. data/db/migrate/20190914212121_convert_post_privileges.rb +56 -0
  109. data/lib/biovision/post/version.rb +1 -1
  110. metadata +18 -13
  111. data/app/services/post_manager.rb +0 -71
  112. data/app/views/admin/index/dashboard/_biovision_post.html.erb +0 -36
  113. data/app/views/articles/show.html.erb +0 -6
  114. data/app/views/blog_posts/show.html.erb +0 -6
  115. data/app/views/news/show.html.erb +0 -6
@@ -31,6 +31,6 @@ class PostGroupCategory < ApplicationRecord
31
31
  next unless link.post_category.visible?
32
32
 
33
33
  link.post_category
34
- end
34
+ end.compact
35
35
  end
36
36
  end
@@ -47,8 +47,9 @@ class PostIllustration < ApplicationRecord
47
47
  end
48
48
 
49
49
  # @param [User] user
50
+ # @deprecated use component handler
50
51
  def editable_by?(user)
51
- owned_by?(user) || UserPrivilege.user_has_privilege?(user, :chief_editor)
52
+ Biovision::Components::BaseComponent.handler('posts', user).editable?(self)
52
53
  end
53
54
 
54
55
  # Response data for CKEditor upload
@@ -52,8 +52,9 @@ class PostImage < ApplicationRecord
52
52
  end
53
53
 
54
54
  # @param [User] user
55
+ # @deprecated use component handler
55
56
  def editable_by?(user)
56
- post.editable_by?(user)
57
+ Biovision::Components::BaseComponent.handler('posts', user).editable?(post)
57
58
  end
58
59
 
59
60
  def has_image_data?
@@ -36,4 +36,19 @@ class PostType < ApplicationRecord
36
36
  def self.page_for_administration
37
37
  active.ordered_by_name
38
38
  end
39
+
40
+ # @param [String] slug
41
+ def self.[](slug)
42
+ find_by(slug: slug)
43
+ end
44
+
45
+ # @param [Symbol] locale
46
+ def url(locale = I18n.default_locale)
47
+ prefix = locale.nil? || locale == I18n.default_locale ? '' : "/#{locale}"
48
+ "#{prefix}/#{url_part}"
49
+ end
50
+
51
+ def category_name!
52
+ default_category_name.blank? ? name : default_category_name
53
+ end
39
54
  end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Biovision
4
+ module Components
5
+ # Component for posts
6
+ class PostsComponent < BaseComponent
7
+ SLUG = 'posts'
8
+
9
+ def self.privilege_names
10
+ %w[chief_editor deputy_chief_editor editor]
11
+ end
12
+
13
+ def use_parameters?
14
+ false
15
+ end
16
+
17
+ # @param [Symbol] name
18
+ def group?(name)
19
+ case name
20
+ when :chief
21
+ allow? 'chief_editor', 'deputy_chief_editor'
22
+ else
23
+ allow? 'chief_editor', 'deputy_chief_editor', 'editor'
24
+ end
25
+ end
26
+
27
+ def show_dashboard?
28
+ return true if user.super_user?
29
+ return true if group?(:chief)
30
+
31
+ criterion = { editorial_member: EditorialMember[user] }
32
+ editor = EditorialMemberPostType.where(criterion).exists?
33
+ editor || Post.owned_by(user).exists?
34
+ end
35
+
36
+ # @param [PostType|String|Symbol] type
37
+ def allow_post_type?(type)
38
+ return false if user.nil?
39
+ return true if user.super_user?
40
+ return true if group?(:chief)
41
+
42
+ criteria = {
43
+ editorial_member: EditorialMember[user],
44
+ post_type: type.is_a?(PostType) ? type : PostType[type]
45
+ }
46
+ EditorialMemberPostType.where(criteria).exists?
47
+ end
48
+
49
+ def editable?(entity)
50
+ return true if group?(:chief)
51
+
52
+ entity.owned_by?(user)
53
+ end
54
+
55
+ # @param [Post] entity
56
+ def edit_path(entity)
57
+ if group?(:chief)
58
+ "/posts/#{entity.id}/edit"
59
+ else
60
+ "/my/posts/#{entity.id}/edit"
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,33 @@
1
+ <li>
2
+ <%= render 'admin/post_types/nav_item' %>
3
+ <ul>
4
+ <% PostType.list_for_administration.each do |post_type| %>
5
+ <li>
6
+ <div><%= admin_post_type_link(post_type) %></div>
7
+ <div class="description">
8
+ <%= t(:post_count, count: post_type.posts_count) %>
9
+ </div>
10
+ <% if handler.allow_post_type?(post_type) %>
11
+ <ul class="actions">
12
+ <li>
13
+ <%= create_icon(new_post_admin_post_type_path(id: post_type.id)) %>
14
+ </li>
15
+ </ul>
16
+ <% end %>
17
+ </li>
18
+ <% end %>
19
+ </ul>
20
+ </li>
21
+ <li><%= render 'admin/posts/nav_item' %></li>
22
+ <% if handler.allow?('chief_editor', 'deputy_chief_editor') %>
23
+ <li><%= render 'admin/featured_posts/nav_item' %></li>
24
+ <% end %>
25
+ <% if handler.allow?('chief_editor') %>
26
+ <li><%= render 'admin/post_groups/nav_item' %></li>
27
+ <li><%= render 'admin/post_tags/nav_item' %></li>
28
+ <% end %>
29
+ <li><%= render 'admin/post_illustrations/nav_item' %></li>
30
+ <li><%= render 'admin/post_images/nav_item' %></li>
31
+ <% if handler.allow?('chief_editor') %>
32
+ <li><%= render 'admin/editorial_members/nav_item' %></li>
33
+ <% end %>
@@ -1,6 +1,7 @@
1
1
  <% content_for :meta_title, t('.title') %>
2
2
  <% content_for :breadcrumbs do %>
3
- <span><%= t('admin.editorial_members.nav_item.text') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <span><%= t('admin.editorial_members.nav_item.text') %></span>
4
5
  <% end %>
5
6
 
6
7
  <article>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.editorial_members.nav_item.text'), admin_editorial_members_path) %>
4
5
  <span><%= @entity.name %></span>
5
6
  <% end %>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title') %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <span><%= t('admin.featured_posts.nav_item.text') %></span>
4
5
  <% end %>
5
6
 
@@ -10,6 +10,16 @@
10
10
  </div>
11
11
  <% end %>
12
12
 
13
+ <%=
14
+ render(
15
+ partial: 'shared/admin/toggleable',
16
+ locals: {
17
+ entity: entity,
18
+ url: toggle_admin_post_category_path(id: entity.id)
19
+ }
20
+ )
21
+ %>
22
+
13
23
  <ul class="actions">
14
24
  <li class="lockable <%= entity.locked? ? 'hidden' : '' %>">
15
25
  <%= edit_icon edit_post_category_path(id: entity.id) %>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
4
5
  <%= admin_post_type_link(@entity.post_type) %>
5
6
  <%= link_to(t('admin.post_types.post_categories.heading'), post_categories_admin_post_type_path(id: @entity.post_type_id)) %>
@@ -50,6 +51,16 @@
50
51
  <% end %>
51
52
  </dl>
52
53
 
54
+ <%=
55
+ render(
56
+ partial: 'shared/admin/toggleable',
57
+ locals: {
58
+ entity: @entity,
59
+ url: toggle_admin_post_category_path(id: @entity.id)
60
+ }
61
+ )
62
+ %>
63
+
53
64
  <% if @entity.child_categories.any? %>
54
65
  <section>
55
66
  <h2><%= t('.children') %></h2>
@@ -1,6 +1,7 @@
1
1
  <% content_for :meta_title, t('.title') %>
2
2
  <% content_for :breadcrumbs do %>
3
- <span><%= t('admin.post_groups.nav_item.text') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <span><%= t('admin.post_groups.nav_item.text') %></span>
4
5
  <% end %>
5
6
 
6
7
  <article>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.post_groups.nav_item.text'), admin_post_groups_path) %>
4
5
  <span><%= @entity.name %></span>
5
6
  <% end %>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', page: current_page) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <span><%= t('admin.post_illustrations.nav_item.text') %></span>
4
5
  <% end %>
5
6
 
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.post_illustrations.nav_item.text'), admin_post_illustrations_path) %>
4
5
  <span><%= @entity.name %></span>
5
6
  <% end %>
@@ -1,6 +1,7 @@
1
1
  <% content_for :meta_title, t('.title', page: current_page) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <span><%= t('admin.post_images.nav_item.text') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <span><%= t('admin.post_images.nav_item.text') %></span>
4
5
  <% end %>
5
6
 
6
7
  <article>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', caption: @entity.caption) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.posts.nav_item.text'), admin_posts_path) %>
4
5
  <%= admin_post_link(@entity.post) %>
5
6
  <%= link_to(t('admin.posts.images.nav_text'), images_admin_post_path(id: @entity.post_id)) %>
@@ -1,6 +1,7 @@
1
1
  <% content_for :meta_title, t('.title', page: current_page) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <span><%= t('admin.post_tags.nav_item.text') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <span><%= t('admin.post_tags.nav_item.text') %></span>
4
5
  <% end %>
5
6
 
6
7
  <article>
@@ -1,8 +1,9 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name, page: current_page) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <%= link_to(t('admin.post_tags.nav_item.text'), admin_post_tags_path) %>
4
- <%= admin_post_tag_link(@entity) %>
5
- <span><%= t('.nav_text') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <%= link_to(t('admin.post_tags.nav_item.text'), admin_post_tags_path) %>
5
+ <%= admin_post_tag_link(@entity) %>
6
+ <span><%= t('.nav_text') %></span>
6
7
  <% end %>
7
8
 
8
9
  <article>
@@ -1,7 +1,8 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <%= link_to(t('admin.post_tags.nav_item.text'), admin_post_tags_path) %>
4
- <span><%= @entity.name %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <%= link_to(t('admin.post_tags.nav_item.text'), admin_post_tags_path) %>
5
+ <span><%= @entity.name %></span>
5
6
  <% end %>
6
7
 
7
8
  <article>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
4
5
  <%= admin_post_type_link(@entity) %>
5
6
  <span><%= t('.nav_text') %></span>
@@ -1,6 +1,7 @@
1
1
  <% content_for :meta_title, t('.title') %>
2
2
  <% content_for :breadcrumbs do %>
3
- <span><%= t('admin.post_types.nav_item.text') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <span><%= t('admin.post_types.nav_item.text') %></span>
4
5
  <% end %>
5
6
 
6
7
  <article>
@@ -1,8 +1,9 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
4
- <%= admin_post_type_link(@entity) %>
5
- <span><%= t('.heading') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
5
+ <%= admin_post_type_link(@entity) %>
6
+ <span><%= t('.heading') %></span>
6
7
  <% end %>
7
8
 
8
9
  <article>
@@ -12,5 +13,13 @@
12
13
  <li><%= return_icon(admin_post_type_path(id: @entity.id)) %></li>
13
14
  </ul>
14
15
 
15
- <%= render partial: 'posts/form', locals: { entity: Post.new(post_type: @entity) } %>
16
+ <%=
17
+ render(
18
+ partial: 'posts/form',
19
+ locals: {
20
+ entity: Post.new(post_type: @entity),
21
+ handler: component_handler
22
+ }
23
+ )
24
+ %>
16
25
  </article>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
4
5
  <%= admin_post_type_link(@entity) %>
5
6
  <span><%= t('.heading') %></span>
@@ -1,8 +1,9 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name, page: current_page) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
4
- <%= admin_post_type_link(@entity) %>
5
- <span><%= t('.nav_text') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
5
+ <%= admin_post_type_link(@entity) %>
6
+ <span><%= t('.nav_text') %></span>
6
7
  <% end %>
7
8
 
8
9
  <article>
@@ -1,7 +1,8 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
4
- <span><%= @entity.name %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <%= link_to(t('admin.post_types.nav_item.text'), admin_post_types_path) %>
5
+ <span><%= @entity.name %></span>
5
6
  <% end %>
6
7
 
7
8
  <article>
@@ -70,14 +70,14 @@
70
70
  partial: 'shared/actions/locks',
71
71
  locals: {
72
72
  entity: entity,
73
- path: (current_user_has_privilege?(:chief_editor) ? lock_admin_post_path(id: entity.id) : '')
73
+ path: (handler.allow?(:chief_editor) ? lock_admin_post_path(id: entity.id) : '')
74
74
  }
75
75
  )
76
76
  %>
77
- <li class="lockable <%= entity.editable_by?(current_user) ? '' : 'hidden' %>">
77
+ <li class="lockable <%= handler.editable?(entity) ? '' : 'hidden' %>">
78
78
  <%= edit_icon(edit_post_path(id: entity.id)) %>
79
79
  </li>
80
- <li class="lockable <%= entity.editable_by?(current_user) ? '' : 'hidden' %> danger">
80
+ <li class="lockable <%= handler.editable?(entity) ? '' : 'hidden' %> danger">
81
81
  <%= destroy_icon(entity) %>
82
82
  </li>
83
83
  </ul>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', post: @entity.title) %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.posts.nav_item.text'), admin_posts_path) %>
4
5
  <%= admin_post_link(@entity) %>
5
6
  <span><%= t('.nav_text') %></span>
@@ -1,6 +1,7 @@
1
1
  <% content_for :meta_title, t('.title', page: current_page) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <span><%= t('admin.posts.nav_item.text') %></span>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
4
+ <span><%= t('admin.posts.nav_item.text') %></span>
4
5
  <% end %>
5
6
 
6
7
  <article>
@@ -1,5 +1,6 @@
1
1
  <% content_for :meta_title, t('.title') %>
2
2
  <% content_for :breadcrumbs do %>
3
+ <%= admin_biovision_component_link(component_handler.component) %>
3
4
  <%= link_to(t('admin.posts.nav_item.text'), admin_posts_path) %>
4
5
  <span><%= t('.nav_text') %></span>
5
6
  <% end %>
@@ -15,7 +16,15 @@
15
16
 
16
17
  <% if @collection.respond_to?(:current_page) %>
17
18
  <%= paginate @collection %>
18
- <%= render partial: 'shared/admin/list', locals: { collection: @collection } %>
19
+ <%=
20
+ render(
21
+ partial: 'shared/admin/list',
22
+ locals: {
23
+ collection: @collection,
24
+ handler: component_handler
25
+ }
26
+ )
27
+ %>
19
28
  <%= paginate @collection %>
20
29
  <% end %>
21
30
  </article>