decidim-blogs 0.27.8 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/blogs/content_blocks/highlighted_posts/content.erb +17 -0
  3. data/app/cells/decidim/blogs/content_blocks/highlighted_posts_cell.rb +52 -0
  4. data/app/cells/decidim/blogs/post_activity_cell.rb +1 -4
  5. data/app/cells/decidim/blogs/post_cell.rb +9 -2
  6. data/app/cells/decidim/blogs/post_g_cell.rb +31 -0
  7. data/app/cells/decidim/blogs/post_l_cell.rb +35 -0
  8. data/app/cells/decidim/blogs/post_metadata_cell.rb +29 -0
  9. data/app/cells/decidim/blogs/post_metadata_g_cell.rb +14 -0
  10. data/app/cells/decidim/blogs/post_s_cell.rb +15 -0
  11. data/app/commands/decidim/blogs/admin/create_post.rb +1 -0
  12. data/app/commands/decidim/blogs/admin/update_post.rb +10 -1
  13. data/app/controllers/decidim/blogs/admin/posts_controller.rb +2 -2
  14. data/app/controllers/decidim/blogs/posts_controller.rb +16 -4
  15. data/app/forms/decidim/blogs/admin/post_form.rb +2 -1
  16. data/app/helpers/decidim/blogs/admin/posts_helper.rb +11 -1
  17. data/app/helpers/decidim/blogs/application_helper.rb +4 -0
  18. data/app/helpers/decidim/blogs/posts_helper.rb +2 -4
  19. data/app/models/decidim/blogs/post.rb +14 -3
  20. data/app/packs/entrypoints/decidim_blogs.js +3 -0
  21. data/app/packs/stylesheets/blogs.scss +53 -0
  22. data/app/presenters/decidim/blogs/admin_log/post_presenter.rb +2 -2
  23. data/app/views/decidim/blogs/admin/posts/_form.html.erb +19 -13
  24. data/app/views/decidim/blogs/admin/posts/edit.html.erb +16 -6
  25. data/app/views/decidim/blogs/admin/posts/index.html.erb +60 -52
  26. data/app/views/decidim/blogs/admin/posts/new.html.erb +17 -6
  27. data/app/views/decidim/blogs/posts/_actions.html.erb +18 -0
  28. data/app/views/decidim/blogs/posts/index.html.erb +22 -9
  29. data/app/views/decidim/blogs/posts/show.html.erb +37 -47
  30. data/config/locales/ar.yml +2 -20
  31. data/config/locales/bg.yml +0 -86
  32. data/config/locales/ca.yml +16 -18
  33. data/config/locales/cs.yml +17 -17
  34. data/config/locales/de.yml +15 -17
  35. data/config/locales/el.yml +7 -18
  36. data/config/locales/en.yml +15 -17
  37. data/config/locales/es-MX.yml +15 -17
  38. data/config/locales/es-PY.yml +15 -17
  39. data/config/locales/es.yml +15 -17
  40. data/config/locales/eu.yml +16 -18
  41. data/config/locales/fi-plain.yml +15 -17
  42. data/config/locales/fi.yml +15 -17
  43. data/config/locales/fr-CA.yml +15 -17
  44. data/config/locales/fr.yml +15 -17
  45. data/config/locales/ga-IE.yml +0 -12
  46. data/config/locales/gl.yml +0 -21
  47. data/config/locales/hu.yml +15 -23
  48. data/config/locales/id-ID.yml +0 -19
  49. data/config/locales/is-IS.yml +0 -13
  50. data/config/locales/it.yml +0 -24
  51. data/config/locales/ja.yml +14 -17
  52. data/config/locales/ko.yml +0 -38
  53. data/config/locales/lb.yml +0 -24
  54. data/config/locales/lt.yml +12 -18
  55. data/config/locales/lv.yml +0 -21
  56. data/config/locales/nl.yml +0 -21
  57. data/config/locales/no.yml +0 -21
  58. data/config/locales/pl.yml +0 -42
  59. data/config/locales/pt-BR.yml +12 -27
  60. data/config/locales/pt.yml +0 -24
  61. data/config/locales/ro-RO.yml +7 -18
  62. data/config/locales/ru.yml +12 -18
  63. data/config/locales/sk.yml +0 -21
  64. data/config/locales/sq-AL.yml +0 -79
  65. data/config/locales/sr-CS.yml +0 -5
  66. data/config/locales/sv.yml +5 -20
  67. data/config/locales/tr-TR.yml +0 -21
  68. data/config/locales/uk.yml +0 -17
  69. data/config/locales/zh-CN.yml +0 -21
  70. data/config/locales/zh-TW.yml +3 -14
  71. data/db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb +17 -0
  72. data/lib/decidim/api/blogs_type.rb +14 -2
  73. data/lib/decidim/api/post_type.rb +1 -0
  74. data/lib/decidim/blogs/admin_engine.rb +2 -2
  75. data/lib/decidim/blogs/component.rb +4 -60
  76. data/lib/decidim/blogs/engine.rb +16 -1
  77. data/lib/decidim/blogs/seeds.rb +76 -0
  78. data/lib/decidim/blogs/test/factories.rb +9 -19
  79. data/lib/decidim/blogs/version.rb +1 -1
  80. metadata +39 -30
  81. data/app/cells/decidim/blogs/post_m/footer.erb +0 -5
  82. data/app/cells/decidim/blogs/post_m_cell.rb +0 -21
  83. data/app/views/decidim/blogs/posts/_datetime.html.erb +0 -1
  84. data/app/views/decidim/blogs/posts/_posts.html.erb +0 -24
  85. data/app/views/decidim/blogs/posts/_sidebar_blog.html.erb +0 -21
  86. data/config/locales/he-IL.yml +0 -1
  87. data/decidim-blogs.gemspec +0 -36
