Skip to content

Commit

Permalink
Bump deps (especially twig updated to 3.12)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-menshchikov committed Aug 30, 2024
1 parent bf084ec commit 708b58b
Show file tree
Hide file tree
Showing 13 changed files with 340 additions and 369 deletions.
156 changes: 79 additions & 77 deletions shared/homeless/composer.lock

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions shared/homeless/migrations/Version20240830130542.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
// SPDX-License-Identifier: BSD-3-Clause

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20240830130542 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update format_date arguments (twig 3.12)';
}

public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
UPDATE certificate_type
SET content_header_left = replace(
content_header_left,
'format_date(\'none\',', 'format_date(pattern:'
),
content_header_right = replace(
content_header_right,
'format_date(\'none\',', 'format_date(pattern:'
),
content_body_right = replace(
content_body_right,
'format_date(\'none\',', 'format_date(pattern:'
),
content_footer = replace(
content_footer,
'format_date(\'none\',', 'format_date(pattern:'
)
SQL);
}

public function down(Schema $schema): void {}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %}

{% block field %}
{% apply spaceless %}
{% if value == constant('App\\Entity\\Document::REGISTRATION_YES') %}
<span class="label label-success">{%- trans from 'SonataAdminBundle' %}label_type_yes{% endtrans -%}</span>
{% else %}
<span class="label label-danger">{%- trans from 'SonataAdminBundle' %}label_type_no{% endtrans -%}</span>
{% endif %}
{% endapply %}
{%- if value == constant('App\\Entity\\Document::REGISTRATION_YES') -%}
<span class="label label-success">{%- trans from 'SonataAdminBundle' %}label_type_yes{% endtrans -%}</span>
{%- else -%}
<span class="label label-danger">{%- trans from 'SonataAdminBundle' %}label_type_no{% endtrans -%}</span>
{%- endif -%}
{% endblock %}
6 changes: 1 addition & 5 deletions shared/homeless/templates/admin/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@
{% endblock sonata_sidebar_search %}

{% block logo %}
{% apply spaceless %}
<a class="logo" href="{{ path('my_clients') }}">
<img src="{{ logo_path }}" style="max-width: 100%;"/>
</a>
{% endapply %}
<a class="logo" href="{{ path('my_clients') }}"><img src="{{ logo_path }}" style="max-width: 100%;"/></a>
{% endblock %}

