Blockier templates table structure
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
{% block table_cell_template_actions %}
|
||||
{%- if hasRole('site-admin') or hasRole('organisations-admin') %}
|
||||
<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">
|
||||
{% endverbatim %}{% if checkAccess('update_organisation_field') %}{% verbatim %}
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-organisation-edit">
|
||||
<i class="fas fa-edit"></i> {% endverbatim %}{{translate("ORGANISATION.EDIT")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
{% endverbatim %}{% if checkAccess('merge_organisations') %}{% verbatim %}
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-organisation-merge">
|
||||
<i class="fas fa-object-group"></i> {% endverbatim %}{{translate("ORGANISATION.MERGE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
{% endverbatim %}{% if checkAccess('approve_organisation') %}{% verbatim %}
|
||||
{{#ifx row.flag_approved '==' 0 }}
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-organisation-approveRegistration">
|
||||
<i class="fas fa-thumbs-up"></i> {% endverbatim %}{{translate("ORGANISATION.REGISTRATION.APPROVE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-organisation-denyRegistration">
|
||||
<i class="fas fa-thumbs-down"></i> {% endverbatim %}{{translate("ORGANISATION.REGISTRATION.DENY")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{{/ifx }}
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
{% endverbatim %}{% if checkAccess('delete_organisation') %}{% verbatim %}
|
||||
{{#ifx row.flag_approved '==' 1 }}
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-organisation-delete">
|
||||
<i class="fas fa-trash-alt"></i> {% endverbatim %}{{translate("ORGANISATION.DELETE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{{/ifx }}
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{%- elseif (current_user.adminForOrganisations.count > 0) -%}
|
||||
<script id="{{table.id}}-column-actions" type="text/x-handlebars-template">
|
||||
{%- verbatim %}
|
||||
<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>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{% endif -%}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% block table_cell_template_admin_count %}
|
||||
{%- if checkAccess('view_organisation_members') -%}
|
||||
<script id="{{table.id}}-column-adminCount" type="text/x-handlebars-template">
|
||||
{%- verbatim %}
|
||||
<td>
|
||||
{{row.admin_count}}
|
||||
</td>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{% endif -%}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% block table_cell_template_description %}
|
||||
<script id="{{table.id}}-column-description" type="text/x-handlebars-template">
|
||||
{%- verbatim %}
|
||||
<td>
|
||||
{{row.description}}
|
||||
</td>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,19 @@
|
||||
{% block table_cell_template_info %}
|
||||
<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 hasRole('organisations-admin') or hasRole('site-admin') %}{% 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>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,27 @@
|
||||
{% block table_cell_template_join %}
|
||||
<script id="{{table.id}}-column-join" type="text/x-handlebars-template">
|
||||
{%- 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 -%}
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% block table_cell_template_member_count %}
|
||||
{%- if checkAccess('view_organisation_members') -%}
|
||||
<script id="{{table.id}}-column-memberCount" type="text/x-handlebars-template">
|
||||
{%- verbatim %}
|
||||
<td>
|
||||
{{row.member_count}}
|
||||
</td>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{% endif -%}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{% block table_cell_template_status %}
|
||||
{%- if hasRole('site-admin') or hasRole('organisations-admin') or (current_user.adminForOrganisations.count > 0) %}
|
||||
<script id="{{table.id}}-column-status" type="text/x-handlebars-template">
|
||||
{%- verbatim %}
|
||||
<td
|
||||
{{#ifx row.flag_approved '==' 1 }}
|
||||
data-text="approved"
|
||||
{{ else }}
|
||||
data-text="pending"
|
||||
{{/ifx }}
|
||||
>
|
||||
{{#ifx row.flag_approved '==' 1 }}
|
||||
<span>
|
||||
{% endverbatim %}{{translate("APPROVED")}}{% verbatim %}
|
||||
</span>
|
||||
{{ else }}
|
||||
<span class="text-yellow">
|
||||
{% endverbatim %}{{translate("PENDING")}}{% verbatim %}
|
||||
</span>
|
||||
{{/ifx }}
|
||||
</td>
|
||||
{% endverbatim -%}
|
||||
</script>
|
||||
{% endif -%}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user