Use flex in a poll in the polls index
Note we aren't using flex-with-gap because currently (until we decide to use the `gap` property) this mixin sets a negative margin that would move the border of this element to the left.
This commit is contained in:
@@ -403,18 +403,10 @@ button,
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.align-middle {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-cell {
|
|
||||||
display: table-cell;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uppercase {
|
.uppercase {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,25 @@
|
|||||||
&.with-image {
|
&.with-image {
|
||||||
|
|
||||||
@include breakpoint(medium) {
|
@include breakpoint(medium) {
|
||||||
|
display: flex;
|
||||||
padding: 0 calc($line-height / 2) 0 0;
|
padding: 0 calc($line-height / 2) 0 0;
|
||||||
|
|
||||||
|
> * {
|
||||||
|
flex-basis: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poll-info {
|
||||||
|
flex-basis: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
> a {
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .poll-info,
|
||||||
|
> a {
|
||||||
|
margin-#{$global-left}: rem-calc(map-get($grid-column-gutter, medium));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
<div class="poll with-image">
|
<div class="poll with-image">
|
||||||
<%= render Polls::AccessStatusComponent.new(poll) %>
|
<%= render Polls::AccessStatusComponent.new(poll) %>
|
||||||
|
|
||||||
<div class="row" data-equalizer data-equalize-on="medium">
|
<div class="image-container">
|
||||||
<div class="small-12 medium-3 column">
|
|
||||||
<div class="image-container" data-equalizer-watch>
|
|
||||||
<% if poll.image.present? %>
|
<% if poll.image.present? %>
|
||||||
<%= image_tag poll.image.variant(:large), alt: poll.image.title.unicode_normalize %>
|
<%= image_tag poll.image.variant(:large), alt: poll.image.title.unicode_normalize %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-6 column" data-equalizer-watch>
|
<div class="poll-info">
|
||||||
<% if poll.questions.one? %>
|
<% if poll.questions.one? %>
|
||||||
<h4><%= link_to_poll poll.questions.first.title, poll %></h4>
|
<h4><%= link_to_poll poll.questions.first.title, poll %></h4>
|
||||||
<div class="dates"><%= dates %></div>
|
<div class="dates"><%= dates %></div>
|
||||||
@@ -26,14 +24,10 @@
|
|||||||
<%= render Polls::GeozonesComponent.new(poll) %>
|
<%= render Polls::GeozonesComponent.new(poll) %>
|
||||||
<%= render SDG::TagListComponent.new(poll, limit: 5, linkable: false) %>
|
<%= render SDG::TagListComponent.new(poll, limit: 5, linkable: false) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-12 medium-3 column table" data-equalizer-watch>
|
|
||||||
<div class="table-cell align-middle">
|
|
||||||
<% if poll.expired? %>
|
<% if poll.expired? %>
|
||||||
<%= link_to_poll t("polls.index.participate_button_expired"), poll, class: "button hollow expanded" %>
|
<%= link_to_poll t("polls.index.participate_button_expired"), poll, class: "button hollow expanded" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to_poll t("polls.index.participate_button"), poll, class: "button hollow expanded" %>
|
<%= link_to_poll t("polls.index.participate_button"), poll, class: "button hollow expanded" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user