biovision-post 0.1.171229 → 0.1.180127
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/post.rb +5 -4
- data/app/views/admin/index/{_biovision_post.html.erb → dashboard/_biovision_post.html.erb} +1 -1
- data/app/views/admin/index/{biovision_post → dashboard/biovision_post}/_additional_items.html.erb +0 -0
- data/app/views/admin/posts/entity/_in_list.html.erb +9 -1
- data/app/views/post_categories/_form.html.erb +0 -18
- data/app/views/posts/_form.html.erb +2 -4
- data/config/locales/posts-en.yml +4 -2
- data/config/locales/posts-ru.yml +4 -2
- data/db/migrate/20170930000003_create_posts.rb +2 -1
- data/db/migrate/20180124111113_add_language_to_posts.rb +11 -0
- data/lib/biovision/post/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b889ba7a155e2072f97474ffa415f86b0aaeb387d5266de6f08715ca090dc016
|
4
|
+
data.tar.gz: b20b223bca477ff0f077720a6102a69dbdd72e68e8b6bbeabb821d632c5296c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c4e4732cd224dfb38af8e72f881d306bed081a5382fcee710e493b685a87a7c7ba1b8b276660dde410adbfe6529b14a7ac1f2722d91f20e6fb0e52a9b792f81
|
7
|
+
data.tar.gz: e5f81682ceb25780a39098d3197fe1120b5e70051de31ebffa7b89baba832b771833b4120e127b6d4d117cdc31b8d0ee21ee5d6664b85b2e06bef2e7f95b975d
|
data/app/models/post.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Post < ApplicationRecord
|
2
2
|
include HasOwner
|
3
|
-
include CommentableItem if '
|
4
|
-
include VotableItem if '
|
3
|
+
include CommentableItem if Gem.loaded_specs.key?('biovision-comment')
|
4
|
+
include VotableItem if Gem.loaded_specs.key?('biovision-vote')
|
5
5
|
include Toggleable
|
6
6
|
|
7
7
|
TITLE_LIMIT = 140
|
@@ -11,16 +11,17 @@ class Post < ApplicationRecord
|
|
11
11
|
BODY_LIMIT = 50000
|
12
12
|
META_LIMIT = 250
|
13
13
|
ALT_LIMIT = 200
|
14
|
-
PER_PAGE =
|
14
|
+
PER_PAGE = 12
|
15
15
|
|
16
16
|
toggleable :visible, :show_owner, :allow_comments
|
17
17
|
|
18
18
|
mount_uploader :image, PostImageUploader
|
19
19
|
|
20
20
|
belongs_to :user
|
21
|
-
belongs_to :region, optional: true
|
21
|
+
belongs_to :region, optional: true if Gem.loaded_specs.key?('biovision-regions')
|
22
22
|
belongs_to :post_type, counter_cache: true
|
23
23
|
belongs_to :post_category, counter_cache: true, optional: true
|
24
|
+
belongs_to :language, optional: true
|
24
25
|
belongs_to :agent, optional: true
|
25
26
|
|
26
27
|
after_initialize { self.uuid = SecureRandom.uuid if uuid.nil? }
|
data/app/views/admin/index/{biovision_post → dashboard/biovision_post}/_additional_items.html.erb
RENAMED
File without changes
|
@@ -27,7 +27,15 @@
|
|
27
27
|
<%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_post_path(entity) } %>
|
28
28
|
|
29
29
|
<ul class="actions">
|
30
|
-
<%=
|
30
|
+
<%=
|
31
|
+
render(
|
32
|
+
partial: 'shared/actions/locks',
|
33
|
+
locals: {
|
34
|
+
entity: entity,
|
35
|
+
path: (current_user_has_privilege?(:chief_editor) ? lock_admin_post_path(entity.id) : '')
|
36
|
+
}
|
37
|
+
)
|
38
|
+
%>
|
31
39
|
<li class="lockable <%= entity.editable_by?(current_user) ? '' : 'hidden' %>">
|
32
40
|
<%= edit_icon(edit_post_path(entity.id)) %>
|
33
41
|
</li>
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
<%= form_with model: entity, html: { id: 'post-category-form' } do |f| %>
|
3
2
|
<%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
|
4
3
|
|
@@ -50,20 +49,3 @@
|
|
50
49
|
<%= f.button t(:save), type: :submit %>
|
51
50
|
</div>
|
52
51
|
<% end %>
|
53
|
-
|
54
|
-
<script>
|
55
|
-
'use strict';
|
56
|
-
|
57
|
-
document.addEventListener('DOMContentLoaded', function () {
|
58
|
-
const form = document.getElementById('post-category-form');
|
59
|
-
const button = form.querySelector('button[type=submit]');
|
60
|
-
|
61
|
-
form.addEventListener('ajax:before', function() {
|
62
|
-
button.disabled = true;
|
63
|
-
});
|
64
|
-
|
65
|
-
form.addEventListener('ajax:complete', function(request, status) {
|
66
|
-
button.disabled = false;
|
67
|
-
});
|
68
|
-
});
|
69
|
-
</script>
|
@@ -21,7 +21,7 @@
|
|
21
21
|
</dd>
|
22
22
|
<% end %>
|
23
23
|
|
24
|
-
<% if Region.any? %>
|
24
|
+
<% if Gem.loaded_specs.key?('biovision-regions') && Region.any? %>
|
25
25
|
<dt><%= f.label :region_id %></dt>
|
26
26
|
<dd>
|
27
27
|
<%# radio_button_tag 'post[region_id]', '', entity.region.nil?, id: 'post_region_0' %>
|
@@ -144,7 +144,7 @@
|
|
144
144
|
<%= f.check_box :show_owner, id: :post_show_owner %>
|
145
145
|
<%= f.label :show_owner %>
|
146
146
|
</li>
|
147
|
-
<% if '
|
147
|
+
<% if Gem.loaded_specs.key?('biovision-comment') %>
|
148
148
|
<li>
|
149
149
|
<%= f.check_box :allow_comments, id: :post_allow_comments %>
|
150
150
|
<%= f.label :allow_comments %>
|
@@ -161,5 +161,3 @@
|
|
161
161
|
<% end %>
|
162
162
|
|
163
163
|
<%= render 'posts/form/wysiwyg' %>
|
164
|
-
|
165
|
-
<%= render partial: 'shared/forms/default_ajax_handler', locals: { form_id: 'post-form' } %>
|
data/config/locales/posts-en.yml
CHANGED
@@ -32,6 +32,7 @@ en:
|
|
32
32
|
image_author_link: "Image author link"
|
33
33
|
image_author_name: "Image author name"
|
34
34
|
image_name: "Image name"
|
35
|
+
language_id: "Language"
|
35
36
|
lead: "Lead"
|
36
37
|
meta_description: "Description for meta tag"
|
37
38
|
meta_keywords: "Keywords for meta tag"
|
@@ -101,8 +102,9 @@ en:
|
|
101
102
|
show:
|
102
103
|
title: "Post \"%{name}\""
|
103
104
|
index:
|
104
|
-
|
105
|
-
|
105
|
+
dashboard:
|
106
|
+
biovision_post:
|
107
|
+
heading: "Posts module"
|
106
108
|
post_categories:
|
107
109
|
new:
|
108
110
|
title: "New post category"
|
data/config/locales/posts-ru.yml
CHANGED
@@ -32,6 +32,7 @@ ru:
|
|
32
32
|
image_author_link: "Ссылка на автора изображения"
|
33
33
|
image_author_name: "Автор изображения"
|
34
34
|
image_name: "Название изображения"
|
35
|
+
language_id: "Язык"
|
35
36
|
lead: "Аннотация"
|
36
37
|
meta_description: "Описание для метатэга"
|
37
38
|
meta_keywords: "Ключевые слова для метатэга"
|
@@ -101,8 +102,9 @@ ru:
|
|
101
102
|
show:
|
102
103
|
title: "Публикация «%{name}»"
|
103
104
|
index:
|
104
|
-
|
105
|
-
|
105
|
+
dashboard:
|
106
|
+
biovision_post:
|
107
|
+
heading: "Модуль публикаций"
|
106
108
|
post_categories:
|
107
109
|
new:
|
108
110
|
title: "Новая категория публикаций"
|
@@ -6,7 +6,8 @@ class CreatePosts < ActiveRecord::Migration[5.1]
|
|
6
6
|
t.references :user, foreign_key: { on_update: :cascade, on_delete: :cascade }
|
7
7
|
t.references :post_type, null: false, foreign_key: { on_update: :cascade, on_delete: :cascade }
|
8
8
|
t.references :post_category, foreign_key: { on_update: :cascade, on_delete: :cascade }
|
9
|
-
t.references :
|
9
|
+
t.references :language, foreign_key: { on_update: :cascade, on_delete: :nullify }
|
10
|
+
t.integer :region_id
|
10
11
|
t.integer :original_post_id
|
11
12
|
t.references :agent, foreign_key: { on_update: :cascade, on_delete: :nullify }
|
12
13
|
t.inet :ip
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biovision-post
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.180127
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Khan-Magomedov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -146,8 +146,8 @@ files:
|
|
146
146
|
- app/services/post_manager/blog_post_handler.rb
|
147
147
|
- app/services/post_manager/news_handler.rb
|
148
148
|
- app/uploaders/post_image_uploader.rb
|
149
|
-
- app/views/admin/index/_biovision_post.html.erb
|
150
|
-
- app/views/admin/index/biovision_post/_additional_items.html.erb
|
149
|
+
- app/views/admin/index/dashboard/_biovision_post.html.erb
|
150
|
+
- app/views/admin/index/dashboard/biovision_post/_additional_items.html.erb
|
151
151
|
- app/views/admin/post_categories/entity/_in_list.html.erb
|
152
152
|
- app/views/admin/post_categories/show.html.erb
|
153
153
|
- app/views/admin/post_types/_nav_item.html.erb
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- db/migrate/20170930000003_create_posts.rb
|
202
202
|
- db/migrate/20171218111111_add_meta_fields_to_posts.rb
|
203
203
|
- db/migrate/20171219111112_add_author_fields_to_posts.rb
|
204
|
+
- db/migrate/20180124111113_add_language_to_posts.rb
|
204
205
|
- lib/biovision/post.rb
|
205
206
|
- lib/biovision/post/engine.rb
|
206
207
|
- lib/biovision/post/version.rb
|