Merge branch 'master' into 110_extend_thirdparty

This commit is contained in:
2021-07-30 22:56:41 +02:00
111 changed files with 3019 additions and 1974 deletions

View File

@@ -1,16 +0,0 @@
<div class="chill_address">
{% if options['has_no_address'] == true and address.isNoAddress == true %}
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
{% endif %}
<div class="chill_address_address {% if options['multiline'] %}chill_address_address--multiline{% endif %}">
{% if address.street is not empty %}<p class="street street1">{{ address.street }}</p>{% endif %}
{% if address.streetNumber is not empty %}<p class="street street2">{{ address.streetNumber }}</p>{% endif %}
{% if address.postCode is not empty %}
<p class="postalCode"><span class="code">{{ address.postCode.code }}</span> <span class="name">{{ address.postCode.name }}</span></p>
<p class="country">{{ address.postCode.country.name|localize_translatable_string }}</p>
{% endif %}
</div>
{%- if options['with_valid_from'] == true -%}
<span class="address_since">{{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }}</span>
{%- endif -%}
</div>

View File

@@ -1,21 +0,0 @@
{%- macro _render(address, options) -%}
{%- set options = { 'with_valid_from' : true }|merge(options|default({})) -%}
{%- set options = { 'has_no_address' : false }|merge(options|default({})) -%}
{%- set options = { 'with_icon' : false }|merge(options|default({})) -%}
<div class="chill_address">
{% if options['has_no_address'] == true and address.isNoAddress == true %}
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
{% endif %}
<div class="chill_address_address">{% if options['with_icon'] == true %}<i class="fa fa-fw fa-map-marker"></i>{% endif %}
{% if address.street is not empty %}<p class="street street1">{{ address.street }}</p>{% endif %}
{% if address.streetNumber is not empty %}<p class="street street2">{{ address.streetNumber }}</p>{% endif %}
{% if address.postCode is not empty %}
<p class="postalCode"><span class="code">{{ address.postCode.code }}</span> <span class="name">{{ address.postCode.name }}</span></p>
<p class="country">{{ address.postCode.country.name|localize_translatable_string }}</p>
{% endif %}
</div>
{%- if options['with_valid_from'] == true -%}
<span class="address_since">{{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }}</span>
{%- endif -%}
</div>
{%- endmacro -%}

View File

