aboutsummaryrefslogtreecommitdiffhomepage
path: root/main/app/sprinkles/admin/templates/tables/groups.html.twig
diff options
context:
space:
mode:
Diffstat (limited to 'main/app/sprinkles/admin/templates/tables/groups.html.twig')
-rwxr-xr-xmain/app/sprinkles/admin/templates/tables/groups.html.twig69
1 files changed, 69 insertions, 0 deletions
diff --git a/main/app/sprinkles/admin/templates/tables/groups.html.twig b/main/app/sprinkles/admin/templates/tables/groups.html.twig
new file mode 100755
index 0000000..2c5a84a
--- /dev/null
+++ b/main/app/sprinkles/admin/templates/tables/groups.html.twig
@@ -0,0 +1,69 @@
+{# This partial template renders a table of groups, to be populated with rows via an AJAX request.
+ # This extends a generic template for paginated tables.
+ #
+ # Note that this template contains a "skeleton" table with an empty table body, and then a block of Handlebars templates which are used
+ # to render the table cells with the data from the AJAX request.
+#}
+
+{% extends "tables/table-paginated.html.twig" %}
+
+{% block table %}
+ <table id="{{table.id}}" class="tablesorter table table-bordered table-hover table-striped" data-sortlist="{{table.sortlist}}">
+ <thead>
+ <tr>
+ <th class="sorter-metatext" data-column-name="name" data-column-template="#group-table-column-info" data-priority="1">{{translate('GROUP')}} <i class="fa fa-sort"></i></th>
+ <th class="sorter-metatext" data-column-name="description" data-column-template="#group-table-column-description" data-priority="2">{{translate("DESCRIPTION")}} <i class="fa fa-sort"></i></th>
+ <th data-column-template="#group-table-column-actions" data-sorter="false" data-filter="false" data-priority="1">{{translate("ACTIONS")}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ </tbody>
+ </table>
+{% 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
+ #}
+ {% verbatim %}
+ <script id="group-table-column-info" type="text/x-handlebars-template">
+ <td data-text="{{row.name}}">
+ <strong>
+ <i class="{{row.icon}} fa-fw"></i> <a href="{{site.uri.public}}/groups/g/{{row.slug}}">{{row.name}}</a>
+ </strong>
+ </td>
+ </script>
+
+ <script id="group-table-column-description" type="text/x-handlebars-template">
+ <td>
+ {{row.description}}
+ </td>
+ </script>
+
+ <script id="group-table-column-actions" type="text/x-handlebars-template">
+ <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">
+ <li>
+ <a href="#" data-slug="{{row.slug}}" class="js-group-edit">
+ <i class="fa fa-edit"></i> {% endverbatim %}{{translate("GROUP.EDIT")}}{% verbatim %}
+ </a>
+ </li>
+ <li>
+ <a href="#" data-slug="{{row.slug}}" class="js-group-delete">
+ <i class="fa fa-trash-o"></i> {% endverbatim %}{{translate("GROUP.DELETE")}}{% verbatim %}
+ </a>
+ </li>
+ </ul>
+ </div>
+ </td>
+ </script>
+ {% endverbatim %}
+{% endblock %}