decidim-blogs 0.27.7 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/blogs/content_blocks/highlighted_posts/content.erb +17 -0
- data/app/cells/decidim/blogs/content_blocks/highlighted_posts_cell.rb +52 -0
- data/app/cells/decidim/blogs/post_activity_cell.rb +1 -4
- data/app/cells/decidim/blogs/post_cell.rb +9 -2
- data/app/cells/decidim/blogs/post_g_cell.rb +31 -0
- data/app/cells/decidim/blogs/post_l_cell.rb +35 -0
- data/app/cells/decidim/blogs/post_metadata_cell.rb +29 -0
- data/app/cells/decidim/blogs/post_metadata_g_cell.rb +14 -0
- data/app/cells/decidim/blogs/post_s_cell.rb +15 -0
- data/app/commands/decidim/blogs/admin/create_post.rb +1 -0
- data/app/commands/decidim/blogs/admin/update_post.rb +10 -1
- data/app/controllers/decidim/blogs/admin/posts_controller.rb +2 -2
- data/app/controllers/decidim/blogs/posts_controller.rb +16 -4
- data/app/forms/decidim/blogs/admin/post_form.rb +2 -1
- data/app/helpers/decidim/blogs/admin/posts_helper.rb +11 -1
- data/app/helpers/decidim/blogs/application_helper.rb +4 -0
- data/app/helpers/decidim/blogs/posts_helper.rb +2 -4
- data/app/models/decidim/blogs/post.rb +14 -3
- data/app/packs/entrypoints/decidim_blogs.js +3 -0
- data/app/packs/stylesheets/blogs.scss +53 -0
- data/app/presenters/decidim/blogs/admin_log/post_presenter.rb +2 -2
- data/app/views/decidim/blogs/admin/posts/_form.html.erb +19 -13
- data/app/views/decidim/blogs/admin/posts/edit.html.erb +16 -6
- data/app/views/decidim/blogs/admin/posts/index.html.erb +60 -52
- data/app/views/decidim/blogs/admin/posts/new.html.erb +17 -6
- data/app/views/decidim/blogs/posts/_actions.html.erb +18 -0
- data/app/views/decidim/blogs/posts/index.html.erb +22 -9
- data/app/views/decidim/blogs/posts/show.html.erb +37 -47
- data/config/locales/ar.yml +2 -20
- data/config/locales/bg.yml +0 -86
- data/config/locales/ca.yml +16 -18
- data/config/locales/cs.yml +17 -17
- data/config/locales/de.yml +15 -17
- data/config/locales/el.yml +7 -18
- data/config/locales/en.yml +15 -17
- data/config/locales/es-MX.yml +15 -17
- data/config/locales/es-PY.yml +15 -17
- data/config/locales/es.yml +15 -17
- data/config/locales/eu.yml +16 -18
- data/config/locales/fi-plain.yml +15 -17
- data/config/locales/fi.yml +15 -17
- data/config/locales/fr-CA.yml +15 -17
- data/config/locales/fr.yml +15 -17
- data/config/locales/ga-IE.yml +0 -12
- data/config/locales/gl.yml +0 -21
- data/config/locales/hu.yml +15 -23
- data/config/locales/id-ID.yml +0 -19
- data/config/locales/is-IS.yml +0 -13
- data/config/locales/it.yml +0 -24
- data/config/locales/ja.yml +14 -17
- data/config/locales/ko.yml +0 -38
- data/config/locales/lb.yml +0 -24
- data/config/locales/lt.yml +12 -18
- data/config/locales/lv.yml +0 -21
- data/config/locales/nl.yml +0 -21
- data/config/locales/no.yml +0 -21
- data/config/locales/pl.yml +0 -42
- data/config/locales/pt-BR.yml +12 -27
- data/config/locales/pt.yml +0 -24
- data/config/locales/ro-RO.yml +7 -18
- data/config/locales/ru.yml +12 -18
- data/config/locales/sk.yml +0 -21
- data/config/locales/sq-AL.yml +0 -79
- data/config/locales/sr-CS.yml +0 -5
- data/config/locales/sv.yml +5 -20
- data/config/locales/tr-TR.yml +0 -21
- data/config/locales/uk.yml +0 -17
- data/config/locales/zh-CN.yml +0 -21
- data/config/locales/zh-TW.yml +3 -14
- data/db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb +17 -0
- data/lib/decidim/api/blogs_type.rb +14 -2
- data/lib/decidim/api/post_type.rb +1 -0
- data/lib/decidim/blogs/admin_engine.rb +2 -2
- data/lib/decidim/blogs/component.rb +4 -60
- data/lib/decidim/blogs/engine.rb +16 -1
- data/lib/decidim/blogs/seeds.rb +76 -0
- data/lib/decidim/blogs/test/factories.rb +9 -19
- data/lib/decidim/blogs/version.rb +1 -1
- metadata +39 -30
- data/app/cells/decidim/blogs/post_m/footer.erb +0 -5
- data/app/cells/decidim/blogs/post_m_cell.rb +0 -21
- data/app/views/decidim/blogs/posts/_datetime.html.erb +0 -1
- data/app/views/decidim/blogs/posts/_posts.html.erb +0 -24
- data/app/views/decidim/blogs/posts/_sidebar_blog.html.erb +0 -21
- data/config/locales/he-IL.yml +0 -1
- data/decidim-blogs.gemspec +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2330f24d70eca14e552dcf053957b8df8b1564de2a265a9b57648b89b079a3e
|
4
|
+
data.tar.gz: 8b5128b4c3f8a6f2b27b613e6796b5782a93d9d81dd26c2d97ab24e9fbfd4285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f848ffdda0e612316006c3ef8990b16a61cb536fac4dec1d484cc60e65526c827dbca9ca1bde5254a91aa95c563153b8bd3ce013c8f9a2678b108982fa0f461
|
7
|
+
data.tar.gz: 26c7b99f72dc7e3813a86da7c8e94d4a33a4e7beddd65743d1f6f74f5d78578d9d2c937f4e220e80a95445619cad8718565111459063911e7f1103d89dcbf479
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="content-block__title">
|
2
|
+
<h2 class="h2 decorator"><%= single_component ? translated_attribute(single_component.name) : t("name", scope: "decidim.components.blogs") %></h2>
|
3
|
+
<div class="label text-lg"><%= posts_count %></div>
|
4
|
+
<% if single_component %>
|
5
|
+
<%= link_to decidim_blogs.root_path, class: "button button__sm button__text-secondary" do %>
|
6
|
+
<span><%= t("decidim.blogs.content_blocks.highlighted_posts.see_all") %></span>
|
7
|
+
<%= icon "arrow-right-line" %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<span class="content-block__span"><%= t("decidim.blogs.content_blocks.highlighted_posts.last_published") %></span>
|
13
|
+
<div class="participatory-space__block-grid">
|
14
|
+
<% posts_to_render.each do |post| %>
|
15
|
+
<%= cell "decidim/blogs/post_g", post %>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
module ContentBlocks
|
6
|
+
class HighlightedPostsCell < Decidim::ContentBlocks::HighlightedElementsCell
|
7
|
+
include Decidim::ComponentPathHelper
|
8
|
+
include Decidim::CardHelper
|
9
|
+
|
10
|
+
def show
|
11
|
+
render unless posts_count.zero?
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def posts
|
17
|
+
@posts ||= Decidim::Blogs::Post.published.where(component: published_components).created_at_desc
|
18
|
+
end
|
19
|
+
|
20
|
+
def decidim_blogs
|
21
|
+
return unless single_component
|
22
|
+
|
23
|
+
Decidim::EngineRouter.main_proxy(single_component)
|
24
|
+
end
|
25
|
+
|
26
|
+
def single_component
|
27
|
+
@single_component ||= published_components.one? ? published_components.first : nil
|
28
|
+
end
|
29
|
+
|
30
|
+
def posts_to_render
|
31
|
+
@posts_to_render ||= posts.includes([:author, :component]).limit(limit)
|
32
|
+
end
|
33
|
+
|
34
|
+
def posts_count
|
35
|
+
@posts_count ||= posts.size
|
36
|
+
end
|
37
|
+
|
38
|
+
def cache_hash
|
39
|
+
hash = []
|
40
|
+
hash << "decidim/blogs/content_blocks/highlighted_posts"
|
41
|
+
hash << posts.cache_key_with_version
|
42
|
+
hash << I18n.locale.to_s
|
43
|
+
hash.join(Decidim.cache_key_separator)
|
44
|
+
end
|
45
|
+
|
46
|
+
def limit
|
47
|
+
3
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -5,10 +5,7 @@ module Decidim
|
|
5
5
|
# A cell to display when a post has been created.
|
6
6
|
class PostActivityCell < ActivityCell
|
7
7
|
def title
|
8
|
-
I18n.t(
|
9
|
-
"decidim.blogs.last_activity.new_post_at_html",
|
10
|
-
link: participatory_space_link
|
11
|
-
)
|
8
|
+
I18n.t("decidim.blogs.last_activity.new_post")
|
12
9
|
end
|
13
10
|
end
|
14
11
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Blogs
|
5
5
|
# This cell renders the card for an instance of a Post
|
6
|
-
# the default size is the
|
6
|
+
# the default size is the List Card (:l)
|
7
7
|
class PostCell < Decidim::ViewModel
|
8
8
|
def show
|
9
9
|
cell card_size, model, options
|
@@ -12,7 +12,14 @@ module Decidim
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def card_size
|
15
|
-
|
15
|
+
case @options[:size]
|
16
|
+
when :s
|
17
|
+
"decidim/blogs/post_s"
|
18
|
+
when :g
|
19
|
+
"decidim/blogs/post_g"
|
20
|
+
else
|
21
|
+
"decidim/blogs/post_l"
|
22
|
+
end
|
16
23
|
end
|
17
24
|
end
|
18
25
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
# This cell renders the Grid (:g) post card
|
6
|
+
# for a given instance of a Post
|
7
|
+
class PostGCell < Decidim::CardGCell
|
8
|
+
delegate :photo, to: :model
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def has_image?
|
13
|
+
resource_image_path.present?
|
14
|
+
end
|
15
|
+
|
16
|
+
def show_description?
|
17
|
+
true
|
18
|
+
end
|
19
|
+
|
20
|
+
def metadata_cell
|
21
|
+
"decidim/blogs/post_metadata_g"
|
22
|
+
end
|
23
|
+
|
24
|
+
def resource_image_path
|
25
|
+
return if photo.blank?
|
26
|
+
|
27
|
+
photo.url
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
# This cell renders the List (:l) post card
|
6
|
+
# for a given instance of a Post
|
7
|
+
class PostLCell < Decidim::CardLCell
|
8
|
+
delegate :photo, to: :model
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def has_image?
|
13
|
+
true
|
14
|
+
end
|
15
|
+
|
16
|
+
def has_description?
|
17
|
+
true
|
18
|
+
end
|
19
|
+
|
20
|
+
def description_length
|
21
|
+
500
|
22
|
+
end
|
23
|
+
|
24
|
+
def metadata_cell
|
25
|
+
"decidim/blogs/post_metadata"
|
26
|
+
end
|
27
|
+
|
28
|
+
def resource_image_path
|
29
|
+
return if photo.blank?
|
30
|
+
|
31
|
+
photo.url
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
# This cell renders metadata for an instance of a Proposal
|
6
|
+
class PostMetadataCell < Decidim::CardMetadataCell
|
7
|
+
def initialize(*)
|
8
|
+
super
|
9
|
+
|
10
|
+
@items.prepend(*post_items)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def post_items
|
16
|
+
[author_item, creation_date, comments_count_item, endorsements_count_item]
|
17
|
+
end
|
18
|
+
|
19
|
+
def creation_date
|
20
|
+
date_at = model.try(:published_at) || model.try(:created_at)
|
21
|
+
|
22
|
+
{
|
23
|
+
text: l(date_at.to_date, format: :decidim_short_with_month_name_short),
|
24
|
+
icon: "calendar-todo-line"
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
# This cell renders metadata for an instance of a Post
|
6
|
+
class PostMetadataGCell < PostMetadataCell
|
7
|
+
private
|
8
|
+
|
9
|
+
def post_items
|
10
|
+
[author_item, comments_count_item]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
# This cell renders the Search (:s) post card
|
6
|
+
# for a given instance of a Post
|
7
|
+
class PostSCell < Decidim::CardSCell
|
8
|
+
private
|
9
|
+
|
10
|
+
def metadata_cell
|
11
|
+
"decidim/blogs/post_metadata"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -37,10 +37,19 @@ module Decidim
|
|
37
37
|
Decidim.traceability.update!(
|
38
38
|
post,
|
39
39
|
@user,
|
40
|
+
attributes
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def attributes
|
45
|
+
{
|
40
46
|
title: form.title,
|
41
47
|
body: form.body,
|
48
|
+
published_at: form.published_at,
|
42
49
|
author: form.author
|
43
|
-
|
50
|
+
}.reject do |attribute, value|
|
51
|
+
value.blank? && attribute == :published_at
|
52
|
+
end
|
44
53
|
end
|
45
54
|
end
|
46
55
|
end
|
@@ -15,7 +15,7 @@ module Decidim
|
|
15
15
|
|
16
16
|
def create
|
17
17
|
enforce_permission_to :create, :blogpost
|
18
|
-
@form = form(PostForm).from_params(params, current_component:
|
18
|
+
@form = form(PostForm).from_params(params, current_component:)
|
19
19
|
|
20
20
|
CreatePost.call(@form, current_user) do
|
21
21
|
on(:ok) do
|
@@ -37,7 +37,7 @@ module Decidim
|
|
37
37
|
|
38
38
|
def update
|
39
39
|
enforce_permission_to :update, :blogpost, blogpost: post
|
40
|
-
@form = form(PostForm).from_params(params, current_component:
|
40
|
+
@form = form(PostForm).from_params(params, current_component:)
|
41
41
|
|
42
42
|
UpdatePost.call(@form, post, current_user) do
|
43
43
|
on(:ok) do
|
@@ -5,25 +5,37 @@ module Decidim
|
|
5
5
|
# Exposes the blog resource so users can view them
|
6
6
|
class PostsController < Decidim::Blogs::ApplicationController
|
7
7
|
include Flaggable
|
8
|
+
include Paginable
|
9
|
+
include Decidim::IconHelper
|
8
10
|
|
9
|
-
helper_method :posts, :post, :paginate_posts, :posts_most_commented
|
11
|
+
helper_method :posts, :post, :post_presenter, :paginate_posts, :posts_most_commented, :tabs, :panels
|
10
12
|
|
11
13
|
def index; end
|
12
14
|
|
13
|
-
def show
|
15
|
+
def show
|
16
|
+
raise ActionController::RoutingError, "Not Found" unless post
|
17
|
+
end
|
14
18
|
|
15
19
|
private
|
16
20
|
|
17
21
|
def paginate_posts
|
18
|
-
@paginate_posts ||= posts.created_at_desc
|
22
|
+
@paginate_posts ||= paginate(posts.created_at_desc)
|
19
23
|
end
|
20
24
|
|
21
25
|
def post
|
22
26
|
@post ||= posts.find(params[:id])
|
23
27
|
end
|
24
28
|
|
29
|
+
def post_presenter
|
30
|
+
@post_presenter ||= Decidim::Blogs::PostPresenter.new(post)
|
31
|
+
end
|
32
|
+
|
25
33
|
def posts
|
26
|
-
@posts ||=
|
34
|
+
@posts ||= if current_user&.admin?
|
35
|
+
Post.where(component: current_component)
|
36
|
+
else
|
37
|
+
Post.published.where(component: current_component)
|
38
|
+
end
|
27
39
|
end
|
28
40
|
|
29
41
|
# PROVISIONAL if we implement counter cache
|
@@ -11,6 +11,7 @@ module Decidim
|
|
11
11
|
translatable_attribute :body, String
|
12
12
|
|
13
13
|
attribute :decidim_author_id, Integer
|
14
|
+
attribute :published_at, Decidim::Attributes::TimeWithZone
|
14
15
|
|
15
16
|
validates :title, translatable_presence: true
|
16
17
|
validates :body, translatable_presence: true
|
@@ -43,7 +44,7 @@ module Decidim
|
|
43
44
|
end
|
44
45
|
|
45
46
|
def post
|
46
|
-
@post ||= Post.find_by(id:
|
47
|
+
@post ||= Post.find_by(id:)
|
47
48
|
end
|
48
49
|
|
49
50
|
def user_groups
|
@@ -7,6 +7,7 @@ module Decidim
|
|
7
7
|
module PostsHelper
|
8
8
|
include Decidim::ApplicationHelper
|
9
9
|
include SanitizeHelper
|
10
|
+
include PaginateHelper
|
10
11
|
|
11
12
|
# Public: truncates the post body
|
12
13
|
#
|
@@ -16,7 +17,7 @@ module Decidim
|
|
16
17
|
# Returns the post's body truncated.
|
17
18
|
def post_description_admin(post, max_length = 100)
|
18
19
|
body = translated_attribute(post.body)
|
19
|
-
CGI.unescapeHTML html_truncate(body, max_length:
|
20
|
+
CGI.unescapeHTML html_truncate(body, max_length:)
|
20
21
|
end
|
21
22
|
|
22
23
|
def post_author_select_field(form, name, _options = {})
|
@@ -33,6 +34,15 @@ module Decidim
|
|
33
34
|
|
34
35
|
form.select(name, select_options)
|
35
36
|
end
|
37
|
+
|
38
|
+
def publish_data(published_at)
|
39
|
+
data = {}
|
40
|
+
if published_at > Time.current
|
41
|
+
data[:icon] = icon("time-line", aria_label: t("decidim.blogs.admin.posts.index.not_published_yet"), role: "img")
|
42
|
+
data[:popup] = t("decidim.blogs.admin.posts.index.not_published_yet")
|
43
|
+
end
|
44
|
+
data
|
45
|
+
end
|
36
46
|
end
|
37
47
|
end
|
38
48
|
end
|
@@ -11,6 +11,10 @@ module Decidim
|
|
11
11
|
include ::Decidim::EndorsableHelper
|
12
12
|
include ::Decidim::FollowableHelper
|
13
13
|
include Decidim::Comments::CommentsHelper
|
14
|
+
|
15
|
+
def component_name
|
16
|
+
(defined?(current_component) && translated_attribute(current_component&.name).presence) || t("decidim.components.blogs.name")
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -14,11 +14,9 @@ module Decidim
|
|
14
14
|
# max_length - a number to limit the length of the body
|
15
15
|
#
|
16
16
|
# Returns the post's body truncated.
|
17
|
-
def post_description(post, max_length =
|
18
|
-
link = post_path(post)
|
17
|
+
def post_description(post, max_length = 300)
|
19
18
|
body = translated_attribute(post.body)
|
20
|
-
|
21
|
-
CGI.unescapeHTML html_truncate(body, max_length: max_length, tail: tail)
|
19
|
+
CGI.unescapeHTML html_truncate(body, max_length:)
|
22
20
|
end
|
23
21
|
end
|
24
22
|
end
|
@@ -26,6 +26,7 @@ module Decidim
|
|
26
26
|
validates :title, presence: true
|
27
27
|
|
28
28
|
scope :created_at_desc, -> { order(arel_table[:created_at].desc) }
|
29
|
+
scope :published, -> { where("published_at <= ?", Time.current) }
|
29
30
|
|
30
31
|
searchable_fields({
|
31
32
|
participatory_space: { component: :participatory_space },
|
@@ -36,12 +37,22 @@ module Decidim
|
|
36
37
|
index_on_create: true,
|
37
38
|
index_on_update: ->(post) { post.visible? })
|
38
39
|
|
40
|
+
class << self
|
41
|
+
def all_timestamp_attributes_in_model
|
42
|
+
super + ["published_at"]
|
43
|
+
end
|
44
|
+
|
45
|
+
def log_presenter_class_for(_log)
|
46
|
+
Decidim::Blogs::AdminLog::PostPresenter
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
39
50
|
def visible?
|
40
|
-
participatory_space.try(:visible?) && component.try(:published?)
|
51
|
+
participatory_space.try(:visible?) && component.try(:published?) && published?
|
41
52
|
end
|
42
53
|
|
43
|
-
def
|
44
|
-
|
54
|
+
def published?
|
55
|
+
published_at <= Time.current
|
45
56
|
end
|
46
57
|
|
47
58
|
# Public: Overrides the `comments_have_alignment?` Commentable concern method.
|
@@ -0,0 +1,53 @@
|
|
1
|
+
.blog {
|
2
|
+
&__image {
|
3
|
+
@apply grow rounded overflow-hidden mb-8 aspect-[3];
|
4
|
+
|
5
|
+
img {
|
6
|
+
@apply w-full h-full object-cover;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
&__actions {
|
11
|
+
@apply flex flex-col md:flex-row justify-between items-center gap-10;
|
12
|
+
|
13
|
+
&-left {
|
14
|
+
@apply flex items-center gap-2;
|
15
|
+
}
|
16
|
+
|
17
|
+
&-right {
|
18
|
+
@apply flex items-center gap-4;
|
19
|
+
|
20
|
+
button {
|
21
|
+
@apply flex items-center gap-1;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
.is-active span:last-child {
|
26
|
+
@apply text-white bg-secondary border-secondary;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
&__endorsers {
|
31
|
+
@apply space-y-3;
|
32
|
+
|
33
|
+
&-text {
|
34
|
+
@apply text-sm text-gray-2;
|
35
|
+
}
|
36
|
+
|
37
|
+
&-grid {
|
38
|
+
@apply flex flex-wrap gap-y-3;
|
39
|
+
}
|
40
|
+
|
41
|
+
&-button {
|
42
|
+
@apply block ml-auto text-right text-xs text-secondary cursor-pointer;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
&__section {
|
47
|
+
@apply mt-16 first-of-type:mt-0 last:mb-16 md:last:mb-36 xl:max-w-[75%] space-y-10;
|
48
|
+
|
49
|
+
p {
|
50
|
+
@apply mt-4 text-gray-2 text-md;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
@@ -6,8 +6,8 @@ module Decidim
|
|
6
6
|
# This class holds the logic to present a `Decidim::Blogs::Post`
|
7
7
|
# for the `AdminLog` log.
|
8
8
|
#
|
9
|
-
# Usage should be automatic and you
|
10
|
-
# directly, but here
|
9
|
+
# Usage should be automatic and you should not need to call this class
|
10
|
+
# directly, but here is an example:
|
11
11
|
#
|
12
12
|
# action_log = Decidim::ActionLog.last
|
13
13
|
# view_helpers # => this comes from the views
|
@@ -1,18 +1,24 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<%= post_author_select_field form, :decidim_author_id, label: t("decidim.blogs.actions.author_id") %>
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="card pt-4">
|
3
|
+
<div class="card-section">
|
4
|
+
<div class="row column">
|
5
|
+
<div class="field">
|
6
|
+
<%= post_author_select_field form, :decidim_author_id, label: t("decidim.blogs.actions.author_id") %>
|
7
|
+
</div>
|
9
8
|
</div>
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
<div class="row column">
|
11
|
+
<%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
|
12
|
+
</div>
|
13
|
+
<div class="row column">
|
14
|
+
<%= form.translated :editor, :body, lines: 30, aria: { label: :body } %>
|
15
|
+
</div>
|
16
|
+
<div class="row">
|
17
|
+
<div class="columns">
|
18
|
+
<%= form.datetime_field :published_at %>
|
19
|
+
</div>
|
20
|
+
</div>
|
16
21
|
</div>
|
17
22
|
</div>
|
23
|
+
|
18
24
|
</div>
|
@@ -1,8 +1,18 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form edit_post" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f %>
|
11
|
+
<div class="item__edit-sticky">
|
12
|
+
<div class="item__edit-sticky-container">
|
13
|
+
<%= f.submit t(".save"), class: "button button__sm button__secondary" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
7
17
|
</div>
|
8
|
-
|
18
|
+
</div>
|