Change actions button depending on site/orgs admin vs organisation administrator

This commit is contained in:
2022-02-15 15:50:42 +00:00
parent a02b4b52a0
commit 8dc120ae15

View File

@@ -18,9 +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 %}
{% if hasRole('site-admin') or hasRole('organisations-admin') %}
<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>
{% endif %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -90,6 +88,7 @@
</td> </td>
</script> </script>
{% 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>
<div class="btn-group"> <div class="btn-group">
@@ -139,5 +138,35 @@
</div> </div>
</td> </td>
</script> </script>
{% endverbatim %}{% else %}{% verbatim %}
<script id="organisation-table-column-actions" type="text/x-handlebars-template">
<td>
{{#ifx row.is_admin '==' 1 }}
<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-edit">
<i class="fas fa-edit"></i> {% endverbatim %}{{translate("ORGANISATION.EDIT")}}{% verbatim %}
</a>
</li>
{{#ifx row.flag_approved '==' 0 }}
{{#ifx row.registrant_id '==' {% endverbatim %}{{current_user.id}}{% verbatim %} }}
<li>
<a href="#" data-slug="{{row.slug}}" class="js-organisation-cancelRegistration">
<i class="fas fa-trash-alt"></i> {% endverbatim %}{{translate("ORGANISATION.REGISTRATION.CANCEL")}}{% verbatim %}
</a>
</li>
{{/ifx}}
{{/ifx}}
</ul>
</div>
{{/ifx }}
</td>
</script>
{% endverbatim %}{% endif %}{% verbatim %}
{% endverbatim %} {% endverbatim %}
{% endblock %} {% endblock %}