Styling view page

This commit is contained in:
Julie Lenaerts 2022-02-23 17:16:26 +01:00
parent 576f46f845
commit 185d1dbf49
5 changed files with 124 additions and 65 deletions

View File

@ -7,15 +7,21 @@
{% block title title %} {% block title title %}
{% block personcontent %} {% block personcontent %}
<div class="budget-show">
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<div class="flex-table">
<div class="item-bloc">
<div class="item-row">
<h2 class="badge-title">
<span class="title_label title_label_charge"></span>
<span class="title_action title_action_charge">{{ element.type|budget_element_type_display('charge') }}</span>
</h2>
</div>
<div class="item-row separator">
<dl class="chill_view_data"> <dl class="chill_view_data">
<dt>{{ 'Type'|trans }}</dt>
<dd>{{ element.type|budget_element_type_display('charge') }}</dd>
<dt>{{ 'Amount'|trans }}</dt> <dt>{{ 'Amount'|trans }}</dt>
<dd>{{ element.amount|format_currency('EUR') }}</dd> <dd>{{ element.amount|format_currency('EUR') }}</dd>
<dt>{{ 'Validity period'|trans }}</dt> <dt>{{ 'Validity period'|trans }}</dt>
<dd> <dd>
{% if element.endDate is not null %} {% if element.endDate is not null %}
@ -24,7 +30,6 @@
{{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|format_date('long') } ) }} {{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|format_date('long') } ) }}
{% endif %} {% endif %}
</dd> </dd>
<dt>{{ 'Comment'|trans }}</dt> <dt>{{ 'Comment'|trans }}</dt>
<dd> <dd>
{%- if element.comment is not empty -%} {%- if element.comment is not empty -%}
@ -36,6 +41,10 @@
{%- endif -%} {%- endif -%}
</dd> </dd>
</dl> </dl>
</div>
</div>
</div>
</div>
<ul class="record_actions sticky-form-buttons"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">

View File

@ -9,8 +9,6 @@
.subtitle { .subtitle {
margin-top: 1rem; margin-top: 1rem;
margin-bottom: 1rem; margin-bottom: 1rem;
background-color: #334d5c;
color: white;
padding: 1rem; padding: 1rem;
} }
.family-title { .family-title {
@ -20,10 +18,10 @@
color: white; color: white;
} }
.budget-table th.charge { .budget-table th.charge {
background-color: #df4949; background-color: #e03851;
} }
.budget-table th.resource { .budget-table th.resource {
background-color: #43b29d; background-color: #5ba1c1;
} }
.budget-table th, td { .budget-table th, td {
padding: 10px; padding: 10px;
@ -103,9 +101,9 @@
<td class="column-small">{{ f.amount|format_currency('EUR') }}</td> <td class="column-small">{{ f.amount|format_currency('EUR') }}</td>
<td class="column-small"> <td class="column-small">
{% if f.endDate is not null %} {% if f.endDate is not null %}
{{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': f.startDate|format_date('long'), '%endDate%': f.endDate|format_date('long') } ) }} {{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': f.startDate|format_date('short'), '%endDate%': f.endDate|format_date('short') } ) }}
{% else %} {% else %}
{{ 'Valid since %startDate%'|trans( { '%startDate%': f.startDate|format_date('long') } ) }} {{ 'Valid since %startDate%'|trans( { '%startDate%': f.startDate|format_date('short') } ) }}
{% endif %} {% endif %}
</td> </td>
<td class="column-small"> <td class="column-small">

View File

@ -7,16 +7,22 @@
{% block title title %} {% block title title %}
{% block personcontent %} {% block personcontent %}
<div class="budget-show">
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<div class="flex-table">
<div class="item-bloc">
<div class="item-row">
<h2 class="badge-title">
<span class="title_label title_label_resource"></span>
<span class="title_action title_action_resource">{{ element.type|budget_element_type_display('resource') }}</span>
</h2>
</div>
<div class="item-row separator">
<dl class="chill_view_data"> <dl class="chill_view_data">
<dt>{{ 'Type'|trans }}</dt> <dt class="inline">{{ 'Amount'|trans }}</dt>
<dd>{{ element.type|budget_element_type_display('resource') }}</dd>
<dt>{{ 'Amount'|trans }}</dt>
<dd>{{ element.amount|format_currency('EUR') }}</dd> <dd>{{ element.amount|format_currency('EUR') }}</dd>
<dt class="inline">{{ 'Validity period'|trans }}</dt>
<dt>{{ 'Validity period'|trans }}</dt>
<dd> <dd>
{% if element.endDate is not null %} {% if element.endDate is not null %}
{{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': element.startDate|format_date('long'), '%endDate%': familyMember.endDate|format_date('long') } ) }} {{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': element.startDate|format_date('long'), '%endDate%': familyMember.endDate|format_date('long') } ) }}
@ -24,8 +30,7 @@
{{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|format_date('long') } ) }} {{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|format_date('long') } ) }}
{% endif %} {% endif %}
</dd> </dd>
<dt class="inline">{{ 'Comment'|trans }}</dt>
<dt>{{ 'Comment'|trans }}</dt>
<dd> <dd>
{%- if element.comment is not empty -%} {%- if element.comment is not empty -%}
<blockquote class="chill-user-quote"> <blockquote class="chill-user-quote">
@ -36,6 +41,10 @@
{%- endif -%} {%- endif -%}
</dd> </dd>
</dl> </dl>
</div>
</div>
</div>
</div>
<ul class="record_actions sticky-form-buttons"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
@ -43,10 +52,10 @@
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}
</a> </a>
</li> </li>
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %} {# {% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %} #}
<li> <li>
<a href="{{ path('chill_budget_resource_edit', { 'id': element.id } ) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a> <a href="{{ path('chill_budget_resource_edit', { 'id': element.id } ) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a>
</li> </li>
{% endif %} {# {% endif %} #}
</ul> </ul>
{% endblock %} {% endblock %}

View File

@ -11,3 +11,5 @@ $chill-household-context: #929d69;
$social-issue-color: #4bafe8; $social-issue-color: #4bafe8;
$social-action-color: $orange; $social-action-color: $orange;
$activity-color: yellowgreen; $activity-color: yellowgreen;
$budget-resource-color: #5ba1c1;
$budget-charge-color: #e03851;

View File

@ -176,6 +176,47 @@ div[class*='activity-'] {
} }
} }
div[class*='budget-'] {
div.dashboard,
h4.badge-title,
h3.badge-title,
h2.badge-title {
span.title_label {
// Calculate same color then border:groove
&_resource {
background-color: shade-color($budget-resource-color, 34%);
}
&_charge {
background-color: shade-color($budget-charge-color, 34%);
}
h3 {
color: $white;
}
}
span.title_action {
&_resource {
@include dashboard_like_badge($budget-resource-color);
}
&_charge {
@include dashboard_like_badge($budget-charge-color);
}
}
span.title_label {
div.duration {
font-size: 70%;
font-weight: 500;
p {
margin-bottom: 0;
text-align: right;
abbr {
text-decoration: none;
}
}
}
}
}
}
/* /*
* Pill badge by entity * Pill badge by entity
*/ */