Broke out the table column templates into individual template files
This commit is contained in:
44
templates/tables/activities.html.twig
Normal file
44
templates/tables/activities.html.twig
Normal file
@@ -0,0 +1,44 @@
|
||||
{# This partial template renders a table of user activities, to be populated with rows via an AJAX request.
|
||||
# This extends a generic template for paginated tables.
|
||||
#
|
||||
# Note that this template contains a "skeleton" table with an empty table body, and then a block of Handlebars templates which are used
|
||||
# to render the table cells with the data from the AJAX request.
|
||||
#}
|
||||
|
||||
{% extends "tables/table-paginated.html.twig" %}
|
||||
|
||||
{% block table %}
|
||||
<table id="{{table.id}}" class="tablesorter table table-bordered table-hover table-striped" data-sortlist="[[0, 1]]">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sorter-metanum" data-column-name="occurred_at" data-column-template="#{{table.id}}-column-occurred-at" data-priority="1">{{translate('ACTIVITY.TIME')}} <i class="fas fa-sort"></i></th>
|
||||
{% if 'user' in table.columns %}
|
||||
<th class="sorter-metatext" data-column-name="user" data-column-template="#{{table.id}}-column-user" data-priority="1">{{translate('USER')}} <i class="fas fa-sort"></i></th>
|
||||
{% endif %}
|
||||
<th class="sorter-metatext" data-column-name="description" data-column-template="#{{table.id}}-column-description" data-priority="1">{{translate("DESCRIPTION")}} <i class="fas fa-sort"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
{% block table_cell_templates %}
|
||||
{# This contains a series of <script> blocks, each of which is a client-side Handlebars template.
|
||||
# Note that these are NOT Twig templates, although the syntax is similar. We wrap them in the `verbatim` tag,
|
||||
# so that Twig will output them directly into the DOM instead of trying to treat them like Twig templates.
|
||||
#
|
||||
# These templates require handlebars-helpers.js, moment.js
|
||||
#}
|
||||
{% block table_activities_column_occurred_at %}
|
||||
{% include "tables/columns/activities-occurred_at.html.twig" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block table_activities_column_user %}
|
||||
{% include "tables/columns/activities-user.html.twig" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block table_activities_column_description %}
|
||||
{% include "tables/columns/activities-description.html.twig" %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user