resume short list style abstraction for accourse-work and activities (wip)

This commit is contained in:
Mathieu Jaumotte 2021-10-04 17:22:08 +02:00
parent 369a29af48
commit 3a07fa4faf
11 changed files with 160 additions and 128 deletions

View File

@ -21,9 +21,9 @@ div.new-activity-select-type {
}
}
// exceptions for flex-table in list-records
// exceptions for flex-table
div.activity-list {
div.flex-table {
&.flex-table {
div.item-bloc {
div.item-row.main {
div.item-col {
@ -86,7 +86,6 @@ div.activity-list {
}
}
}
}
ul.list-content {
list-style-type: none;
@ -103,6 +102,32 @@ div.activity-list {
margin-top: 1em;
}
}
/// Activities on resume page
h2.badge-title {
span.title_label {
background-color: #668821;
div.duration {
font-size: 70%;
font-weight: 500;
p {
margin-bottom: 0;
text-align: right;
}
}
}
span.title_action {
//text-transform: capitalize !important;
font-weight: 500 !important;
border-left: 20px groove yellowgreen;
&:before {
content: '\f04b';
font-family: ForkAwesome;
color: yellowgreen;
margin: 0 0 0 -1.05em;
}
}
}
}
// exceptions for flex-bloc in concerned-groups
@ -130,7 +155,6 @@ div.flex-bloc.concerned-groups {
}
}
/// CHILL ENTITY RENDER BOX
.chill-entity {

View File

@ -1,4 +1,4 @@
<div class="activity-list context-{{ context }}">
<div class="context-{{ context }}">
{% if activities|length == 0 %}
<p class="chill-no-data-statement">
@ -7,7 +7,7 @@
</p>
{% else %}
<div class="flex-table">
<div class="flex-table activity-list">
{% for activity in activities %}
{% set t = activity.type %}
<div class="item-bloc">
@ -102,12 +102,8 @@
</li>
<li>
<b>{{ 'location'|trans ~ ': ' }}</b>
Domicile de l'usager
{# TODO {% if activity.location %}{{ activity.location }}{% endif %}
#}
<b>{{ 'location'|trans ~ ': ' }}</b> Domicile de l'usager
{# TODO {% if activity.location %}{{ activity.location }}{% endif %} #}
</li>
{%- if t.reasonsVisible -%}

View File

@ -0,0 +1,46 @@
<div class="activity-list">
{% for activity in activities | slice(0,5) %}
{% set t = activity.type %}
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"></a>
<h2 class="badge-title">
<span class="title_label">
{% if activity.date %}
<h3>{{ activity.date|format_date('short') }}</h3>
{% endif %}
<div class="duration">
{% if activity.durationTime and t.durationTimeVisible %}
<p>
<abbr class="fa fa-fw fa-hourglass-end" title="{{ 'Duration Time'|trans }}"></abbr>
{{ activity.durationTime|date('H:i') }}
</p>
{% endif %}
{% if activity.travelTime and t.travelTimeVisible %}
<p>
<abbr class="fa fa-fw fa-car" title="{{ 'Travel time'|trans }}"></abbr>
{{ activity.travelTime|date('H:i') }}
</p>
{% endif %}
</div>
</span>
<span class="title_action">
{{ activity.type.name | localize_translatable_string }}
<ul class="small_in_title">
<li>
<abbr title="{{ 'location'|trans }}">{{ 'location'|trans ~ ': ' }}</abbr>
{# TODO {% if activity.location %}{{ activity.location }}{% endif %} #}
Domicile de l'usager
</li>
{% if activity.user and t.userVisible %}
<li>
<abbr title="{{ 'Referrer'|trans }}">{{ 'Referrer'|trans ~ ': ' }}</abbr>
{{ activity.user.usernameCanonical }}
</li>
{% endif %}
</ul>
</span>
</h2>
{% endfor %}
</div>

View File

@ -73,7 +73,7 @@
{% endif %}
{% if t.travelTimeVisible %}
<dt class="inline">{{ 'Travel Time'|trans }}</dt>
<dt class="inline">{{ 'Travel time'|trans }}</dt>
<dd>{% if entity.travelTime is not null %}
{{ entity.travelTime|date('H:i') }}
{% else %}

View File

@ -248,8 +248,10 @@ span.fa-holder {
}
}
///
div.accompanyingcourse-resume {
div.associated-persons {
font-size: 110%;
span.household {
display: inline-block;
border-radius: 8px;

View File

@ -1,28 +1,49 @@
/// Display Title like a badge (with background-colored label)
h2.badge-title {
display: flex;
flex-direction: row;
width: 100%;
color: $dark;
a & {
text-decoration: none;
}
span.title_label {
border-radius: 0.35rem 0 0 0.35rem;
color: $white;
font-size: 80%;
padding: 0.5em;
padding-right: 0;
}
span.title_action {
flex-grow: 1;
margin: 0 0 0 auto;
border-radius: 0 0.35rem 0.35rem 0;
background-color: $light;
padding: 0.2em 1em;
ul.small_in_title {
margin-top: 0.5em;
font-size: 70%;
padding-left: 1rem;
}
}
}
/// AccompanyingCourse Work list Page
div.accompanying_course_work-list {
h2.title {
display: flex;
flex-direction: row;
width: 100%;
color: $dark;
//height: 40px;
h2.badge-title {
span.title_label {
border-radius: 0.35rem 0 0 0.35rem;
background-color: $social-action-label-color;
color: $white;
font-size: 80%;
padding: 0.5em;
padding-right: 0;
}
span.title_action {
flex-grow: 1;
margin: 0 0 0 auto;
border-radius: 0 0.35rem 0.35rem 0;
background-color: $light;
padding: 0.2em 0.7em;
@include badge_social_action;
&:before {
margin: 0 0.3em 0 -1.05em !important;
}
}
}
@ -140,4 +161,3 @@ div.accompanying_course_work-list {
}
}

View File

@ -15,7 +15,7 @@ $social-action-label-color: shade-color($orange, 34%);
///
@mixin badge_social_issue {
text-transform: capitalize !important;
//text-transform: capitalize !important;
font-weight: 500 !important;
border-left: 20px groove $social-issue-color;
&:before {
@ -32,7 +32,7 @@ $social-action-label-color: shade-color($orange, 34%);
///
@mixin badge_social_action {
text-transform: capitalize !important;
//text-transform: capitalize !important;
font-weight: 500 !important;
border-left: 20px groove $social-action-color;
&:before {

View File

@ -71,7 +71,7 @@
<div class="col-md-6 location mb-5">
{% if accompanyingCourse.locationStatus == 'person' %}
<h5>{{ 'This course is located by'|trans }}</h5>
<h2>{{ 'This course is located by'|trans }}</h2>
<h4>{{ accompanyingCourse.personLocation|chill_entity_render_string }}</h4>
{% elseif accompanyingCourse.locationStatus == 'address' %}
<h4>{{ 'This course has a temporarily location'|trans }}</h4>
@ -82,97 +82,9 @@
{% endif %}
</div>
{# DISABLED
<h1>{{ 'Resume Accompanying Course'|trans }}</h1>
<div class="associated-persons mb-5">
<h2 class="mb-3">{{ 'Associated peoples'|trans }}</h2>
<div class="flex-table mb-3">
{% for participation in accompanyingCourse.participations %}
{% if participation.enddate is null %}
<div class="item-bloc">
{{ participation.person|chill_entity_render_box({
'render': 'bloc', 'addLink': false, 'addInfo': true, 'addAltNames': false,
'customButtons': { 'before': _self.button_person(participation.person) }
}) }}
</div>
{% endif %}
{% endfor %}
</div>
</div>
<div class="location mb-5">
<h2 class="mb-3">{{ 'Accompanying course location'|trans }}</h2>
{% if accompanyingCourse.locationStatus == 'person' %}
<p>{{ 'This course is located by'|trans }}
<b>{{ accompanyingCourse.personLocation|chill_entity_render_string }}</b>
</p>
{% elseif accompanyingCourse.locationStatus == 'address' %}
<p>{{ 'This course has a temporarily location'|trans }}</p>
{% endif %}
{% if accompanyingCourse.locationStatus != 'none' %}
<div class="flex-table">
<div class="item-bloc">
{{ accompanyingCourse.location|chill_entity_render_box }}
</div>
</div>
{% endif %}
</div>
<div class="requestor mb-5">
<h2 class="mb-3">{{ 'Requestor'|trans }}</h2>
{% if accompanyingCourse.requestorPerson is not empty %}
{% set requestor = accompanyingCourse.requestorPerson %}
{% set info = true %}
{% elseif accompanyingCourse.requestor is not empty %}
{% set requestor = accompanyingCourse.requestorThirdParty %}
{% set info = false %}
{% endif %}
{% if accompanyingCourse.requestor == null %}
<p class="chill-no-data-statement">{{ 'Any requestor to this accompanying course'|trans }}</p>
{% else %}
<div class="flex-bloc row row-cols-1 g-0">
<div class="item-bloc col">
{{ requestor|chill_entity_render_box({
'render': 'bloc', 'addLink': false, 'addEntity': true, 'addInfo': info, 'addAltNames': false
}) }}
</div>
</div>
{% endif %}
</div>
<div class="resources mb-5">
<h2 class="mb-3">{{ 'Resources'|trans }}</h2>
{% if accompanyingCourse.resources|length == 0 %}
<p class="chill-no-data-statement">{{ 'Any resource for this accompanying course'|trans }}</p>
{% else %}
<div class="flex-bloc row row-cols-1 row-cols-sm-2 row-cols-xl-3 row-cols-xxl-4 g-0">
{% for r in accompanyingCourse.resources %}
<div class="item-bloc col">
{% if r.person %}
{{ r.person|chill_entity_render_box({
'render': 'bloc', 'addLink': false, 'addEntity': true, 'addInfo': true, 'addAltNames': false
}) }}
{% endif %}
{% if r.thirdParty %}
{{ r.thirdParty|chill_entity_render_box({
'render': 'bloc', 'addLink': false, 'addEntity': true, 'addInfo': false
}) }}
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
#}
<div class="mt-5"></div>
<div class="social-actions mb-5">
<h2 class="mb-3">{{ 'Social actions'|trans }}</h2>
{% include 'ChillPersonBundle:AccompanyingCourseWork:list_by_accompanying_period.html.twig' with {'buttonText': false, 'render': 'resume' } %}
{% include 'ChillPersonBundle:AccompanyingCourseWork:recent_list_by_accompanying_period.html.twig' with {'buttonText': false } %}
</div>
{% block contentActivity %}
@ -189,9 +101,9 @@
{% set accompanying_course_id = accompanyingCourse.id %}
{% endif %}
<h2>{{ 'Activity list' |trans }}</h2>
<h2 class="mb-3">{{ 'Activity list' |trans }}</h2>
{% include 'ChillActivityBundle:Activity:list.html.twig' with { 'context': 'accompanyingCourse', 'no_action': true } %}
{% include 'ChillActivityBundle:Activity:recent_list.html.twig' with { 'context': 'accompanyingCourse', 'no_action': true } %}
</div>
{% endblock %}

View File

@ -7,7 +7,7 @@
<h1>{{ block('title') }}</h1>
{% include 'ChillPersonBundle:AccompanyingCourseWork:list_by_accompanying_period.html.twig' with {'render': 'list'} %}
{% include 'ChillPersonBundle:AccompanyingCourseWork:list_by_accompanying_period.html.twig' %}
<ul class="record_actions sticky-form-buttons">
<li>

View File

@ -5,12 +5,12 @@
</p>
{% endif %}
<div class="flex-table accompanying_course_work-{{ render }}">
<div class="flex-table accompanying_course_work-list">
{% for w in works %}
<div class="item-bloc">
<div class="item-row">
<h2 class="title">
<h2 class="badge-title">
<span class="title_label">{{ 'accompanying_course_work.action'|trans }}</span>
<span class="title_action">{{ w.socialAction|chill_entity_render_string }}</span>
</h2>

View File

@ -0,0 +1,32 @@
{% if works|length == 0 %}
<p class="chill-no-data-statement">{{ 'accompanying_course_work.Any work'|trans }}
<a class="btn btn-sm btn-create"
href="" title="TODO"></a>{# TODO link #}
</p>
{% endif %}
<div class="accompanying_course_work-list">
{% for w in works | slice(0,5) %}
<a href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}"></a>
<h2 class="badge-title">
<span class="title_label">{{ 'accompanying_course_work.action'|trans }}</span>
<span class="title_action">{{ w.socialAction|chill_entity_render_string }}
<ul class="small_in_title">
<li>
<abbr title="{{ 'accompanying_course_work.start_date'|trans }}">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</abbr>
{{ w.startDate|format_date('short') }}
</li>
<li>
<abbr title="{{ 'Last updated by'|trans }}">{{ 'Last updated by'|trans ~ ' : ' }}</abbr>
{{ w.updatedBy|chill_entity_render_box }}, {{ w.updatedAt|format_datetime('short', 'short') }}
</li>
</ul>
</span>
</h2>
{% endfor %}
</div>