@@ -18,11 +18,23 @@ module Decidim
18
18
  end
19
19
 
20
20
  def posts(filter: {}, order: {})
21
- Decidim::Core::ComponentListBase.new(model_class: Post).call(object, { filter: filter, order: order }, context)
21
+ base_query = Decidim::Core::ComponentListBase.new(model_class: Post).call(object, { filter:, order: }, context)
22
+ if context[:current_user]&.admin?
23
+ base_query
24
+ else
25
+ base_query.published
26
+ end
22
27
  end
23
28
 
24
29
  def post(id:)
25
- Decidim::Core::ComponentFinderBase.new(model_class: Post).call(object, { id: id }, context)
30
+ scope =
31
+ if context[:current_user]&.admin?
32
+ Post
33
+ else
34
+ Post.published
35
+ end
36
+
37
+ Decidim::Core::ComponentFinderBase.new(model_class: scope).call(object, { id: }, context)
26
38
  end
27
39
  end
28
40
  end
@@ -16,6 +16,7 @@ module Decidim
16
16
  field :id, GraphQL::Types::ID, "The internal ID of this post", null: false
17
17
  field :title, Decidim::Core::TranslatedFieldType, "The title for this post", null: true
18
18
  field :body, Decidim::Core::TranslatedFieldType, "The body of this post", null: true
19
+ field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
19
20
  end
20
21
  end
21
22
  end
@@ -12,8 +12,8 @@ module Decidim
12
12
 
13
13
  routes do
14
14
  resources :posts do
15
- resources :attachment_collections
16
- resources :attachments
15
+ resources :attachment_collections, except: [:show]
16
+ resources :attachments, except: [:show]
17
17
  end
18
18
  root to: "posts#index"
19
19
  end
@@ -1,17 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "decidim/components/namer"
4
-
5
3
  Decidim.register_component(:blogs) do |component|
6
4
  component.engine = Decidim::Blogs::Engine
7
5
  component.admin_engine = Decidim::Blogs::AdminEngine
8
6
  component.icon = "media/images/decidim_blogs.svg"
7
+ component.icon_key = "pen-nib-line"
9
8
  component.permissions_class_name = "Decidim::Blog::Permissions"
10
9
 
11
10
  component.query_type = "Decidim::Blogs::BlogsType"
12
11
 
13
12
  component.on(:before_destroy) do |instance|
14
- raise StandardError, "Can't remove this component" if Decidim::Blogs::Post.where(component: instance).any?
13
+ raise StandardError, "Cannot remove this component" if Decidim::Blogs::Post.where(component: instance).any?
15
14
  end
16
15
 
17
16
  component.register_stat :posts_count, primary: true, priority: Decidim::StatsRegistry::MEDIUM_PRIORITY do |components, _start_at, _end_at|
@@ -41,63 +40,8 @@ Decidim.register_component(:blogs) do |component|
41
40
  end
42
41
 
43
42
  component.seeds do |participatory_space|
