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;
|
||||
}
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.table {
|
||||
display: table;
|
||||
}
|
||||
|
||||
.table-cell {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.uppercase {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,25 @@
|
||||
&.with-image {
|
||||
|
||||
@include breakpoint(medium) {
|
||||
display: flex;
|
||||
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">
|
||||
<%= render Polls::AccessStatusComponent.new(poll) %>
|
||||
|
||||
<div class="row" data-equalizer data-equalize-on="medium">
|
||||
<div class="small-12 medium-3 column">
|
||||
<div class="image-container" data-equalizer-watch>
|
||||
<div class="image-container">
|
||||
<% if poll.image.present? %>
|
||||
<%= image_tag poll.image.variant(:large), alt: poll.image.title.unicode_normalize %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column" data-equalizer-watch>
|
||||
|
||||
<div class="poll-info">
|
||||
<% if poll.questions.one? %>
|
||||
<h4><%= link_to_poll poll.questions.first.title, poll %></h4>
|
||||
<div class="dates"><%= dates %></div>
|
||||
@@ -26,14 +24,10 @@
|
||||
<%= render Polls::GeozonesComponent.new(poll) %>
|
||||
<%= render SDG::TagListComponent.new(poll, limit: 5, linkable: false) %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column table" data-equalizer-watch>
|
||||
<div class="table-cell align-middle">
|
||||
|
||||
<% if poll.expired? %>
|
||||
<%= link_to_poll t("polls.index.participate_button_expired"), poll, class: "button hollow expanded" %>
|
||||
<% else %>
|
||||
<%= link_to_poll t("polls.index.participate_button"), poll, class: "button hollow expanded" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user