biovision-post 0.2.180325 → 0.21.190513.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +79 -13
  3. data/app/assets/images/biovision/post/icons/time.svg +6 -0
  4. data/app/assets/images/biovision/post/publisher_logo.png +0 -0
  5. data/app/assets/javascripts/biovision/post/biovision-posts.js +258 -0
  6. data/app/assets/stylesheets/biovision/post/admin/posts.scss +93 -0
  7. data/app/assets/stylesheets/biovision/post/posts.scss +88 -37
  8. data/app/controllers/admin/editorial_members_controller.rb +43 -0
  9. data/app/controllers/admin/featured_posts_controller.rb +23 -0
  10. data/app/controllers/admin/post_group_categories_controller.rb +19 -0
  11. data/app/controllers/admin/post_group_tags_controller.rb +19 -0
  12. data/app/controllers/admin/post_groups_controller.rb +62 -0
  13. data/app/controllers/admin/post_illustrations_controller.rb +26 -0
  14. data/app/controllers/admin/post_images_controller.rb +33 -0
  15. data/app/controllers/admin/post_links_controller.rb +19 -0
  16. data/app/controllers/admin/post_tags_controller.rb +30 -0
  17. data/app/controllers/admin/post_types_controller.rb +16 -4
  18. data/app/controllers/admin/posts_controller.rb +26 -2
  19. data/app/controllers/articles_controller.rb +23 -11
  20. data/app/controllers/authors_controller.rb +27 -0
  21. data/app/controllers/blog_posts_controller.rb +23 -11
  22. data/app/controllers/editorial_members_controller.rb +65 -0
  23. data/app/controllers/featured_posts_controller.rb +59 -0
  24. data/app/controllers/my/posts_controller.rb +124 -0
  25. data/app/controllers/news_controller.rb +23 -11
  26. data/app/controllers/post_categories_controller.rb +4 -14
  27. data/app/controllers/post_groups_controller.rb +76 -0
  28. data/app/controllers/post_illustrations_controller.rb +22 -0
  29. data/app/controllers/post_images_controller.rb +62 -0
  30. data/app/controllers/post_links_controller.rb +37 -0
  31. data/app/controllers/post_tags_controller.rb +41 -0
  32. data/app/controllers/posts_controller.rb +119 -14
  33. data/app/helpers/biovision_posts_helper.rb +114 -5
  34. data/app/jobs/application_job.rb +7 -0
  35. data/app/jobs/post_body_parser_job.rb +15 -0
  36. data/app/models/editorial_member.rb +92 -0
  37. data/app/models/editorial_member_post_type.rb +15 -0
  38. data/app/models/featured_post.rb +25 -0
  39. data/app/models/post.rb +203 -38
  40. data/app/models/post_category.rb +76 -54
  41. data/app/models/post_group.rb +84 -0
  42. data/app/models/post_group_category.rb +36 -0
  43. data/app/models/post_group_tag.rb +32 -0
  44. data/app/models/post_illustration.rb +62 -0
  45. data/app/models/post_image.rb +88 -0
  46. data/app/models/post_layout.rb +14 -0
  47. data/app/models/post_link.rb +2 -0
  48. data/app/models/post_post_category.rb +24 -0
  49. data/app/models/post_post_tag.rb +21 -0
  50. data/app/models/post_tag.rb +70 -0
  51. data/app/models/post_translation.rb +7 -0
  52. data/app/models/post_type.rb +18 -2
  53. data/app/models/post_zen_category.rb +6 -0
  54. data/app/models/zen_category.rb +21 -0
  55. data/app/services/post_manager.rb +52 -15
  56. data/app/services/post_parser.rb +80 -0
  57. data/app/uploaders/post_image_uploader.rb +9 -9
  58. data/app/views/admin/editorial_members/_nav_item.html.erb +2 -0
  59. data/app/views/admin/editorial_members/entity/_in_list.html.erb +37 -0
  60. data/app/views/admin/editorial_members/index.html.erb +15 -0
  61. data/app/views/admin/editorial_members/show.html.erb +71 -0
  62. data/app/views/admin/featured_posts/_add.html.erb +140 -0
  63. data/app/views/admin/featured_posts/_language.html.erb +14 -0
  64. data/app/views/admin/featured_posts/_nav_item.html.erb +2 -0
  65. data/app/views/admin/featured_posts/entity/_in_list.html.erb +26 -0
  66. data/app/views/admin/featured_posts/index.html.erb +18 -0
  67. data/app/views/admin/index/dashboard/_biovision_post.html.erb +32 -25
  68. data/app/views/admin/post_categories/entity/_in_list.html.erb +22 -6
  69. data/app/views/admin/post_categories/show.html.erb +6 -1
  70. data/app/views/admin/post_group_categories/entity/_in_list.html.erb +18 -0
  71. data/app/views/admin/post_group_tags/entity/_in_list.html.erb +18 -0
  72. data/app/views/admin/post_groups/_nav_item.html.erb +6 -0
  73. data/app/views/admin/post_groups/entity/_categories.html.erb +33 -0
  74. data/app/views/admin/post_groups/entity/_in_list.html.erb +25 -0
  75. data/app/views/admin/post_groups/index.html.erb +22 -0
  76. data/app/views/admin/post_groups/show.html.erb +65 -0
  77. data/app/views/admin/post_groups/tags.jbuilder +12 -0
  78. data/app/views/admin/post_illustrations/_nav_item.html.erb +6 -0
  79. data/app/views/admin/post_illustrations/entity/_in_list.html.erb +19 -0
  80. data/app/views/admin/post_illustrations/index.html.erb +23 -0
  81. data/app/views/admin/post_illustrations/show.html.erb +32 -0
  82. data/app/views/admin/post_images/_nav_item.html.erb +2 -0
  83. data/app/views/admin/post_images/entity/_in_list.html.erb +30 -0
  84. data/app/views/admin/post_images/index.html.erb +16 -0
  85. data/app/views/admin/post_images/show.html.erb +49 -0
  86. data/app/views/admin/post_links/entity/_in_list.html.erb +43 -0
  87. data/app/views/admin/post_tags/_nav_item.html.erb +2 -0
  88. data/app/views/admin/post_tags/entity/_in_list.html.erb +23 -0
  89. data/app/views/admin/post_tags/index.html.erb +16 -0
  90. data/app/views/admin/post_tags/posts.html.erb +18 -0
  91. data/app/views/admin/post_tags/show.html.erb +37 -0
  92. data/app/views/admin/post_types/authors.html.erb +23 -0
  93. data/app/views/admin/post_types/post_categories.html.erb +15 -4
  94. data/app/views/admin/post_types/post_tags.html.erb +18 -0
  95. data/app/views/admin/post_types/show.html.erb +28 -5
  96. data/app/views/admin/posts/_filter.html.erb +19 -0
  97. data/app/views/admin/posts/_nav_item.html.erb +3 -0
  98. data/app/views/admin/posts/_search_form.html.erb +13 -0
  99. data/app/views/admin/posts/entity/_in_list.html.erb +31 -7
  100. data/app/views/admin/posts/entity/_in_search.html.erb +8 -0
  101. data/app/views/admin/posts/entity/_links.html.erb +125 -0
  102. data/app/views/admin/posts/images.html.erb +22 -0
  103. data/app/views/admin/posts/index.html.erb +4 -0
  104. data/app/views/admin/posts/search.html.erb +21 -0
  105. data/app/views/admin/posts/search.jbuilder +26 -0
  106. data/app/views/admin/posts/show.html.erb +118 -18
  107. data/app/views/articles/category.html.erb +9 -9
  108. data/app/views/articles/index.html.erb +12 -9
  109. data/app/views/articles/show.html.erb +2 -4
  110. data/app/views/articles/tagged.html.erb +14 -0
  111. data/app/views/authors/_list.html.erb +18 -0
  112. data/app/views/authors/entity/_in_list.html.erb +9 -0
  113. data/app/views/authors/index.html.erb +10 -0
  114. data/app/views/authors/show.html.erb +31 -0
  115. data/app/views/blog_posts/category.html.erb +9 -9
  116. data/app/views/blog_posts/index.html.erb +12 -9
  117. data/app/views/blog_posts/show.html.erb +2 -4
  118. data/app/views/blog_posts/tagged.html.erb +14 -0
  119. data/app/views/editorial_members/_form.html.erb +107 -0
  120. data/app/views/editorial_members/edit.html.erb +17 -0
  121. data/app/views/editorial_members/new.html.erb +15 -0
  122. data/app/views/featured_posts/create.jbuilder +10 -0
  123. data/app/views/index/dashboard/_biovision_post.html.erb +18 -2
  124. data/app/views/my/index/dashboard/_biovision_post.html.erb +43 -0
  125. data/app/views/my/posts/_form.html.erb +357 -0
  126. data/app/views/my/posts/_list.html.erb +9 -0
  127. data/app/views/my/posts/_post.html.erb +80 -0
  128. data/app/views/my/posts/_preview.html.erb +35 -0
  129. data/app/views/my/posts/articles.html.erb +24 -0
  130. data/app/views/my/posts/blog_posts.html.erb +24 -0
  131. data/app/views/my/posts/edit.html.erb +19 -0
  132. data/app/views/my/posts/index.html.erb +14 -0
  133. data/app/views/my/posts/index/_navigation.html.erb +29 -0
  134. data/app/views/my/posts/new.html.erb +14 -0
  135. data/app/views/my/posts/news_index.html.erb +24 -0
  136. data/app/views/my/posts/show.html.erb +7 -0
  137. data/app/views/news/category.html.erb +9 -9
  138. data/app/views/news/index.html.erb +12 -9
  139. data/app/views/news/show.html.erb +2 -4
  140. data/app/views/news/tagged.html.erb +14 -0
  141. data/app/views/post_categories/_form.html.erb +82 -43
  142. data/app/views/post_groups/_form.html.erb +79 -0
  143. data/app/views/post_groups/edit.html.erb +17 -0
  144. data/app/views/post_groups/new.html.erb +15 -0
  145. data/app/views/post_groups/show.html.erb +10 -0
  146. data/app/views/post_images/_form.html.erb +121 -0
  147. data/app/views/post_images/edit.html.erb +19 -0
  148. data/app/views/post_images/new.html.erb +18 -0
  149. data/app/views/post_links/create.jbuilder +20 -0
  150. data/app/views/post_tags/_form.html.erb +26 -0
  151. data/app/views/post_tags/edit.html.erb +18 -0
  152. data/app/views/post_tags/new.html.erb +18 -0
  153. data/app/views/posts/_archive_dates.jbuilder +13 -0
  154. data/app/views/posts/_breadcrumbs.html.erb +4 -8
  155. data/app/views/posts/_calendar.html.erb +9 -0
  156. data/app/views/posts/_collection.html.erb +5 -0
  157. data/app/views/posts/_form.html.erb +204 -64
  158. data/app/views/posts/_list.html.erb +1 -1
  159. data/app/views/{articles/index.jbuilder → posts/_list.jbuilder} +3 -3
  160. data/app/views/posts/_post.html.erb +43 -16
  161. data/app/views/posts/_preview.html.erb +32 -21
  162. data/app/views/posts/_search.html.erb +6 -0
  163. data/app/views/posts/_wysiwyg.html.erb +25 -0
  164. data/app/views/posts/archive.jbuilder +3 -0
  165. data/app/views/posts/archive_day.html.erb +12 -0
  166. data/app/views/posts/category.html.erb +18 -0
  167. data/app/views/posts/entity/_gallery.html.erb +54 -0
  168. data/app/views/posts/entity/_linked_posts.html.erb +7 -0
  169. data/app/views/posts/entity/_metadata.html.erb +35 -12
  170. data/app/views/posts/entity/_publisher.html.erb +3 -1
  171. data/app/views/posts/form/_category_links.html.erb +32 -0
  172. data/app/views/posts/form/_gallery.html.erb +163 -0
  173. data/app/views/posts/index.html.erb +13 -0
  174. data/app/views/posts/index.jbuilder +1 -0
  175. data/app/views/posts/post_type/_category.html.erb +7 -0
  176. data/app/views/posts/post_type/_post_page.html.erb +9 -0
  177. data/app/views/posts/post_type/_posts.html.erb +5 -0
  178. data/app/views/posts/post_type/_tagged.html.erb +7 -0
  179. data/app/views/posts/rss.xml.erb +47 -0
  180. data/app/views/posts/search.html.erb +15 -0
  181. data/app/views/posts/show.html.erb +5 -3
  182. data/app/views/posts/tagged.html.erb +10 -0
  183. data/app/views/posts/tagged.jbuilder +1 -0
  184. data/app/views/posts/zen.xml.erb +42 -0
  185. data/config/locales/posts-en.yml +257 -19
  186. data/config/locales/posts-ru.yml +380 -14
  187. data/config/locales/posts-sv.yml +416 -0
  188. data/config/routes.rb +111 -15
  189. data/db/{migrate → amends}/20180124111113_add_language_to_posts.rb +0 -0
  190. data/db/{migrate → amends}/20180318215555_add_active_to_post_types.rb +0 -0
  191. data/db/amends/20180606120000_add_original_title_to_posts.rb +9 -0
  192. data/db/amends/20180606120001_add_time_required_to_posts.rb +11 -0
  193. data/db/amends/20180611111111_add_pubdate_and_translator_to_posts.rb +19 -0
  194. data/db/amends/20180618111111_add_default_category_name_to_post_types.rb +15 -0
  195. data/db/amends/20180703191919_add_rating_to_posts.rb +14 -0
  196. data/db/amends/20180810111111_add_explicit_to_posts.rb +11 -0
  197. data/db/amends/20180825111111_add_meta_description_to_post_categories.rb +11 -0
  198. data/db/amends/20180927111111_amend_editorial_member_about.rb +13 -0
  199. data/db/migrate/20170930000001_create_post_types.rb +98 -20
  200. data/db/migrate/20170930000010_create_posts.rb +194 -0
  201. data/db/migrate/20180706000000_create_editorial_members.rb +37 -0
  202. data/db/migrate/20180808000000_create_zen_categories.rb +42 -0
  203. data/db/migrate/20190202232323_add_spam_to_posts.rb +11 -0
  204. data/db/migrate/20190224212121_add_data_to_posts.rb +13 -0
  205. data/db/migrate/20190224212122_rename_post_image_source.rb +26 -0
  206. data/db/migrate/20190224212123_add_uuid_to_post_images.rb +10 -0
  207. data/db/migrate/20190313141414_convert_json_post_columns.rb +25 -0
  208. data/db/migrate/20190401101010_create_post_illustrations.rb +20 -0
  209. data/db/migrate/20190407101010_create_editorial_member_post_types.rb +18 -0
  210. data/db/migrate/20190410101010_add_avoid_parsing_to_posts.rb +14 -0
  211. data/db/migrate/20190410120000_create_post_groups.rb +47 -0
  212. data/db/migrate/20190412191919_add_nav_text_to_post_categories.rb +14 -0
  213. data/db/migrate/20190412212121_add_url_part_to_post_types.rb +26 -0
  214. data/db/migrate/20190420212121_create_post_layouts.rb +27 -0
  215. data/db/migrate/20190424161616_create_post_post_categories.rb +31 -0
  216. data/lib/biovision/post/version.rb +3 -1
  217. data/lib/tasks/posts.rake +6 -0
  218. metadata +170 -25
  219. data/app/assets/images/biovision/post/publisher_logo.svg +0 -3
  220. data/app/services/post_manager/article_handler.rb +0 -10
  221. data/app/services/post_manager/blog_post_handler.rb +0 -10
  222. data/app/services/post_manager/news_handler.rb +0 -10
  223. data/app/views/admin/index/dashboard/biovision_post/_additional_items.html.erb +0 -0
  224. data/app/views/blog_posts/index.jbuilder +0 -11
  225. data/app/views/news/index.jbuilder +0 -11
  226. data/app/views/post_categories/edit.jbuilder +0 -3
  227. data/app/views/post_categories/edit.js.erb +0 -1
  228. data/app/views/post_categories/new.jbuilder +0 -3
  229. data/app/views/post_categories/new.js.erb +0 -1
  230. data/db/migrate/20170930000002_create_post_categories.rb +0 -29
  231. data/db/migrate/20170930000003_create_posts.rb +0 -60
  232. data/db/migrate/20171218111111_add_meta_fields_to_posts.rb +0 -15
  233. data/db/migrate/20171219111112_add_author_fields_to_posts.rb +0 -11
  234. data/db/migrate/20180321100000_create_post_references.rb +0 -21
  235. data/db/migrate/20180321100001_create_post_notes.rb +0 -18
  236. data/db/migrate/20180321100002_create_post_links.rb +0 -20
