cmor_blog 0.0.54.pre → 0.0.55.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/cmor/blog/asset_detail.rb +4 -0
- data/app/views/cmor/blog/application_view_helper/_render_post.html.haml +5 -2
- data/app/views/cmor/blog/posts/_post.html.haml +27 -20
- data/app/views/cmor/blog/posts/_post_in_index.html.haml +2 -1
- data/app/views/cmor/blog/posts/_post_in_index_with_preview_picture.haml +2 -1
- data/app/views/cmor/blog/posts/show.html.haml +6 -1
- data/config/locales/de.yml +6 -0
- data/config/locales/en.yml +6 -0
- data/lib/cmor/blog/configuration.rb +2 -2
- data/lib/generators/cmor/blog/install/templates/initializer.rb +9 -5
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0201f2ca0c8aa20e93e86be7e459ae173c8be83bdd469f7b5c1506127504480f
|
4
|
+
data.tar.gz: 623eb45db211e6725087c1bea8c0549f6cb9fb89d318183ff5bbb42348771acd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e2816649fa64701d925ee8e74e8b33e07fd1a38f873687a5472936a3248e39b7291207d15acb1f48ddc0bcfa2fe23806e62edd147883c14ac5f40928bb44022
|
7
|
+
data.tar.gz: 86c7787d940c70b8a91d7d950d58077ae428857556bb8c33ef05abdbf9f04ff560b4f7c2f770a52209c6ab9b19706cff44ded7d912c350f51f70c71a1c9bd9bb
|
@@ -5,6 +5,10 @@ module Cmor::Blog
|
|
5
5
|
|
6
6
|
acts_as_list scope: :post_id
|
7
7
|
|
8
|
+
# acts as published
|
9
|
+
include ActsAsPublished::ActiveRecord
|
10
|
+
acts_as_published
|
11
|
+
|
8
12
|
scope :images, -> { joins(asset: [:blob]).where("active_storage_blobs.content_type LIKE '%image/%'") }
|
9
13
|
scope :non_images, -> { joins(asset: [:blob]).where("active_storage_blobs.content_type NOT LIKE '%image/%'") }
|
10
14
|
|
@@ -1,10 +1,13 @@
|
|
1
1
|
%div{ id: dom_id(post), class: "row #{dom_class(post)} bottom-margin-5 mb-4" }
|
2
|
-
.col-lg-
|
2
|
+
.col-lg-4
|
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')
|
5
|
+
.col-lg-8
|
3
6
|
%h2.post-title
|
4
7
|
= link_to(post.title, cmor_blog.url_for(post))
|
5
8
|
%small
|
6
9
|
%span.post-creation-information.text-muted
|
7
|
-
=
|
10
|
+
= instance_exec(post, &Cmor::Blog::Configuration.post_creation_information_proc)
|
8
11
|
- if Cmor::Core.features?(:cmor_comments)
|
9
12
|
|
|
10
13
|
%span.comments-information
|
@@ -1,19 +1,24 @@
|
|
1
1
|
%div{ id: dom_id(post), class: dom_class(post) }
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
%span.comments-information
|
10
|
-
= link_to(t('cmor.comments.commentable.comments_information', comments_count: post.comments.count), cmor_blog.post_url(post, anchor: 'comments'))
|
11
|
-
- if Cmor::Core.features?(:cmor_tags)
|
12
|
-
|
|
13
|
-
%span.post-tags
|
14
|
-
= tags_helper(self).render_tags_for(post)
|
2
|
+
.row
|
3
|
+
.col-12
|
4
|
+
%h1.post-title
|
5
|
+
= post.title
|
6
|
+
%small
|
7
|
+
%span.post-creation-information.text-muted
|
8
|
+
= instance_exec(post, &Cmor::Blog::Configuration.post_creation_information_proc)
|
15
9
|
|
16
|
-
|
10
|
+
- if Cmor::Core.features?(:cmor_comments)
|
11
|
+
|
|
12
|
+
%span.comments-information
|
13
|
+
= link_to(t('cmor.comments.commentable.comments_information', comments_count: post.comments.count), cmor_blog.post_url(post, anchor: 'comments'))
|
14
|
+
- if Cmor::Core.features?(:cmor_tags)
|
15
|
+
|
|
16
|
+
%span.post-tags
|
17
|
+
= tags_helper(self).render_tags_for(post)
|
18
|
+
|
19
|
+
.row
|
20
|
+
.col-12
|
21
|
+
%p.post-body= post.body(format: :html).html_safe
|
17
22
|
|
18
23
|
- if post.asset_details.images.any?
|
19
24
|
.row
|
@@ -21,7 +26,7 @@
|
|
21
26
|
.col-lg-4.d-flex.align-items-stretch
|
22
27
|
.card.text-center.border-0
|
23
28
|
%a{ href: main_app.url_for(picture_detail.asset), data: { gallery: dom_id(post) } }
|
24
|
-
%img{ src: main_app.url_for(picture_detail.asset.variant(Cmor::Blog::Configuration.preview_picture_asset_variant_options)) }
|
29
|
+
%img.ing-fluid.w-100{ src: main_app.url_for(picture_detail.asset.variant(Cmor::Blog::Configuration.preview_picture_asset_variant_options)) }
|
25
30
|
.card-body
|
26
31
|
%h5.card-title
|
27
32
|
= picture_detail.title
|
@@ -29,8 +34,10 @@
|
|
29
34
|
= picture_detail.description
|
30
35
|
|
31
36
|
- if post.asset_details.non_images.any?
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
.row
|
38
|
+
.col-12
|
39
|
+
= collection_table(collection: post.asset_details.non_images.order(position: :asc)) do |t|
|
40
|
+
= t.column :filename
|
41
|
+
= t.column :actions do |resource|
|
42
|
+
- link_to(main_app.url_for(resource.asset), class: 'btn btn-primary') do
|
43
|
+
- t('.download')
|
@@ -4,7 +4,8 @@
|
|
4
4
|
= link_to(post.title, cmor_blog.url_for(post))
|
5
5
|
%small
|
6
6
|
%span.post-creation-information.text-muted
|
7
|
-
=
|
7
|
+
= instance_exec(post, &Cmor::Blog::Configuration.post_creation_information_proc)
|
8
|
+
|
8
9
|
- if Cmor::Core.features?(:cmor_comments)
|
9
10
|
|
|
10
11
|
%span.comments-information
|
@@ -7,7 +7,8 @@
|
|
7
7
|
= link_to(post.title, cmor_blog.url_for(post))
|
8
8
|
%small
|
9
9
|
%span.post-creation-information.text-muted
|
10
|
-
=
|
10
|
+
= instance_exec(post, &Cmor::Blog::Configuration.post_creation_information_proc)
|
11
|
+
|
11
12
|
- if Cmor::Core.features?(:cmor_comments)
|
12
13
|
|
|
13
14
|
%span.comments-information
|
data/config/locales/de.yml
CHANGED
@@ -12,12 +12,14 @@ de:
|
|
12
12
|
attributes:
|
13
13
|
cmor/blog/post:
|
14
14
|
id: ID
|
15
|
+
append_assets: Dateien hinzufügen
|
15
16
|
asset_details_count: Anhänge
|
16
17
|
assets: Anhänge
|
17
18
|
body: Inhalt
|
18
19
|
created_by_id: Erstellt von
|
19
20
|
creator: Erstellt von
|
20
21
|
locale: Sprache
|
22
|
+
overwrite_assets: Dateien ersetzen
|
21
23
|
position: Position
|
22
24
|
published: Veröffentlicht
|
23
25
|
published_at: Veröffentlicht am
|
@@ -40,6 +42,7 @@ de:
|
|
40
42
|
title: Titel
|
41
43
|
preview_picture: Vorschau
|
42
44
|
position: Position
|
45
|
+
published: Veröffentlicht
|
43
46
|
published_at: Veröffentlicht am
|
44
47
|
created_at: Erstellt am
|
45
48
|
updated_at: Aktualisiert am
|
@@ -48,5 +51,8 @@ de:
|
|
48
51
|
application_view_helper:
|
49
52
|
render_post:
|
50
53
|
more: 'Mehr'
|
54
|
+
posts:
|
55
|
+
show:
|
56
|
+
back: 'Zurück'
|
51
57
|
routes:
|
52
58
|
cmor_blog_engine: blog
|
data/config/locales/en.yml
CHANGED
@@ -12,12 +12,14 @@ en:
|
|
12
12
|
attributes:
|
13
13
|
cmor/blog/post:
|
14
14
|
id: ID
|
15
|
+
append_assets: Append files
|
15
16
|
asset_details_count: Assets
|
16
17
|
assets: Asset
|
17
18
|
body: Body
|
18
19
|
created_by_id: Created by
|
19
20
|
creator: Created by
|
20
21
|
locale: Locale
|
22
|
+
overwrite_assets: Overwrite files
|
21
23
|
position: Position
|
22
24
|
published: Published
|
23
25
|
published_at: Published at
|
@@ -40,6 +42,7 @@ en:
|
|
40
42
|
title: Title
|
41
43
|
preview_picture: Preview
|
42
44
|
position: Position
|
45
|
+
published: Published
|
43
46
|
published_at: Published at
|
44
47
|
created_at: Created at
|
45
48
|
updated_at: Updated at
|
@@ -48,5 +51,8 @@ en:
|
|
48
51
|
application_view_helper:
|
49
52
|
render_post:
|
50
53
|
more: 'More'
|
54
|
+
posts:
|
55
|
+
post:
|
56
|
+
back: 'Back'
|
51
57
|
routes:
|
52
58
|
cmor_blog_engine: blog
|
@@ -32,8 +32,8 @@ module Cmor
|
|
32
32
|
{ combine_options: { resize: "320x240^", extent: "384x216", gravity: "center" } }
|
33
33
|
end
|
34
34
|
|
35
|
-
mattr_accessor(:
|
36
|
-
-> (post) { post.creator&.
|
35
|
+
mattr_accessor(:post_creation_information_proc) do
|
36
|
+
-> (post) { "#{l(post.created_at)} | #{post.creator&.human}" }
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -46,17 +46,21 @@ Cmor::Blog.configure do |config|
|
|
46
46
|
#
|
47
47
|
config.preview_picture_asset_variant_options = { combine_options: { resize: "320x240^", extent: "384x216", gravity: "center" } }
|
48
48
|
|
49
|
-
# Define how the author will be shown on posts.
|
49
|
+
# Define how the author and post date will be shown on posts.
|
50
50
|
#
|
51
51
|
# You can generalize the label by not taking the creator into account at all:
|
52
52
|
#
|
53
|
-
# config.
|
53
|
+
# config.post_creation_information_proc = -> (post) { "#{l(post.created_at)} | "Site Owner" }
|
54
54
|
#
|
55
55
|
# You can show a default when the creator is not set:
|
56
56
|
#
|
57
|
-
# config.
|
57
|
+
# config.post_creation_information_proc = -> (post) { post.creator&.to_s || "Site owner" }
|
58
58
|
#
|
59
|
-
#
|
59
|
+
# You can remove the date:
|
60
60
|
#
|
61
|
-
config.
|
61
|
+
# config.post_creation_information_proc = -> (post) { post.creator&.to_s }
|
62
|
+
#
|
63
|
+
# default: config.post_creation_information_proc = -> (post) { "#{l(post.created_at)} | #{post.creator&.to_s}" }
|
64
|
+
#
|
65
|
+
config.post_creation_information_proc = -> (post) { "#{l(post.created_at)} | #{post.creator&.to_s}" }
|
62
66
|
end
|
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.55.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: 2020-
|
11
|
+
date: 2020-06-28 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.55.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.55.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.55.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.55.pre
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sqlite3
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -499,7 +499,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
499
499
|
- !ruby/object:Gem::Version
|
500
500
|
version: 1.3.1
|
501
501
|
requirements: []
|
502
|
-
rubygems_version: 3.1.
|
502
|
+
rubygems_version: 3.1.4
|
503
503
|
signing_key:
|
504
504
|
specification_version: 4
|
505
505
|
summary: Cmor::Blog.
|