Blockier templates table structure
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
{% extends "@blockier-templates/tables/users.html.twig" %}
|
||||
{% extends "tables/users.html.twig" %}
|
||||
|
||||
{% use 'tables/partials/organisation-members/column-status.html.twig' %}
|
||||
{% use 'tables/partials/organisation-members/column-actions.html.twig' %}
|
||||
|
||||
{% block table %}
|
||||
<table id="{{table.id}}" class="tablesorter table table-bordered table-hover table-striped" data-sortlist="{{table.sortlist}}">
|
||||
@@ -18,105 +21,4 @@
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block table_cell_template_status %}
|
||||
<script id="{{table.id}}-column-status" type="text/x-handlebars-template">
|
||||
{%- verbatim %}
|
||||
<td
|
||||
{{#ifx row.membership_approved '==' 0 }}
|
||||
data-text="pending"
|
||||
{{ else }}
|
||||
data-text="accepted"
|
||||
{{/ifx }}
|
||||
>
|
||||
{{#ifx row.membership_approved '==' 0 }}
|
||||
<span class="text-yellow">{% endverbatim %}{{translate("PENDING")}}{% verbatim %}</span>
|
||||
{{ else }}
|
||||
<span>{% endverbatim %}{{translate("ACCEPTED")}}{% verbatim %}</span>
|
||||
{{#ifx row.organisation_admin '==' 1 }}<span class="text-secondary">({% endverbatim %}{{translate("ADMIN")}}{% verbatim %})</span>{{/ifx}}
|
||||
{{/ifx }}
|
||||
</td>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block table_cell_template_actions %}
|
||||
{% if checkAccess('update_organisation_field', { 'organisation': organisation, 'fields': [ 'members' ] }) or isOrganisationAdmin(organisation) %}
|
||||
<script id="{{table.id}}-column-actions" type="text/x-handlebars-template">
|
||||
{%- verbatim %}
|
||||
<td class="uf-table-fit-width">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">{% endverbatim %}{{translate("ACTIONS")}}{% verbatim %}<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu dropdown-menu-right-responsive" role="menu">
|
||||
{{#ifx row.membership_approved '!=' 1 }}
|
||||
<li>
|
||||
<a href="#" data-slug="{% endverbatim %}{{organisation.slug}}{% verbatim %}" data-user_name="{{row.user_name}}" class="js-member-accept">
|
||||
<i class="fas fa-thumbs-up"></i> {% endverbatim %}{{translate("ORGANISATION.JOIN_REQUEST.ACCEPT")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-slug="{% endverbatim %}{{organisation.slug}}{% verbatim %}" data-user_name="{{row.user_name}}" class="js-member-reject">
|
||||
<i class="fas fa-thumbs-down"></i> {% endverbatim %}{{translate("ORGANISATION.JOIN_REQUEST.REJECT")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{{ else }}
|
||||
{{#ifx row.organisation_admin '==' 1 }}
|
||||
<li>
|
||||
<a href="#" data-slug="{% endverbatim %}{{organisation.slug}}{% verbatim %}" data-user_name="{{row.user_name}}" class="js-member-demote">
|
||||
<i class="fas fa-angle-double-down"></i> {% endverbatim %}{{translate("MEMBER.DEMOTE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="#" data-slug="{% endverbatim %}{{organisation.slug}}{% verbatim %}" data-user_name="{{row.user_name}}" class="js-member-promote">
|
||||
<i class="fas fa-angle-double-up"></i> {% endverbatim %}{{translate("MEMBER.PROMOTE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{{/ifx}}
|
||||
<li>
|
||||
<a href="#" data-slug="{% endverbatim %}{{organisation.slug}}{% verbatim %}" data-user_name="{{row.user_name}}" class="js-user-edit">
|
||||
<i class="fas fa-edit"></i> {% endverbatim %}{{translate("MEMBER.EDIT")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-slug="{% endverbatim %}{{organisation.slug}}{% verbatim %}" data-user_name="{{row.user_name}}" class="js-user-password">
|
||||
<i class="fas fa-key"></i> {% endverbatim %}{{translate("MEMBER.CHANGE_PASSWORD")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-slug="{% endverbatim %}{{organisation.slug}}{% verbatim %}" data-user_name="{{row.user_name}}" class="js-member-remove">
|
||||
<i class="fas fa-door-open"></i> {% endverbatim %}{{translate("MEMBER.REMOVE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{{/ifx}}
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block table_cell_template_extra %}
|
||||
{% block table_cell_template_organisations %}
|
||||
<script id="{{table.id}}-column-organisations" type="text/x-handlebars-template">
|
||||
{%- verbatim %}
|
||||
<td style="line-height: 2em;">
|
||||
{{#if row.organisations.length }}
|
||||
{{#each row.organisations }}
|
||||
<a href="{% endverbatim %}{{site.uri.public}}{% verbatim %}/organisations/o/{{this.slug}}" class="label bg-primary {{#ifx this.flag_approved '!=' 1 }}organisation-pending{{/ifx}} {{#if this.pivot.flag_admin }}organisation-admin{{/if}}" title="{{this.description}}" data-text="{{this.name}}" style="font-size: 100%;">{{this.name}}</a><br>
|
||||
{{/each}}
|
||||
{{/if }}
|
||||
{{#if row.pending_organisations.length }}
|
||||
{{#each row.pending_organisations }}
|
||||
<a href="{% endverbatim %}{{site.uri.public}}{% verbatim %}/organisations/o/{{this.slug}}" class="label bg-primary {{#ifx this.flag_approved '!=' 1 }}organisation-pending{{/ifx}} {{#if this.pivot.flag_admin }}organisation-admin{{/if}} membership-pending" title="{{this.description}}" data-text="{{this.name}}" style="font-size: 100%;">{{this.name}}</a><br>
|
||||
{{/each}}
|
||||
{{/if }}
|
||||
</td>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user