biovision-post 0.26.191013.0 → 0.28.191126.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/biovision/post/admin/posts.scss +8 -0
- data/app/controllers/admin/post_categories_controller.rb +16 -0
- data/app/controllers/admin/post_types_controller.rb +20 -0
- data/app/controllers/my/posts_controller.rb +10 -0
- data/app/services/biovision/components/posts_component.rb +64 -5
- data/app/views/admin/components/user_settings/_posts.html.erb +43 -0
- data/app/views/admin/components/user_settings/posts/_post_categories.html.erb +38 -0
- data/app/views/admin/editorial_members/show.html.erb +3 -25
- data/app/views/admin/post_types/show.html.erb +9 -1
- data/app/views/admin/posts/index.html.erb +9 -1
- data/app/views/editorial_members/_form.html.erb +0 -21
- data/app/views/my/posts/_form.html.erb +188 -160
- data/app/views/posts/_form.html.erb +379 -367
- data/app/views/posts/_list.jbuilder +1 -1
- data/app/views/posts/form/_category_links.html.erb +9 -4
- data/config/locales/posts-ru.yml +4 -0
- data/config/routes.rb +8 -1
- data/db/migrate/20191124232323_convert_editorial_privileges.rb +17 -0
- data/lib/biovision/post/version.rb +1 -1
- metadata +5 -2
@@ -2,7 +2,7 @@ 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.call(entity, :title, :lead
|
5
|
+
json.call(entity, :title, :lead)
|
6
6
|
end
|
7
7
|
json.meta do
|
8
8
|
json.html_preview render(partial: 'posts/preview', formats: [:html], locals: { entity: entity })
|
@@ -2,13 +2,17 @@
|
|
2
2
|
<ul class="post-category-tree">
|
3
3
|
<% collection.each do |category_id, item| %>
|
4
4
|
<li>
|
5
|
-
<%
|
5
|
+
<%
|
6
|
+
element_id = "post_category_#{category_id}"
|
7
|
+
allowed = handler.allow_post_category?(category_id)
|
8
|
+
%>
|
6
9
|
<%=
|
7
10
|
check_box_tag(
|
8
11
|
"post_category_ids[]",
|
9
12
|
category_id,
|
10
13
|
item[:item].post?(entity),
|
11
|
-
id: element_id
|
14
|
+
id: element_id,
|
15
|
+
disabled: !allowed
|
12
16
|
)
|
13
17
|
%>
|
14
18
|
<%= label_tag element_id, item[:item].name %>
|
@@ -19,9 +23,10 @@
|
|
19
23
|
render(
|
20
24
|
partial: 'posts/form/category_links',
|
21
25
|
locals: {
|
22
|
-
|
26
|
+
categories: categories,
|
23
27
|
collection: children,
|
24
|
-
|
28
|
+
entity: entity,
|
29
|
+
handler: handler
|
25
30
|
}
|
26
31
|
)
|
27
32
|
%>
|
data/config/locales/posts-ru.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -91,10 +91,17 @@ Rails.application.routes.draw do
|
|
91
91
|
get :new_post
|
92
92
|
get :post_tags
|
93
93
|
get :authors
|
94
|
+
put 'users/:user_id' => :add_user, as: :user
|
95
|
+
delete 'users/:user_id' => :remove_user
|
94
96
|
end
|
95
97
|
end
|
96
98
|
|
97
|
-
resources :post_categories, only: :show, concerns: %i[toggle priority]
|
99
|
+
resources :post_categories, only: :show, concerns: %i[toggle priority] do
|
100
|
+
member do
|
101
|
+
put 'users/:user_id' => :add_user, as: :user
|
102
|
+
delete 'users/:user_id' => :remove_user
|
103
|
+
end
|
104
|
+
end
|
98
105
|
|
99
106
|
resources :posts, only: %i[index show], concerns: %i[lock toggle] do
|
100
107
|
get 'search', on: :collection
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Convert editorial_member_post_types to component settings
|
4
|
+
class ConvertEditorialPrivileges < ActiveRecord::Migration[5.2]
|
5
|
+
def up
|
6
|
+
slug = Biovision::Components::PostsComponent::SLUG
|
7
|
+
handler = Biovision::Components::BaseComponent.handler(slug)
|
8
|
+
EditorialMemberPostType.order('id asc').each do |link|
|
9
|
+
handler.user = link.editorial_member.user
|
10
|
+
handler.allow_post_type(link.post_type)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def down
|
15
|
+
# No rollback needed
|
16
|
+
end
|
17
|
+
end
|
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.
|
4
|
+
version: 0.28.191126.0
|
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: 2019-
|
11
|
+
date: 2019-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -190,6 +190,8 @@ files:
|
|
190
190
|
- app/services/post_parser.rb
|
191
191
|
- app/uploaders/post_image_uploader.rb
|
192
192
|
- app/views/admin/components/links/_posts.html.erb
|
193
|
+
- app/views/admin/components/user_settings/_posts.html.erb
|
194
|
+
- app/views/admin/components/user_settings/posts/_post_categories.html.erb
|
193
195
|
- app/views/admin/editorial_members/_nav_item.html.erb
|
194
196
|
- app/views/admin/editorial_members/entity/_in_list.html.erb
|
195
197
|
- app/views/admin/editorial_members/index.html.erb
|
@@ -357,6 +359,7 @@ files:
|
|
357
359
|
- db/migrate/20190801161616_add_posts_component.rb
|
358
360
|
- db/migrate/20190822121212_create_post_attachments.rb
|
359
361
|
- db/migrate/20190914212121_convert_post_privileges.rb
|
362
|
+
- db/migrate/20191124232323_convert_editorial_privileges.rb
|
360
363
|
- lib/biovision/post.rb
|
361
364
|
- lib/biovision/post/engine.rb
|
362
365
|
- lib/biovision/post/version.rb
|