Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen committed Sep 14, 2023
2 parents e3c7375 + a4e289d commit 0aef1d8
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 66 deletions.
2 changes: 1 addition & 1 deletion app/cells/decidim/favorites/favorite_button/icon_fill.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<svg width="50" height="44" version="1.1" viewBox="0 0 13.229 11.642" xmlns="http://www.w3.org/2000/svg"><path d="m3.3073 0c-0.90951 0-1.7198 0.38034-2.3316 0.97565-0.59531 0.59531-0.97565 1.4056-0.97565 2.3316 0 0.90951 0.38034 1.7198 0.97565 2.3316l5.6389 5.6389 5.6389-5.6389c0.59531-0.59531 0.97565-1.4056 0.97565-2.3316 0-0.90951-0.38034-1.7198-0.97565-2.3316-0.59531-0.59531-1.4056-0.97565-2.3316-0.97565-0.90951 0-1.7198 0.38034-2.3316 0.97565-0.59531 0.59531-0.97565 1.4056-0.97565 2.3316 0-0.90951-0.38034-1.7198-0.97565-2.3316-0.59531-0.59531-1.4056-0.97565-2.3316-0.97565z" stroke-width="1.6536"/></svg>
<%= icon("heart", role: "img", "aria-hidden": true) %>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<svg width="50" height="44" version="1.1" viewBox="0 0 13.229 11.642" xmlns="http://www.w3.org/2000/svg"><path d="m3.5387 0c-0.97453 0-1.8456 0.41218-2.4902 1.0393l-0.00308 3e-3h-0.00308c-0.63222 0.63222-1.0423 1.5086-1.0423 2.4962 0 0.97452 0.41218 1.8456 1.0393 2.4902l0.00308 3e-3 5.5722 5.5722 5.5722-5.5692c0.63222-0.63221 1.0424-1.5086 1.0424-2.4962 0-0.97452-0.41218-1.8456-1.0393-2.4902l-0.0031-3e-3v-3e-3c-0.63213-0.63223-1.5085-1.0424-2.4961-1.0424-0.97453 0-1.8456 0.41218-2.4902 1.0393l-0.00308 3e-3h-0.00308c-0.17568 0.17576-0.27419 0.27946-0.35198 0.3948-0.077788 0.11535-0.13485 0.24233-0.22762 0.46464-0.20671-0.49598-0.22874-0.49576-0.57674-0.85344l-0.00308-3e-3v-3e-3c-0.63206-0.63222-1.5085-1.0424-2.4961-1.0424zm0 0.92519c0.73494 0 1.3662 0.29686 1.8414 0.772 0.79509 0.84233 0.82753 0.87766 1.2345 1.8413 0.46851-0.95978 0.49641-0.99171 1.2346-1.8413 0.49282-0.47736 1.1265-0.772 1.8414-0.772 0.73494 0 1.3662 0.29686 1.8414 0.772 0.47736 0.49282 0.772 1.1265 0.772 1.8414 0 0.73494-0.29686 1.3662-0.772 1.8414l-4.9174 4.9174-4.9143-4.9113-0.0030761-0.0060135c-0.47728-0.49282-0.77192-1.1265-0.77192-1.8414 0-0.73494 0.29686-1.3662 0.772-1.8414 0.49282-0.47736 1.1265-0.772 1.8414-0.772z" stroke-width="5.8129"/></svg>
<%= icon("heart-line", role: "img", "aria-hidden": true) %>
39 changes: 14 additions & 25 deletions app/cells/decidim/favorites/favorite_button/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,21 @@
<% if current_user %>
<% if current_user_favoriting? %>
<%= button(t("decidim.favorites.favorite_button.remove_from_favorites"), decidim_favorites.favorite_path(model.to_sgid.to_s, button_params), :delete) do %>
<span class="icon-wrap">
<span class="heart-icon" aria-hidden="true">
<%= render :icon_fill %>
</span>
<span class="show-for-sr"><%= t("decidim.favorites.favorite_button.remove_from_favorites") %></span>
<span class="indicator-wrap" aria-hidden="true">-</span>
</span>
<% if display_text? %>
<span class="button-text link-text"><%= t("decidim.favorites.favorite_button.remove_from_favorites") %></span>
<span class="link-text"><%= t("decidim.favorites.favorite_button.remove_from_favorites") %></span>
<% else %>
<span class="show-for-sr"><%= t("decidim.favorites.favorite_button.remove_from_favorites") %></span>
<% end %>
<%= render :icon_fill %>
<% end %>
<% else %>
<%= button(t("decidim.favorites.favorite_button.add_to_favorites"), decidim_favorites.favorites_path(button_params), :post) do %>
<span class="icon-wrap">
<span class="heart-icon" aria-hidden="true">
<%= render :icon_hollow %>
</span>
<span class="show-for-sr"><%= t("decidim.favorites.favorite_button.add_to_favorites") %></span>
<span class="indicator-wrap" aria-hidden="true">+</span>
</span>
<% if display_text? %>
<span class="button-text link-text"><%= t("decidim.favorites.favorite_button.add_to_favorites") %></span>
<span class="link-text"><%= t("decidim.favorites.favorite_button.add_to_favorites") %></span>
<% else %>
<span class="show-for-sr"><%= t("decidim.favorites.favorite_button.add_to_favorites") %></span>
<% end %>
<%= render :icon_hollow %>
<% end %>
<% end %>
<% else %>
Expand All @@ -37,17 +29,14 @@
data: tooltip_data(true),
:'aria-haspopup' => true,
title: t("decidim.favorites.favorite_button.sign_in_before_favorite"),
remote: true) do %>
<span class="icon-wrap">
<span class="heart-icon" aria-hidden="true">
<%= render :icon_hollow %>
</span>
<span class="show-for-sr"><%= t("decidim.favorites.favorite_button.add_to_favorites") %></span>
<span class="indicator-wrap" aria-hidden="true">+</span>
</span>
remote: true) do
%>
<% if display_text? %>
<span class="button-text link-text"><%= t("decidim.favorites.favorite_button.add_to_favorites") %></span>
<span class="link-text"><%= t("decidim.favorites.favorite_button.add_to_favorites") %></span>
<% else %>
<span class="show-for-sr"><%= t("decidim.favorites.favorite_button.add_to_favorites") %></span>
<% end %>
<%= render :icon_hollow %>
<% end %>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/cells/decidim/favorites/favorite_button_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def button_classes
extra_classes = ""
extra_classes += " active" if current_user_favoriting?