44
- admin_user = Decidim::User.find_by(
45
- organization: participatory_space.organization,
46
- email: "admin@example.org"
47
- )
48
-
49
- step_settings = if participatory_space.allows_steps?
50
- { participatory_space.active_step.id => { comments_enabled: true, comments_blocked: false } }
51
- else
52
- {}
53
- end
54
-
55
- params = {
56
- name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :blogs).i18n_name,
57
- manifest_name: :blogs,
58
- published_at: Time.current,
59
- participatory_space: participatory_space,
60
- settings: {
61
- vote_limit: 0
62
- },
63
- step_settings: step_settings
64
- }
65
-
66
- component = Decidim.traceability.perform_action!(
67
- "publish",
68
- Decidim::Component,
69
- admin_user,
70
- visibility: "all"
71
- ) do
72
- Decidim::Component.create!(params)
73
- end
74
-
75
- 6.times do |n|
76
- author = if n >= 3
77
- Decidim::User.where(organization: component.organization).order(Arel.sql("RANDOM()")).first
78
- elsif n <= 1
79
- Decidim::UserGroup.where(organization: component.organization).order(Arel.sql("RANDOM()")).first
80
- else
81
- component.organization
82
- end
83
-
84
- params = {
85
- component: component,
86
- title: Decidim::Faker::Localized.sentence(word_count: 5),
87
- body: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
88
- Decidim::Faker::Localized.paragraph(sentence_count: 20)
89
- end,
90
- author: author
91
- }
92
-
93
- post = Decidim.traceability.create!(
94
- Decidim::Blogs::Post,
95
- author,
96
- params,
97
- visibility: "all"
98
- )
43
+ require "decidim/blogs/seeds"
99
44
 
100
- Decidim::Comments::Seed.comments_for(post)
101
- end
45
+ Decidim::Blogs::Seeds.new(participatory_space:).call
102
46
  end
103
47
  end
@@ -15,7 +15,14 @@ module Decidim
15
15
 
16
16
  routes do
17
17
  resources :posts, only: [:index, :show]
18
- root to: "posts#index"
18
+ scope "/posts" do
19
+ root to: "posts#index"
20
+ end
21
+ get "/", to: redirect("posts", status: 301)
22
+ end
23
+
24
+ initializer "decidim_blogs.register_icons" do
25
+ Decidim.icons.register(name: "Decidim::Blogs::Post", icon: "pen-nib-line", description: "Blogs post", category: "activity", engine: :core)
19
26
  end
20
27
 
21
28
  initializer "decidim_blogs.add_cells_view_paths" do
@@ -26,6 +33,14 @@ module Decidim
26
33
  initializer "decidim_blogs.webpacker.assets_path" do
27
34
  Decidim.register_assets_path File.expand_path("app/packs", root)
28
35
  end
36
+
37
+ initializer "decidim_blogs.authorization_transfer" do
38
+ config.to_prepare do
39
+ Decidim::AuthorizationTransfer.register(:blogs) do |transfer|
40
+ transfer.move_records(Decidim::Blogs::Post, :decidim_author_id)
41
+ end
42
+ end
43
+ end
29
44
  end
30
45
  end
31
46
  end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "decidim/components/namer"
4
+
5
+ module Decidim
6
+ module Blogs
7
+ class Seeds
8
+ attr_reader :participatory_space
9
+
10
+ def initialize(participatory_space:)
11
+ @participatory_space = participatory_space
12
+ end
13
+
14
+ def call
15
+ admin_user = Decidim::User.find_by(
16
+ organization: participatory_space.organization,
17
+ email: "admin@example.org"
18
+ )
19
+
20
+ step_settings = if participatory_space.allows_steps?
21
+ { participatory_space.active_step.id => { comments_enabled: true, comments_blocked: false } }
22
+ else
23
+ {}
24
+ end
25
+
26
+ params = {
27
+ name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :blogs).i18n_name,
28
+ manifest_name: :blogs,
29
+ published_at: Time.current,
30
+ participatory_space:,
31
+ settings: {
32
+ vote_limit: 0
33
+ },
34
+ step_settings:
35
+ }
36
+
37
+ component = Decidim.traceability.perform_action!(
38
+ "publish",
39
+ Decidim::Component,
40
+ admin_user,
41
+ visibility: "all"
42
+ ) do
43
+ Decidim::Component.create!(params)
44
+ end
45
+
46
+ 6.times do |n|
47
+ author = if n >= 3
48
+ Decidim::User.where(organization: component.organization).sample
49
+ elsif n <= 1
50
+ Decidim::UserGroup.where(organization: component.organization).sample
51
+ else
52
+ component.organization
53
+ end
54
+
55
+ params = {
56
+ component:,
57
+ title: Decidim::Faker::Localized.sentence(word_count: 5),
58
+ body: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
59
+ Decidim::Faker::Localized.paragraph(sentence_count: 20)
60
+ end,
61
+ author:
62
+ }
63
+
64
+ post = Decidim.traceability.create!(
65
+ Decidim::Blogs::Post,
66
+ author,
67
+ params,
68
+ visibility: "all"
69
+ )
70
+
71
+ Decidim::Comments::Seed.comments_for(post)
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -1,37 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "decidim/components/namer"
3
4
  require "decidim/faker/localized"
