diff --git a/app/assets/stylesheets/dashboard/poll.scss b/app/assets/stylesheets/dashboard/poll.scss index 9235a79e1..754194621 100644 --- a/app/assets/stylesheets/dashboard/poll.scss +++ b/app/assets/stylesheets/dashboard/poll.scss @@ -1,7 +1,8 @@ -.dashboard-poll .poll-card { +.dashboard-poll { background: #e7f3fd; border-radius: rem-calc(4); - margin-bottom: $line-height; + display: flex; + flex-direction: column; min-height: $line-height * 9; padding: $line-height; position: relative; diff --git a/app/assets/stylesheets/dashboard/polls.scss b/app/assets/stylesheets/dashboard/polls.scss new file mode 100644 index 000000000..2256e7d84 --- /dev/null +++ b/app/assets/stylesheets/dashboard/polls.scss @@ -0,0 +1,7 @@ +.dashboard-polls { + display: grid; + gap: $line-height; + grid-auto-rows: 1fr; + grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); + margin-top: $line-height; +} diff --git a/app/components/dashboard/poll_component.html.erb b/app/components/dashboard/poll_component.html.erb index 55a28d88b..0dadf4f54 100644 --- a/app/components/dashboard/poll_component.html.erb +++ b/app/components/dashboard/poll_component.html.erb @@ -1,36 +1,34 @@ -
-
-

<%= link_to poll.title, proposal_poll_path(proposal, poll) %>

- - <%= l(poll.starts_at.to_date) %> - <%= l(poll.ends_at.to_date) %> - +
+

<%= link_to poll.title, proposal_poll_path(proposal, poll) %>

+ + <%= l(poll.starts_at.to_date) %> - <%= l(poll.ends_at.to_date) %> + -

- <%= t("dashboard.polls.poll.responses", count: poll.answer_count) %> -

+

+ <%= t("dashboard.polls.poll.responses", count: poll.answer_count) %> +

-
- <% if poll.starts_at.to_date >= Date.current %> - <%= link_to t("dashboard.polls.poll.edit_poll"), - edit_proposal_dashboard_poll_path(proposal, poll), class: "button hollow" %> - <% else %> - <%= link_to t("dashboard.polls.poll.view_results"), - results_proposal_poll_path(proposal, poll), - class: "button" %> - <% end %> -
- - <%= form_for poll, remote: true, - data: { type: :json }, - url: proposal_dashboard_poll_path(proposal, poll) do |f| %> - <%= f.check_box :results_enabled, class: "js-submit-on-change" %> +
+ <% if poll.starts_at.to_date >= Date.current %> + <%= link_to t("dashboard.polls.poll.edit_poll"), + edit_proposal_dashboard_poll_path(proposal, poll), class: "button hollow" %> + <% else %> + <%= link_to t("dashboard.polls.poll.view_results"), + results_proposal_poll_path(proposal, poll), + class: "button" %> <% end %> -

<%= t("dashboard.polls.poll.show_results_help") %>

- - <%= button_to t("dashboard.polls.poll.delete"), - proposal_dashboard_poll_path(proposal, poll), - method: :delete, - "data-confirm": t("dashboard.polls.poll.alert_notice"), - class: "delete" %>
+ + <%= form_for poll, remote: true, + data: { type: :json }, + url: proposal_dashboard_poll_path(proposal, poll) do |f| %> + <%= f.check_box :results_enabled, class: "js-submit-on-change" %> + <% end %> +

<%= t("dashboard.polls.poll.show_results_help") %>

+ + <%= button_to t("dashboard.polls.poll.delete"), + proposal_dashboard_poll_path(proposal, poll), + method: :delete, + "data-confirm": t("dashboard.polls.poll.alert_notice"), + class: "delete" %>
diff --git a/app/components/dashboard/polls_component.html.erb b/app/components/dashboard/polls_component.html.erb index 68cb5b18a..9c79103e8 100644 --- a/app/components/dashboard/polls_component.html.erb +++ b/app/components/dashboard/polls_component.html.erb @@ -1,4 +1,4 @@ -
+
<% polls.each do |poll| %> <%= render Dashboard::PollComponent.new(poll) %> <% end %>