cmor_blog 0.0.39.pre → 0.0.40.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/cmor/blog/posts_controller.rb +1 -1
- data/app/models/cmor/blog/post.rb +2 -2
- data/app/views/cmor/blog/posts/_post.html.haml +2 -2
- data/app/views/cmor/blog/posts/_post_in_index.html.haml +2 -2
- data/app/views/cmor/blog/posts/_post_in_index_with_preview_picture.haml +4 -3
- data/app/views/cmor/blog/posts/show.html.haml +1 -1
- data/lib/cmor/blog.rb +0 -1
- data/lib/cmor/blog/configuration.rb +23 -12
- data/lib/generators/cmor/blog/install/templates/initializer.rb +0 -8
- metadata +6 -7
- data/lib/cmor/blog/feature.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fc857e86a91e648a4f4ff238fffa0af4f1fb925712dcc54807cff7471819f80
|
4
|
+
data.tar.gz: cd57c5b371ddcb640bc0f025bd6d5d190a3973daf02aefac488c0b5e3b14807c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 363b54cf9a9fe5b547234266b07ba3379be55609f1f956e773048b19095f72be308c8b2fd204f1b557b8e78ac5086e52efe89ca8dc06aba2b442d5f8f9e3ee01
|
7
|
+
data.tar.gz: 25c79e21acb7f5799be32b472da05c940f51ede31ea889ecd50aa131170059030b8b7c284daf1ce75bdfe9c2d872ec875464f8d335c0e5bff59650fe1be5a050
|
@@ -8,7 +8,7 @@ module Cmor
|
|
8
8
|
include Rao::ResourcesController::KaminariConcern
|
9
9
|
include Rao::ResourcesController::LocationHistoryConcern
|
10
10
|
|
11
|
-
helper Cmor::Comments::ApplicationHelper if Cmor::
|
11
|
+
helper Cmor::Comments::ApplicationHelper if Cmor::Core.features?(:cmor_comments)
|
12
12
|
|
13
13
|
def self.resource_class
|
14
14
|
Cmor::Blog::Post
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Cmor
|
2
2
|
module Blog
|
3
3
|
class Post < ActiveRecord::Base
|
4
|
-
include Model::Cmor::Comments::CommentableConcern if Cmor::
|
5
|
-
include Model::Cmor::Tags::TaggableConcern if Cmor::
|
4
|
+
include Model::Cmor::Comments::CommentableConcern if Cmor::Core.features?(:cmor_comments)
|
5
|
+
include Model::Cmor::Tags::TaggableConcern if Cmor::Core.features?(:cmor_tags)
|
6
6
|
|
7
7
|
# publishing
|
8
8
|
include ActsAsPublished::ActiveRecord
|
@@ -4,11 +4,11 @@
|
|
4
4
|
%small
|
5
5
|
%span.post-creation-information.text-muted
|
6
6
|
= "#{l(post.created_at)} | #{post.creator.send(Cmor::Blog::Configuration.creator_label_method_name)}"
|
7
|
-
- if Cmor::
|
7
|
+
- if Cmor::Core.features?(:cmor_comments)
|
8
8
|
|
|
9
9
|
%span.comments-information
|
10
10
|
= link_to(t('cmor.comments.commentable.comments_information', comments_count: post.comments.count), cmor_blog.post_url(post, anchor: 'comments'))
|
11
|
-
- if Cmor::
|
11
|
+
- if Cmor::Core.features?(:cmor_tags)
|
12
12
|
|
|
13
13
|
%span.post-tags
|
14
14
|
= tags_helper(self).render_tags_for(post)
|
@@ -5,11 +5,11 @@
|
|
5
5
|
%small
|
6
6
|
%span.post-creation-information.text-muted
|
7
7
|
= "#{l(post.created_at)} | #{post.creator.send(Cmor::Blog::Configuration.creator_label_method_name)}"
|
8
|
-
- if Cmor::
|
8
|
+
- if Cmor::Core.features?(:cmor_comments)
|
9
9
|
|
|
10
10
|
%span.comments-information
|
11
11
|
= link_to(t('cmor.comments.commentable.comments_information', comments_count: post.comments.count), cmor_blog.post_url(post, anchor: 'comments'))
|
12
|
-
- if Cmor::
|
12
|
+
- if Cmor::Core.features?(:cmor_tags)
|
13
13
|
|
|
14
14
|
%span.post-tags
|
15
15
|
= tags_helper(self).render_tags_for(post)
|
@@ -1,17 +1,18 @@
|
|
1
1
|
%div{ id: dom_id(post), class: "row #{dom_class(post)} bottom-margin-5 mb-4" }
|
2
2
|
.col-lg-4
|
3
|
-
|
3
|
+
.post-preview-picture
|
4
|
+
= image_tag(main_app.url_for(post.preview_picture.asset.variant(Cmor::Blog::Configuration.preview_picture_asset_variant_options)), class: 'img-fluid')
|
4
5
|
.col-lg-8
|
5
6
|
%h2.post-title
|
6
7
|
= link_to(post.title, cmor_blog.url_for(post))
|
7
8
|
%small
|
8
9
|
%span.post-creation-information.text-muted
|
9
10
|
= "#{l(post.created_at)} | #{post.creator.send(Cmor::Blog::Configuration.creator_label_method_name)}"
|
10
|
-
- if Cmor::
|
11
|
+
- if Cmor::Core.features?(:cmor_comments)
|
11
12
|
|
|
12
13
|
%span.comments-information
|
13
14
|
= link_to(t('cmor.comments.commentable.comments_information', comments_count: post.comments.count), cmor_blog.post_url(post, anchor: 'comments'))
|
14
|
-
- if Cmor::
|
15
|
+
- if Cmor::Core.features?(:cmor_tags)
|
15
16
|
|
|
16
17
|
%span.post-tags
|
17
18
|
= tag_labels_for(post)
|
data/lib/cmor/blog.rb
CHANGED
@@ -9,20 +9,31 @@ module Cmor
|
|
9
9
|
yield self
|
10
10
|
end
|
11
11
|
|
12
|
-
mattr_accessor(:base_controller)
|
13
|
-
|
14
|
-
mattr_accessor(:user_factory_name) { :user }
|
15
|
-
mattr_accessor(:posts_index_page_title_proc) { ->(view) { view.resource_class.model_name.human(count: :other) } }
|
16
|
-
mattr_accessor(:pagination_options_proc) { ->(view) { { theme: 'twitter-bootstrap-3' } } }
|
17
|
-
mattr_accessor(:preview_picture_asset_variant_options) { { resize: '320x240' } }
|
18
|
-
mattr_accessor(:creator_label_method_name) { :to_s }
|
19
|
-
mattr_accessor(:features) { {} }
|
20
|
-
def enable_feature(name, options = {})
|
21
|
-
@@features[name] = Cmor::Blog::Feature.new(name, options)
|
12
|
+
mattr_accessor(:base_controller) do
|
13
|
+
'::FrontendController'
|
22
14
|
end
|
23
15
|
|
24
|
-
|
25
|
-
|
16
|
+
mattr_accessor(:creator_class_name) do
|
17
|
+
'User'
|
18
|
+
end
|
19
|
+
|
20
|
+
mattr_accessor(:user_factory_name) do
|
21
|
+
:user
|
22
|
+
end
|
23
|
+
|
24
|
+
mattr_accessor(:posts_index_page_title_proc) do
|
25
|
+
->(view) { view.resource_class.model_name.human(count: :other) }
|
26
|
+
end
|
27
|
+
|
28
|
+
mattr_accessor(:pagination_options_proc) do
|
29
|
+
->(view) { { theme: 'twitter-bootstrap-3' } }
|
30
|
+
end
|
31
|
+
mattr_accessor(:preview_picture_asset_variant_options) do
|
32
|
+
{ resize: '320x240' }
|
33
|
+
end
|
34
|
+
|
35
|
+
mattr_accessor(:creator_label_method_name) do
|
36
|
+
:to_s
|
26
37
|
end
|
27
38
|
end
|
28
39
|
end
|
@@ -46,14 +46,6 @@ Cmor::Blog.configure do |config|
|
|
46
46
|
#
|
47
47
|
config.preview_picture_asset_variant_options = { resize: '320x240' }
|
48
48
|
|
49
|
-
# Enables the Cmor::Comments integration
|
50
|
-
#
|
51
|
-
# config.enable_feature :cmor_comments, {}
|
52
|
-
|
53
|
-
# Enables the Cmor::Tags integration
|
54
|
-
#
|
55
|
-
# config.enable_feature :cmor_tags, {}
|
56
|
-
|
57
49
|
# Method to call on creator for display.
|
58
50
|
#
|
59
51
|
# default: config.creator_label_method_name = :to_s
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmor_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.40.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.40.pre
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.0.
|
40
|
+
version: 0.0.40.pre
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cmor_core_frontend
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.0.
|
47
|
+
version: 0.0.40.pre
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.0.
|
54
|
+
version: 0.0.40.pre
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sqlite3
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -452,7 +452,6 @@ files:
|
|
452
452
|
- lib/cmor/blog.rb
|
453
453
|
- lib/cmor/blog/configuration.rb
|
454
454
|
- lib/cmor/blog/engine.rb
|
455
|
-
- lib/cmor/blog/feature.rb
|
456
455
|
- lib/cmor/blog/version.rb
|
457
456
|
- lib/cmor_blog.rb
|
458
457
|
- lib/generators/cmor/blog/install/install_generator.rb
|