fix admin form for news item

This commit is contained in:
Julie Lenaerts 2023-11-08 14:00:53 +01:00
parent f4c08ee0d7
commit 6cd6cb1000
2 changed files with 10 additions and 4 deletions

View File

@ -29,17 +29,19 @@ class NewsItemType extends AbstractType
'required' => true,
])
->add('content', ChillTextareaType::class, [
'required' => true,
'required' => false,
])
->add(
'startDate',
ChillDateType::class,
[
'required' => true,
'input' => 'datetime_immutable'
]
)
->add('endDate', ChillDateType::class, [
'required' => false,
'input' => 'datetime_immutable'
]);
}

View File

@ -11,12 +11,16 @@
{% for entity in entities %}
<tr>
<td>{{ entity.title }}</td>
<td>{{ entity.startDate }}</td>
<td>{{ entity.endDate }}</td>
<td>{{ entity.startDate|date }}</td>
{% if entity.endDate is not null %}
<td>{{ entity.endDate|date }}</td>
{% else %}
<td>Pas de date de fin</td>
{% endif %}
<td>
<ul class="record_actions">
<li>
<a href="{{ path('chill_crud_main_news_item_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
<a href="{{ path('chill_crud_news_item_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
</li>
</ul>
</td>