Feature: [calendar doc] re-introduce button to edit document title and remove document

This commit is contained in:
Julien Fastré 2023-04-03 21:30:50 +02:00
parent 4cf6721e35
commit 907c724047
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
5 changed files with 35 additions and 28 deletions

View File

@ -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',
]);
}

View File

@ -20,15 +20,24 @@
<div class="row">
<div class="col text-start">
{{ d.storedObject.title }}
{% if d.dateTimeVersion < d.calendar.dateTimeVersion %}
</div>
{% if d.dateTimeVersion < d.calendar.dateTimeVersion %}
<div class="col text-start">
<span class="badge bg-danger">{{ 'chill_calendar.Document outdated'|trans }}</span>
{% endif %}
</div>
<div class="col-md-auto text-center">
{{ mm.mimeIcon(d.storedObject.type) }}
</div>
{% endif %}
<div class="col col-lg-4 text-end">
{{ d.storedObject|chill_document_button_group(d.storedObject.title, is_granted('CHILL_CALENDAR_DOC_EDIT', d), {'small': true}) }}
<ul class="record_actions">
<li>
{{ d.storedObject|chill_document_button_group(d.storedObject.title, is_granted('CHILL_CALENDAR_DOC_EDIT', d), {'small': true}) }}
</li>
<li>
<a href="{{ chill_path_add_return_path('chill_calendar_calendardoc_edit', {id: d.id}) }}" class="btn btn-sm btn-edit"></a>
</li>
<li>
<a href="{{ chill_path_add_return_path('chill_calendar_calendardoc_delete', {id: d.id}) }}" class="btn btn-sm btn-delete"></a>
</li>
</ul>
</div>
</div>
</li>

View File

@ -103,6 +103,13 @@
</div>
{% endif %}
<div class="item-row separator column">
<div>
{{ include('@ChillCalendar/Calendar/_documents.twig.html') }}
</div>
</div>
{% if calendar.activity is not null %}
<div class="item-row separator">
<div class="item-col">
@ -121,16 +128,19 @@
</span>
</h2>
<ul class="record_actions">
<li class="cancel">
{{ 'Created by'|trans }} {{ calendar.activity.createdBy|chill_entity_render_string }}, {{ 'on'|trans }} {{ calendar.activity.createdAt|format_datetime('short', 'short') }}
<ul class="record_actions">
<li class="cancel">
<span class="createdBy">
{{ 'Created by'|trans }}
<b>{{ calendar.activity.createdBy|chill_entity_render_string }}</b>, {{ 'on'|trans }} {{ calendar.activity.createdAt|format_datetime('short', 'short') }}
</span>
</li>
{% if is_granted('CHILL_ACTIVITY_SEE', calendar.activity) %}
<li>
<a href="{{ chill_path_add_return_path('chill_activity_activity_show', {'id': calendar.activity.id}) }}" class="btn btn-sm btn-show" ></a>
</li>
{% if is_granted('CHILL_ACTIVITY_SEE', calendar.activity) %}
<li>
<a href="{{ chill_path_add_return_path('chill_activity_activity_show', {'id': calendar.activity.id}) }}" class="btn btn-sm btn-show" ></a>
</li>
{% endif %}
</ul>
{% endif %}
</ul>
</div>
</div>
@ -139,14 +149,7 @@
</div>
{% endif %}
<div class="item-row separator column">
<div>
{{ include('@ChillCalendar/Calendar/_documents.twig.html') }}
</div>
</div>
<div class="item-row">
<div class="item-row separator">
<ul class="record_actions">
{% if is_granted('CHILL_CALENDAR_CALENDAR_SEE', calendar) %}
{% if templates|length == 0 %}

View File

@ -24,7 +24,6 @@
{{ form_start(form) }}
{{ form_row(form.title) }}
{{ form_row(form.doc) }}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">

View File

@ -23,7 +23,6 @@
{{ form_start(form) }}
{{ form_row(form.title) }}
{{ form_row(form.doc) }}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">