Use blockier-templates

This commit is contained in:
2022-02-21 16:13:28 +00:00
parent 7023025fdc
commit e58f514896
5 changed files with 148 additions and 227 deletions

View File

@@ -28,12 +28,7 @@
{% endblock %}
{% block table_cell_templates %}
{# This contains a series of <script> blocks, each of which is a client-side Handlebars template.
# Note that these are NOT Twig templates, although the syntax is similar. We wrap them in the `verbatim` tag,
# so that Twig will output them directly into the DOM instead of trying to treat them like Twig templates.
#
# These templates require handlebars-helpers.js, moment.js
#}
{% block table_cell_template_info %}
{% verbatim %}
<script id="organisation-table-column-info" type="text/x-handlebars-template">
<td data-text="{{row.name}}">
@@ -50,13 +45,21 @@
</strong>
</td>
</script>
{% endverbatim %}
{% endblock %}
{% block table_cell_template_description %}
{% verbatim %}
<script id="organisation-table-column-description" type="text/x-handlebars-template">
<td>
{{row.description}}
</td>
</script>
{% endverbatim %}
{% endblock %}
{% block table_cell_template_status %}
{% verbatim %}
<script id="user-table-column-status" type="text/x-handlebars-template">
<td
{{#ifx row.flag_approved '==' 1 }}
@@ -76,19 +79,31 @@
{{/ifx }}
</td>
</script>
{% endverbatim %}
{% endblock %}
{% block table_cell_template_memberCount %}
{% verbatim %}
<script id="organisation-table-column-memberCount" type="text/x-handlebars-template">
<td>
{{row.member_count}}
</td>
</script>
{% endverbatim %}
{% endblock %}
{% block table_cell_template_adminCount %}
{% verbatim %}
<script id="organisation-table-column-adminCount" type="text/x-handlebars-template">
<td>
{{row.admin_count}}
</td>
</script>
{% endverbatim %}
{% endblock %}
{% block table_cell_template_join %}
{% verbatim %}
<script id="organisation-table-column-join" type="text/x-handlebars-template">
<td>
<div class="btn-group">
@@ -112,8 +127,12 @@
</div>
</td>
</script>
{% endverbatim %}
{% endblock %}
{% endverbatim %}{% if hasRole('site-admin') or hasRole('organisations-admin') %}{% verbatim %}
{% block table_cell_template_actions %}
{% if hasRole('site-admin') or hasRole('organisations-admin') %}
{% verbatim %}
<script id="organisation-table-column-actions" type="text/x-handlebars-template">
<td>
<div class="btn-group">
@@ -163,7 +182,9 @@
</div>
</td>
</script>
{% endverbatim %}{% else %}{% verbatim %}
{% endverbatim %}
{% else %}
{% verbatim %}
<script id="organisation-table-column-actions" type="text/x-handlebars-template">
<td>
{{#ifx row.is_admin '==' 1 }}
@@ -192,6 +213,9 @@
{{/ifx }}
</td>
</script>
{% endverbatim %}{% endif %}{% verbatim %}
{% endverbatim %}
{% endif %}
{% endblock %}
{% block table_cell_template_extra %}{% endblock %}
{% endblock %}