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.
- checksums.yaml +4 -4
- data/README.md +79 -13
- data/app/assets/images/biovision/post/icons/time.svg +6 -0
- data/app/assets/images/biovision/post/publisher_logo.png +0 -0
- data/app/assets/javascripts/biovision/post/biovision-posts.js +258 -0
- data/app/assets/stylesheets/biovision/post/admin/posts.scss +93 -0
- data/app/assets/stylesheets/biovision/post/posts.scss +88 -37
- data/app/controllers/admin/editorial_members_controller.rb +43 -0
- data/app/controllers/admin/featured_posts_controller.rb +23 -0
- data/app/controllers/admin/post_group_categories_controller.rb +19 -0
- data/app/controllers/admin/post_group_tags_controller.rb +19 -0
- data/app/controllers/admin/post_groups_controller.rb +62 -0
- data/app/controllers/admin/post_illustrations_controller.rb +26 -0
- data/app/controllers/admin/post_images_controller.rb +33 -0
- data/app/controllers/admin/post_links_controller.rb +19 -0
- data/app/controllers/admin/post_tags_controller.rb +30 -0
- data/app/controllers/admin/post_types_controller.rb +16 -4
- data/app/controllers/admin/posts_controller.rb +26 -2
- data/app/controllers/articles_controller.rb +23 -11
- data/app/controllers/authors_controller.rb +27 -0
- data/app/controllers/blog_posts_controller.rb +23 -11
- data/app/controllers/editorial_members_controller.rb +65 -0
- data/app/controllers/featured_posts_controller.rb +59 -0
- data/app/controllers/my/posts_controller.rb +124 -0
- data/app/controllers/news_controller.rb +23 -11
- data/app/controllers/post_categories_controller.rb +4 -14
- data/app/controllers/post_groups_controller.rb +76 -0
- data/app/controllers/post_illustrations_controller.rb +22 -0
- data/app/controllers/post_images_controller.rb +62 -0
- data/app/controllers/post_links_controller.rb +37 -0
- data/app/controllers/post_tags_controller.rb +41 -0
- data/app/controllers/posts_controller.rb +119 -14
- data/app/helpers/biovision_posts_helper.rb +114 -5
- data/app/jobs/application_job.rb +7 -0
- data/app/jobs/post_body_parser_job.rb +15 -0
- data/app/models/editorial_member.rb +92 -0
- data/app/models/editorial_member_post_type.rb +15 -0
- data/app/models/featured_post.rb +25 -0
- data/app/models/post.rb +203 -38
- data/app/models/post_category.rb +76 -54
- data/app/models/post_group.rb +84 -0
- data/app/models/post_group_category.rb +36 -0
- data/app/models/post_group_tag.rb +32 -0
- data/app/models/post_illustration.rb +62 -0
- data/app/models/post_image.rb +88 -0
- data/app/models/post_layout.rb +14 -0
- data/app/models/post_link.rb +2 -0
- data/app/models/post_post_category.rb +24 -0
- data/app/models/post_post_tag.rb +21 -0
- data/app/models/post_tag.rb +70 -0
- data/app/models/post_translation.rb +7 -0
- data/app/models/post_type.rb +18 -2
- data/app/models/post_zen_category.rb +6 -0
- data/app/models/zen_category.rb +21 -0
- data/app/services/post_manager.rb +52 -15
- data/app/services/post_parser.rb +80 -0
- data/app/uploaders/post_image_uploader.rb +9 -9
- data/app/views/admin/editorial_members/_nav_item.html.erb +2 -0
- data/app/views/admin/editorial_members/entity/_in_list.html.erb +37 -0
- data/app/views/admin/editorial_members/index.html.erb +15 -0
- data/app/views/admin/editorial_members/show.html.erb +71 -0
- data/app/views/admin/featured_posts/_add.html.erb +140 -0
- data/app/views/admin/featured_posts/_language.html.erb +14 -0
- data/app/views/admin/featured_posts/_nav_item.html.erb +2 -0
- data/app/views/admin/featured_posts/entity/_in_list.html.erb +26 -0
- data/app/views/admin/featured_posts/index.html.erb +18 -0
- data/app/views/admin/index/dashboard/_biovision_post.html.erb +32 -25
- data/app/views/admin/post_categories/entity/_in_list.html.erb +22 -6
- data/app/views/admin/post_categories/show.html.erb +6 -1
- data/app/views/admin/post_group_categories/entity/_in_list.html.erb +18 -0
- data/app/views/admin/post_group_tags/entity/_in_list.html.erb +18 -0
- data/app/views/admin/post_groups/_nav_item.html.erb +6 -0
- data/app/views/admin/post_groups/entity/_categories.html.erb +33 -0
- data/app/views/admin/post_groups/entity/_in_list.html.erb +25 -0
- data/app/views/admin/post_groups/index.html.erb +22 -0
- data/app/views/admin/post_groups/show.html.erb +65 -0
- data/app/views/admin/post_groups/tags.jbuilder +12 -0
- data/app/views/admin/post_illustrations/_nav_item.html.erb +6 -0
- data/app/views/admin/post_illustrations/entity/_in_list.html.erb +19 -0
- data/app/views/admin/post_illustrations/index.html.erb +23 -0
- data/app/views/admin/post_illustrations/show.html.erb +32 -0
- data/app/views/admin/post_images/_nav_item.html.erb +2 -0
- data/app/views/admin/post_images/entity/_in_list.html.erb +30 -0
- data/app/views/admin/post_images/index.html.erb +16 -0
- data/app/views/admin/post_images/show.html.erb +49 -0
- data/app/views/admin/post_links/entity/_in_list.html.erb +43 -0
- data/app/views/admin/post_tags/_nav_item.html.erb +2 -0
- data/app/views/admin/post_tags/entity/_in_list.html.erb +23 -0
- data/app/views/admin/post_tags/index.html.erb +16 -0
- data/app/views/admin/post_tags/posts.html.erb +18 -0
- data/app/views/admin/post_tags/show.html.erb +37 -0
- data/app/views/admin/post_types/authors.html.erb +23 -0
- data/app/views/admin/post_types/post_categories.html.erb +15 -4
- data/app/views/admin/post_types/post_tags.html.erb +18 -0
- data/app/views/admin/post_types/show.html.erb +28 -5
- data/app/views/admin/posts/_filter.html.erb +19 -0
- data/app/views/admin/posts/_nav_item.html.erb +3 -0
- data/app/views/admin/posts/_search_form.html.erb +13 -0
- data/app/views/admin/posts/entity/_in_list.html.erb +31 -7
- data/app/views/admin/posts/entity/_in_search.html.erb +8 -0
- data/app/views/admin/posts/entity/_links.html.erb +125 -0
- data/app/views/admin/posts/images.html.erb +22 -0
- data/app/views/admin/posts/index.html.erb +4 -0
- data/app/views/admin/posts/search.html.erb +21 -0
- data/app/views/admin/posts/search.jbuilder +26 -0
- data/app/views/admin/posts/show.html.erb +118 -18
- data/app/views/articles/category.html.erb +9 -9
- data/app/views/articles/index.html.erb +12 -9
- data/app/views/articles/show.html.erb +2 -4
- data/app/views/articles/tagged.html.erb +14 -0
- data/app/views/authors/_list.html.erb +18 -0
- data/app/views/authors/entity/_in_list.html.erb +9 -0
- data/app/views/authors/index.html.erb +10 -0
- data/app/views/authors/show.html.erb +31 -0
- data/app/views/blog_posts/category.html.erb +9 -9
- data/app/views/blog_posts/index.html.erb +12 -9
- data/app/views/blog_posts/show.html.erb +2 -4
- data/app/views/blog_posts/tagged.html.erb +14 -0
- data/app/views/editorial_members/_form.html.erb +107 -0
- data/app/views/editorial_members/edit.html.erb +17 -0
- data/app/views/editorial_members/new.html.erb +15 -0
- data/app/views/featured_posts/create.jbuilder +10 -0
- data/app/views/index/dashboard/_biovision_post.html.erb +18 -2
- data/app/views/my/index/dashboard/_biovision_post.html.erb +43 -0
- data/app/views/my/posts/_form.html.erb +357 -0
- data/app/views/my/posts/_list.html.erb +9 -0
- data/app/views/my/posts/_post.html.erb +80 -0
- data/app/views/my/posts/_preview.html.erb +35 -0
- data/app/views/my/posts/articles.html.erb +24 -0
- data/app/views/my/posts/blog_posts.html.erb +24 -0
- data/app/views/my/posts/edit.html.erb +19 -0
- data/app/views/my/posts/index.html.erb +14 -0
- data/app/views/my/posts/index/_navigation.html.erb +29 -0
- data/app/views/my/posts/new.html.erb +14 -0
- data/app/views/my/posts/news_index.html.erb +24 -0
- data/app/views/my/posts/show.html.erb +7 -0
- data/app/views/news/category.html.erb +9 -9
- data/app/views/news/index.html.erb +12 -9
- data/app/views/news/show.html.erb +2 -4
- data/app/views/news/tagged.html.erb +14 -0
- data/app/views/post_categories/_form.html.erb +82 -43
- data/app/views/post_groups/_form.html.erb +79 -0
- data/app/views/post_groups/edit.html.erb +17 -0
- data/app/views/post_groups/new.html.erb +15 -0
- data/app/views/post_groups/show.html.erb +10 -0
- data/app/views/post_images/_form.html.erb +121 -0
- data/app/views/post_images/edit.html.erb +19 -0
- data/app/views/post_images/new.html.erb +18 -0
- data/app/views/post_links/create.jbuilder +20 -0
- data/app/views/post_tags/_form.html.erb +26 -0
- data/app/views/post_tags/edit.html.erb +18 -0
- data/app/views/post_tags/new.html.erb +18 -0
- data/app/views/posts/_archive_dates.jbuilder +13 -0
- data/app/views/posts/_breadcrumbs.html.erb +4 -8
- data/app/views/posts/_calendar.html.erb +9 -0
- data/app/views/posts/_collection.html.erb +5 -0
- data/app/views/posts/_form.html.erb +204 -64
- data/app/views/posts/_list.html.erb +1 -1
- data/app/views/{articles/index.jbuilder → posts/_list.jbuilder} +3 -3
- data/app/views/posts/_post.html.erb +43 -16
- data/app/views/posts/_preview.html.erb +32 -21
- data/app/views/posts/_search.html.erb +6 -0
- data/app/views/posts/_wysiwyg.html.erb +25 -0
- data/app/views/posts/archive.jbuilder +3 -0
- data/app/views/posts/archive_day.html.erb +12 -0
- data/app/views/posts/category.html.erb +18 -0
- data/app/views/posts/entity/_gallery.html.erb +54 -0
- data/app/views/posts/entity/_linked_posts.html.erb +7 -0
- data/app/views/posts/entity/_metadata.html.erb +35 -12
- data/app/views/posts/entity/_publisher.html.erb +3 -1
- data/app/views/posts/form/_category_links.html.erb +32 -0
- data/app/views/posts/form/_gallery.html.erb +163 -0
- data/app/views/posts/index.html.erb +13 -0
- data/app/views/posts/index.jbuilder +1 -0
- data/app/views/posts/post_type/_category.html.erb +7 -0
- data/app/views/posts/post_type/_post_page.html.erb +9 -0
- data/app/views/posts/post_type/_posts.html.erb +5 -0
- data/app/views/posts/post_type/_tagged.html.erb +7 -0
- data/app/views/posts/rss.xml.erb +47 -0
- data/app/views/posts/search.html.erb +15 -0
- data/app/views/posts/show.html.erb +5 -3
- data/app/views/posts/tagged.html.erb +10 -0
- data/app/views/posts/tagged.jbuilder +1 -0
- data/app/views/posts/zen.xml.erb +42 -0
- data/config/locales/posts-en.yml +257 -19
- data/config/locales/posts-ru.yml +380 -14
- data/config/locales/posts-sv.yml +416 -0
- data/config/routes.rb +111 -15
- data/db/{migrate → amends}/20180124111113_add_language_to_posts.rb +0 -0
- data/db/{migrate → amends}/20180318215555_add_active_to_post_types.rb +0 -0
- data/db/amends/20180606120000_add_original_title_to_posts.rb +9 -0
- data/db/amends/20180606120001_add_time_required_to_posts.rb +11 -0
- data/db/amends/20180611111111_add_pubdate_and_translator_to_posts.rb +19 -0
- data/db/amends/20180618111111_add_default_category_name_to_post_types.rb +15 -0
- data/db/amends/20180703191919_add_rating_to_posts.rb +14 -0
- data/db/amends/20180810111111_add_explicit_to_posts.rb +11 -0
- data/db/amends/20180825111111_add_meta_description_to_post_categories.rb +11 -0
- data/db/amends/20180927111111_amend_editorial_member_about.rb +13 -0
- data/db/migrate/20170930000001_create_post_types.rb +98 -20
- data/db/migrate/20170930000010_create_posts.rb +194 -0
- data/db/migrate/20180706000000_create_editorial_members.rb +37 -0
- data/db/migrate/20180808000000_create_zen_categories.rb +42 -0
- data/db/migrate/20190202232323_add_spam_to_posts.rb +11 -0
- data/db/migrate/20190224212121_add_data_to_posts.rb +13 -0
- data/db/migrate/20190224212122_rename_post_image_source.rb +26 -0
- data/db/migrate/20190224212123_add_uuid_to_post_images.rb +10 -0
- data/db/migrate/20190313141414_convert_json_post_columns.rb +25 -0
- data/db/migrate/20190401101010_create_post_illustrations.rb +20 -0
- data/db/migrate/20190407101010_create_editorial_member_post_types.rb +18 -0
- data/db/migrate/20190410101010_add_avoid_parsing_to_posts.rb +14 -0
- data/db/migrate/20190410120000_create_post_groups.rb +47 -0
- data/db/migrate/20190412191919_add_nav_text_to_post_categories.rb +14 -0
- data/db/migrate/20190412212121_add_url_part_to_post_types.rb +26 -0
- data/db/migrate/20190420212121_create_post_layouts.rb +27 -0
- data/db/migrate/20190424161616_create_post_post_categories.rb +31 -0
- data/lib/biovision/post/version.rb +3 -1
- data/lib/tasks/posts.rake +6 -0
- metadata +170 -25
- data/app/assets/images/biovision/post/publisher_logo.svg +0 -3
- data/app/services/post_manager/article_handler.rb +0 -10
- data/app/services/post_manager/blog_post_handler.rb +0 -10
- data/app/services/post_manager/news_handler.rb +0 -10
- data/app/views/admin/index/dashboard/biovision_post/_additional_items.html.erb +0 -0
- data/app/views/blog_posts/index.jbuilder +0 -11
- data/app/views/news/index.jbuilder +0 -11
- data/app/views/post_categories/edit.jbuilder +0 -3
- data/app/views/post_categories/edit.js.erb +0 -1
- data/app/views/post_categories/new.jbuilder +0 -3
- data/app/views/post_categories/new.js.erb +0 -1
- data/db/migrate/20170930000002_create_post_categories.rb +0 -29
- data/db/migrate/20170930000003_create_posts.rb +0 -60
- data/db/migrate/20171218111111_add_meta_fields_to_posts.rb +0 -15
- data/db/migrate/20171219111112_add_author_fields_to_posts.rb +0 -11
- data/db/migrate/20180321100000_create_post_references.rb +0 -21
- data/db/migrate/20180321100001_create_post_notes.rb +0 -18
- data/db/migrate/20180321100002_create_post_links.rb +0 -20
@@ -1,11 +1,11 @@
|
|
1
|
-
json.data
|
1
|
+
json.data collection do |entity|
|
2
2
|
json.id entity.id
|
3
3
|
json.type entity.class.table_name
|
4
4
|
json.attributes do
|
5
|
-
json.(entity, :title, :lead, :post_category_id)
|
5
|
+
json.call(entity, :title, :lead, :post_category_id)
|
6
6
|
end
|
7
7
|
json.meta do
|
8
8
|
json.html_preview render(partial: 'posts/preview', formats: [:html], locals: { entity: entity })
|
9
9
|
end
|
10
10
|
end
|
11
|
-
json.partial! 'shared/pagination', locals: { collection:
|
11
|
+
json.partial! 'shared/pagination', locals: { collection: collection }
|
@@ -1,20 +1,29 @@
|
|
1
|
-
<% handler = PostManager.
|
1
|
+
<% handler = PostManager.new(post) %>
|
2
2
|
<article class="post" itemscope itemtype="http://schema.org/Article" itemprop="mainEntityOfPage">
|
3
3
|
<h1 itemprop="headline"><%= post.title %></h1>
|
4
4
|
<% if post.editable_by? current_user %>
|
5
5
|
<ul class="actions">
|
6
|
-
<% if
|
6
|
+
<% if post.owned_by?(current_user) %>
|
7
|
+
<li><%= gear_icon(my_post_path(id: post.id)) %></li>
|
8
|
+
<% elsif UserPrivilege.user_in_group?(current_user, :editors) %>
|
7
9
|
<li><%= gear_icon(admin_post_path(id: post.id)) %></li>
|
8
10
|
<% end %>
|
9
11
|
<% unless post.locked? %>
|
10
|
-
|
12
|
+
<% if post.owned_by?(current_user) %>
|
13
|
+
<li><%= edit_icon(edit_my_post_path(id: post.id)) %></li>
|
14
|
+
<% else %>
|
15
|
+
<li><%= edit_icon(handler.edit_path) %></li>
|
16
|
+
<% end %>
|
11
17
|
<% end %>
|
12
18
|
</ul>
|
13
19
|
<% end %>
|
14
20
|
|
15
21
|
<% unless post.image.blank? %>
|
16
22
|
<figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject" role="group">
|
17
|
-
|
23
|
+
<div class="post-image-main">
|
24
|
+
<%= post_image_large(post, { itemprop: 'about' }) %>
|
25
|
+
<meta itemprop="url" content="<%= request.protocol + request.host_with_port + post.image.url %>"/>
|
26
|
+
</div>
|
18
27
|
<% if post.has_image_data? %>
|
19
28
|
<figcaption>
|
20
29
|
<% unless post.image_name.blank? %>
|
@@ -22,13 +31,13 @@
|
|
22
31
|
<%= post.image_name %>
|
23
32
|
</div>
|
24
33
|
<% end %>
|
25
|
-
<% unless post.
|
26
|
-
<div class="
|
27
|
-
<span><%= t('
|
28
|
-
<% if post.
|
29
|
-
<%= post.
|
34
|
+
<% unless post.image_source_name.blank? %>
|
35
|
+
<div class="image_source" itemprop="author">
|
36
|
+
<span><%= t('.image_credit') %></span>
|
37
|
+
<% if post.image_source_link.blank? %>
|
38
|
+
<%= post.image_source_name %>
|
30
39
|
<% else %>
|
31
|
-
<%= link_to(post.
|
40
|
+
<%= link_to(post.image_source_name, post.image_source_link, rel: 'external nofollow noopener noreferrer', itemprop: 'url', target: '_blank') %>
|
32
41
|
<% end %>
|
33
42
|
</div>
|
34
43
|
<% end %>
|
@@ -37,14 +46,29 @@
|
|
37
46
|
</figure>
|
38
47
|
<% end %>
|
39
48
|
|
40
|
-
<div class="
|
41
|
-
|
49
|
+
<div class="text" itemprop="articleBody mainEntityOfPage">
|
50
|
+
<div class="lead"><%= post.lead %></div>
|
51
|
+
|
52
|
+
<div class="body">
|
53
|
+
<%= raw(post.parsed_body || post.body) %>
|
54
|
+
</div>
|
42
55
|
</div>
|
43
56
|
|
57
|
+
<%=
|
58
|
+
render(
|
59
|
+
partial: 'posts/entity/gallery',
|
60
|
+
locals: {
|
61
|
+
collection: post.post_images.list_for_visitors
|
62
|
+
}
|
63
|
+
)
|
64
|
+
%>
|
65
|
+
|
44
66
|
<% if post.tags_cache.any? %>
|
45
|
-
<
|
46
|
-
|
47
|
-
|
67
|
+
<ul class="post-tags" aria-label="<%= t('activerecord.attributes.post.tags_cache') %>">
|
68
|
+
<% post.tags_cache.each do |tag_name| %>
|
69
|
+
<li><%= tagged_posts_link(tag_name, post) %></li>
|
70
|
+
<% end %>
|
71
|
+
</ul>
|
48
72
|
<% end %>
|
49
73
|
|
50
74
|
<footer>
|
@@ -74,9 +98,12 @@
|
|
74
98
|
<% end %>
|
75
99
|
|
76
100
|
<div class="time">
|
77
|
-
<%= time_tag post.
|
101
|
+
<%= time_tag post.publication_time, itemProp: 'datePublished', aria: { label: t('activerecord.attributes.post.created_at') } %>
|
78
102
|
</div>
|
79
103
|
|
104
|
+
<% unless post.time_required.blank? %>
|
105
|
+
<meta itemprop="timeRequired" content="P<%= post.time_required %>M"/>
|
106
|
+
<% end %>
|
80
107
|
<meta itemprop="commentCount" content="<%= post.comments_count %>"/>
|
81
108
|
<meta itemprop="dateModified" content="<%= post.updated_at.strftime('%Y-%m-%d') %>"/>
|
82
109
|
<%= render partial: 'posts/entity/publisher', locals: { entity: post } %>
|
@@ -1,35 +1,46 @@
|
|
1
1
|
<div class="post-preview" role="group">
|
2
2
|
<div class="image">
|
3
|
-
<%=
|
3
|
+
<%=
|
4
|
+
post_link(
|
5
|
+
entity,
|
6
|
+
post_image_small(entity),
|
7
|
+
class: 'covered proportional-container r-16x9'
|
8
|
+
)
|
9
|
+
%>
|
4
10
|
</div>
|
5
|
-
<div class="
|
6
|
-
|
11
|
+
<div class="text">
|
12
|
+
<div class="title"><%= post_link(entity) %></div>
|
13
|
+
<div class="lead"><%= post_link(entity, entity.lead) %></div>
|
7
14
|
</div>
|
8
|
-
<div class="
|
9
|
-
|
10
|
-
<% if entity.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<div class="author-title"><%= entity.author_title %></div>
|
15
|
+
<div class="meta">
|
16
|
+
<div class="time-and-author">
|
17
|
+
<% if entity.show_owner? %>
|
18
|
+
<% if entity.author_name.blank? %>
|
19
|
+
<%= user_link(entity.user) %>
|
20
|
+
<% else %>
|
21
|
+
<%= post_author_link(entity) %>
|
16
22
|
<% end %>
|
17
23
|
<% end %>
|
18
|
-
|
19
|
-
|
20
|
-
</div>
|
21
|
-
<div class="lead"><%= entity.lead %></div>
|
22
|
-
<% unless entity.post_category.nil? %>
|
24
|
+
<%= time_tag(entity.publication_time.to_date, format: :default) %>
|
25
|
+
</div>
|
23
26
|
<div class="category" aria-label="<%= t('activerecord.attributes.post.post_category_id') %>">
|
24
|
-
<%= entity
|
27
|
+
<%= post_category_link(entity) %>
|
25
28
|
</div>
|
26
|
-
|
29
|
+
<% if entity.tags_cache.any? %>
|
30
|
+
<ul class="post-tags">
|
31
|
+
<% entity.tags_cache.each do |tag_name| %>
|
32
|
+
<li><%= tagged_posts_link(tag_name, entity) %></li>
|
33
|
+
<% end %>
|
34
|
+
</ul>
|
35
|
+
<% end %>
|
36
|
+
</div>
|
27
37
|
<div class="counters">
|
38
|
+
<span class="view_count"><%= entity.view_count %></span>
|
28
39
|
<% if entity.allow_comments? && 'CommentableItem'.safe_constantize %>
|
29
40
|
<span class="comment_count"><%= entity.comments_count %></span>
|
30
41
|
<% end %>
|
31
|
-
|
32
|
-
|
33
|
-
|
42
|
+
<% if entity.time_required.to_i.positive? %>
|
43
|
+
<div class="time_required"><%= entity.time_required %> min</div>
|
44
|
+
<% end %>
|
34
45
|
</div>
|
35
46
|
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<script src="https://cdn.ckeditor.com/ckeditor5/12.0.0/classic/ckeditor.js"></script>
|
2
|
+
<script>
|
3
|
+
"use strict";
|
4
|
+
|
5
|
+
document.addEventListener("DOMContentLoaded", function () {
|
6
|
+
document.querySelectorAll("button.js-wysiwyg-toggle").forEach(function (button) {
|
7
|
+
button.addEventListener("click", function (event) {
|
8
|
+
const button = event.target;
|
9
|
+
button.classList.add("hidden");
|
10
|
+
const editor = document.getElementById(button.getAttribute("data-element"));
|
11
|
+
editor.required = false;
|
12
|
+
ClassicEditor
|
13
|
+
.create(editor, {
|
14
|
+
image: {
|
15
|
+
toolbar: ['imageTextAlternative']
|
16
|
+
},
|
17
|
+
ckfinder: {
|
18
|
+
uploadUrl: editor.getAttribute('data-upload-url')
|
19
|
+
}
|
20
|
+
})
|
21
|
+
.catch(error => console.error(error));
|
22
|
+
});
|
23
|
+
});
|
24
|
+
});
|
25
|
+
</script>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% content_for :meta_title, t('.title') %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<span><%= t('posts.index.nav_text') %></span>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<article>
|
7
|
+
<h1>
|
8
|
+
<%= l(Date.parse("#{params[:year]}-#{params[:month]}-#{params[:day]}")) %>
|
9
|
+
</h1>
|
10
|
+
|
11
|
+
<%= render partial: 'posts/collection', locals: { collection: @collection } %>
|
12
|
+
</article>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% content_for :meta_title, t('.title', category: @category.name, page: current_page) %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<%= link_to(t('posts.index.nav_text'), posts_path) %>
|
4
|
+
<% @category.parents.each do |parent| %>
|
5
|
+
<%= link_to(parent.name, short_category_posts_path(category_slug: parent.long_slug)) %>
|
6
|
+
<% end %>
|
7
|
+
<span><%= @category.name %></span>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%=
|
11
|
+
render(
|
12
|
+
partial: 'posts/post_type/category',
|
13
|
+
locals: {
|
14
|
+
category: @category,
|
15
|
+
collection: @collection
|
16
|
+
}
|
17
|
+
)
|
18
|
+
%>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<% if collection.any? %>
|
2
|
+
<section class="post-gallery">
|
3
|
+
<h2><%= t('.heading') %></h2>
|
4
|
+
|
5
|
+
<div class="biovision-slider">
|
6
|
+
<button class="prev"></button>
|
7
|
+
<ul class="container">
|
8
|
+
<% collection.each do |post_image| %>
|
9
|
+
<li class="slider-item">
|
10
|
+
<figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject" role="group">
|
11
|
+
<div class="image">
|
12
|
+
<%= post_image_large(post_image, { itemprop: 'about' }) %>
|
13
|
+
</div>
|
14
|
+
<meta itemprop="url" content="<%= request.protocol + request.host_with_port + post_image.image.url %>"/>
|
15
|
+
<% if post_image.has_image_data? %>
|
16
|
+
<figcaption>
|
17
|
+
<% unless post_image.caption.blank? %>
|
18
|
+
<div class="image_name" itemprop="caption">
|
19
|
+
<%= post_image.caption %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
<% unless post_image.source_name.blank? %>
|
23
|
+
<div class="image_source" itemprop="author">
|
24
|
+
<span><%= t('posts.post.image_credit') %></span>
|
25
|
+
<% if post_image.source_link.blank? %>
|
26
|
+
<%= post_image.source_name %>
|
27
|
+
<% else %>
|
28
|
+
<%=
|
29
|
+
link_to(
|
30
|
+
post_image.source_name,
|
31
|
+
post_image.source_link,
|
32
|
+
rel: 'external nofollow noopener noreferrer',
|
33
|
+
itemprop: 'url',
|
34
|
+
target: '_blank'
|
35
|
+
)
|
36
|
+
%>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
40
|
+
</figcaption>
|
41
|
+
<% end %>
|
42
|
+
</figure>
|
43
|
+
<% unless post_image.description.blank? %>
|
44
|
+
<div class="description">
|
45
|
+
<%= simple_format(post_image.description) %>
|
46
|
+
</div>
|
47
|
+
<% end %>
|
48
|
+
</li>
|
49
|
+
<% end %>
|
50
|
+
</ul>
|
51
|
+
<button class="next"></button>
|
52
|
+
</div>
|
53
|
+
</section>
|
54
|
+
<% end %>
|
@@ -1,16 +1,39 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<%
|
2
|
+
meta_description = entity.meta_description.blank? ? entity.lead : entity.meta_description
|
3
|
+
meta_image = entity.image.blank? ? '' : (request.protocol + request.host_with_port + entity.image.url)
|
4
|
+
meta_title = entity.meta_title.blank? ? entity.title : entity.meta_title
|
5
|
+
content_for :meta_title, meta_title
|
6
|
+
content_for :meta_description, meta_description
|
7
|
+
content_for :meta_keywords, entity.meta_keywords unless entity.meta_keywords.blank?
|
8
|
+
%>
|
9
|
+
<% content_for :meta_opengraph do %>
|
10
|
+
<meta property="og:url" content="<%= url_for(only_path: false) %>"/>
|
11
|
+
<meta property="og:type" content="article"/>
|
12
|
+
<meta property="og:title" content="<%= meta_title %>"/>
|
13
|
+
<% unless entity.language.nil? %>
|
14
|
+
<meta property="og:locale" content="<%= entity.language.code %>"/>
|
15
|
+
<% end %>
|
16
|
+
<meta property="og:description" content="<%= meta_description %>"/>
|
17
|
+
<meta property="article:published_time" content="<%= entity.publication_time.strftime('%F') %>"/>
|
18
|
+
<meta property="article:updated_time" content="<%= entity.updated_at.strftime('%F') %>"/>
|
19
|
+
<meta property="article:modified_time" content="<%= entity.updated_at.strftime('%F') %>"/>
|
6
20
|
<% if entity.show_owner? %>
|
7
|
-
<meta property="
|
21
|
+
<meta property="article:author" content="<%= entity.author_name.blank? ? entity.user.screen_name : entity.author_name %>"/>
|
22
|
+
<% end %>
|
23
|
+
<% unless entity.post_category.nil? %>
|
24
|
+
<meta property="article:section" content="<%= entity.post_category.name %>"/>
|
25
|
+
<% end %>
|
26
|
+
<% entity.tags_cache.each do |tag| %>
|
27
|
+
<meta property="article:tag" content="<%= tag %>"/>
|
28
|
+
<% end %>
|
29
|
+
<% unless meta_image.blank? %>
|
30
|
+
<meta property="og:image" content="<%= meta_image %>"/>
|
31
|
+
<meta property="og:image:alt" content="<%= entity.image_alt_text %>"/>
|
8
32
|
<% end %>
|
9
33
|
<% end %>
|
10
|
-
<% content_for :
|
11
|
-
|
12
|
-
<%
|
13
|
-
|
14
|
-
<%
|
34
|
+
<% content_for :meta_twitter do %>
|
35
|
+
<meta property="twitter:title" content="<%= content_for :meta_title %>"/>
|
36
|
+
<% unless meta_image.blank? %>
|
37
|
+
<meta name="twitter:image" content="<%= meta_image %>"/>
|
38
|
+
<% end %>
|
15
39
|
<% end %>
|
16
|
-
<% content_for :meta_keywords, entity.meta_keywords unless entity.meta_keywords.blank? %>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
|
2
2
|
<meta itemprop="url" content="<%= request.protocol + request.host_with_port %>"/>
|
3
3
|
<meta itemprop="name" content="<%= t('shared.meta_texts.site_name') %>"/>
|
4
|
-
<
|
4
|
+
<span itemprop="logo" itemscope itemtype="https://www.schema.org/ImageObject">
|
5
|
+
<link itemprop="url" href="<%= image_url('biovision/post/publisher_logo.png') %>">
|
6
|
+
</span>
|
5
7
|
</span>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<% if collection.any? %>
|
2
|
+
<ul class="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_category_ids[]",
|
9
|
+
category_id,
|
10
|
+
item[:item].post?(entity),
|
11
|
+
id: element_id
|
12
|
+
)
|
13
|
+
%>
|
14
|
+
<%= label_tag element_id, item[:item].name %>
|
15
|
+
<% categories.delete(category_id) %>
|
16
|
+
<% children = categories.select { |_, i| i[:parent_id] == category_id } %>
|
17
|
+
<% if children.any? %>
|
18
|
+
<%=
|
19
|
+
render(
|
20
|
+
partial: 'posts/form/category_links',
|
21
|
+
locals: {
|
22
|
+
entity: entity,
|
23
|
+
collection: children,
|
24
|
+
categories: categories
|
25
|
+
}
|
26
|
+
)
|
27
|
+
%>
|
28
|
+
<% end %>
|
29
|
+
</li>
|
30
|
+
<% end %>
|
31
|
+
</ul>
|
32
|
+
<% end %>
|
@@ -0,0 +1,163 @@
|
|
1
|
+
<section class="post-form-gallery">
|
2
|
+
<h2><%= t('.heading') %></h2>
|
3
|
+
|
4
|
+
<% next_number = 1 %>
|
5
|
+
<ol id="post-form-image-gallery" class="list-of-entities">
|
6
|
+
<% entity.post_images.each do |post_image| %>
|
7
|
+
<li data-number="<%= post_image.priority %>" data-id="<%= post_image.id %>">
|
8
|
+
<%=
|
9
|
+
render(
|
10
|
+
partial: 'admin/post_images/entity/in_list',
|
11
|
+
locals: { entity: post_image }
|
12
|
+
)
|
13
|
+
%>
|
14
|
+
</li>
|
15
|
+
<% end %>
|
16
|
+
<li data-number="<%= next_number %>" class="new-post-image">
|
17
|
+
<%
|
18
|
+
figure_id = "post-item-image-#{next_number}"
|
19
|
+
image_id = "post_images_#{next_number}_image"
|
20
|
+
image_name = "post_images[#{next_number}][image]"
|
21
|
+
%>
|
22
|
+
<div class="image" id="<%= figure_id %>">
|
23
|
+
<%=
|
24
|
+
label_tag(image_id, image_tag('biovision/base/placeholders/3x2.svg'))
|
25
|
+
%>
|
26
|
+
</div>
|
27
|
+
<div class="data">
|
28
|
+
<div class="field">
|
29
|
+
<%=
|
30
|
+
file_field_tag(
|
31
|
+
image_name,
|
32
|
+
id: image_id,
|
33
|
+
accept: 'image/jpeg,image/png',
|
34
|
+
data: { image: figure_id }
|
35
|
+
)
|
36
|
+
%>
|
37
|
+
<div class="guideline">
|
38
|
+
<%= t('post_images.form.guidelines.image') %>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<div class="field">
|
42
|
+
<div>
|
43
|
+
<%=
|
44
|
+
label_tag(
|
45
|
+
"post_images_#{next_number}_image_alt_text",
|
46
|
+
t('activerecord.attributes.post_image.image_alt_text')
|
47
|
+
)
|
48
|
+
%>
|
49
|
+
</div>
|
50
|
+
<div>
|
51
|
+
<%=
|
52
|
+
text_field_tag(
|
53
|
+
"post_images[#{next_number}][image_alt_text]",
|
54
|
+
'',
|
55
|
+
id: "post_images_#{next_number}_image_alt_text",
|
56
|
+
size: nil,
|
57
|
+
maxlength: PostImage::META_LIMIT
|
58
|
+
)
|
59
|
+
%>
|
60
|
+
<div class="guideline"><%= t('post_images.form.guidelines.image_alt_text') %></div>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
<div class="field">
|
64
|
+
<div>
|
65
|
+
<%=
|
66
|
+
label_tag(
|
67
|
+
"post_images_#{next_number}_caption",
|
68
|
+
t('activerecord.attributes.post_image.caption')
|
69
|
+
)
|
70
|
+
%>
|
71
|
+
</div>
|
72
|
+
<div>
|
73
|
+
<%=
|
74
|
+
text_field_tag(
|
75
|
+
"post_images[#{next_number}][caption]",
|
76
|
+
'',
|
77
|
+
id: "post_images_#{next_number}_caption",
|
78
|
+
size: nil,
|
79
|
+
maxlength: PostImage::META_LIMIT
|
80
|
+
)
|
81
|
+
%>
|
82
|
+
<div class="guideline"><%= t('post_images.form.guidelines.caption') %></div>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
<div class="field">
|
86
|
+
<div>
|
87
|
+
<%=
|
88
|
+
label_tag(
|
89
|
+
"post_images_#{next_number}_description",
|
90
|
+
t('activerecord.attributes.post_image.description')
|
91
|
+
)
|
92
|
+
%>
|
93
|
+
</div>
|
94
|
+
<div>
|
95
|
+
<%=
|
96
|
+
text_area_tag(
|
97
|
+
"post_images[#{next_number}][description]",
|
98
|
+
'',
|
99
|
+
id: "post_images_#{next_number}_description",
|
100
|
+
cols: 80,
|
101
|
+
rows: 5,
|
102
|
+
maxlength: PostImage::DESCRIPTION_LIMIT,
|
103
|
+
class: 'auto-expand',
|
104
|
+
data: {
|
105
|
+
min_rows: 5,
|
106
|
+
max_rows: 20
|
107
|
+
}
|
108
|
+
)
|
109
|
+
%>
|
110
|
+
<div class="guideline"><%= t('post_images.form.guidelines.description') %></div>
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="field">
|
114
|
+
<div>
|
115
|
+
<%=
|
116
|
+
label_tag(
|
117
|
+
"post_images_#{next_number}_source_name",
|
118
|
+
t('activerecord.attributes.post_image.source_name')
|
119
|
+
)
|
120
|
+
%>
|
121
|
+
</div>
|
122
|
+
<div>
|
123
|
+
<%=
|
124
|
+
text_field_tag(
|
125
|
+
"post_images[#{next_number}][source_name]",
|
126
|
+
'',
|
127
|
+
id: "post_images_#{next_number}_source_name",
|
128
|
+
size: nil,
|
129
|
+
maxlength: PostImage::META_LIMIT
|
130
|
+
)
|
131
|
+
%>
|
132
|
+
<div class="guideline"><%= t('post_images.form.guidelines.source_name') %></div>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
<div class="field">
|
136
|
+
<div>
|
137
|
+
<%=
|
138
|
+
label_tag(
|
139
|
+
"post_images_#{next_number}_source_link",
|
140
|
+
t('activerecord.attributes.post_image.source_link')
|
141
|
+
)
|
142
|
+
%>
|
143
|
+
</div>
|
144
|
+
<div>
|
145
|
+
<%=
|
146
|
+
url_field_tag(
|
147
|
+
"post_images[#{next_number}][source_link]",
|
148
|
+
'',
|
149
|
+
id: "post_images_#{next_number}_source_link",
|
150
|
+
size: nil,
|
151
|
+
maxlength: PostImage::META_LIMIT
|
152
|
+
)
|
153
|
+
%>
|
154
|
+
<div class="guideline"><%= t('post_images.form.guidelines.source_link') %></div>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
</li>
|
159
|
+
</ol>
|
160
|
+
<div class="image-adder">
|
161
|
+
<%= button_tag(t('.add_image'), type: :button, class: 'button-action') %>
|
162
|
+
</div>
|
163
|
+
</section>
|