Skip to content

Commit

Permalink
Fixing height
Browse files Browse the repository at this point in the history
  • Loading branch information
alecslupu committed Nov 15, 2023
1 parent d025f0f commit 6ec3fbd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def default_filter_params
end

def categories_filter
@categories_filter ||= Decidim::Category.where(id: linked_components.map(&:categories).flatten)
@categories_filter ||= Decidim::Category.where(id: linked_components.map(&:categories).flatten).map { |category| [translated_attribute(category.name), category.id] }
end

def selected_component_id
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/decidim/proposals_slider_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def build_proposals_api
id: proposal.id,

title: translated_attribute(proposal.title).truncate(30),
body: decidim_sanitize_editor(translated_attribute(proposal.body), strip_tags: true).truncate(150),
body: decidim_sanitize(translated_attribute(proposal.body), strip_tags: true).truncate(150),
url: proposal_path(proposal),
image: image_for(proposal),
state: proposal.state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default class Proposal extends GlideItem {
<div class="card card--proposal card--stack">
<a href="${this.url}">
<div class="proposal-glance card--header">
<img src="${this.image}" class="proposal-glance__img" alt="slider_img">
</div>
<img src="${this.image}" class="proposal-glance__img" alt="slider_img">
</div>
</a>
<div class="card--process__small text-center padding-1">
<span class="${this.color} card__text--status status_slider"> ${this.state.charAt(0).toUpperCase() + this.state.slice(1)} </span>
Expand All @@ -50,7 +50,7 @@ export default class Proposal extends GlideItem {
${this.body}
</div>
</div>
<div class="card__button align-bottom padding-top-1">
<div class="card__button align-bottom text-center padding-top-1">
<a href="${this.url}">
<span class="button small button--secondary">Visit</span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

.glide__slide {
.card--process__small {
height: 340px;
height: 250px;

.card__text--paragraph {
height: 200px;
Expand Down
7 changes: 4 additions & 3 deletions app/views/decidim/shared/homepage_proposals/_filters.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
</div>
<p><%= I18n.t("decidim.homepage_proposals.proposal_at_a_glance.filters.about") %></p>
<div>
<%= form.categories_select :category_id,
<%= form.collection_select :category_id,
categories_filter,
disable_parents: false,
:last,
:first,
root: false,
label: false,
selected: filter.category_id,
include_blank: t("decidim.homepage_proposals.proposal_at_a_glance.filters.default_categories") %>
</div>
<p><%= I18n.t("decidim.homepage_proposals.proposal_at_a_glance.filters.in") %></p>
Expand Down

0 comments on commit 6ec3fbd

Please sign in to comment.