Split pending organisations into a separate list and default to only returning organisations a user is an accepted member of (Fixes #1)
This commit is contained in:
@@ -117,7 +117,7 @@
|
||||
{% endverbatim %}{{translate("LEAVE")}}{% verbatim %}
|
||||
</button>
|
||||
{{ else }}
|
||||
{% endverbatim %}{% if (organisationConfig.membership.single_membership == 0) or (current_user.organisations.count == 0) %}{% verbatim %}
|
||||
{% 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>
|
||||
|
||||
@@ -83,15 +83,18 @@
|
||||
{% block table_cell_template_organisations %}
|
||||
{% verbatim %}
|
||||
<script id="user-table-column-organisations" type="text/x-handlebars-template">
|
||||
{{#if row.organisations.length }}
|
||||
<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.pivot.flag_approved '!=' 1 }}membership-pending{{/ifx}} {{#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>
|
||||
<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}}
|
||||
</td>
|
||||
{{ else }}
|
||||
<td></td>
|
||||
{{/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>
|
||||
</script>
|
||||
{% endverbatim %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user