Adds "Admin ballots" button in admin budgets index

This commit is contained in:
María Checa
2018-06-07 18:31:57 +02:00
committed by Javi Martín
parent 7dd314c699
commit f6739dc7e5
4 changed files with 20 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
<th><%= t("admin.budgets.index.table_investments") %></th> <th><%= t("admin.budgets.index.table_investments") %></th>
<th><%= t("admin.budgets.index.table_edit_groups") %></th> <th><%= t("admin.budgets.index.table_edit_groups") %></th>
<th><%= t("admin.budgets.index.table_edit_budget") %></th> <th><%= t("admin.budgets.index.table_edit_budget") %></th>
<th><%= t("admin.budgets.index.table_admin_ballots") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -39,6 +40,11 @@
<td class="small"> <td class="small">
<%= link_to t("admin.budgets.index.edit_budget"), edit_admin_budget_path(budget) %> <%= link_to t("admin.budgets.index.edit_budget"), edit_admin_budget_path(budget) %>
</td> </td>
<td class="small">
<% if budget.poll.present? %>
<%= link_to t("admin.budgets.index.admin_ballots"), admin_poll_path(budget.poll) %>
<% end %>
</td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

View File

@@ -85,8 +85,10 @@ en:
table_investments: Investments table_investments: Investments
table_edit_groups: Headings groups table_edit_groups: Headings groups
table_edit_budget: Edit table_edit_budget: Edit
table_admin_ballots: Ballots
edit_groups: Edit headings groups edit_groups: Edit headings groups
edit_budget: Edit budget edit_budget: Edit budget
admin_ballots: Admin ballots
no_budgets: "There are no budgets." no_budgets: "There are no budgets."
create: create:
notice: New participatory budget created successfully! notice: New participatory budget created successfully!

View File

@@ -85,8 +85,10 @@ es:
table_investments: Proyectos de gasto table_investments: Proyectos de gasto
table_edit_groups: Grupos de partidas table_edit_groups: Grupos de partidas
table_edit_budget: Editar table_edit_budget: Editar
table_admin_ballots: Urnas
edit_groups: Editar grupos de partidas edit_groups: Editar grupos de partidas
edit_budget: Editar presupuesto edit_budget: Editar presupuesto
admin_ballots: Gestionar urnas
no_budgets: "No hay presupuestos participativos." no_budgets: "No hay presupuestos participativos."
create: create:
notice: "¡Presupuestos participativos creados con éxito!" notice: "¡Presupuestos participativos creados con éxito!"

View File

@@ -88,6 +88,16 @@ feature "Admin budgets" do
end end
end end
scenario "Admin ballots link appears if budget has a poll associated" do
budget = create(:budget)
create(:poll, budget: budget)
visit admin_budgets_path
within "#budget_#{budget.id}" do
expect(page).to have_link("Admin ballots")
end
end
end end
context "New" do context "New" do