Added buttons to join/leave organisations (no functionality yet)
This commit is contained in:
@@ -23,5 +23,8 @@ return [
|
|||||||
'require_approval' => true,
|
'require_approval' => true,
|
||||||
'timeout' => -1,
|
'timeout' => -1,
|
||||||
],
|
],
|
||||||
|
'membership' => [
|
||||||
|
'single_membership' => false,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@@ -110,8 +110,10 @@ return [
|
|||||||
|
|
||||||
'VIEW_DELETED' => 'View deleted',
|
'VIEW_DELETED' => 'View deleted',
|
||||||
'DELETED' => 'Deleted',
|
'DELETED' => 'Deleted',
|
||||||
|
|
||||||
'RETURN' => 'Return',
|
'RETURN' => 'Return',
|
||||||
|
|
||||||
|
'JOIN' => 'Join',
|
||||||
|
'LEAVE' => 'Leave',
|
||||||
|
|
||||||
'ACTION_CANNOT_UNDONE' => 'This action cannot be undone!',
|
'ACTION_CANNOT_UNDONE' => 'This action cannot be undone!',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ class OrganisationsExtension extends AbstractExtension implements GlobalsInterfa
|
|||||||
|
|
||||||
public function getGlobals()
|
public function getGlobals()
|
||||||
{
|
{
|
||||||
return [];
|
$config = $this->services->config['organisation'];
|
||||||
|
|
||||||
|
return [
|
||||||
|
'organisationConfig' => $config
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<th class="sorter-metanum" data-column-name="member_count" data-column-template="#organisation-table-column-memberCount" data-priority="2">{{translate("ORGANISATION.MEMBER_COUNT")}} <i class="fas fa-sort"></i></th>
|
<th class="sorter-metanum" data-column-name="member_count" data-column-template="#organisation-table-column-memberCount" data-priority="2">{{translate("ORGANISATION.MEMBER_COUNT")}} <i class="fas fa-sort"></i></th>
|
||||||
<th class="sorter-metanum" data-column-name="admin_count" data-column-template="#organisation-table-column-adminCount" data-priority="2">{{translate("ORGANISATION.ADMIN_COUNT")}} <i class="fas fa-sort"></i></th>
|
<th class="sorter-metanum" data-column-name="admin_count" data-column-template="#organisation-table-column-adminCount" data-priority="2">{{translate("ORGANISATION.ADMIN_COUNT")}} <i class="fas fa-sort"></i></th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<th data-column-template="#organisation-table-column-join" data-column-name="join" data-sorter="false" data-filter="false" data-priority="3">{{translate("JOIN")}}/{{translate("LEAVE")}}</th>
|
||||||
<th data-column-template="#organisation-table-column-actions" data-sorter="false" data-filter="false" data-priority="1">{{translate("ACTIONS")}}</th>
|
<th data-column-template="#organisation-table-column-actions" data-sorter="false" data-filter="false" data-priority="1">{{translate("ACTIONS")}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -88,6 +89,30 @@
|
|||||||
</td>
|
</td>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script id="organisation-table-column-join" type="text/x-handlebars-template">
|
||||||
|
<td>
|
||||||
|
<div class="btn-group">
|
||||||
|
{{#ifx row.is_pending '==' 0 }}
|
||||||
|
<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) %}{% 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>
|
||||||
|
</script>
|
||||||
|
|
||||||
{% endverbatim %}{% if hasRole('site-admin') or hasRole('organisations-admin') %}{% verbatim %}
|
{% endverbatim %}{% if hasRole('site-admin') or hasRole('organisations-admin') %}{% verbatim %}
|
||||||
<script id="organisation-table-column-actions" type="text/x-handlebars-template">
|
<script id="organisation-table-column-actions" type="text/x-handlebars-template">
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user