From d348933b1ac02a42f4e3ab979151f95e2c1d9e59 Mon Sep 17 00:00:00 2001 From: Joonas Date: Thu, 12 Sep 2024 09:46:24 +0300 Subject: [PATCH] Update cards --- app/cells/decidim/plans/plan_l/data.erb | 2 +- app/cells/decidim/plans/plan_m/data.erb | 2 +- app/cells/decidim/plans/plan_m_cell.rb | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/cells/decidim/plans/plan_l/data.erb b/app/cells/decidim/plans/plan_l/data.erb index 00e9f51a..f41c1e7c 100644 --- a/app/cells/decidim/plans/plan_l/data.erb +++ b/app/cells/decidim/plans/plan_l/data.erb @@ -10,7 +10,7 @@
- <%= creation_date_status %> + <%# <%= creation_date_status %>
<% if has_category? %> diff --git a/app/cells/decidim/plans/plan_m/data.erb b/app/cells/decidim/plans/plan_m/data.erb index 502ba574..62909022 100644 --- a/app/cells/decidim/plans/plan_m/data.erb +++ b/app/cells/decidim/plans/plan_m/data.erb @@ -12,7 +12,7 @@
- <%= creation_date_status %> +
<% if has_category? %> diff --git a/app/cells/decidim/plans/plan_m_cell.rb b/app/cells/decidim/plans/plan_m_cell.rb index bb678e48..1ebedc3e 100644 --- a/app/cells/decidim/plans/plan_m_cell.rb +++ b/app/cells/decidim/plans/plan_m_cell.rb @@ -5,7 +5,7 @@ module Decidim module Plans # This cell renders a plan with its M-size card. - class PlanMCell < Decidim::ViewModel + class PlanMCell < Decidim::CardLCell include PlanCellsHelper include Decidim::Plans::CellContentHelper @@ -97,26 +97,26 @@ def has_footer? def badge_classes return super unless options[:full_badge] - state_classes.push("label", "idea-status").join(" ") + state_classes.push(["label", "idea-status"]).join(" ") end def statuses return [] if preview? return [:comments_count] if model.draft? - [:comments_count, :favorites_count] + [:comments_count, :favoriting_count] end def comments_count_status render_comments_count end - def creation_date_status - l(model.published_at.to_date, format: :decidim_short) - end + # def creation_date_status + # l(model.published_at.to_date, format: :decidim_short) + # end - def favorites_count_status - cell("decidim/favorites/favorites_count", model) + def favoriting_count_status + cell("decidim/favorites/favoriting_count", model) end def category_icon @@ -124,7 +124,7 @@ def category_icon return unless cat content_tag(:span, class: "card__category__icon", "aria-hidden": true) do - image_tag(cat.attached_uploader(:category_icon).url, alt: full_category) + image_tag(cat.attached_uploader(:category_icon).path, alt: full_category) end end @@ -181,11 +181,11 @@ def plan_image end def default_plan_image - Decidim::Plans.config.default_card_image + Decidim::Plans.default_card_image end def resource_image_path - return plan_image.attached_uploader(:file).variant_url(resource_image_variant) if has_image? + return plan_image.attached_uploader(:file).path(variant: resource_image_variant) if has_image? if has_category? path = category_image_path(category) @@ -207,7 +207,7 @@ def category_image_path(cat) return unless cat.category_image return unless cat.category_image.attached? - cat.attached_uploader(:category_image).variant_url(category_image_variant) + cat.attached_uploader(:category_image).path(variant: category_image_variant) end def category_image_variant