From 269b4138815c87e0b1a8d6acbc13184aa7cc2f6e Mon Sep 17 00:00:00 2001 From: Antti Hukkanen Date: Tue, 26 Sep 2023 13:45:35 +0300 Subject: [PATCH] Fix plan author presenting if the author is not available --- .../plans/plans/_linked_plans.html.erb | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/views/decidim/plans/plans/_linked_plans.html.erb b/app/views/decidim/plans/plans/_linked_plans.html.erb index 70ca2508..b28fc9f6 100644 --- a/app/views/decidim/plans/plans/_linked_plans.html.erb +++ b/app/views/decidim/plans/plans/_linked_plans.html.erb @@ -9,17 +9,19 @@ <%= link_to resource_locator(plan).path, class: "card__link" do %>
<%== decidim_html_escape(present(plan).title) %>
<% end %> - <% present(plan) do |plan| %> - <% author = present(plan.author) %> -
- - <%= image_tag author.avatar_url %> - - - <%= author.name %> - <%= author.nickname %> - -
+ <% present(plan) do |presenter| %> + <% author = present(presenter.author) %> + <% if author.present? %> +
+ + <%= image_tag author.avatar_url %> + + + <%= author.name %> + <%= author.nickname %> + +
+ <% end %> <% end %>