Applies new card design for polls in proposals dashboard.
Fixes warnings during tests.
Adds tests for new card design for polls in proposals dashboard.
This commit is contained in:
Juan Salvador Pérez García
2018-07-23 10:31:50 +02:00
parent f632fa8b6e
commit 3b37b4b09d
7 changed files with 25 additions and 16 deletions

View File

@@ -1,14 +1,12 @@
.poll-card { .poll-card {
.card { .card {
background-color: #e7f3fd; background-color: #e7f3fd;
} }
.clipboard-btn { .clipboard-btn {
border-radius: 12pt; border-radius: rem-calc(12);
padding: 0; padding: rem-calc(5) rem-calc(10) rem-calc(10) rem-calc(10);
width: 24pt; height: rem-calc(24);
height: 24pt;
padding-top: 5pt;
padding-left: 1pt;
} }
} }

View File

@@ -45,7 +45,7 @@ module AdminHelper
end end
def menu_proposals_dashboard? def menu_proposals_dashboard?
["proposal_dashboard_actions", "administrator_tasks"].include?(controller_name) ["actions", "administrator_tasks"].include?(controller_name)
end end
def official_level_options def official_level_options

View File

@@ -57,7 +57,7 @@
<% if feature?(:budgets) %> <% if feature?(:budgets) %>
<li class="section-title <%= "is-active" if controller_name == "budgets" || <li class="section-title <%= "is-active" if controller_name == "budgets" ||
"budget_investment_statuses" %>"> controller_name == "budget_investment_statuses" %>">
<%= link_to admin_budgets_path do %> <%= link_to admin_budgets_path do %>
<span class="icon-budget"></span> <span class="icon-budget"></span>
<strong><%= t("admin.menu.budgets") %></strong> <strong><%= t("admin.menu.budgets") %></strong>
@@ -240,7 +240,7 @@
<strong><%= t("admin.menu.proposals_dashboard") %></strong> <strong><%= t("admin.menu.proposals_dashboard") %></strong>
</a> </a>
<ul <%= "class=is-active" if menu_proposals_dashboard? %>> <ul <%= "class=is-active" if menu_proposals_dashboard? %>>
<li <%= "class=is-active" if controller_name == "proposal_dashboard_actions" %>> <li <%= "class=is-active" if controller_name == "actions" %>>
<%= link_to ProposalDashboardAction.model_name.human(count: 2), admin_proposal_dashboard_actions_path %> <%= link_to ProposalDashboardAction.model_name.human(count: 2), admin_proposal_dashboard_actions_path %>
</li> </li>

View File

@@ -1,15 +1,14 @@
<div class="column poll-card" id="<%= dom_id(poll) %>"> <div class="column poll-card" id="<%= dom_id(poll) %>">
<div class="card"> <div class="card">
<div class="card-section"> <div class="card-section">
<p class="text-right"> <p class="text-center">
<a href='#' class="button round hollow clipboard-btn" data-clipboard-text="<%= poll_url(poll) %>"> <a href='#' class="button round hollow clipboard-btn" data-clipboard-text="<%= poll_url(poll) %>">
<i class="fi-clipboard-notes"></i> <i class="fi-clipboard-notes"></i> <%= t("dashboard.polls.poll.copy_link") %>
</a> </a>
</p> </p>
<h4 class="text-center"><%= poll.title %></h4> <h4 class="text-center"><%= link_to poll.title, poll %></h4>
<p class="text-center"> <p class="text-center">
<%= t("dashboard.polls.poll.published_on") %> <%= l(poll.starts_at.to_date) %> - <%= l(poll.ends_at.to_date) %>
<%= l(poll.starts_at.to_date) %>
</p> </p>
</div> </div>

View File

@@ -572,7 +572,7 @@ en:
links: Links links: Links
additiontal_information: Additional information additiontal_information: Additional information
poll: poll:
published_on: Published on copy_link: Copy link
responses: responses:
one: "%{count} response" one: "%{count} response"
other: "%{count} responses" other: "%{count} responses"

View File

@@ -572,7 +572,7 @@ es:
links: Enlaces links: Enlaces
additiontal_information: Información adicional additiontal_information: Información adicional
poll: poll:
published_on: Publicada copy_link: Copiar enlace
responses: responses:
one: "%{count} respuesta" one: "%{count} respuesta"
other: "%{count} respuestas" other: "%{count} respuestas"

View File

@@ -120,4 +120,16 @@ feature 'Polls' do
expect(page.current_path).to eq(results_poll_path(poll)) expect(page.current_path).to eq(results_poll_path(poll))
end end
end end
scenario 'Poll card' do
poll = create(:poll, :expired, related: proposal)
visit proposal_dashboard_polls_path(proposal)
within "div#poll_#{poll.id}" do
expect(page).to have_content(I18n.l(poll.starts_at.to_date))
expect(page).to have_content(I18n.l(poll.ends_at.to_date))
expect(page).to have_link(poll.title)
end
end
end end