List existing organisations

This commit is contained in:
2022-01-21 10:56:43 +00:00
parent c26c65fa8c
commit 584aa1909e
13 changed files with 613 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
{% block navigation %}
{% if checkAccess('uri_dashboard') %}
<li>
<a href="{{site.uri.public}}/dashboard"><i class="fas fa-tachometer-alt fa-fw"></i> <span>{{ translate("DASHBOARD") }}</span></a>
</li>
{% endif %}
{% if checkAccess('uri_users') %}
<li>
<a href="{{site.uri.public}}/users"><i class="fas fa-user fa-fw"></i> <span>{{ translate("USER", 2) }}</span></a>
</li>
{% elseif checkAccess('uri_group', {
'group': current_user.group
}) %}
<li>
<a href="{{site.uri.public}}/groups/g/{{current_user.group.slug}}"><i class="{{current_user.group.icon}} fa-fw"></i> <span>{{ translate("GROUP.MANAGE") }}</span></a>
</li>
{% endif %}
{% if checkAccess('uri_activities') %}
<li>
<a href="{{site.uri.public}}/activities"><i class="fas fa-tasks fa-fw"></i> <span>{{ translate("ACTIVITY", 2) }}</span></a>
</li>
{% endif %}
{% if checkAccess('uri_roles') %}
<li>
<a href="{{site.uri.public}}/roles"><i class="fas fa-id-card fa-fw"></i> <span>{{ translate("ROLE", 2) }}</span></a>
</li>
{% endif %}
{% if checkAccess('uri_permissions') %}
<li>
<a href="{{site.uri.public}}/permissions"><i class="fas fa-key fa-fw"></i> <span>{{ translate("PERMISSION", 2) }}</span></a>
</li>
{% endif %}
{% if checkAccess('uri_groups') %}
<li>
<a href="{{site.uri.public}}/groups"><i class="fas fa-users fa-fw"></i> <span>{{ translate("GROUP", 2) }}</span></a>
</li>
{% endif %}
{% if checkAccess('uri_organisations') %}
<li>
<a href="{{site.uri.public}}/organisations"><i class="fas fa-users fa-fw"></i> <span>{{ translate("ORGANISATION", 2) }}</span></a>
</li>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,45 @@
{% extends "pages/abstract/dashboard.html.twig" %}
{% block stylesheets_page %}
<!-- Page-specific CSS asset bundle -->
{{ assets.css('css/form-widgets') | raw }}
{% endblock %}
{# Overrides blocks in head of base template #}
{% block page_title %}{{ translate("ORGANISATION", 2) }}{% endblock %}
{% block page_description %}{{ translate("ORGANISATION.PAGE_DESCRIPTION") }}{% endblock %}
{% block body_matter %}
<div class="row">
<div class="col-md-12">
<div id="widget-organisations" class="box box-primary">
<div class="box-header">
<h3 class="box-title"><i class="fas fa-fw fa-users"></i> {{translate('ORGANISATION', 2)}}</h3>
{% include "tables/table-tool-menu.html.twig" %}
</div>
<div class="box-body">
{% include "tables/organisations.html.twig" with {
"table" : {
"id" : "table-organisations"
}
}
%}
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts_page %}
<!-- Include validation rules -->
<script>
{% include "pages/partials/page.js.twig" %}
</script>
<!-- Include form widgets JS -->
{{ assets.js('js/form-widgets') | raw }}
<!-- Include page-specific JS -->
{{ assets.js('js/pages/organisations') | raw }}
{% endblock %}

View File

@@ -0,0 +1,59 @@
{# This partial template renders a table of organisations, 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="#organisation-table-column-info" data-priority="1">{{translate('ORGANISATION')}} <i class="fas fa-sort"></i></th>
<th class="sorter-metatext" data-column-name="description" data-column-template="#organisation-table-column-description" data-priority="2">{{translate("DESCRIPTION")}} <i class="fas fa-sort"></i></th>
<th data-column-template="#organisation-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="organisation-table-column-info" type="text/x-handlebars-template">
<td data-text="{{row.name}}">
<strong>
<a href="{{site.uri.public}}/organisations/o/{{row.slug}}">{{row.name}}</a>
</strong>
</td>
</script>
<script id="organisation-table-column-description" type="text/x-handlebars-template">
<td>
{{row.description}}
</td>
</script>
<script id="organisation-table-column-actions" type="text/x-handlebars-template">
<td>
<div class="btn-organisation">
<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">
</ul>
</div>
</td>
</script>
{% endverbatim %}
{% endblock %}