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 {
.card {
background-color: #e7f3fd;
}
.clipboard-btn {
border-radius: 12pt;
padding: 0;
width: 24pt;
height: 24pt;
padding-top: 5pt;
padding-left: 1pt;
border-radius: rem-calc(12);
padding: rem-calc(5) rem-calc(10) rem-calc(10) rem-calc(10);
height: rem-calc(24);
}
}

View File

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

View File

@@ -57,7 +57,7 @@
<% if feature?(: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 %>
<span class="icon-budget"></span>
<strong><%= t("admin.menu.budgets") %></strong>
@@ -240,7 +240,7 @@
<strong><%= t("admin.menu.proposals_dashboard") %></strong>
</a>
<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 %>
</li>

View File

@@ -1,15 +1,14 @@
<div class="column poll-card" id="<%= dom_id(poll) %>">
<div class="card">
<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) %>">
<i class="fi-clipboard-notes"></i>
<i class="fi-clipboard-notes"></i> <%= t("dashboard.polls.poll.copy_link") %>
</a>
</p>
<h4 class="text-center"><%= poll.title %></h4>
<h4 class="text-center"><%= link_to poll.title, poll %></h4>
<p class="text-center">
<%= t("dashboard.polls.poll.published_on") %>
<%= l(poll.starts_at.to_date) %>
<%= l(poll.starts_at.to_date) %> - <%= l(poll.ends_at.to_date) %>
</p>
</div>

View File

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

View File

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

View File

@@ -120,4 +120,16 @@ feature 'Polls' do
expect(page.current_path).to eq(results_poll_path(poll))
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