@@ -0,0 +1,121 @@
{#
Template to render an address
OPTIONS
* render string ['list'|'bloc'|'inline']
* with_valid_from bool start date
* with_valid_to bool end date
* with_picto bool add a forkawesome pictogram
* with_delimiter bool add a delimiter between fragments
* has_no_address bool
* multiline bool multiline display
* extended_infos bool add extra informations (step, floor, etc.)
#}
{% macro raw(address, options) %}
{% if address.street is not empty %}
<p class="street">{{ address.street }}
{% if address.streetNumber is not empty %}
<span class="streetnumber">{{ address.streetNumber }}</span>
{% endif %}
</p>
{% endif %}
{% if options['extended_infos'] %}
{{ _self.extended(address, options) }}
{% endif %}
{% if address.postCode is not empty %}
<p class="postcode">
<span class="code">{{ address.postCode.code }}</span>
<span class="name">{{ address.postCode.name }}</span>
</p>
<p class="country">{{ address.postCode.country.name|localize_translatable_string }}</p>
{% endif %}
{% endmacro %}
{% macro extended(address, options) %}
{% if address.floor is not empty %}
<span class="floor">{{ address.floor }}</span>
{% endif %}
{% if address.corridor is not empty %}
<span class="corridor">{{ address.corridor }}</span>
{% endif %}
{% if address.steps is not empty %}
<span class="steps">{{ address.steps }}</span>
{% endif %}
{% if address.buildingName is not empty %}
<span class="buildingName">{{ address.buildingName }}</span>
{% endif %}
{% if address.flat is not empty %}
<span class="flat">{{ address.flat }}</span>
{% endif %}
{% if address.distribution is not empty %}
<span class="distribution">{{ address.distribution }}</span>
{% endif %}
{% if address.extra is not empty %}
<span class="extra">{{ address.extra }}</span>
{% endif %}
{% endmacro %}
{% macro inline(address, options) %}
{% if options['has_no_address'] == true and address.isNoAddress == true %}
<span class="noaddress">
{{ 'address.consider homeless'|trans }}
</span>
{% else %}
<span class="address{% if options['multiline'] %} multiline{% endif %}{% if options['with_delimiter'] %} delimiter{% endif %}">
{{ _self.raw(address, options) }}
</span>
{% endif %}
{{ _self.validity(address, options) }}
{% endmacro %}
{% macro validity(address, options) %}
{%- if options['with_valid_from'] == true -%}
<span class="address-valid address-since">
{{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }}
</span>
{%- endif -%}
{%- if options['with_valid_to'] == true -%}
<span class="address-valid address-until">
{{ 'Until %date%'|trans( { '%date%' : address.validTo|format_date('long') } ) }}
</span>
{%- endif -%}
{% endmacro %}
{%- if render == 'list' -%}
<li class="chill-entity entity-address">
{% if options['with_picto'] %}
<i class="fa fa-li fa-map-marker"></i>
{% endif %}
{{ _self.inline(address, options) }}
</li>
{%- endif -%}
{%- if render == 'inline' -%}
<span class="chill-entity entity-address">
{% if options['with_picto'] %}
<i class="fa fa-fw fa-map-marker"></i>
{% endif %}
{{ _self.inline(address, options) }}
</span>
{%- endif -%}
{%- if render == 'bloc' -%}
<div class="chill-entity entity-address">
{% if options['has_no_address'] == true and address.isNoAddress == true %}
<div class="noaddress">
{{ 'address.consider homeless'|trans }}
</div>
{% else %}
<div class="address{% if options['multiline'] %} multiline{% endif %}{% if options['with_delimiter'] %} delimiter{% endif %}">
{% if options['with_picto'] %}
<i class="fa fa-fw fa-map-marker"></i>
{% endif %}
{{ _self.raw(address, options) }}
</div>
{% endif %}
{{ _self.validity(address, options) }}
</div>
{%- endif -%}

View File

@@ -60,14 +60,22 @@
{{- form_errors(form) -}}
</div>
{%- else -%}
{{- form_label(form) -}}
<div class="{{ block('form_group_class') }}">
{{- form_widget(form, widget_attr) -}}
{{- form_help(form) -}}
{{- form_errors(form) -}}
</div>
{% if form.vars.hideLabel is not defined or form.vars.hideLabel == false %}
{{- form_label(form) -}}
<div class="{{ block('form_group_class') }}">
{{- form_widget(form, widget_attr) -}}
{{- form_help(form) -}}
{{- form_errors(form) -}}
</div>
{% else %}
<div class="col-sm">
{{- form_widget(form, widget_attr) -}}
{{- form_help(form) -}}
{{- form_errors(form) -}}
</div>
{% endif %}
{%- endif -%}
{##}</div>
</div>
{%- endif -%}
{%- endblock form_row %}

View File

@@ -1,5 +1,5 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -19,15 +19,15 @@
{% block form_row %}
{% apply spaceless %}
{% if form.vars.hideLabel is not defined or form.vars.hideLabel == false %}
<div class="container-fluid mb-2">
<div class="mb-2">
<div class="row">
<div class="{% apply spaceless %}
{% if attr.class is defined and ('cf-title' in attr.class or 'cf-fields' in attr.class ) %}
col-12
col-sm-12
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
col-2 col-md-4 clear
col-sm-2 col-md-4 clear
{% else %}
col-4 clear
col-sm-4 clear
{% endif %}
{% endapply %}">
{% if attr.class is not defined or ('cf-title' not in attr.class and 'cf-fields' not in attr.class ) %}
@@ -36,13 +36,13 @@
</div>
<div class="{% apply spaceless %}
{% if attr.class is defined and 'cf-title' in attr.class %}
col-12
col-sm-12
{% elseif attr.class is defined and 'cf-fields' in attr.class %}
col-12 parent
col-sm-12 parent
{% elseif attr.class is defined and 'multiple-cf-inline' in attr.class %}
col-2 col-md-8 multiple-cf-inline
col-sm-2 col-md-8 multiple-cf-inline
{% else %}
col-8
col-sm-8
{% endif %}
{% endapply %}">
{{ form_widget(form) }}
@@ -55,7 +55,7 @@
{% endif %}
{% endapply %}
{% endblock form_row %}
{% block choice_widget_expanded %}
{% apply spaceless %}
<div {{ block('widget_container_attributes') }} class="choice-widget-expanded">
@@ -125,7 +125,7 @@
</div>
{%- endif -%}
{%- endblock time_widget -%}
{% block form_errors %}
{% apply spaceless %}
{% if errors|length > 0 %}
@@ -140,27 +140,27 @@
{% block _formatter__aggregator_placement_csv_formatter_row %}
<h3>{{ form_label(form) }}</h3>
{{ form_row(form.order) }}
{{ form_row(form.position) }}
{% endblock %}
{% block _formatter__aggregator_placement_spreadsheet_formatter_row %}
<h3>{{ form_label(form) }}</h3>
{{ form_row(form.order) }}
{% endblock %}
{% block chill_collection_widget %}
<div class="chill-collection">
<ul class="list-entry"
data-collection-name="{{ form.vars.name|escape('html_attr') }}"
data-collection-identifier="{{ form.vars.identifier|escape('html_attr') }}"
data-collection-button-remove-label="{{ form.vars.button_remove_label|trans|e }}"
data-collection-allow-add="{{ form.vars.allow_add|escape('html_attr') }}"
<ul class="list-entry"
data-collection-name="{{ form.vars.name|escape('html_attr') }}"
data-collection-identifier="{{ form.vars.identifier|escape('html_attr') }}"
data-collection-button-remove-label="{{ form.vars.button_remove_label|trans|e }}"
data-collection-allow-add="{{ form.vars.allow_add|escape('html_attr') }}"
data-collection-allow-delete="{{ form.vars.allow_delete|escape('html_attr') }}">
{% for entry in form %}
<li class="entry" data-collection-is-persisted="1">
@@ -172,14 +172,14 @@
</ul>
{% if form.vars.allow_add == 1 %}
<button class="add-entry btn btn-misc"
data-collection-add-target="{{ form.vars.name|escape('html_attr') }}"
<button class="add-entry btn btn-misc"
data-collection-add-target="{{ form.vars.name|escape('html_attr') }}"
data-form-prototype="{{ ('<div>' ~ form_widget(form.vars.prototype) ~ '</div>')|escape('html_attr') }}" >
<i class="fa fa-plus fa-fw"></i>
{{ form.vars.button_add_label|trans }}
</button>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1 @@
<div class="responsive"></div>

View File

@@ -0,0 +1,42 @@
{% extends "@ChillMain/layout.html.twig" %}
{% block content %}
<div id="container content">
<div class="grid-8 centered">
<h1>{{ "Notifications list" | trans }}</h1>
<!-- TODO : UNREAD & READ -->
{%for data in datas %}
{% set notification = data.notification %}
<dl class="chill_view_data">
<dt class="inline">{{ 'Message'|trans }}</dt>
<dd>{{ notification.message }}</dd>
</dl>
<dl class="chill_view_data">
<dt class="inline">{{ 'Date'|trans }}</dt>
<dd>{{ notification.date | date('long') }}</dd>
</dl>
<dl class="chill_view_data">
<dt class="inline">{{ 'Sender'|trans }}</dt>
<dd>{{ notification.sender }}</dd>
</dl>
<dl class="chill_view_data">
<dt class="inline">{{ 'Addressees'|trans }}</dt>
<dd>{{ notification.addressees |join(', ') }}</dd>
</dl>
<dl class="chill_view_data">
<dt class="inline">{{ 'Entity'|trans }}</dt>
<dd>
{% include data.template with data.template_data %}
</dd>
</dl>
{% endfor %}
</div>
</div>
{% endblock content %}

View File

@@ -1 +1 @@
{% if nb > 0 %}<span class="notification-counter">{{ nb }}</span>{% endif %}
{% if nb > 0 %}<span class="badge rounded-pill bg-danger notification-counter">{{ nb }}</span>{% endif %}

View File

@@ -38,6 +38,9 @@
</head>
<body>
{#
{{ include('@ChillMain/Layout/_debug.html.twig') }}
#}
{{ include('@ChillMain/Layout/_header.html.twig') }}
{% block top_banner %}{#
@@ -50,30 +53,23 @@
{% block sublayout_content %}
<div class="row justify-content-center my-5">
{# Flash messages ! #}
{% if app.session.flashbag.all()|length > 0 %}
<div class="col-8 mb-5 flash_message">
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="col-8 mb-5 alert alert-success flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="col-8 alert alert-success flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="col-8 mb-5 alert alert-danger flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="col-8 alert alert-danger flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="col-8 alert alert-warning flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
</div>
{% endif %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="col-8 mb-5 alert alert-warning flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% block content %}
<div class="col-8 main_search">

View File

@@ -1,5 +1,5 @@
{#
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -27,30 +27,23 @@
<div class="row">
<div class="col-md-9 my-5">
{# Flash messages ! #}
{% if app.session.flashbag.all()|length > 0 %}
<div class="row justify-content-center mb-5">
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="col-8 mb-5 alert alert-success flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="col-8 alert alert-success flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="col-8 mb-5 alert alert-danger flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="col-8 alert alert-danger flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="col-8 alert alert-warning flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
</div>
{% endif %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="col-8 mb-5 alert alert-warning flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% block layout_wvm_content %}<!-- content of the layoutWithVerticalMenu is empty -->
{% endblock %}