Skip to content

Commit

Permalink
Fix cells
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Jul 22, 2024
1 parent 64b0600 commit 98fb304
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/cells/decidim/plans/author/flag.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if flaggable? %>
<button type="button" data-open="<%= current_user.present? ? "flagModal" : "loginModal" %>" title="<%= t("report", scope: "decidim.plans.plans.show") %>" aria-controls="<%= current_user.present? ? "flagModal" : "loginModal" %>" aria-haspopup="true" tabindex="0">
<%= icon "flag", aria_label: t("report", scope: "decidim.plans.plans.show"), class: "icon--small" %>
<%= icon "flag-line", aria_label: t("report", scope: "decidim.plans.plans.show"), class: "icon--small" %>
</button>
<% end %>
33 changes: 17 additions & 16 deletions app/cells/decidim/plans/collapsible_authors/show.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<div class="author--inline">
<%= cell(
"decidim/collapsible_list",
list,
cell_name: cell_name,
cell_options: options.merge(has_actions: false),
size: size
) %>
<div class="author__coauthors" data-component="accordion">
<% visible_authors.each do |author| %>
<%= cell "decidim/plans/author", author, layout: :compact %>
<% end %>
<% if model.length > MAX_ITEMS_STACKED %>
<div id="panel-coauthors" class="author__coauthors" aria-hidden="true">
<% (model - visible_authors).each do |author| %>
<%= cell "decidim/plans/author", author, layout: :compact %>
<% end %>
</div>

<button id="coauthors-trigger" data-controls="panel-coauthors" class="button button__sm button__text-secondary">
<span><%= t("decidim.collapsible_list.hidden_elements_count", count: model.length - MAX_ITEMS_STACKED ) %></span>
<span><%= t("decidim.collapsible_list.see_less") %></span>
</button>
<% end %>
</div>
<% if actionable? %>
<div class="author-data__extra">
<% author_cell= cell("decidim/plans/author", model, from: from_context) %>
<%= author_cell.(:date) %>
<%= author_cell.(:flag) %>
<%= author_cell.(:withdraw) %>
</div>
<% end %>
4 changes: 2 additions & 2 deletions app/cells/decidim/plans/plan_add_authors/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</div>
</div>
</div>
<div class="wrapper wrapper--inner">
<div class="button--double form-general-submit float-right">
<div class="row">
<div class="button button__sm button__secondary">
<%= f.submit t(".next") %>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/cells/decidim/plans/plan_notification_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ def status_class

def icon_key
if model.accepted?
"circle-check"
"checkbox-circle-line"
elsif model.rejected?
"warning"
"error-warning-line"
else
"flag"
"flag-line"
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/cells/decidim/plans/plan_view/actions.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<% if flaggable? %>
<li>
<button type="button" class="link action-link" data-open="<%= current_user.present? ? "flagModal" : "loginModal" %>" aria-controls="<%= current_user.present? ? "flagModal" : "loginModal" %>" aria-haspopup="true">
<%= icon "flag", role: "img", "aria-hidden": true %>
<%= icon "flag-line", role: "img", "aria-hidden": true %>
<span class="link-text"><%= t ".flag" %></span>
</button>
</li>
Expand Down
8 changes: 5 additions & 3 deletions app/cells/decidim/plans/plan_view/share_modal.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div class="reveal" id="socialShare" data-reveal>
<div class="reveal__header">
<h3 class="reveal__title"><%= t("decidim.shared.share_modal.share") %>:</h3>
<button class="close-button" data-close aria-label="<%= t("decidim.shared.share_modal.close_window") %>" type="button">
<button class="close-button" data-close aria-label="Translation missing: en.decidim.shared.share_modal.close_window
" type="button">
<span aria-hidden="true">&times;</span>
</button>
</div>
Expand All @@ -14,15 +15,16 @@
via: twitter_handle
) %>
<a href="#" class="button" data-open="urlShare">
<%= icon "link-intact", role: "img", "aria-hidden": true %>
<%= icon "links-line", role: "img", "aria-hidden": true %>
<%= t("decidim.shared.share_modal.share_link") %>
</a>
</div>
</div>
<div class="reveal" id="urlShare" data-reveal>
<div class="reveal__header">
<h3 class="reveal__title"><%= t("decidim.shared.share_modal.share_link") %>:</h3>
<button class="close-button" data-close aria-label="<%= t("decidim.shared.share_modal.close_window") %>" type="button">
<button class="close-button" data-close aria-label="This contained Translation missing: en.decidim.shared.share_modal.close_window
" type="button">
<span aria-hidden="true">&times;</span>
</button>
</div>
Expand Down
1 change: 0 additions & 1 deletion app/cells/decidim/plans/plan_view/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
<div class="row">
<div class="columns medium-8">
<div class="section">
<%== cell("decidim/plans/plan_m", plan, full_badge: true).badge %>
<%= contents %>
<%= cell("decidim/plans/tags", plan, context: { extra_classes: ["tags--plan"] }) %>
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/cells/decidim/plans/plan_view_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class PlanViewCell < Decidim::ViewModel
include Decidim::ApplicationHelper # For presenter
include Decidim::LayoutHelper # For the icon helper
include Decidim::FormFactory
include Decidim::SocialShareButtonHelper
include Decidim::TooltipHelper
include Decidim::MetaTagsHelper
include Decidim::Plans::LinksHelper
Expand Down Expand Up @@ -188,7 +189,7 @@ def organization_share_image_url
scope_name: :homepage,
manifest_name: :hero
).try(:images_container)
container.attached_uploader(:background_image).url if container && container.background_image && container.background_image.attached?
container.attached_uploader(:background_image).path if container && container.background_image && container.background_image.attached?
end
end

Expand Down
1 change: 1 addition & 0 deletions lib/decidim/plans/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class Engine < ::Rails::Engine

initializer "decidim_plans.register_icons", after: "decidim_core.add_social_share_services" do
Decidim.icons.register(name: "focus-3-line", icon: "focus-3-line", category: "system", description: "", engine: :core)
Decidim.icons.register(name: "links-line", icon: "links-line", category: "system", description: "", engine: :core)
end
end
end
Expand Down
4 changes: 0 additions & 4 deletions spec/cells/decidim/plans/collapsible_authors_cell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

controller Decidim::Plans::PlansController

before do
expect(my_cell).to receive(:cell).with("decidim/collapsible_list", any_args)
end

it "renders collapsible list" do
subject
end
Expand Down
2 changes: 1 addition & 1 deletion spec/cells/decidim/plans/plan_notification_cell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

it "renders the show" do
expect(subject).to have_css(".callout__title")
expect(subject).to have_css("svg.icon--circle-check.icon[aria-label='circle-check']")
expect(subject).to have_css("svg[role=\"img\"][aria-hidden=\"true\"] use[href*=\"#ri-checkbox-circle-line\"]")
expect(subject).to have_content("This proposal has been accepted")
within ".callout__content" do
expect(subject).to have_content(translated(plan.title))
Expand Down

0 comments on commit 98fb304

Please sign in to comment.