Merge remote-tracking branch 'origin/master' into issue406_truncate_comment

This commit is contained in:
2022-01-26 14:03:49 +01:00
26 changed files with 1331 additions and 16 deletions

View File

@@ -0,0 +1,14 @@
<div class="col-md col-xxl">
<div id="collapseForm" class="collapse">
{% include "@ChillPerson/PersonResource/form.html.twig" %}
</div>
<ul class="record_actions sticky-form-buttons">
<li>
<button class="btn btn-primary btn-create change-icon" type="button" data-bs-toggle="collapse" data-bs-target="#collapseForm" aria-expanded="false" aria-controls="collapseForm">
{{ 'Add a person resource'|trans }}
</button>
</li>
</ul>
</div>

View File

@@ -0,0 +1,17 @@
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = 'chill_person_resource_list' %}
{# {% set person = person %} #}
{% block title 'Remove resource'|trans %}
{% block personcontent %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Remove resource'|trans,
'confirm_question' : 'Are you sure you want to remove the resource for "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname } ),
'cancel_route' : 'chill_person_resource_list',
'cancel_parameters' : { 'person_id' : person.id },
'form' : form
} ) }}
{% endblock %}

View File

@@ -0,0 +1,23 @@
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = 'chill_person_resource_edit' %}
{% block js %}
{{ encore_entry_script_tags('page_person_resource_showhide_input') }}
{{ encore_entry_script_tags('mod_pickentity_type') }}
{% endblock %}
{% block css %}
{{ encore_entry_link_tags('page_person_resource_showhide_input') }}
{{ encore_entry_link_tags('mod_pickentity_type') }}
{% endblock %}
{% block title %}{{ 'edit resource'|trans|capitalize }}{% endblock %}
{% block personcontent %}
<h1 style="margin-bottom: 2rem;">{{ 'edit resource'|trans }}</h1>
{% include "@ChillPerson/PersonResource/form.html.twig" %}
{% endblock %}

View File

@@ -0,0 +1,78 @@
{{ form_start(form, {'attr' : {'id' : 'create-form'}}) }}
{{ form_row(form.kind) }}
<div id="linked-entity">
<fieldset class="mb-3">
<div class="row">
<legend class="col-sm-4 col-form-label">Associer un</legend>
<div class="col-sm-8">
<div id="entity-selector">
<div class="form-check">
{% if resource is defined and resource.person is not null %}
<input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_0" name="linked-entity" class="form-check-input" value="person" />
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_0">Usager</label>
{% else %}
<input type="radio" id="chill_personbundle_person_resource_linkedEntity_0" name="linked-entity" class="form-check-input" value="person" />
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_0">Usager</label>
{% endif %}
</div>
<div class="form-check">
{% if resource is defined and resource.thirdparty is not null %}
<input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_1" name="linked-entity" class="form-check-input" value="thirdparty" />
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_1">Tiers</label>
{% else %}
<input type="radio" id="chill_personbundle_person_resource_linkedEntity_1" name="linked-entity" class="form-check-input" value="thirdparty" />
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_1">Tiers</label>
{% endif %}
</div>
<div class="form-check">
{% if resource is defined and resource.freeText is not null %}
<input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_2" name="linked-entity" class="form-check-input" value="freetext" />
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_2">Description libre</label>
{% else %}
<input type="radio" id="chill_personbundle_person_resource_linkedEntity_2" name="linked-entity" class="form-check-input" value="freetext" />
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_2">Description libre</label>
{% endif %}
</div>
</div>
</div>
</div>
</fieldset>
</div>
<div id="person-entity">
{{ form_row(form.person) }}
</div>
<div id="thirdparty-entity">
{{ form_row(form.thirdparty) }}
</div>
<div id="freetext-entity">
{{ form_row(form.freetext) }}
</div>
{{ form_row(form.comment) }}
{% if action is defined %}
<ul class="record_actions sticky-form-buttons">
<li class="edit">
<button class="btn btn-edit"
type="submit" id="newPersonResource">
{{ 'edit resource'|trans|capitalize }}
</button>
</li>
</ul>
{% else %}
<ul class="record_actions">
<li>
<button class="btn btn-create"
type="submit" id="newPersonResource">
{{ 'Save'|trans }}
</button>
</li>
</ul>
{% endif %}
{{ form_end(form) }}

View File

@@ -0,0 +1,101 @@
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = 'chill_person_resource_list' %}
{% block title %}{{ 'Person resources'|trans|capitalize ~ ' ' ~ person|chill_entity_render_string }}{% endblock %}
{% block js %}
{{ encore_entry_script_tags('page_person_resource_showhide_input') }}
{{ encore_entry_script_tags('mod_pickentity_type') }}
{% endblock %}
{% block css %}
{{ encore_entry_link_tags('page_person_resource_showhide_input') }}
{{ encore_entry_link_tags('mod_pickentity_type') }}
{% endblock %}
{% block personcontent %}
<h1>{{ 'List of resources'|trans }}</h1>
{% if personResources is not null %}
{% for resource in personResources %}
<div class="flex-table">
<div class="item-bloc">
<div class="item-row">
<div class="wrap-header">
<div class="wh-row">
<div class="wh-col">
{% if resource.person is not null %}
<div class="item-col">
<div class="denomination h3">
<span class="name">{{ resource.person }}</span>
<span class="badge rounded-pill bg-person">{{ 'person'|trans|capitalize }}</span>
</div>
</div>
{% elseif resource.thirdparty is not null %}
<div class="item-col">
<div class="denomination h3">
<span class="name">{{ resource.thirdparty }}</span>
<span class="badge rounded-pill bg-thirdparty">
{{ 'thirdparty'|trans|capitalize }}
<i class="fa fa-fw fa-user-md"></i>
</span>
</div>
</div>
{% else %}
<div class="item-col">
<div class="denomination h3">
<span>{{ resource.freetext }}</span>
</div>
</div>
{% endif %}
<div class="wh-col">
{% if resource.kind %}
<span>{{ resource.kind.title.fr|capitalize }}</span>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% if resource.comment.comment is not null %}
<div class="item-row separator">
<section class="chill-entity entity-comment-embeddable">
<blockquote class="chill-user-quote">
<div>{{ resource.comment.comment }}<div>
</blockquote>
</section>
</div>
{% endif %}
<div class="item-row separator">
<div class="item-col">
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_person_resource_edit', {'resource_id': resource.id,
'person_id': person.id,}) }}"
class="btn btn-sm btn-edit"
title="{{ 'Edit'|trans }}"></a>
</li>
<li>
<a href="{{ chill_path_add_return_path('chill_person_resource_delete', {'person_id': person.id,
'resource_id': resource.id}) }}"
class="btn btn-sm btn-delete"
title="{{ 'Delete'|trans }}"></a>
</li>
</ul>
</div>
</div>
</div>
</div>
{% endfor %}
{% else %}
<p>{{ 'There are no available resources'|trans }}</p>
{% endif %}
<h1 style="margin-bottom: 2rem;">{{ 'Add a person resource'|trans }}</h1>
{% include "@ChillPerson/PersonResource/create.html.twig" %}
{% endblock %}