Files
sprinkle-organisations/templates/tables/organisations.html.twig

59 lines
3.6 KiB
Twig

{# This partial template renders a table of organisations, 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" %}
{% use 'tables/partials/organisations/column-info.html.twig' %}
{% use 'tables/partials/organisations/column-description.html.twig' %}
{% use 'tables/partials/organisations/column-status.html.twig' %}
{% use 'tables/partials/organisations/column-member_count.html.twig' %}
{% use 'tables/partials/organisations/column-admin_count.html.twig' %}
{% use 'tables/partials/organisations/column-join.html.twig' %}
{% use 'tables/partials/organisations/column-actions.html.twig' %}
{% block table %}
<table id="{{table.id}}" class="tablesorter table table-bordered table-hover table-striped" data-sortlist="{{table.sortlist}}">
<thead>
<tr>
<th class="sorter-metatext" data-column-name="name" data-column-template="#{{table.id}}-column-info" data-priority="1">{{translate('ORGANISATION')}} <i class="fas fa-sort"></i></th>
{% if 'description' not in table.hidden_columns %}
<th class="sorter-metatext" data-column-name="description" data-column-template="#{{table.id}}-column-description" data-priority="2">{{translate("DESCRIPTION")}} <i class="fas fa-sort"></i></th>
{% endif %}
{% if hasRole('site-admin') or hasRole('organisations-admin') or (current_user.adminForOrganisations.count > 0) -%}
<th class="filter-select filter-metatext" data-column-name="status" data-column-template="#{{table.id}}-column-status" data-priority="2">{{translate("STATUS")}} <i class="fas fa-sort"></i></th>
{% endif -%}
{% if checkAccess('view_organisation_members') -%}
<th class="sorter-metanum" data-column-name="member_count" data-column-template="#{{table.id}}-column-member_count" data-priority="2" style="min-width: 180px">{{translate("ORGANISATION.MEMBER_COUNT")}} <i class="fas fa-sort"></i></th>
<th class="sorter-metanum" data-column-name="admin_count" data-column-template="#{{table.id}}-column-admin_count" data-priority="2">{{translate("ORGANISATION.ADMIN_COUNT")}} <i class="fas fa-sort"></i></th>
{% endif -%}
{% if 'join' in table.columns %}
<th data-column-template="#{{table.id}}-column-join" data-column-name="join" data-sorter="false" data-filter="false" data-priority="3">{{translate("JOIN")}}/{{translate("LEAVE")}}</th>
{% endif %}
{% if 'actions' in table.columns %}
{% if hasRole('site-admin') or hasRole('organisations-admin') or (current_user.adminForOrganisations.count > 0) -%}
<th data-column-template="#{{table.id}}-column-actions" data-sorter="false" data-filter="false" data-priority="1">{{translate("ACTIONS")}}</th>
{% endif -%}
{% endif %}
</tr>
</thead>
<tbody>
</tbody>
</table>
{% endblock %}
{% block table_cell_templates %}
{{ block('table_cell_template_info') }}
{{ block('table_cell_template_description') }}
{{ block('table_cell_template_status') }}
{{ block('table_cell_template_member_count') }}
{{ block('table_cell_template_admin_count') }}
{{ block('table_cell_template_join') }}
{{ block('table_cell_template_actions') }}
{% endblock %}