{% block side_bar_after_nav_content %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{% extends '@!SonataUser/Form/form_admin_fields.html.twig' %}

{% block sonata_roles_matrix_widget %}
{% apply spaceless %}
<ul class="list-unstyled">
{{ renderRolesList(form)|raw }}
{{- renderRolesList(form)|raw -}}
</ul>
{% endapply %}
{% endblock sonata_roles_matrix_widget %}
128 changes: 61 additions & 67 deletions shared/homeless/templates/form/fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,86 @@
{% endblock %}

{% block app_homeless_from_date_widget %}
{% apply spaceless %}
{% if widget == 'single_text' %}
{{ block('form_widget_simple') }}
{% else %}
{% if row is not defined or row == true %}
{% set attr = attr|merge({'class': attr.class|default('') ~ ' row' }) %}
{% endif %}
{% set input_wrapper_class = input_wrapper_class|default('col-sm-6') %}
<div {{ block('widget_container_attributes') }}>
{{ date_pattern|replace({
'{{ year }}': '<div class="'~ input_wrapper_class ~ '">' ~ form_widget(form.year) ~ '</div>',
'{{ month }}': '<div class="'~ input_wrapper_class ~ '">' ~ form_widget(form.month) ~ '</div>',
})|raw }}
</div>
{%- if widget == 'single_text' -%}
{{- block('form_widget_simple') -}}
{%- else -%}
{% if row is not defined or row == true %}
{% set attr = attr|merge({'class': attr.class|default('') ~ ' row' }) %}
{% endif %}
{% endapply %}
{% set input_wrapper_class = input_wrapper_class|default('col-sm-6') %}
<div {{ block('widget_container_attributes') }}>
{{- date_pattern|replace({
'{{ year }}': '<div class="'~ input_wrapper_class ~ '">' ~ form_widget(form.year) ~ '</div>',
'{{ month }}': '<div class="'~ input_wrapper_class ~ '">' ~ form_widget(form.month) ~ '</div>',
})|raw -}}
</div>
{%- endif -%}
{% endblock %}

{% block app_photo_widget %}
{% apply spaceless %}
<div id="user-webcam-photo">
<p><a href="#" id="do-file-photo">Загрузить файл с фотографией</a></p>

<div id="camera">
<div class="placeholder">
Ваш браузер не поддерживает доступ к веб-камере.<br>
Мы рекомендуем
<a href="https://www.google.com/chrome/" target="_blank">Chrome</a>
&mdash; современный, безопасный, быстрый браузер от Google.<br>
Это бесплатно.
</div>
<div id="user-webcam-photo">
<p><a href="#" id="do-file-photo">Загрузить файл с фотографией</a></p>

<div id="camera">
<div class="placeholder">
Ваш браузер не поддерживает доступ к веб-камере.<br>
Мы рекомендуем
<a href="https://www.google.com/chrome/" target="_blank">Chrome</a>
&mdash; современный, безопасный, быстрый браузер от Google.<br>
Это бесплатно.
</div>
<br>
</div>
<br>

<button id="take_snapshots">Сфотографировать</button>
<button id="show_stream">Показать изображение с камеры</button>
<br>
<button id="take_snapshots">Сфотографировать</button>
<button id="show_stream">Показать изображение с камеры</button>
<br>

<div id="snapshots_container">
<p>Выберите фотографию:</p>
<div id="snapshots"></div>
</div>
<div id="snapshots_container">
<p>Выберите фотографию:</p>
<div id="snapshots"></div>
</div>
</div>

<div id="user-file-photo">
<p><a href="#" id="do-webcam-photo">Сделать фотографию на веб-камеру</a></p>
<div id="user-file-photo">
<p><a href="#" id="do-webcam-photo">Сделать фотографию на веб-камеру</a></p>

<div class="vich-image">
{% if form.delete is defined %}
{{ form_row(form.delete) }}
{% endif %}
<div class="vich-image">
{% if form.delete is defined %}
{{ form_row(form.delete) }}
{% endif %}

{% if download_uri %}
<p><img src="{{ download_uri }}" alt="" style="max-height: 300px; max-width: 250px;"/></p>
{% endif %}
{% if download_uri %}
<p><img src="{{ download_uri }}" alt="" style="max-height: 300px; max-width: 250px;"/></p>
{% endif %}

{% if download_uri %}
<a href="{{ download_uri }}">{{ 'download'|trans({}, 'VichUploaderBundle') }}</a>
{% endif %}
</div>
{% if download_uri %}
<a href="{{ download_uri }}">{{ 'download'|trans({}, 'VichUploaderBundle') }}</a>
{% endif %}
</div>
</div>

{{ form_widget(form.file) }}
{% endapply %}
{{ form_widget(form.file) }}
{% endblock %}

{% block app_document_file_widget %}
{% apply spaceless %}
<div id="user-file-photo">
<div class="vich-image">
{% if form.delete is defined %}
{{ form_row(form.delete) }}
{% endif %}

{% if download_uri %}
<p><a href="{{ download_uri }}" data-lightbox="download_uri" ><img width="100px" src="{{ download_uri }}" alt="" style="max-height: 300px; max-width: 250px;"/></a></p>
{% endif %}

{% if download_uri %}
<a download href="{{ download_uri }}">{{ 'download'|trans({}, 'VichUploaderBundle') }}</a>
{% endif %}
</div>
<div id="user-file-photo">
<div class="vich-image">
{% if form.delete is defined %}
{{ form_row(form.delete) }}
{% endif %}

{% if download_uri %}
<p><a href="{{ download_uri }}" data-lightbox="download_uri" ><img width="100px" src="{{ download_uri }}" alt="" style="max-height: 300px; max-width: 250px;"/></a></p>
{% endif %}

{% if download_uri %}
<a download href="{{ download_uri }}">{{ 'download'|trans({}, 'VichUploaderBundle') }}</a>
{% endif %}
</div>
</div>

{{ form_widget(form.file) }}
{% endapply %}
{{ form_widget(form.file) }}
{% endblock %}

{% block app_contract_duration_widget %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '/pdf/certificate/layout.html.twig' %}

{% block header_left %}
Направление № <u>{{ certificate.id }}</u>{% if certificate.dateFrom %} от {{ certificate.dateFrom|format_date('none', '<u>«d»</u> <u>MMMM</u> <u>Y</u>') }} года{% endif %} в
Направление № <u>{{ certificate.id }}</u>{% if certificate.dateFrom %} от {{ certificate.dateFrom|format_date(pattern: '<u>«d»</u> <u>MMMM</u> <u>Y</u>') }} года{% endif %} в
{{ employment_name }} {{ employment_address }}
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions shared/homeless/templates/pdf/certificate/help.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% block header_right %}
{% if certificate.client %}
{{ certificate.client.fullname }},<br/>
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.yyyy') }}
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date(pattern: 'dd.MM.yyyy') }}
<br/>{% endif %}
получает социальную помощь в {{ org_description_short }}.
{% endif %}
Expand All @@ -19,7 +19,7 @@
Благодарим за содействие!<br/><br/>