@@ -0,0 +1,18 @@
1
+ <div class="data">
2
+ <div><%= admin_post_tag_link(entity.post_tag) %></div>
3
+
4
+ <div class="info">
5
+ <%= entity.post_tag.post_type.name %>
6
+ </div>
7
+
8
+ <ul class="actions">
9
+ <%=
10
+ render(
11
+ partial: 'shared/actions/priority_changer',
12
+ locals: {
13
+ path: admin_priority_post_group_tag_path(id: entity.id)
14
+ }
15
+ )
16
+ %>
17
+ </ul>
18
+ </div>
@@ -0,0 +1,6 @@
1
+ <div>
2
+ <%= link_to(t('.text'), admin_post_groups_path) %>
3
+ </div>
4
+ <div class="description">
5
+ <%= t('.description') %>
6
+ </div>
@@ -0,0 +1,33 @@
1
+ <% if collection.any? %>
2
+ <ul class="entity-links post-category-tree">
3
+ <% collection.each do |category_id, item| %>
4
+ <li>
5
+ <% element_id = "post_category_#{category_id}" %>
6
+ <%=
7
+ check_box_tag(
8
+ 'post_categories[]',
9
+ category_id,
10
+ post_group.category?(item[:item]),
11
+ id: element_id,
12
+ data: {
13
+ url: category_admin_post_group_path(id: post_group.id, category_id: category_id)
14
+ }
15
+ )
16
+ %>
17
+ <%= label_tag(element_id, item[:item].name) %>
18
+ (<%= t(:post_count, count: item[:item].posts_count) %>)
19
+ <% categories.delete(category_id) %>
20
+ <%=
21
+ render(
22
+ partial: 'admin/post_groups/entity/categories',
23
+ locals: {
24
+ collection: categories.select { |_, i| i[:parent_id] == category_id },
25
+ categories: categories,
26
+ post_group: post_group
27
+ }
28
+ )
29
+ %>
30
+ </li>
31
+ <% end %>
32
+ </ul>
33
+ <% end %>
@@ -0,0 +1,25 @@
1
+ <div class="data">
2
+ <div><%= admin_post_group_link(entity) %></div>
3
+ <div class="secondary info">
4
+ <%= entity.slug %>
5
+ </div>
6
+
7
+ <%=
8
+ render(
9
+ partial: 'shared/admin/toggleable',
10
+ locals: {
11
+ entity: entity,
12
+ url: toggle_admin_post_group_path(id: entity.id)
13
+ }
14
+ )
15
+ %>
16
+
17
+ <ul class="actions">
18
+ <%=
19
+ render(
20
+ partial: 'shared/actions/priority_changer',
21
+ locals: { path: priority_admin_post_group_path(id: entity.id) }
22
+ )
23
+ %>
24
+ </ul>
25
+ </div>
@@ -0,0 +1,22 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <span><%= t('admin.post_groups.nav_item.text') %></span>
4
+ <% end %>
5
+
6
+ <article>
7
+ <h1><%= t('.heading') %></h1>
8
+
9
+ <ul class="actions">
10
+ <li><%= back_icon(admin_path) %></li>
11
+ <li><%= create_icon(new_post_group_path) %></li>
12
+ </ul>
13
+
14
+ <%=
15
+ render(
16
+ partial: 'shared/admin/list_with_priority',
17
+ locals: {
18
+ collection: @collection
19
+ }
20
+ )
21
+ %>
22
+ </article>
@@ -0,0 +1,65 @@
1
+ <% content_for :meta_title, t('.title', name: @entity.name) %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.post_groups.nav_item.text'), admin_post_groups_path) %>
4
+ <span><%= @entity.name %></span>
5
+ <% end %>
6
+
7
+ <article>
8
+ <h1><%= @entity.name %></h1>
9
+
10
+ <ul class="actions">
11
+ <li><%= back_icon(admin_post_groups_path) %></li>
12
+ </ul>
13
+
14
+ <dl>
15
+ <dt><%= t('activerecord.attributes.post_group.priority') %></dt>
16
+ <dd><%= @entity.priority %></dd>
17
+
18
+ <dt><%= t('activerecord.attributes.post_group.slug') %></dt>
19
+ <dd><%= @entity.slug %></dd>
20
+ </dl>
21
+
22
+ <%=
23
+ render(
24
+ partial: 'shared/admin/toggleable',
25
+ locals: {
26
+ entity: @entity,
27
+ url: toggle_admin_post_group_path(id: @entity.id)
28
+ }
29
+ )
30
+ %>
31
+
32
+ <section>
33
+ <h2><%= t('.categories') %></h2>
34
+
35
+ <%=
36
+ render(
37
+ partial: 'shared/admin/list_with_priority',
38
+ locals: {
39
+ collection: @entity.post_group_categories.list_for_administration
40
+ }
41
+ )
42
+ %>
43
+ </section>
44
+
45
+ <section>
46
+ <h2><%= t('.add_category') %></h2>
47
+
48
+ <% PostType.list_for_administration.each do |post_type| %>
49
+ <div>
50
+ <h3><%= post_type.name %></h3>
51
+ <% categories = PostCategory.list_for_tree(post_type) %>
52
+ <%=
53
+ render(
54
+ partial: 'admin/post_groups/entity/categories',
55
+ locals: {
56
+ collection: categories.select { |_, i| i[:parent_id].nil? },
57
+ categories: categories,
58
+ post_group: @entity
59
+ }
60
+ )
61
+ %>
62
+ </div>
63
+ <% end %>
64
+ </section>
65
+ </article>
@@ -0,0 +1,12 @@
1
+ json.data @collection do |entity|
2
+ json.id entity.id
3
+ json.type entity.class.table_name
4
+ json.attributes do
5
+ json.call(entity, :name, :post_type_id, :posts_count)
6
+ end
7
+ json.meta do
8
+ json.post_type entity.post_type.name
9
+ json.checked @entity.tag?(entity)
10
+ json.url tag_admin_post_group_path(id: @entity.id, tag_id: entity.id)
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ <div>
2
+ <%= link_to(t('.text'), admin_post_illustrations_path) %>
3
+ </div>
4
+ <div class="description">
5
+ <%= t('.description') %>
6
+ </div>
@@ -0,0 +1,19 @@
1
+ <div class="image">
2
+ <%= simple_image_preview(entity) %>
3
+ </div>
4
+ <div class="data">
5
+ <div><%= admin_post_illustration_link(entity) %></div>
6
+ <div class="info">
7
+ <%= t(:created_at) %>: <%= time_tag(entity.created_at) %>
8
+ </div>
9
+ <% unless entity.image.blank? %>
10
+ <div class="secondary info">
11
+ <%= link_to(number_to_human_size(File.size(entity.image.path)), entity.image.url) %>
12
+ </div>
13
+ <% end %>
14
+ <% unless entity.user.blank? %>
15
+ <div class="secondary info">
16
+ <%= admin_user_link(entity.user) %>
17
+ </div>
18
+ <% end %>
19
+ </div>
@@ -0,0 +1,23 @@
1
+ <% content_for :meta_title, t('.title', page: current_page) %>
2
+ <% content_for :breadcrumbs do %>
3
+ <span><%= t('admin.post_illustrations.nav_item.text') %></span>
4
+ <% end %>
5
+
6
+ <article>
7
+ <h1><%= t('.heading') %></h1>
8
+
9
+ <ul class="actions">
10
+ <li><%= back_icon(admin_path) %></li>
11
+ </ul>
12
+
13
+ <%= paginate @collection %>
14
+ <%=
15
+ render(
16
+ partial: 'shared/admin/list',
17
+ locals: {
18
+ collection: @collection
19
+ }
20
+ )
21
+ %>
22
+ <%= paginate @collection %>
23
+ </article>
@@ -0,0 +1,32 @@
1
+ <% content_for :meta_title, t('.title', name: @entity.name) %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.post_illustrations.nav_item.text'), admin_post_illustrations_path) %>
4
+ <span><%= @entity.name %></span>
5
+ <% end %>
6
+
7
+ <article>
8
+ <h1><%= @entity.name %></h1>
9
+
10
+ <ul class="actions">
11
+ <li><%= back_icon(admin_post_illustrations_path) %></li>
12
+ </ul>
13
+
14
+ <dl>
15
+ <dt><%= t('activerecord.attributes.post_illustration.image') %></dt>
16
+ <dd>
17
+ <figure class="preview">
18
+ <%= simple_image_medium(@entity) %>
19
+ <figcaption>
20
+ <%= link_to(@entity.name, @entity.image.url) %>
21
+ </figcaption>
22
+ </figure>
23
+ </dd>
24
+
25
+ <% unless @entity.user.nil? %>
26
+ <dt><%= t('activerecord.attributes.post_illustration.user') %></dt>
27
+ <dd><%= admin_user_link(@entity.user) %></dd>
28
+ <% end %>
29
+ </dl>
30
+
31
+ <%= render partial: 'shared/track', locals: { item: @entity } %>
32
+ </article>
@@ -0,0 +1,2 @@
1
+ <div><%= link_to(t('.text'), admin_post_images_path) %></div>
2
+ <div class="description"><%= t('.description') %></div>
@@ -0,0 +1,30 @@
1
+ <div class="image">
2
+ <%= post_image_preview(entity) %>
3
+ </div>
4
+ <div class="data">
5
+ <div><%= admin_post_image_link(entity) %></div>
6
+ <div class="info">
7
+ <%= t('activerecord.attributes.post_image.post') %>:
8
+ <%= admin_post_link(entity.post) %>
9
+ </div>
10
+
11
+ <%=
12
+ render(
13
+ partial: 'shared/admin/toggleable',
14
+ locals: {
15
+ entity: entity,
16
+ url: toggle_admin_post_image_path(id: entity.id)
17
+ }
18
+ )
19
+ %>
20
+
21
+ <ul class="actions">
22
+ <li><%= edit_icon(edit_post_image_path(id: entity.id)) %></li>
23
+ <%=
24
+ render(
25
+ partial: 'shared/actions/priority_changer',
26
+ locals: { path: priority_admin_post_image_path(id: entity.id) }
27
+ )
28
+ %>
29
+ </ul>
30
+ </div>
@@ -0,0 +1,16 @@
1
+ <% content_for :meta_title, t('.title', page: current_page) %>
2
+ <% content_for :breadcrumbs do %>
3
+ <span><%= t('admin.post_images.nav_item.text') %></span>
4
+ <% end %>
5
+
6
+ <article>
7
+ <h1><%= t('.heading') %></h1>
8
+
9
+ <ul class="actions">
10
+ <li><%= back_icon(admin_path) %></li>
11
+ </ul>
12
+
13
+ <%= paginate @collection %>
14
+ <%= render partial: 'shared/admin/list', locals: { collection: @collection } %>
15
+ <%= paginate @collection %>
16
+ </article>
@@ -0,0 +1,49 @@
1
+ <% content_for :meta_title, t('.title', caption: @entity.caption) %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.posts.nav_item.text'), admin_posts_path) %>
4
+ <%= admin_post_link(@entity.post) %>
5
+ <%= link_to(t('admin.posts.images.nav_text'), images_admin_post_path(id: @entity.post_id)) %>
6
+ <span><%= @entity.caption %></span>
7
+ <% end %>
8
+
9
+ <article>
10
+ <h1><%= @entity.caption %></h1>
11
+
12
+ <ul class="actions">
13
+ <li><%= return_icon(admin_post_path(id: @entity.post_id)) %></li>
14
+ <li><%= back_icon(admin_post_images_path) %></li>
15
+ </ul>
16
+
17
+ <dl>
18
+ <dt><%= t('activerecord.attributes.post_image.image') %></dt>
19
+ <dd>
20
+ <figure class="preview" role="group">
21
+ <%= post_image_medium(@entity) %>
22
+ <figcaption><%= @entity.caption %></figcaption>
23
+ </figure>
24
+ </dd>
25
+
26
+ <% unless @entity.image_alt_text.blank? %>
27
+ <dt><%= t('activerecord.attributes.post_image.image_alt_text') %></dt>
28
+ <dd><%= @entity.image_alt_text %></dd>
29
+ <% end %>
30
+
31
+ <dt><%= t('activerecord.attributes.post_image.post') %></dt>
32
+ <dd><%= admin_post_link(@entity.post) %></dd>
33
+
34
+ <% unless @entity.source_name.blank? %>
35
+ <dt><%= t('activerecord.attributes.post_image.source_name') %></dt>
36
+ <dd><%= @entity.source_name %></dd>
37
+ <% end %>
38
+
39
+ <% unless @entity.source_link.blank? %>
40
+ <dt><%= t('activerecord.attributes.post_image.source_link') %></dt>
41
+ <dd><%= @entity.source_link %></dd>
42
+ <% end %>
43
+
44
+ <% unless @entity.description.blank? %>
45
+ <dt><%= t('activerecord.attributes.post_image.description') %></dt>
46
+ <dd><%= simple_format(@entity.description) %></dd>
47
+ <% end %>
48
+ </dl>
49
+ </article>
@@ -0,0 +1,43 @@
1
+ <% post = entity.other_post %>
2
+ <div class="image">
3
+ <%= post_image_preview(post) %>
4
+ </div>
5
+ <div class="data" data-post-id="<%= post.id %>">
6
+ <div>
7
+ <%= post.post_type.name %> <cite><%= admin_post_link(post) %></cite>
8
+ </div>
9
+ <div class="info">
10
+ <%= admin_user_link(post.user) %>,
11
+ <%= time_tag(post.created_at) %>
12
+ </div>
13
+ <% unless post.language.nil? %>
14
+ <div class="secondary info">
15
+ <%= t('activerecord.attributes.post.language_id') %>:
16
+ <%= language_name(post.language) %>
17
+ </div>
18
+ <% end %>
19
+ <div class="secondaty info">
20
+ <div>
21
+ <%= t('activerecord.attributes.post.publication_time') %>:
22
+ <%= time_tag(post.publication_time) %>
23
+ </div>
24
+ <% if post.post_categories.any? %>
25
+ <div>
26
+ <%= t('.post_categories') %>:
27
+ <%= post.post_categories.map(&:name).join(', ') %>
28
+ </div>
29
+ <% end %>
30
+ </div>
31
+
32
+ <ul class="actions">
33
+ <%=
34
+ render(
35
+ partial: 'shared/actions/priority_changer',
36
+ locals: { path: admin_priority_post_link_path(id: entity.id) }
37
+ )
38
+ %>
39
+ <li class="danger">
40
+ <button class="destroy" data-url="<%= post_link_path(id: entity.id) %>">&times;</button>
41
+ </li>
42
+ </ul>
43
+ </div>
@@ -0,0 +1,2 @@
1
+ <div><%= link_to(t('.text'), admin_post_tags_path) %></div>
2
+ <div class="description"><%= t('.description') %></div>
@@ -0,0 +1,23 @@
1
+ <div class="data">
2
+ <div><%= admin_post_tag_link(entity) %></div>
3
+ <div class="info">
4
+ <%= entity.slug %>
5
+ </div>
6
+ <div class="secondary info">
7
+ <%= t('activerecord.attributes.post_tag.post_type') %>:
8
+ <%= entity.post_type.name %>
9
+ </div>
10
+ <div class="secondary info">
11
+ <%=
12
+ link_to(
13
+ t(:post_count, count: entity.posts_count),
14
+ posts_admin_post_tag_path(id: entity.id)
15
+ )
16
+ %>
17
+ </div>
18
+
19
+ <ul class="actions">
20
+ <li><%= edit_icon(edit_post_tag_path(id: entity.id)) %></li>
21
+ <li class="danger"><%= destroy_icon(entity) %></li>
22
+ </ul>
23
+ </div>