mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
list.html.twig template added and adapted to display list of aside activities, still need to adapt to show only activities of logged in user
This commit is contained in:
parent
fb43980a2a
commit
a1ed0d3ce4
@ -80,7 +80,7 @@ final class ChillAsideActivityExtension extends Extension implements PrependExte
|
||||
'controller' => \Chill\AsideActivityBundle\Controller\AsideActivityController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'template' => '@ChillAsideActivity/asideActivity/index.html.twig',
|
||||
'template' => '@ChillAsideActivity/asideActivity/list.html.twig',
|
||||
'role' => 'ROLE_USER'
|
||||
],
|
||||
'new' => [
|
||||
|
@ -6,7 +6,7 @@
|
||||
<table class="records_list table table-bordered border-dark">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'Name'|trans }}</th>
|
||||
{# <th>{{ 'Name'|trans }}</th> #}
|
||||
<th>{{ 'Active'|trans }}</th>
|
||||
<th>{{ 'Actions'|trans }}</th>
|
||||
</tr>
|
||||
@ -14,7 +14,7 @@
|
||||
<tbody>
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.name|localize_translatable_string }}</td>
|
||||
{# <td>{{ entity.name|localize_translatable_string }}</td> #}
|
||||
<td style="text-align:center;">
|
||||
{%- if entity.active -%}
|
||||
<i class="fa fa-check-square-o"></i>
|
||||
|
@ -0,0 +1,79 @@
|
||||
{# {% set person_id = null %}
|
||||
{% if person %}
|
||||
{% set person_id = person.id %}
|
||||
{% endif %} #}
|
||||
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
|
||||
|
||||
{% block admin_content %}
|
||||
<h2>{{ 'Activity list' |trans }}</h2>
|
||||
|
||||
{% if entities|length == 0 %}
|
||||
<p class="chill-no-data-statement">
|
||||
{{ "There isn't any activities."|trans }}
|
||||
<a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create button-small"></a>
|
||||
</p>
|
||||
{% else %}
|
||||
|
||||
<div class="flex-table list-records">
|
||||
|
||||
{% for entity in entities %}
|
||||
{% set t = entity.type %}
|
||||
<div class="item-bloc">
|
||||
<div class="item-row main">
|
||||
<div class="item-col">
|
||||
|
||||
{% if entity.date %}
|
||||
<h3>{{ entity.date|format_date('long') }}</h3>
|
||||
{% endif %}
|
||||
|
||||
<div class="duration">
|
||||
<p>
|
||||
<i class="fa fa-fw fa-hourglass-end"></i>
|
||||
{{ entity.duration|date('H:i') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<ul class="list-content">
|
||||
{% if entity.createdBy %}
|
||||
<li>
|
||||
<b>{{ 'by'|trans }}{{ entity.createdBy.usernameCanonical }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
<li>
|
||||
<b>{{ entity.type.title | localize_translatable_string }}</b>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{%
|
||||
if entity.note is not empty
|
||||
or entity.createdBy|length > 0
|
||||
%}
|
||||
<div class="item-row details">
|
||||
{% if entity.note is not empty %}
|
||||
<div class="item-col comment">
|
||||
{{ entity.note|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# TODO set this condition in configuration #}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_crud_aside_activity_new') }}" class="btn btn-create">
|
||||
{{ 'Add a new activity' | trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user