button_class = options[:button_class] || "button clear button--icon"
button_class = options[:button_class] || "link action-link"

"#{button_class} favorite-button #{extra_classes}"
end
Expand Down
2 changes: 1 addition & 1 deletion app/cells/decidim/favorites/favoriting_count/show.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="<%= dom_id(model, :favoriting_count) %>" class="favorites-icon-wrapper">
<%= content_tag(:span, title: t("decidim.favorites.favoriting_count.times_added_to_favorites", count: favoriting_count), data: tooltip_data) do %>
<%= icon("heart", class: "icon--before", aria_hidden: true) %>
<%= icon("heart-line", class: "icon--before", aria_hidden: true) %>
<span aria-hidden="true"><%= favoriting_count %></span>
<span class="show-for-sr"><%= t("decidim.favorites.favoriting_count.times_added_to_favorites", count: favoriting_count) %></span>
<% end %>
Expand Down
16 changes: 7 additions & 9 deletions app/views/decidim/favorites/favorites/_side_panel.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<div class="side-panel">
<div class="sub-navigation">
<button class="sub-navigation-opener hide-for-mediumlarge" data-toggle="sub_navigation">
<%= t(".show_navigation") %>
</button>
<ul id="sub_navigation" class="sub-navigation-content vertical menu" data-toggler=".active">
<div class="sub-navigation">
<nav role="navigation" aria-label="<%= t(".nav_label") %>">
<ul class="vertical striped large menu" role="menubar">
<% types.each do |key, type| %>
<li class="page-item <%= @selected_type == key ? "is-active" : nil %>">
<%= link_to type[:name], favorite_path(type: key) %>
<li role="presentation" class="page-item <%= @selected_type == key ? "is-active" : nil %>">
<%= link_to type[:name], favorite_path(type: key), role: "menuitem" %>
</li>
<% end %>
</ul>
</div>
</nav>
</div>

2 changes: 0 additions & 2 deletions app/views/decidim/favorites/favorites/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ edit_link(
)
%>

<%= render partial: "layouts/decidim/breadcrumbs" rescue nil %>

<div class="wrapper">
<div class="row column">
<div class="main-container tabbed-container">
Expand Down
39 changes: 16 additions & 23 deletions app/views/decidim/favorites/favorites/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,29 @@ edit_link(
)
%>

<%= render partial: "layouts/decidim/breadcrumbs" rescue nil %>

<div class="wrapper">
<div class="container content-section">
<div class="row column">
<div class="main-container tabbed-container">
<div class="row collapse main-container--side-panel">
<div class="columns medium-12 mediumlarge-4 large-3">
<div class="page-title">
<h1><%= t ".title" %></h1>
</div>

<div class="row medium-unstack">
<div class="columns medium-4 large-3">
<%= render "side_panel" %>
</div>

<div class="columns medium-12 mediumlarge-8 large-9">
<div class="main-container__content">
<div class="tabs-content vertical">
<div class="static__content">
<h1 class="heading1 page-title">
<%= t ".title" %>
</h1>
<%= t(".description_html") %>
<div class="columns medium-8 large-9">
<%= t(".description_html") %>

<h2><%= @type[:name] %></h2>
<h2><%= @type[:name] %></h2>

<div class="row">
<div id="ideas" class="columns">
<div class="row small-up-1 medium-up-2 card-grid">
<% @resources.each do |resource| %>
<%= card_for(resource) %>
<% end %>
</div>
</div>
</div>
<div class="row">
<div id="ideas" class="columns">
<div class="row small-up-1 medium-up-2 card-grid">
<% @resources.each do |resource| %>
<%= card_for(resource) %>
<% end %>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ en:
title: Favourites
description_html: <p>Here you can see all favourites you have added in different phases of the process. From the side navigation you can choose which favourites you want to see.</p>
side_panel:
show_navigation: Show navigation
nav_label: Sub navigation
2 changes: 1 addition & 1 deletion config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ fi:
title: Suosikit
description_html: <p>Täällä näet kaikki omat suosikit, joita olet lisännyt prosessin eri vaiheissa. Sivupalkista voit valita, mitä suosikkeja haluat selata.</p>
side_panel:
show_navigation: Näytä navigaatio
nav_label: Alanavigaatio
2 changes: 1 addition & 1 deletion config/locales/sv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ sv:
title: Favoriter
description_html: <p>Här kan du se alla favoriter du har lagt till i olika faser av processen. Från sidnavigeringen kan du välja vilka favoriter du vill se.</p>
side_panel:
show_navigation: Visa navigering
nav_label: Undernavigering

0 comments on commit 0aef1d8

Please sign in to comment.