Add help text in budgets admin index

Co-authored-by: decabeza <alberto@decabeza.es>
This commit is contained in:
Julian Herrero
2020-03-16 12:54:00 +01:00
committed by Javi Martín
parent 435747764c
commit b1cb981980
7 changed files with 61 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
.admin .budgets-help {
$padding: $line-height / 2;
$quote-size: 1em;
$quote-padding: 2 * $quote-size / 5;
$quote-width: $quote-size + 2 * $quote-padding;
@include has-fa-icon(quote-right, solid, after);
background: $table-header;
border-radius: rem-calc(6);
color: $admin-text;
margin-bottom: $line-height;
padding: $padding;
padding-right: calc(2 * #{$padding} + #{$quote-width});
position: relative;
@include breakpoint(medium) {
width: 50%;
}
p {
font-size: $small-font-size;
font-style: italic;
}
&::before {
background: #ccd8e4;
content: "";
height: 100%;
position: absolute;
right: $padding;
top: 0;
width: $quote-width;
}
&::after {
bottom: $padding / 2;
color: $white;
margin-right: 0;
position: absolute;
right: calc(#{$padding} + #{$quote-padding});
}
}

View File

@@ -31,7 +31,7 @@
@import "leaflet";
@import "sticky_overrides";
@import "tags";
@import "admin/*";
@import "admin/**/*";
@import "sdg/**/*";
@import "sdg_management/*";
@import "sdg_management/**/*";

View File

@@ -0,0 +1,3 @@
<div class="budgets-help">
<p><%= text %></p>
</div>

View File

@@ -0,0 +1,12 @@
class Admin::Budgets::HelpComponent < ApplicationComponent
private
def i18n_namespace
"admin.budgets.index"
end
def text
t("#{i18n_namespace}.help")
end
end

View File

@@ -3,6 +3,7 @@
<%= link_to t("admin.budgets.index.new_link"), new_admin_budget_path %>
</header>
<%= render Admin::Budgets::HelpComponent.new %>
<%= render "shared/filter_subnav", i18n_namespace: "admin.budgets.index" %>
<% if @budgets.any? %>

View File

@@ -70,6 +70,7 @@ en:
filters:
open: Open
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_name: Name
table_phase: Phase

View File

@@ -70,6 +70,7 @@ es:
filters:
open: Abiertos
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_name: Nombre
table_phase: Fase