Skip to content

Commit

Permalink
Update views
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Dec 5, 2024
1 parent 208c1c5 commit ae449a5
Show file tree
Hide file tree
Showing 40 changed files with 88 additions and 139 deletions.
2 changes: 1 addition & 1 deletion app/cells/decidim/ideas/idea_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def show
private

def card_size
"decidim/ideas/idea_m"
"decidim/ideas/idea_g"
end

def resource_path
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= card_wrapper do %>
<%= render :top if render_top? %>
<%= render :image %>

<div class="card__content">
Expand All @@ -14,5 +13,4 @@

<%= render :tags %>
<%= render :data %>
<%= render :status %>
<% end %>
File renamed without changes.
1 change: 1 addition & 0 deletions app/cells/decidim/ideas/idea_g/state.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span class="label <%= state_class %>"><%= badge_name %></span>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Decidim
module Ideas
# This cell renders a idea with its M-size card.
class IdeaMCell < Decidim::CardMCell
class IdeaGCell < Decidim::CardGCell
include IdeaCellsHelper

property :area_scope, :answered?
Expand All @@ -25,8 +25,7 @@ def resource_utm_params
private

def card_wrapper
cls = card_classes.is_a?(Array) ? card_classes.join(" ") : card_classes
wrapper_options = { class: "card #{cls}", aria: { label: t(".card_label", title: title) } }
wrapper_options = { class: "card", aria: { label: t(".card_label", title:) } }
if has_link_to_resource?
link_to resource_path, **wrapper_options do
yield
Expand Down
3 changes: 0 additions & 3 deletions app/cells/decidim/ideas/idea_l/inner.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@
<div class="card__main">
<%= render :data %>
</div>
<div class="card__aside">
<%= render :status %>
</div>
</div>
<% end %>
2 changes: 1 addition & 1 deletion app/cells/decidim/ideas/idea_l_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Decidim
module Ideas
# This cell renders an idea with its L-size card.
class IdeaLCell < Decidim::Ideas::IdeaMCell
class IdeaLCell < Decidim::Ideas::IdeaGCell
def card_classes
classes = super
classes = classes.split unless classes.is_a?(Array)
Expand Down
5 changes: 0 additions & 5 deletions app/cells/decidim/ideas/idea_m/state.erb

This file was deleted.

2 changes: 1 addition & 1 deletion app/cells/decidim/ideas/ideas_picker/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
</div>
</div>

<%= javascript_pack_tag "decidim_ideas_idea_picker" %>
<%= append_javascript_pack_tag "decidim_ideas_idea_picker" %>
2 changes: 1 addition & 1 deletion app/cells/decidim/ideas/ideas_picker_inline/filters.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<%= form.search_field :search_text, label: false, class: "input-group-field", placeholder: t(".filters.search"), title: t(".filters.search") %>
<div class="input-group-button">
<button class="button button--muted" aria-label="<%= t(".filters.search") %>">
<%= icon "magnifying-glass", aria_label: t(".filters.search"), role: "img" %>
<%= icon "search-line", aria_label: t(".filters.search"), role: "img" %>
</button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="filters-controls hide-for-mediumlarge">
<button data-open="filter-box" class="filters-controls__trigger">
<%= t ".filters.filter" %>
<%= icon "caret-bottom", class: "icon--small float-right", aria_label: t(".filters.unfold"), role: "img" %>
<%= icon "arrow-down-s-line", class: "icon--small float-right", aria_label: t(".filters.unfold"), role: "img" %>
</button>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/cells/decidim/ideas/ideas_picker_inline/ideas.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="idea-picker-item-state">
<div class="ideas-picker-item-choose"><%= t(".choose_idea") %></div>
<div class="ideas-picker-item-chosen">
<%= icon "check", aria_hidden: true %>
<%= icon "check-line", aria_hidden: true %>
<%= t(".chosen_idea") %>
<div class="idea-picker-item-remove">
<%= t(".remove_idea") %>
Expand Down
1 change: 0 additions & 1 deletion app/controllers/decidim/ideas/ideas_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module Decidim
module Ideas
class IdeasController < Decidim::Ideas::ApplicationController
helper Decidim::WidgetUrlsHelper
helper IdeaWizardHelper
helper Decidim::Ideas::IdeasFormHelper

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def settings_attribute_input(form, attribute, name, i18n_scope, options = {})
""
else
@ideas_settings_js_included = true
javascript_pack_tag("decidim_ideas_admin_component_settings")
append_javascript_pack_tag("decidim_ideas_admin_component_settings")
end