4
5
  require "decidim/core/test/factories"
5
6
  require "decidim/participatory_processes/test/factories"
6
7
 
7
8
  FactoryBot.define do
8
9
  factory :post_component, parent: :component do
9
- transient do
10
- skip_injection { false }
11
- end
12
-
13
- name { generate_component_name(participatory_space.organization.available_locales, :blogs, skip_injection: skip_injection) }
10
+ name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :blogs).i18n_name }
14
11
  manifest_name { :blogs }
15
- participatory_space { create(:participatory_process, :with_steps, skip_injection: skip_injection, organization: organization) }
12
+ participatory_space { create(:participatory_process, :with_steps, organization:) }
16
13
  end
17
14
 
18
15
  factory :post, class: "Decidim::Blogs::Post" do
19
- transient do
20
- skip_injection { false }
21
- end
22
-
23
- title { generate_localized_title(:blog_title, skip_injection: skip_injection) }
24
- body { generate_localized_description(:blog_body, skip_injection: skip_injection) }
25
- component { build(:post_component, skip_injection: skip_injection) }
26
- author { build(:user, :confirmed, skip_injection: skip_injection, organization: component.organization) }
16
+ title { generate_localized_title }
17
+ body { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
18
+ component { build(:component, manifest_name: "blogs") }
19
+ author { build(:user, :confirmed, organization: component.organization) }
27
20
 
28
21
  trait :with_endorsements do
29
- after :create do |post, evaluator|
22
+ after :create do |post|
30
23
  5.times.collect do
31
- create(:endorsement,
32
- resource: post,
33
- skip_injection: evaluator.skip_injection,
34
- author: build(:user, skip_injection: evaluator.skip_injection, organization: post.participatory_space.organization))
24
+ create(:endorsement, resource: post, author: build(:user, organization: post.participatory_space.organization))
35
25
  end
36
26
  end
37
27
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-pages version.
5
5
  module Blogs
6
6
  def self.version
7
- "0.27.8"
7
+ "0.28.0.rc4"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-blogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.8
4
+ version: 0.28.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Massot Gil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-30 00:00:00.000000000 Z
11
+ date: 2023-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.27.8
19
+ version: 0.28.0.rc4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.27.8
26
+ version: 0.28.0.rc4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-comments
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.27.8
33
+ version: 0.28.0.rc4
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.27.8
40
+ version: 0.28.0.rc4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.27.8
47
+ version: 0.28.0.rc4
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.27.8
54
+ version: 0.28.0.rc4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-admin
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.27.8
61
+ version: 0.28.0.rc4
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.27.8
68
+ version: 0.28.0.rc4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: decidim-assemblies
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.27.8
75
+ version: 0.28.0.rc4
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.27.8
82
+ version: 0.28.0.rc4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: decidim-dev
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.27.8
89
+ version: 0.28.0.rc4
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.27.8
96
+ version: 0.28.0.rc4
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: decidim-participatory_processes
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.27.8
103
+ version: 0.28.0.rc4
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.27.8
110
+ version: 0.28.0.rc4
111
111
  description: A Blog component for decidim's participatory spaces.
112
112
  email:
113
113
  - isaac.mg@coditramuntana.com
@@ -117,10 +117,15 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - README.md
119
119
  - Rakefile
120
+ - app/cells/decidim/blogs/content_blocks/highlighted_posts/content.erb
121
+ - app/cells/decidim/blogs/content_blocks/highlighted_posts_cell.rb
120
122
  - app/cells/decidim/blogs/post_activity_cell.rb
121
123
  - app/cells/decidim/blogs/post_cell.rb
122
- - app/cells/decidim/blogs/post_m/footer.erb
123
- - app/cells/decidim/blogs/post_m_cell.rb
124
+ - app/cells/decidim/blogs/post_g_cell.rb
125
+ - app/cells/decidim/blogs/post_l_cell.rb
126
+ - app/cells/decidim/blogs/post_metadata_cell.rb
127
+ - app/cells/decidim/blogs/post_metadata_g_cell.rb
128
+ - app/cells/decidim/blogs/post_s_cell.rb
124
129
  - app/commands/decidim/blogs/admin/create_post.rb
125
130
  - app/commands/decidim/blogs/admin/update_post.rb
126
131
  - app/controllers/decidim/blogs/admin/application_controller.rb
@@ -138,6 +143,7 @@ files:
138
143
  - app/models/decidim/blogs/post.rb
139
144
  - app/packs/entrypoints/decidim_blogs.js
140
145
  - app/packs/images/decidim/blogs/decidim_blogs.svg
146
+ - app/packs/stylesheets/blogs.scss
141
147
  - app/permissions/decidim/blog/permissions.rb
142
148
  - app/presenters/decidim/blogs/admin_log/post_presenter.rb
143
149
  - app/presenters/decidim/blogs/official_author_presenter.rb
@@ -146,9 +152,7 @@ files:
146
152
  - app/views/decidim/blogs/admin/posts/edit.html.erb
147
153
  - app/views/decidim/blogs/admin/posts/index.html.erb
148
154
  - app/views/decidim/blogs/admin/posts/new.html.erb
149
- - app/views/decidim/blogs/posts/_datetime.html.erb
150
- - app/views/decidim/blogs/posts/_posts.html.erb
151
- - app/views/decidim/blogs/posts/_sidebar_blog.html.erb
155
+ - app/views/decidim/blogs/posts/_actions.html.erb
152
156
  - app/views/decidim/blogs/posts/index.html.erb
153
157
  - app/views/decidim/blogs/posts/show.html.erb
154
158
  - config/assets.rb
@@ -184,7 +188,6 @@ files:
184
188
  - config/locales/ga-IE.yml
185
189
  - config/locales/gl.yml
186
190
  - config/locales/gn-PY.yml
187
- - config/locales/he-IL.yml
188
191
  - config/locales/hr-HR.yml
189
192
  - config/locales/hr.yml
190
193
  - config/locales/hu.yml
@@ -240,7 +243,7 @@ files:
240
243
  - db/migrate/20200320105910_index_foreign_keys_in_decidim_blogs_posts.rb
241
244
  - db/migrate/20200827153709_add_commentable_counter_cache_to_posts.rb
242
245
  - db/migrate/20210310120514_add_followable_counter_cache_to_blogs.rb
243
- - decidim-blogs.gemspec
246
+ - db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
244
247
  - lib/decidim/api/blogs_type.rb
245
248
  - lib/decidim/api/post_input_filter.rb
246
249
  - lib/decidim/api/post_input_sort.rb
@@ -251,28 +254,34 @@ files:
251
254
  - lib/decidim/blogs/api.rb
252
255
  - lib/decidim/blogs/component.rb
253
256
  - lib/decidim/blogs/engine.rb
257
+ - lib/decidim/blogs/seeds.rb
254
258
  - lib/decidim/blogs/test/factories.rb
255
259
  - lib/decidim/blogs/version.rb
256
- homepage: https://github.com/decidim/decidim
260
+ homepage: https://decidim.org
257
261
  licenses:
258
262
  - AGPL-3.0
259
- metadata: {}
263
+ metadata:
264
+ bug_tracker_uri: https://github.com/decidim/decidim/issues
265
+ documentation_uri: https://docs.decidim.org/
266
+ funding_uri: https://opencollective.com/decidim
267
+ homepage_uri: https://decidim.org
268
+ source_code_uri: https://github.com/decidim/decidim
260
269
  post_install_message:
261
270
  rdoc_options: []
262
271
  require_paths:
263
272
  - lib
264
273
  required_ruby_version: !ruby/object:Gem::Requirement
265
274
  requirements:
266
- - - "~>"
275
+ - - ">="
267
276
  - !ruby/object:Gem::Version
268
- version: 3.0.0
277
+ version: '3.1'
269
278
  required_rubygems_version: !ruby/object:Gem::Requirement
270
279
  requirements:
271
- - - ">="
280
+ - - ">"
272
281
  - !ruby/object:Gem::Version
273
- version: '0'
282
+ version: 1.3.1
274
283
  requirements: []
275
- rubygems_version: 3.5.14
284
+ rubygems_version: 3.4.20
276
285
  signing_key:
277
286
  specification_version: 4
278
287
  summary: Decidim blogs module
@@ -1,5 +0,0 @@
1
- <div class="card__footer card__footer--spaces">
2
- <div class="card__support">
3
- <%= link_to t("decidim.blogs.posts.show.view"), resource_path, class: "card__button button--sc light button small" %>
4
- </div>
5
- </div>
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Blogs
5
- # This cell renders the Medium (:m) post card
6
- # for an given instance of a Post
7
- class PostMCell < Decidim::CardMCell
8
- private
9
-
10
- def has_actions?
11
- false
12
- end
13
-
14
- def endorsements_count
15
- with_tooltip t("decidim.endorsable.endorsements") do
16
- "#{icon("bullhorn", class: "icon--small")} #{model.endorsements_count}"
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1 +0,0 @@
1
- <%= l post.created_at, format: "%d/%m/%Y" %>
@@ -1,24 +0,0 @@
1
- <div class="row small-12">
2
- <% paginate_posts.each do |post| %>
3
- <div class="card card--post">
4
- <% if post.photo.present? %>
5
- <%= image_tag post.photo.url, class: "card__image" %>
6
- <% end %>
7
- <div class="card__content">
8
- <div class="card__header">
9
- <%= link_to post, class: "card__link" do %>
10
- <h2 class="card__title">
11
- <%= translated_attribute post.title %>
12
- </h2>
13
- <% end %>
14
- <div class="card__author">
15
- <% post_presenter = Decidim::Blogs::PostPresenter.new(post) %>
16
- <%= cell "decidim/author", post_presenter.author, from: post, has_actions: true %>
17
- </div>
18
- </div>
19
- <%= decidim_sanitize_editor post_description(post) %>
20
- </div>
21
- </div>
22
- <% end %>
23
- </div>
24
- <%= decidim_paginate paginate_posts %>
@@ -1,21 +0,0 @@
1
- <% if posts.any? %>
2
- <div class="section">
3
- <div class="section-heading">
4
- <%= t(".most_commented_posts") %>
5
- </div>
6
- <% posts.each do |post| %>
7
- <div class="m-bottom">
8
- <strong><%= link_to translated_attribute(post.title), post %></strong>
9
- <div class="author-data author-data--nopadding">
10
- <%= render partial: "datetime", locals: { post: post } %>&nbsp;&nbsp;·&nbsp;&nbsp;
11
- <%= link_to "#{post_path(post)}#comments", title: t(".comments") do %>
12
- <%= icon "comment-square", class: "icon--small", aria_label: t(".comments"), role: "img" %>
13
- <%= post.comments_count %>
14
- <%= t(".comments") %>
15
- <% end %>
16
- <a href="#comments" title="<%= t(".comments") %>"></a>
17
- </div>
18
- </div>
19
- <% end %>
20
- </div>
21
- <% end %>
@@ -1 +0,0 @@
1
- he:
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.push File.expand_path("lib", __dir__)
4
-
5
- # Maintain your gem's version:
6
- require "decidim/blogs/version"
7
-
8
- # Describe your gem and declare its dependencies:
9
- Gem::Specification.new do |s|
10
- s.version = Decidim::Blogs.version
11
- s.authors = ["Isaac Massot Gil"]
12
- s.email = ["isaac.mg@coditramuntana.com"]
13
- s.license = "AGPL-3.0"
14
- s.homepage = "https://github.com/decidim/decidim"
15
- s.required_ruby_version = "~> 3.0.0"
16
-
17
- s.name = "decidim-blogs"
18
- s.summary = "Decidim blogs module"
19
- s.description = "A Blog component for decidim's participatory spaces."
20
-
21
- s.files = Dir.chdir(__dir__) do
22
- `git ls-files -z`.split("\x0").select do |f|
23
- (File.expand_path(f) == __FILE__) ||
24
- f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
25
- end
26
- end
27
-
28
- s.add_dependency "decidim-admin", Decidim::Blogs.version
29
- s.add_dependency "decidim-comments", Decidim::Blogs.version
30
- s.add_dependency "decidim-core", Decidim::Blogs.version
31
-
32
- s.add_development_dependency "decidim-admin", Decidim::Blogs.version
33
- s.add_development_dependency "decidim-assemblies", Decidim::Blogs.version
34
- s.add_development_dependency "decidim-dev", Decidim::Blogs.version
35
- s.add_development_dependency "decidim-participatory_processes", Decidim::Blogs.version
36
- end