Add draft info on unpublished budgets
Before commit28caabecd, it was clear which budgets were in draft mode because their phase was "drafting". Now the phase isn't "drafting" anymore, so we have to make it clear somehow that the budget is a draft. I'm using styles similar to the ones we added in commit2f636eaf7for completed budgets but at the same time making them slightly different so it's easy to differenciate completed and drafting budgets.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
.admin .budgets-table {
|
.admin .budgets-table {
|
||||||
|
|
||||||
.budget-completed {
|
.budget-completed,
|
||||||
@include has-fa-icon(lock, solid);
|
.budget-draft {
|
||||||
padding-left: calc(1em + #{rem-calc(10)});
|
padding-left: calc(1em + #{rem-calc(10)});
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
@@ -18,10 +18,25 @@
|
|||||||
font-size: $tiny-font-size;
|
font-size: $tiny-font-size;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: rem-calc(12);
|
line-height: rem-calc(12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.budget-completed {
|
||||||
|
@include has-fa-icon(lock, solid);
|
||||||
|
|
||||||
|
span {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.budget-draft {
|
||||||
|
@include has-fa-icon(pencil-alt, solid);
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
td time:last-of-type::after,
|
td time:last-of-type::after,
|
||||||
td small::before {
|
td small::before {
|
||||||
content: "";
|
content: "";
|
||||||
|
|||||||
@@ -31,11 +31,17 @@ class Admin::Budgets::IndexComponent < ApplicationComponent
|
|||||||
end
|
end
|
||||||
|
|
||||||
def status_html_class(budget)
|
def status_html_class(budget)
|
||||||
"budget-completed" if budget.finished?
|
if budget.drafting?
|
||||||
|
"budget-draft"
|
||||||
|
elsif budget.finished?
|
||||||
|
"budget-completed"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def status_text(budget)
|
def status_text(budget)
|
||||||
if budget.finished?
|
if budget.drafting?
|
||||||
|
tag.span t("admin.budgets.index.table_draft")
|
||||||
|
elsif budget.finished?
|
||||||
tag.span t("admin.budgets.index.table_completed")
|
tag.span t("admin.budgets.index.table_completed")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ en:
|
|||||||
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."
|
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
|
budget_investments: Manage projects
|
||||||
table_completed: Completed
|
table_completed: Completed
|
||||||
|
table_draft: "Draft"
|
||||||
table_duration: "Duration"
|
table_duration: "Duration"
|
||||||
table_name: Name
|
table_name: Name
|
||||||
table_phase: Phase
|
table_phase: Phase
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ es:
|
|||||||
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."
|
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
|
budget_investments: Gestionar proyectos de gasto
|
||||||
table_completed: Completado
|
table_completed: Completado
|
||||||
|
table_draft: "Borrador"
|
||||||
table_duration: "Duración"
|
table_duration: "Duración"
|
||||||
table_name: Nombre
|
table_name: Nombre
|
||||||
table_phase: Fase
|
table_phase: Fase
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ describe "Admin budgets", :admin do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Filters by phase" do
|
scenario "Filters by phase" do
|
||||||
create(:budget, :drafting, name: "Drafting budget")
|
create(:budget, :drafting, name: "Unpublished budget")
|
||||||
create(:budget, :accepting, name: "Accepting budget")
|
create(:budget, :accepting, name: "Accepting budget")
|
||||||
create(:budget, :selecting, name: "Selecting budget")
|
create(:budget, :selecting, name: "Selecting budget")
|
||||||
create(:budget, :balloting, name: "Balloting budget")
|
create(:budget, :balloting, name: "Balloting budget")
|
||||||
@@ -35,18 +35,21 @@ describe "Admin budgets", :admin do
|
|||||||
|
|
||||||
visit admin_budgets_path
|
visit admin_budgets_path
|
||||||
|
|
||||||
expect(page).to have_content "Drafting budget"
|
|
||||||
expect(page).to have_content "Accepting budget"
|
expect(page).to have_content "Accepting budget"
|
||||||
expect(page).to have_content "Selecting budget"
|
expect(page).to have_content "Selecting budget"
|
||||||
expect(page).to have_content "Balloting budget"
|
expect(page).to have_content "Balloting budget"
|
||||||
|
|
||||||
|
within "tr", text: "Unpublished budget" do
|
||||||
|
expect(page).to have_content "Draft"
|
||||||
|
end
|
||||||
|
|
||||||
within "tr", text: "Finished budget" do
|
within "tr", text: "Finished budget" do
|
||||||
expect(page).to have_content "COMPLETED"
|
expect(page).to have_content "COMPLETED"
|
||||||
end
|
end
|
||||||
|
|
||||||
click_link "Finished"
|
click_link "Finished"
|
||||||
|
|
||||||
expect(page).not_to have_content "Drafting budget"
|
expect(page).not_to have_content "Unpublished budget"
|
||||||
expect(page).not_to have_content "Accepting budget"
|
expect(page).not_to have_content "Accepting budget"
|
||||||
expect(page).not_to have_content "Selecting budget"
|
expect(page).not_to have_content "Selecting budget"
|
||||||
expect(page).not_to have_content "Balloting budget"
|
expect(page).not_to have_content "Balloting budget"
|
||||||
@@ -54,7 +57,7 @@ describe "Admin budgets", :admin do
|
|||||||
|
|
||||||
click_link "Open"
|
click_link "Open"
|
||||||
|
|
||||||
expect(page).to have_content "Drafting budget"
|
expect(page).to have_content "Unpublished budget"
|
||||||
expect(page).to have_content "Accepting budget"
|
expect(page).to have_content "Accepting budget"
|
||||||
expect(page).to have_content "Selecting budget"
|
expect(page).to have_content "Selecting budget"
|
||||||
expect(page).to have_content "Balloting budget"
|
expect(page).to have_content "Balloting budget"
|
||||||
|
|||||||
Reference in New Issue
Block a user