{% if certificate.dateFrom %}
Дата выдачи: {{ certificate.dateFrom|format_date('none', 'dd.MM.yyyy') }}<br/>
Дата выдачи: {{ certificate.dateFrom|format_date(pattern: 'dd.MM.yyyy') }}<br/>
Справка действительна в течение 90 дней.
{% endif %}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion shared/homeless/templates/pdf/certificate/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
{% if certificate.createdBy %}<span class="underline">{{ certificate.createdBy.fullname }}</span> {% endif %}

{% if certificate.type and certificate.type.showDate and certificate.dateFrom %}
<br/><span class="underline">«{{ certificate.dateFrom|format_date('none', 'd') }}»</span> <span class="underline">{{ certificate.dateFrom|format_date('none', 'MMMM') }}</span> {{ certificate.dateFrom|format_date('none', 'Y') }} года
<br/><span class="underline">«{{ certificate.dateFrom|format_date(pattern: 'd') }}»</span> <span class="underline">{{ certificate.dateFrom|format_date(pattern: 'MMMM') }}</span> {{ certificate.dateFrom|format_date(pattern: 'Y') }} года
{% endif %}
{% endif %}
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% if certificate.client %}
{{ certificate.client.fullname }},<br/>
регистрационный номер клиента в базе данных: № {{ certificate.client.id }}<br/>
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.yyyy') }}
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date(pattern: 'dd.MM.yyyy') }}
<br/>{% endif %}
{% if certificate.client.birthPlace %}Место рождения: {{ certificate.client.birthPlace }}{% endif %}
{% endif %}
Expand All @@ -23,15 +23,15 @@
{% endif %}

{% if certificate.client and certificate.client.createdAt %}
Дата регистрации: {{ certificate.client.createdAt|format_date('none', 'dd.MM.yyyy') }}<br/>
Дата регистрации: {{ certificate.client.createdAt|format_date(pattern: 'dd.MM.yyyy') }}<br/>
{% endif %}

{% if certificate.dateFrom %}
Дата выдачи справки: {{ certificate.dateFrom|format_date('none', 'dd.MM.yyyy') }}<br/>
Дата выдачи справки: {{ certificate.dateFrom|format_date(pattern: 'dd.MM.yyyy') }}<br/>
{% endif %}

{% if certificate.dateTo %}
Справка действует до: {{ certificate.dateTo|format_date('none', 'dd.MM.yyyy') }}<br/>
Справка действует до: {{ certificate.dateTo|format_date(pattern: 'dd.MM.yyyy') }}<br/>
{% endif %}
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions shared/homeless/templates/pdf/certificate/travel.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% block header_right %}
{% if certificate.client %}
{{ certificate.client.fullname }},<br/>
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date('none', 'dd.MM.yyyy') }}
{% if certificate.client.birthDate %}Дата рождения: {{ certificate.client.birthDate|format_date(pattern: 'dd.MM.yyyy') }}
<br/>{% endif %}
получает социальную помощь в {{ org_description_short }}.
{% endif %}
Expand All @@ -20,7 +20,7 @@
Благодарим за содействие!<br/><br/>

{% if certificate.dateFrom %}
Дата выдачи: {{ certificate.dateFrom|format_date('none', 'dd.MM.yyyy') }}<br/>
Дата выдачи: {{ certificate.dateFrom|format_date(pattern: 'dd.MM.yyyy') }}<br/>
Справка действительна в течение 30 дней.
{% endif %}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion shared/homeless/templates/pdf/generated_document.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<td>
<p>
{% if document.number %}Исх. {{ document.number }}{% endif %}
{% if document.createdAt %}<br/>От {{ document.createdAt|format_date('none', 'dd.MM.yyyy') }}{% endif %}
{% if document.createdAt %}<br/>От {{ document.createdAt|format_date(pattern: 'dd.MM.yyyy') }}{% endif %}
{% if document.whom %}<br/>{{ document.whom }}{% endif %}
</p>
</td>
Expand Down
Loading

0 comments on commit 708b58b

Please sign in to comment.