Change table template hierarchy structure
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<script id="{{table.id}}-column-actions" type="text/x-handlebars-template">
|
||||
{% verbatim %}
|
||||
<td>
|
||||
<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" role="menu">
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-organisation-restore">
|
||||
<i class="fas fa-trash-restore"></i> {% endverbatim %}{{translate("ORGANISATION.RESTORE_DELETED")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-organisation-permenentDelete">
|
||||
<i class="fas fa-trash-alt"></i> {% endverbatim %}{{translate("ORGANISATION.PERMENENT_DELETE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<script id="{{table.id}}-column-info" type="text/x-handlebars-template">
|
||||
{% verbatim %}
|
||||
<td data-text="{{row.name}}">
|
||||
<strong>
|
||||
<a href="{{site.uri.public}}/organisations/o/{{row.slug}}">{{row.name}}</a>
|
||||
</strong>
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
@@ -0,0 +1,54 @@
|
||||
<script id="{{table.id}}-column-actions" type="text/x-handlebars-template">
|
||||
{% if checkAccess('update_organisation_field', { 'organisation': organisation, 'fields': [ 'members' ] }) or isOrganisationAdmin(organisation) %}
|
||||
{% 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 %}
|
||||
{% endif %}
|
||||
</script>
|
||||
19
templates/tables/columns/organisation_members-info.html.twig
Normal file
19
templates/tables/columns/organisation_members-info.html.twig
Normal file
@@ -0,0 +1,19 @@
|
||||
<script id="{{table.id}}-column-info" type="text/x-handlebars-template">
|
||||
{% verbatim %}
|
||||
<td data-text="{{row.last_name}}">
|
||||
<strong>
|
||||
{% endverbatim -%}{% if isOrganisationAdmin(organisation) %}{%- verbatim %}
|
||||
<a href="{{site.uri.public}}/users/u/{{row.user_name}}">{{row.first_name}} {{row.last_name}} ({{row.user_name}})</a>
|
||||
{% endverbatim -%}{% elseif checkAccess('uri_user') %}{%- verbatim %}
|
||||
<a href="{{site.uri.public}}/users/u/{{row.user_name}}">{{row.first_name}} {{row.last_name}} ({{row.user_name}})</a>
|
||||
{% endverbatim -%}{% else %}{%- verbatim %}
|
||||
{{row.first_name}} {{row.last_name}} ({{row.user_name}})
|
||||
{% endverbatim -%}{% endif %}{%- verbatim %}
|
||||
</strong>
|
||||
<div class="js-copy-container">
|
||||
<span class="js-copy-target">{{row.email}}</span>
|
||||
<button class="btn btn-xs uf-copy-trigger js-copy-trigger"><i class="fas fa-copy"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
@@ -0,0 +1,18 @@
|
||||
<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>
|
||||
74
templates/tables/columns/organisations-actions.html.twig
Normal file
74
templates/tables/columns/organisations-actions.html.twig
Normal file
@@ -0,0 +1,74 @@
|
||||
<script id="{{table.id}}-column-actions" type="text/x-handlebars-template">
|
||||
{% if 'actions' in table.columns %}
|
||||
<td>
|
||||
{% if not hasRole('organisation-admin') %}
|
||||
{% verbatim %}{{#ifx row.is_admin '==' 1 }}{% endverbatim %}
|
||||
{% endif %}
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||
{{translate("ACTIONS")}}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right" role="menu">
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-edit">
|
||||
<i class="fas fa-edit"></i>
|
||||
{{translate("ORGANISATION.EDIT")}}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% if checkAccess('merge_organisations') %}
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-merge">
|
||||
<i class="fas fa-object-group"></i>
|
||||
{{translate("ORGANISATION.MERGE")}}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if checkAccess('approve_organisation') %}
|
||||
{% verbatim %}{{#ifx row.flag_approved '==' 0 }}{% endverbatim %}
|
||||
|
||||
{% verbatim %}{{#ifx row.registrant_id '==' {% endverbatim %}{{current_user.id}}{% verbatim %} }}{% endverbatim %}
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-cancelRegistration">
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
{{translate("ORGANISATION.REGISTRATION.CANCEL")}}
|
||||
</a>
|
||||
</li>
|
||||
{% verbatim %}{{/ifx}}{% endverbatim %}
|
||||
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-approveRegistration">
|
||||
<i class="fas fa-thumbs-up"></i> {{translate("ORGANISATION.REGISTRATION.APPROVE")}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-denyRegistration">
|
||||
<i class="fas fa-thumbs-down"></i>
|
||||
{{translate("ORGANISATION.REGISTRATION.DENY")}}
|
||||
</a>
|
||||
</li>
|
||||
{% verbatim %}{{/ifx}}{% endverbatim %}
|
||||
{% endif %}
|
||||
|
||||
{% if checkAccess('delete_organisation') %}
|
||||
{% verbatim %}{{#ifx row.flag_approved '==' 1 }}{% endverbatim %}
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-delete">
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
{{translate("ORGANISATION.DELETE")}}
|
||||
</a>
|
||||
</li>
|
||||
{% verbatim %}{{/ifx }}{% endverbatim %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if not hasRole('organisation-admin') %}
|
||||
{% verbatim %}{{/ifx}}{% endverbatim %}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<script id="{{table.id}}-column-adminCount" type="text/x-handlebars-template">
|
||||
{% if checkAccess('view_organisation_members') %}
|
||||
{% verbatim %}
|
||||
<td>
|
||||
{{row.admin_count}}
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
{% endif %}
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
{% include "@uf-tweaks/tables/columns/abstract/description.html.twig" %}
|
||||
17
templates/tables/columns/organisations-info.html.twig
Normal file
17
templates/tables/columns/organisations-info.html.twig
Normal file
@@ -0,0 +1,17 @@
|
||||
<script id="{{table.id}}-column-info" type="text/x-handlebars-template">
|
||||
{% verbatim %}
|
||||
<td data-text="{{row.name}}">
|
||||
<strong>
|
||||
{{#ifx row.is_member '==' 1 }}
|
||||
<a href="{{site.uri.public}}/organisations/o/{{row.slug}}">{{row.name}}</a>
|
||||
{{ else }}
|
||||
{% endverbatim %}{% if checkAccess('uri_organisation') %}{% verbatim %}
|
||||
<a href="{{site.uri.public}}/organisations/o/{{row.slug}}">{{row.name}}</a>
|
||||
{% endverbatim %}{% else %}{% verbatim %}
|
||||
{{row.name}}
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
{{/ifx }}
|
||||
</strong>
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
27
templates/tables/columns/organisations-join.html.twig
Normal file
27
templates/tables/columns/organisations-join.html.twig
Normal file
@@ -0,0 +1,27 @@
|
||||
<script id="{{table.id}}-column-join" type="text/x-handlebars-template">
|
||||
{% if 'join' in table.columns %}
|
||||
{% verbatim %}
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
{{#ifx row.is_pending '==' 1 }}
|
||||
<button type="button" data-slug="{{row.slug}}" class="btn btn-danger js-organisation-cancelJoin" style="min-width: 70px">
|
||||
{% endverbatim %}{{translate("CANCEL")}}{% verbatim %}
|
||||
</button>
|
||||
{{ else }}
|
||||
{{#ifx row.is_member '==' 1 }}
|
||||
<button type="button" data-slug="{{row.slug}}" class="btn btn-danger js-organisation-leave" style="min-width: 70px">
|
||||
{% endverbatim %}{{translate("LEAVE")}}{% verbatim %}
|
||||
</button>
|
||||
{{ else }}
|
||||
{% endverbatim %}{% if (organisationConfig.membership.single_membership == 0) or ((current_user.organisations.count == 0) and (current_user.pendingOrganisations.count == 0)) %}{% verbatim %}
|
||||
<button type="button" data-slug="{{row.slug}}" class="btn btn-success js-organisation-join" style="min-width: 70px">
|
||||
{% endverbatim %}{{translate("JOIN")}}{% verbatim %}
|
||||
</button>
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
{{/ifx}}
|
||||
{{/ifx}}
|
||||
</div>
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
{% endif %}
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<script id="{{table.id}}-column-memberCount" type="text/x-handlebars-template">
|
||||
{% if checkAccess('view_organisation_members') %}
|
||||
{% verbatim %}
|
||||
<td>
|
||||
{{row.member_count}}
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
{% endif %}
|
||||
</script>
|
||||
25
templates/tables/columns/organisations-status.html.twig
Normal file
25
templates/tables/columns/organisations-status.html.twig
Normal file
@@ -0,0 +1,25 @@
|
||||
<script id="{{table.id}}-column-status" type="text/x-handlebars-template">
|
||||
{% if 'status' in table.columns %}
|
||||
{% verbatim %}
|
||||
<td
|
||||
{{#ifx row.flag_approved '==' 1 }}
|
||||
data-text="approved"
|
||||
{{ else }}
|
||||
data-text="pending"
|
||||
{{/ifx }}
|
||||
>
|
||||
{% endverbatim %}{# {{# ifx row.flag_admin '==' 1 }} #}{% verbatim %}
|
||||
{{#ifx row.flag_approved '==' 1 }}
|
||||
<span>
|
||||
{% endverbatim %}{{translate("APPROVED")}}{% verbatim %}
|
||||
</span>
|
||||
{{ else }}
|
||||
<span class="text-yellow">
|
||||
{% endverbatim %}{{translate("PENDING")}}{% verbatim %}
|
||||
</span>
|
||||
{{/ifx }}
|
||||
{% endverbatim %}{# {{/ifx }} #}{% verbatim %}
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
{% endif %}
|
||||
</script>
|
||||
54
templates/tables/columns/users-actions.html.twig
Normal file
54
templates/tables/columns/users-actions.html.twig
Normal file
@@ -0,0 +1,54 @@
|
||||
<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.flag_verified '==' 0 }}
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-activate">
|
||||
<i class="fas fa-bolt"></i> {% endverbatim %}{{translate("USER.ACTIVATE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{{/ifx }}
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-edit">
|
||||
<i class="fas fa-edit"></i> {% endverbatim %}{{translate("USER.EDIT")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-roles">
|
||||
<i class="fas fa-id-card"></i> {% endverbatim %}{{translate("ROLE.MANAGE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-organisations">
|
||||
<i class="fas fa-sitemap"></i> {% endverbatim %}{{translate("ORGANISATION.MANAGE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-password">
|
||||
<i class="fas fa-key"></i> {% endverbatim %}{{translate("USER.ADMIN.CHANGE_PASSWORD")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{#ifx row.flag_enabled '==' 1 }}
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-disable">
|
||||
<i class="fas fa-minus-circle"></i> {% endverbatim %}{{translate("USER.DISABLE")}}{% verbatim %}
|
||||
</a>
|
||||
{{ else }}
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-enable">
|
||||
<i class="fas fa-plus-circle"></i> {% endverbatim %}{{translate("USER.ENABLE")}}{% verbatim %}
|
||||
</a>
|
||||
{{/ifx }}
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-delete">
|
||||
<i class="fas fa-trash-alt"></i> {% endverbatim %}{{translate("USER.DELETE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
16
templates/tables/columns/users-organisations.html.twig
Normal file
16
templates/tables/columns/users-organisations.html.twig
Normal file
@@ -0,0 +1,16 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user