mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
295 resume retouches
This commit is contained in:
@@ -1,35 +1,33 @@
|
||||
<template>
|
||||
<teleport to="#add-persons" v-if="isComponentVisible">
|
||||
<teleport to="#add-persons" v-if="isComponentVisible">
|
||||
|
||||
<div class="flex-bloc concerned-groups" :class="getContext">
|
||||
<persons-bloc
|
||||
v-for="bloc in contextPersonsBlocs"
|
||||
v-bind:key="bloc.key"
|
||||
v-bind:bloc="bloc"
|
||||
v-bind:setPersonsInBloc="setPersonsInBloc">
|
||||
</persons-bloc>
|
||||
</div>
|
||||
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
|
||||
<ul class="list-unstyled">
|
||||
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
|
||||
<span class="badge bg-primary" style="cursor: pointer;">
|
||||
<i class="fa fa-plus fa-fw text-success"></i>
|
||||
{{ p.text }}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="flex-bloc concerned-groups" :class="getContext">
|
||||
<persons-bloc
|
||||
v-for="bloc in contextPersonsBlocs"
|
||||
v-bind:key="bloc.key"
|
||||
v-bind:bloc="bloc"
|
||||
v-bind:blocWidth="getBlocWidth"
|
||||
v-bind:setPersonsInBloc="setPersonsInBloc">
|
||||
</persons-bloc>
|
||||
</div>
|
||||
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
|
||||
<ul class="list-suggest add-items">
|
||||
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
|
||||
<span>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<add-persons
|
||||
buttonTitle="activity.add_persons"
|
||||
modalTitle="activity.add_persons"
|
||||
v-bind:key="addPersons.key"
|
||||
v-bind:options="addPersonsOptions"
|
||||
@addNewPersons="addNewPersons"
|
||||
ref="addPersons">
|
||||
</add-persons>
|
||||
<add-persons
|
||||
buttonTitle="activity.add_persons"
|
||||
modalTitle="activity.add_persons"
|
||||
v-bind:key="addPersons.key"
|
||||
v-bind:options="addPersonsOptions"
|
||||
@addNewPersons="addNewPersons"
|
||||
ref="addPersons">
|
||||
</add-persons>
|
||||
|
||||
</teleport>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -122,6 +120,9 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
getBlocWidth() {
|
||||
return Math.round(100/(this.contextPersonsBlocs.length)) + '%';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setPersonsInBloc();
|
||||
|
@@ -1,12 +1,8 @@
|
||||
<template>
|
||||
<li>
|
||||
<span class="badge bg-primary" :title="person.text">
|
||||
<span class="chill_denomination">
|
||||
{{ textCutted }}
|
||||
</span>
|
||||
<a class="fa fa-fw fa-times text-danger text-decoration-none"
|
||||
@click.prevent="$emit('remove', person)">
|
||||
</a>
|
||||
<span :title="person.text">
|
||||
<span class="chill_denomination">{{ textCutted }}</span>
|
||||
<a @click.prevent="$emit('remove', person)"></a>
|
||||
</span>
|
||||
</li>
|
||||
</template>
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="item-bloc">
|
||||
<div class="item-bloc" :style="{ 'flex-basis': blocWidth }">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<h4>{{ $t(bloc.title) }}</h4>
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<ul class="list-content">
|
||||
<ul class="list-suggest remove-items">
|
||||
<person-badge
|
||||
v-for="person in bloc.persons"
|
||||
v-bind:key="person.id"
|
||||
@@ -25,7 +25,7 @@ export default {
|
||||
components: {
|
||||
PersonBadge
|
||||
},
|
||||
props: ['bloc', 'setPersonsInBloc'],
|
||||
props: ['bloc', 'setPersonsInBloc', 'blocWidth'],
|
||||
methods: {
|
||||
removePerson(item) {
|
||||
console.log('@@ CLICK remove person: item', item);
|
||||
|
@@ -26,23 +26,45 @@
|
||||
|
||||
{{ activity.type.name | localize_translatable_string }}
|
||||
|
||||
<ul class="small_in_title">
|
||||
{% if activity.location and t.locationVisible %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'location'|trans ~ ': ' }}</span>
|
||||
<span>{{ activity.location.locationType.title|localize_translatable_string }}</span>
|
||||
{{ activity.location.name }}
|
||||
</li>
|
||||
{% if activity.emergency %}
|
||||
<span class="badge bg-danger rounded-pill fs-6">{{ 'Emergency'|trans|upper }}</span>
|
||||
{% endif %}
|
||||
|
||||
<ul class="small_in_title mt-3">
|
||||
|
||||
{% if activity.sentReceived is not empty and t.sentReceivedVisible %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'Sent received'|trans ~ ' : ' }}</span>
|
||||
<b>{{ activity.sentReceived|capitalize|trans }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.location and t.locationVisible %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'location'|trans ~ ': ' }}</span>
|
||||
<b>
|
||||
<span>{{ activity.location.locationType.title|localize_translatable_string }}</span>
|
||||
{{ activity.location.name }}
|
||||
</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.user and t.userVisible %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'Referrer'|trans ~ ': ' }}</span>
|
||||
{{ activity.user.usernameCanonical }}
|
||||
<b>{{ activity.user.usernameCanonical }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
<li class="associated-persons">
|
||||
<span class="item-key">{{ 'Participants'|trans ~ ' : ' }}</span>
|
||||
{% for p in activity.personsAssociated %}
|
||||
<span class="badge-person">{{ p|chill_entity_render_box }}</span>
|
||||
{% endfor %}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="list-content">
|
||||
<ul class="list-content my-3">
|
||||
{%- if t.reasonsVisible -%}
|
||||
{%- if activity.reasons is not empty -%}
|
||||
<li class="reasons">
|
||||
@@ -71,11 +93,9 @@
|
||||
{%- endif -%}
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
{#
|
||||
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
|
||||
<div class="mt-3">
|
||||
<a class="btn btn-sm btn-outline-primary"
|
||||
@@ -87,4 +107,4 @@
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
#}
|
||||
|
||||
|
@@ -3,89 +3,93 @@
|
||||
{{ path(pathname, parms) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% if context == 'person' %}
|
||||
{% set blocs = [
|
||||
{ 'title': 'Others persons'|trans,
|
||||
{% macro computeWidth(nbBlocks) %}
|
||||
{{ 'flex-basis: ' ~ (100 / nbBlocks)|round(1) ~ '%;' }}
|
||||
{% endmacro %}
|
||||
|
||||
{% set blocks = [] %}
|
||||
{% if entity.activityType.personsVisible %}
|
||||
{% if context == 'person' %}
|
||||
{% set blocks = blocks|merge([{
|
||||
'title': 'Others persons'|trans,
|
||||
'items': entity.persons,
|
||||
'path' : 'chill_person_view',
|
||||
'key' : 'person_id'
|
||||
},
|
||||
{ 'title': 'Third parties'|trans,
|
||||
'items': entity.thirdParties,
|
||||
'path' : 'chill_crud_3party_3party_view',
|
||||
'key' : 'id'
|
||||
},
|
||||
{ 'title': 'Users concerned'|trans,
|
||||
'items': entity.users,
|
||||
'key' : 'id'
|
||||
},
|
||||
] %}
|
||||
{% else %}
|
||||
{% set blocs = [
|
||||
{ 'title': 'Persons in accompanying course'|trans,
|
||||
}]) %}
|
||||
{% else %}
|
||||
{% set blocks = blocks|merge([{
|
||||
'title': 'Persons in accompanying course'|trans,
|
||||
'items': entity.personsAssociated,
|
||||
'path' : 'chill_person_view',
|
||||
'key' : 'person_id'
|
||||
},
|
||||
{ 'title': 'Third persons'|trans,
|
||||
},{
|
||||
'title': 'Third persons'|trans,
|
||||
'items': entity.personsNotAssociated,
|
||||
'path' : 'chill_person_view',
|
||||
'key' : 'person_id'
|
||||
},
|
||||
{ 'title': 'Third parties'|trans,
|
||||
'items': entity.thirdParties,
|
||||
'path' : 'chill_crud_3party_3party_view',
|
||||
'key' : 'id'
|
||||
},
|
||||
{ 'title': 'Users concerned'|trans,
|
||||
'items': entity.users,
|
||||
'key' : 'id'
|
||||
},
|
||||
] %}
|
||||
'key' : 'person_id',
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if entity.activityType.thirdPartiesVisible %}
|
||||
{% set blocks = blocks|merge([{
|
||||
'title': 'Third parties'|trans,
|
||||
'items': entity.thirdParties,
|
||||
'path' : 'chill_crud_3party_3party_view',
|
||||
'key' : 'id',
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% if entity.activityType.usersVisible %}
|
||||
{% set blocks = blocks|merge([{
|
||||
'title': 'Users concerned'|trans,
|
||||
'items': entity.users,
|
||||
'key' : 'id',
|
||||
}]) %}
|
||||
{% endif %}
|
||||
|
||||
{% if (with_display == 'bloc') %}
|
||||
<div class="{{ context }} flex-bloc concerned-groups">
|
||||
{% for bloc in blocs %}
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<h4>{{ bloc.title }}</h4>
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<ul class="list-content">
|
||||
{% for item in bloc.items %}
|
||||
<li>
|
||||
{% if bloc.path is defined %}
|
||||
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
|
||||
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
|
||||
{{ item|chill_entity_render_box({
|
||||
'render': 'raw',
|
||||
'addAltNames': false
|
||||
}) }}
|
||||
</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
|
||||
{{ item|chill_entity_render_box({
|
||||
'render': 'raw',
|
||||
'addAltNames': false
|
||||
}) }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% for bloc in blocks %}
|
||||
|
||||
<div class="item-bloc" style="{{ _self.computeWidth(loop.length) }}">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<h4>{{ bloc.title }}</h4>
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<ul class="list-content">
|
||||
{% for item in bloc.items %}
|
||||
<li>
|
||||
{% if bloc.path is defined %}
|
||||
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
|
||||
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
|
||||
{{ item|chill_entity_render_box({
|
||||
'render': 'raw',
|
||||
'addAltNames': false
|
||||
}) }}
|
||||
</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
|
||||
{{ item|chill_entity_render_box({
|
||||
'render': 'raw',
|
||||
'addAltNames': false
|
||||
}) }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if (with_display == 'row') %}
|
||||
<div class="concerned-groups">
|
||||
{% for bloc in blocs %}
|
||||
{% for bloc in blocks %}
|
||||
<div class="group">
|
||||
{% if bloc.items|length > 0 %}
|
||||
<h4>{{ bloc.title }}</h4>
|
||||
@@ -118,7 +122,7 @@
|
||||
|
||||
{% if (with_display == 'wrap-list') %}
|
||||
<div class="concerned-groups wrap-list">
|
||||
{% for bloc in blocs %}
|
||||
{% for bloc in blocks %}
|
||||
<div class="wl-row">
|
||||
{% if bloc.items|length > 0 %}
|
||||
<div class="wl-col title">
|
||||
|
@@ -2,9 +2,11 @@
|
||||
{% 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>
|
||||
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
|
||||
class="badge-link" title="{{ 'Show the activity'|trans }}">
|
||||
|
||||
{% include '@ChillActivity/Activity/activity-badge-title.html.twig' %}
|
||||
{% include '@ChillActivity/Activity/activity-badge-title.html.twig' %}
|
||||
</a>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
{% block content -%}
|
||||
<div class="activity-show">
|
||||
|
||||
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %}
|
||||
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %}
|
||||
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
Reference in New Issue
Block a user