Re-built organisation permissions
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<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 %}
|
||||
{% if not organisationConfig.combine_action_buttons %}
|
||||
{% if not (checkAccess('delete_organisation') or checkAccess('approve_organisation') or checkAccess('merge_organisations')) %}
|
||||
{% verbatim %}{{#ifx row.is_admin '==' 1 }}{% endverbatim %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="btn-group">
|
||||
@@ -11,45 +13,97 @@
|
||||
<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 organisationConfig.combine_action_buttons %}
|
||||
{% verbatim %}{{#ifx row.is_pending '==' 1 }}{% endverbatim %}
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-cancelJoin">
|
||||
<i class="fas fa-window-close"></i>
|
||||
{{translate("JOIN.CANCEL")}}
|
||||
</a>
|
||||
</li>
|
||||
{% verbatim %}{{ else }}{% endverbatim %}
|
||||
{% verbatim %}{{#ifx row.is_member '==' 1 }}{% endverbatim %}
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-leave">
|
||||
<i class="fas fa-sign-out-alt"></i>
|
||||
{{translate("LEAVE")}}
|
||||
</a>
|
||||
</li>
|
||||
{% verbatim %}{{ else }}{% endverbatim %}
|
||||
{% if (organisationConfig.membership.single_membership == 0) or ((current_user.organisations.count == 0) and (current_user.pendingOrganisations.count == 0)) %}
|
||||
<li>
|
||||
<a href="#" data-slug="{% verbatim %}{{row.slug}}{% endverbatim %}" class="js-organisation-join">
|
||||
<i class="fas fa-sign-in-alt"></i>
|
||||
{{translate("JOIN")}}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% verbatim %}{{/ifx}}{% endverbatim %}
|
||||
{% verbatim %}{{/ifx}}{% endverbatim %}
|
||||
|
||||
{% if checkAccess('merge_organisations') or checkAccess('approve_organisation') or checkAccess('delete_organisation') %}
|
||||
<li class="divider"></li>
|
||||
{% else %}
|
||||
{% if organisationConfig.combine_action_buttons %}
|
||||
{% if not (checkAccess('delete_organisation') or checkAccess('approve_organisation') or checkAccess('merge_organisations')) %}
|
||||
{% verbatim %}{{#ifx row.is_admin '==' 1 }}<li class="divider"></li>{{/ifx}}{% endverbatim %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if organisationConfig.combine_action_buttons %}
|
||||
{% if not (checkAccess('delete_organisation') or checkAccess('approve_organisation') or checkAccess('merge_organisations')) %}
|
||||
{% verbatim %}{{#ifx row.is_admin '==' 1 }}{% endverbatim %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<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 organisationConfig.combine_action_buttons %}
|
||||
{% if not (checkAccess('delete_organisation') or checkAccess('approve_organisation') or checkAccess('merge_organisations')) %}
|
||||
{% verbatim %}{{/ifx }}{% endverbatim %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% 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>
|
||||
<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 %}
|
||||
|
||||
{% 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 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 %}
|
||||
|
||||
<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 %}
|
||||
|
||||
@@ -66,8 +120,10 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% if not hasRole('organisation-admin') %}
|
||||
{% verbatim %}{{/ifx}}{% endverbatim %}
|
||||
{% if not organisationConfig.combine_action_buttons %}
|
||||
{% if not (checkAccess('delete_organisation') or checkAccess('approve_organisation') or checkAccess('merge_organisations')) %}
|
||||
{% verbatim %}{{/ifx}}{% endverbatim %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script id="{{table.id}}-column-adminCount" type="text/x-handlebars-template">
|
||||
{% if checkAccess('view_organisation_members') %}
|
||||
{% if checkAccess('view_organisation_field', { 'property' : 'members' }) %}
|
||||
{% verbatim %}
|
||||
<td>
|
||||
{{row.admin_count}}
|
||||
|
||||
@@ -1,27 +1,29 @@
|
||||
<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 %}
|
||||
{% if not organisationConfig.combine_action_buttons %}
|
||||
{% 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 }}
|
||||
{% 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 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}}
|
||||
{{/ifx}}
|
||||
</div>
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
</div>
|
||||
</td>
|
||||
{% endverbatim %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</script>
|
||||
@@ -1,5 +1,5 @@
|
||||
<script id="{{table.id}}-column-memberCount" type="text/x-handlebars-template">
|
||||
{% if checkAccess('view_organisation_members') %}
|
||||
{% if checkAccess('view_organisation_field', { 'property' : 'members' }) %}
|
||||
{% verbatim %}
|
||||
<td>
|
||||
{{row.member_count}}
|
||||
|
||||
Reference in New Issue
Block a user