label + coordinates_element + settings_js
Expand Down
2 changes: 1 addition & 1 deletion app/views/decidim/ideas/admin/ideas/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@
</div>
</div>

<%= javascript_pack_tag "decidim_ideas_admin_ideas_form" %>
<%= append_javascript_pack_tag "decidim_ideas_admin_ideas_form" %>
4 changes: 2 additions & 2 deletions app/views/decidim/ideas/admin/ideas/_idea-tr.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@

<td class="table-list__actions">
<% if allowed_to? :edit, :idea, idea: idea %>
<%= icon_link_to "pencil", edit_idea_path(idea), t("actions.edit_idea", scope: "decidim.ideas"), class: "action-icon--edit-idea" %>
<%= icon_link_to "pencil-line", edit_idea_path(idea), t("actions.edit_idea", scope: "decidim.ideas"), class: "action-icon--edit-idea" %>
<% end %>

<%= icon_with_link_to_idea(idea) %>

<%= icon_link_to "eye", resource_locator(idea).path, t("actions.preview", scope: "decidim.ideas.admin"), class: "action-icon--preview", target: :blank %>
<%= icon_link_to "eye-line", resource_locator(idea).path, t("actions.preview", scope: "decidim.ideas.admin"), class: "action-icon--preview", target: :blank %>
</td>
</tr>
2 changes: 1 addition & 1 deletion app/views/decidim/ideas/admin/ideas/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
</div>
</div>

<%= javascript_pack_tag "decidim_ideas_admin_ideas" %>
<%= append_javascript_pack_tag "decidim_ideas_admin_ideas" %>
6 changes: 3 additions & 3 deletions app/views/decidim/ideas/admin/ideas/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%= decidim_html_escape(present(idea).title).html_safe %>

<% if allowed_to? :edit, :idea, idea: idea %>
<%= icon_link_to "pencil", edit_idea_path(idea), t("actions.edit_idea", scope: "decidim.ideas"), class: "action-icon--edit-idea" %>
<%= icon_link_to "pencil-line", edit_idea_path(idea), t("actions.edit_idea", scope: "decidim.ideas"), class: "action-icon--edit-idea" %>
<% end %>
</h2>
</div>
Expand All @@ -27,12 +27,12 @@
target: :blank
) %>
<% if presented_author.can_be_contacted? && presented_author.nickname != present(current_user).nickname %>
<%= icon_link_to "envelope-closed", current_or_new_conversation_path_with(presented_author), t("decidim.contact"), class:"action-icon--new" %>
<%= icon_link_to "mail-line", current_or_new_conversation_path_with(presented_author), t("decidim.contact"), class:"action-icon--new" %>
<% end %>

<% user = presented_author.__getobj__ %>
<% if user.respond_to?(:id) && allowed_to?(:show_email, :user, user: user) %>
<%= icon_link_to "envelope-open", decidim_admin.show_email_officialization_path(user_id: user.id), t(".show_email"), class: "action-icon action-icon--show-email", data: { full_name: user.name, toggle: "show-email-modal" } %>
<%= icon_link_to "mail-open-line", decidim_admin.show_email_officialization_path(user_id: user.id), t(".show_email"), class: "action-icon action-icon--show-email", data: { full_name: user.name, toggle: "show-email-modal" } %>
<% end %>
</li>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/decidim/ideas/ideas/_filters.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div class="filters__actions">
<button type="submit" class="button button--icon" aria-label="<%= t(".search") %>" aria-controls="ideas-count ideas" data-close>
<%= t(".search") %>
<%= icon("magnifying-glass", role: "img", "aria-hidden": true) %>
<%= icon("search-line", role: "img", "aria-hidden": true) %>
</button>
<button type="reset" class="button clear text-lg"><%= t ".reset" %></button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/decidim/ideas/ideas/_filters_small_view.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="filters-controls hide-for-mediumlarge">
<button data-open="filter-box" class="filters-controls__trigger">
<%= t ".filter" %>
<%= icon "caret-bottom", class: "icon--small float-right", aria_label: t(".unfold"), role: "img" %>
<%= icon "arrow-down-s-line", class: "icon--small float-right", aria_label: t(".unfold"), role: "img" %>
</button>
</div>

