From 907c7240471cde457361546d234f4f7ea333719b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 3 Apr 2023 21:30:50 +0200 Subject: [PATCH] Feature: [calendar doc] re-introduce button to edit document title and remove document --- .../Form/CalendarDocEditType.php | 3 -- .../views/Calendar/_documents.twig.html | 21 ++++++++--- .../Resources/views/Calendar/_list.html.twig | 37 ++++++++++--------- .../edit_accompanying_period.html.twig | 1 - .../views/CalendarDoc/edit_person.html.twig | 1 - 5 files changed, 35 insertions(+), 28 deletions(-) diff --git a/src/Bundle/ChillCalendarBundle/Form/CalendarDocEditType.php b/src/Bundle/ChillCalendarBundle/Form/CalendarDocEditType.php index 26a9d59e2..34a501028 100644 --- a/src/Bundle/ChillCalendarBundle/Form/CalendarDocEditType.php +++ b/src/Bundle/ChillCalendarBundle/Form/CalendarDocEditType.php @@ -26,9 +26,6 @@ class CalendarDocEditType extends AbstractType ->add('title', TextType::class, [ 'label' => 'chill_calendar.Document title', 'required' => true, - ]) - ->add('doc', StoredObjectType::class, [ - 'label' => 'chill_calendar.Document object', ]); } diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html index 09824b5cc..c295d31a1 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html @@ -20,15 +20,24 @@
{{ d.storedObject.title }} - {% if d.dateTimeVersion < d.calendar.dateTimeVersion %} +
+ {% if d.dateTimeVersion < d.calendar.dateTimeVersion %} +
{{ 'chill_calendar.Document outdated'|trans }} - {% endif %} -
-
- {{ mm.mimeIcon(d.storedObject.type) }}
+ {% endif %}
- {{ d.storedObject|chill_document_button_group(d.storedObject.title, is_granted('CHILL_CALENDAR_DOC_EDIT', d), {'small': true}) }} +
    +
  • + {{ d.storedObject|chill_document_button_group(d.storedObject.title, is_granted('CHILL_CALENDAR_DOC_EDIT', d), {'small': true}) }} +
  • +
  • + +
  • +
  • + +
  • +
diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig index c09be27b7..2c3cde01a 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig @@ -103,6 +103,13 @@ {% endif %} +
+
+ + {{ include('@ChillCalendar/Calendar/_documents.twig.html') }} +
+
+ {% if calendar.activity is not null %}
@@ -121,16 +128,19 @@ -
    -
  • - {{ 'Created by'|trans }} {{ calendar.activity.createdBy|chill_entity_render_string }}, {{ 'on'|trans }} {{ calendar.activity.createdAt|format_datetime('short', 'short') }} +
      +
    • + + {{ 'Created by'|trans }} + {{ calendar.activity.createdBy|chill_entity_render_string }}, {{ 'on'|trans }} {{ calendar.activity.createdAt|format_datetime('short', 'short') }} + +
    • + {% if is_granted('CHILL_ACTIVITY_SEE', calendar.activity) %} +
    • +
    • - {% if is_granted('CHILL_ACTIVITY_SEE', calendar.activity) %} -
    • - -
    • - {% endif %} -
    + {% endif %} +
@@ -139,14 +149,7 @@ {% endif %} -
-
- - {{ include('@ChillCalendar/Calendar/_documents.twig.html') }} -
-
- -
+
    {% if is_granted('CHILL_CALENDAR_CALENDAR_SEE', calendar) %} {% if templates|length == 0 %} diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/edit_accompanying_period.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/edit_accompanying_period.html.twig index 9941b000a..545db7100 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/edit_accompanying_period.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/edit_accompanying_period.html.twig @@ -24,7 +24,6 @@ {{ form_start(form) }} {{ form_row(form.title) }} - {{ form_row(form.doc) }}
    • diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/edit_person.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/edit_person.html.twig index 8ed218d29..b6d26ea69 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/edit_person.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/CalendarDoc/edit_person.html.twig @@ -23,7 +23,6 @@ {{ form_start(form) }} {{ form_row(form.title) }} - {{ form_row(form.doc) }}