Add completed info on finished budgets

This commit is contained in:
decabeza
2020-03-16 12:54:00 +01:00
committed by Javi Martín
parent 4ff8162a2e
commit 2f636eaf77
5 changed files with 39 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
.admin .budgets-table {
.budget-completed {
@include has-fa-icon(lock, solid);
padding-left: calc(1em + #{rem-calc(10)});
position: relative;
&::before {
color: $admin-border-color;
left: rem-calc(4);
position: absolute;
transform: translateY(50%);
}
span {
color: $admin-text;
display: block;
font-size: $tiny-font-size;
font-weight: bold;
line-height: rem-calc(12);
text-transform: uppercase;
}
}
}

View File

@@ -9,7 +9,7 @@
<% if @budgets.any? %>
<h3><%= page_entries_info @budgets %></h3>
<table>
<table class="budgets-table">
<thead>
<tr>
<th><%= t("admin.budgets.index.table_name") %></th>
@@ -20,8 +20,13 @@
<tbody>
<% @budgets.each do |budget| %>
<tr id="<%= dom_id(budget) %>" class="budget">
<td>
<%= budget.name %>
<td class="<%= "budget-completed" if budget.finished? %>">
<% if budget.finished? %>
<span>
<%= t("admin.budgets.index.table_completed") %>
</span>
<% end %>
<strong><%= budget.name %></strong>
</td>
<td class="small">
<%= t("budgets.phase.#{budget.phase}") %>

View File

@@ -75,6 +75,7 @@ en:
finished: Finished
help: "Participatory budgets allow citizens to propose and decide directly how to spend part of the budget, with monitoring and rigorous evaluation of proposals by the institution."
budget_investments: Manage projects
table_completed: Completed
table_name: Name
table_phase: Phase
edit_groups: Edit headings groups

View File

@@ -75,6 +75,7 @@ es:
finished: Terminados
help: "Los presupuestos participativos permiten que los ciudadanos propongan y decidan de manera directa cómo gastar parte del presupuesto, con un seguimiento y evaluación riguroso de las propuestas por parte de la institución."
budget_investments: Gestionar proyectos de gasto
table_completed: Completado
table_name: Nombre
table_phase: Fase
edit_groups: Editar grupos de partidas

View File

@@ -60,7 +60,11 @@ describe "Admin budgets", :admin do
expect(page).to have_content(accepting_budget.name)
expect(page).to have_content(selecting_budget.name)
expect(page).to have_content(balloting_budget.name)
expect(page).not_to have_content(finished_budget.name)
expect(page).to have_content(finished_budget.name)
within "#budget_#{finished_budget.id}" do
expect(page).to have_content("Completed")
end
click_link "Finished"
expect(page).not_to have_content(drafting_budget.name)