Expand Down
8 changes: 4 additions & 4 deletions app/views/decidim/ideas/ideas/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<%= form.check_box :terms_agreed, required: true %>
<div class="field-info field-info-with-icon">
<%= link_to info_path("terms"), class: "info-modal-link" do %>
<%= icon "information", aria_hidden: true %>
<%= icon "information-line", aria_hidden: true %>
<%= t(".show_terms_info_text") %>
<% end %>
</div>
Expand Down Expand Up @@ -86,7 +86,7 @@
<div class="columns large-6">
<div class="field-info field-info-with-icon">
<%= link_to info_path("areas"), class: "info-modal-link" do %>
<%= icon "information", aria_hidden: true %>
<%= icon "information-line", aria_hidden: true %>
<%= t(".show_areas_info_text") %>
<% end %>
</div>
Expand Down Expand Up @@ -138,7 +138,7 @@
<div class="columns large-6">
<div class="field-info field-info-with-icon">
<%= link_to info_path("categories"), class: "info-modal-link" do %>
<%= icon "information", aria_hidden: true %>
<%= icon "information-line", aria_hidden: true %>
<%= t(".show_categories_info_text") %>
<% end %>
</div>
Expand Down Expand Up @@ -225,7 +225,7 @@
</div>
<% end %>

<%= javascript_pack_tag "decidim_ideas_idea_form" %>
<%= append_javascript_pack_tag "decidim_ideas_idea_form" %>

<%
js_options = {
Expand Down
54 changes: 0 additions & 54 deletions app/views/decidim/ideas/ideas/_idea_actions.html.erb

This file was deleted.

42 changes: 42 additions & 0 deletions app/views/decidim/ideas/ideas/_idea_aside.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<% if show_actions %>
<section class="layout-aside__section actions__secondary">
<%= cell("decidim/favorites/favorite_button", idea, button_class: "link text-secondary", disable_tooltip: true) %>
</section>
<% end %>

<% if component_settings.geocoding_enabled? && idea.address.present? && idea.latitude.present? && idea.longitude.present? %>
<section class="layout-aside__section actions__secondary">
<a href="#idea_map" class="text-secondary">
<span class="link-text"><%= t ".show_on_map" %></span>
<%= icon "map-pin-line", role: "img", "aria-hidden": true %>
</a>
</section>
<% end %>

<% if show_actions %>
<% if idea.commentable? %>
<section class="layout-aside__section actions__secondary">
<%= link_to "#comments", class: "text-secondary" do %>
<span class="link-text"><%= t ".show_comments" %></span>
<%= icon "question-answer-line", role: "img", "aria-hidden": true %>
<% end %>
</section>
<% end %>

<section class="layout-aside__section actions__secondary">
<%= cell "decidim/share_button", nil %>
</section>

<section class="layout-aside__section actions__secondary">
<%= cell "decidim/report_button", idea, only_button: true%>
</section>
<% end %>

<% if false %>
<section class="layout-aside__section actions__secondary">
<button type="button" class="link text-secondary">
<%= icon "print", role: "img", "aria-hidden": true %>
<span class="link-text"><%= t ".print" %></span>
</button>
</section>
<% end %>
2 changes: 1 addition & 1 deletion app/views/decidim/ideas/ideas/_idea_full.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="columns small-12 medium-4">
<div class="resource__aside">
<div class="resource__actions">
<%= render partial: "idea_actions", locals: { idea: idea, show_actions: show_actions } %>
<%= render partial: "idea_aside", locals: { idea: idea, show_actions: show_actions } %>
</div>

<% if show_actions && allowed_to?(:withdraw, :idea, idea: idea) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/decidim/ideas/ideas/_idea_similar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<%= resource_reference(idea, class: "tech-info--text-left") %>
</div>

<%== cell("decidim/ideas/idea_m", idea).badge %>
<%== cell("decidim/ideas/idea_g", idea).badge %>

<p><%= truncate(present(idea).body(strip_tags: true), length: 100) %></p>
<%= cell "decidim/tags", idea, context: { extra_classes: ["tags--idea"] } %>
Expand Down
28 changes: 0 additions & 28 deletions app/views/decidim/ideas/ideas/_share_modal.html.erb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/decidim/ideas/ideas/_wizard_aside.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="m-bottom">
<% unless @step == :step_2 %>
<%= link_to idea_wizard_aside_link_to_back(@step) do %>
<%= icon "chevron-left", class: "icon--small", role: "img" %>
<%= icon "arrow-left-s-line", class: "icon--small", role: "img" %>
<%= wizard_aside_back_text %>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/decidim/ideas/ideas/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="row">
<div class="columns large-12">
<%= link_to ideas_path do %>
<%= icon "chevron-left", class: "icon--small", role: "img" %>
<%= icon "arrow-left-s-line", class: "icon--small", role: "img" %>
<%= t(".back") %>
<% end %>
</div>
Expand Down
Loading

0 comments on commit ae449a5

Please sign in to comment.