See the README for current tweaks
This commit is contained in:
305
templates/pages/dashboard.html.twig
Normal file
305
templates/pages/dashboard.html.twig
Normal file
@@ -0,0 +1,305 @@
|
||||
{% extends "@admin/pages/abstract/dashboard.html.twig" %}
|
||||
|
||||
{# Overrides blocks in head of base template #}
|
||||
{% block page_title %}{{ translate("DASHBOARD") }}{% endblock %}
|
||||
{% block page_description %}{% endblock %}
|
||||
|
||||
{% block body_matter %}
|
||||
{% set dashboard_is_empty = true %}
|
||||
|
||||
<!-- Info boxes -->
|
||||
<div class="row">
|
||||
{% if checkAccess('uri_users') %}
|
||||
{% set dashboard_is_empty = false %}
|
||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||
<a href="{{site.uri.public}}/users">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-aqua"><i class="fas fa-user fa-fw"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ translate("USER", 2) }}</span>
|
||||
<span class="info-box-number">{{counter.users}}</span>
|
||||
</div>
|
||||
<!-- /.info-box-content -->
|
||||
</div>
|
||||
<!-- /.info-box -->
|
||||
</a>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
{% endif %}
|
||||
|
||||
{% if checkAccess('uri_roles') %}
|
||||
{% set dashboard_is_empty = false %}
|
||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||
<a href="{{site.uri.public}}/roles">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-red"><i class="fas fa-id-card"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ translate("ROLE", 2) }}</span>
|
||||
<span class="info-box-number">{{counter.roles}}</span>
|
||||
</div>
|
||||
<!-- /.info-box-content -->
|
||||
</div>
|
||||
<!-- /.info-box -->
|
||||
</a>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
{% endif %}
|
||||
|
||||
{% if checkAccess('uri_groups') %}
|
||||
{% set dashboard_is_empty = false %}
|
||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||
<a href="{{site.uri.public}}/groups">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-green"><i class="fas fa-users"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ translate("GROUP", 2) }}</span>
|
||||
<span class="info-box-number">{{counter.groups}}</span>
|
||||
</div>
|
||||
<!-- /.info-box-content -->
|
||||
</div>
|
||||
<!-- /.info-box -->
|
||||
</a>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<!-- Main panels -->
|
||||
<div class="row">
|
||||
{% if checkAccess('view_system_info') %}
|
||||
{% set dashboard_is_empty = false %}
|
||||
<div class="col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{translate("SYSTEM_INFO")}}</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>{{translate("SYSTEM_INFO.UF_VERSION")}}</dt>
|
||||
<dd>{{info.version.UF}}</dd>
|
||||
|
||||
<dt>{{translate("SYSTEM_INFO.PHP_VERSION")}}</dt>
|
||||
<dd>{{info.version.php}}</dd>
|
||||
|
||||
<dt>{{translate("SYSTEM_INFO.SERVER")}}</dt>
|
||||
<dd>{{info.environment.SERVER_SOFTWARE}}</dd>
|
||||
|
||||
<dt>{{translate("SYSTEM_INFO.DB_VERSION")}}</dt>
|
||||
<dd>{{info.version.database.type}} {{info.version.database.version}}</dd>
|
||||
|
||||
<dt>{{translate("SYSTEM_INFO.DB_NAME")}}</dt>
|
||||
<dd>{{info.database.name}}</dd>
|
||||
|
||||
<dt>{{translate("SYSTEM_INFO.DIRECTORY")}}</dt>
|
||||
<dd>{{info.path.project}}</dd>
|
||||
|
||||
<dt>{{translate("SYSTEM_INFO.URL")}}</dt>
|
||||
<dd>{{site.uri.public}}</dd>
|
||||
|
||||
<dt>{{translate("SYSTEM_INFO.SPRINKLES")}}</dt>
|
||||
<dd>
|
||||
<ul class="list-unstyled">
|
||||
{% for sprinkle in sprinkles %}
|
||||
<li>
|
||||
{{sprinkle}}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer text-center">
|
||||
<a href="javascript:void(0)" class="js-clear-cache uppercase">{{ translate("CACHE.CLEAR") }}</a>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!--/.box -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
{% endif %}
|
||||
|
||||
{% if checkAccess('uri_users') %}
|
||||
{% set dashboard_is_empty = false %}
|
||||
<div class="col-md-6 col-sm-12 col-xs-12">
|
||||
<!-- USERS LIST -->
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{translate("USER.LATEST")}}</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body no-padding">
|
||||
<ul class="users-list clearfix">
|
||||
{% for user in users %}
|
||||
<li>
|
||||
<img src="{{ user.avatar }}" alt="User Image">
|
||||
<a class="users-list-name" href="{{site.uri.public}}/users/u/{{user.user_name}}">{{user.first_name}} {{user.last_name}}</a>
|
||||
<span class="users-list-date">{{ user.registered }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<!-- /.users-list -->
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
<div class="box-footer text-center">
|
||||
<a href="{{site.uri.public}}/users" class="uppercase">{{translate("USER.VIEW_ALL")}}</a>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!--/.box -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
{% endif %}
|
||||
|
||||
{% if checkAccess('uri_activities') %}
|
||||
{% set dashboard_is_empty = false %}
|
||||
<div class="col-md-6 col-sm-12 col-xs-12">
|
||||
<div id="widget-activities" class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><i class="fas fa-tasks fa-fw"></i> {{translate('ACTIVITY', 2)}}</h3>
|
||||
{% include "tables/table-tool-menu.html.twig" %}
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{% include "tables/activities.html.twig" with {
|
||||
"table" : {
|
||||
"id" : "table-activities",
|
||||
"columns" : ["user"]
|
||||
}
|
||||
}
|
||||
%}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
|
||||
{% if current_user.group %}
|
||||
<!-- Group info boxes -->
|
||||
<div class="row">
|
||||
{% if checkAccess('uri_group', {
|
||||
'group': current_user.group
|
||||
}) %}
|
||||
{% set dashboard_is_empty = false %}
|
||||
<div class="col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-aqua"><i class="{{current_user.group.icon}}"></i></span>
|
||||
<div class="info-box-content">
|
||||
<h1>{{current_user.group.name}}</h1>
|
||||
</div>
|
||||
<!-- /.info-box-content -->
|
||||
</div>
|
||||
<!-- /.info-box -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
|
||||
<div class="col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-aqua"><i class="fas fa-user fa-fw"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ translate("USER", 2) }}</span>
|
||||
<span class="info-box-number">{{current_user.group.users.count}}</span>
|
||||
</div>
|
||||
<!-- /.info-box-content -->
|
||||
</div>
|
||||
<!-- /.info-box -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<!-- Main panels -->
|
||||
<div class="row">
|
||||
{% if checkAccess('view_group_field', {
|
||||
'group': current_user.group,
|
||||
'property': 'users'
|
||||
}) %}
|
||||
{% set dashboard_is_empty = false %}
|
||||
<div class="col-md-offset-3 col-md-6 col-sm-12 col-xs-12">
|
||||
<div id="widget-group-users" class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><i class="fas fa-fw fa-user"></i> {{translate('GROUP')}} {{translate('USER', 2)}}</h3>
|
||||
{% include "tables/table-tool-menu.html.twig" %}
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{% include "tables/users.html.twig" with {
|
||||
"table" : {
|
||||
"id" : "table-group-users",
|
||||
"columns" : [
|
||||
(checkAccess('view_user_field', { "property" : 'activities' }) ? "last_activity" : "")
|
||||
]
|
||||
}
|
||||
}
|
||||
%}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="button" class="btn btn-success js-user-create">
|
||||
<i class="fas fa-plus-square"></i> {{translate("USER.CREATE")}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
<!-- /User's group -->
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if dashboard_is_empty %}
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-sm-offset-4 col-xs-12">
|
||||
<div class="box box-widget widget-user">
|
||||
<!-- Add the bg color to the header using any of the bg-* classes -->
|
||||
<div class="widget-user-header bg-black-active">
|
||||
<h3 class="widget-user-username">
|
||||
{{translate("WELCOME", {
|
||||
'first_name': current_user.first_name
|
||||
})}}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="widget-user-image">
|
||||
<img class="img-circle" src="{{assets.url('assets://userfrosting/images/cupcake.png')}}" alt="User Avatar">
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<h4>
|
||||
{{translate("WELCOME_TO", {
|
||||
'title': site.title
|
||||
})}}
|
||||
</h4>
|
||||
<p>
|
||||
{{translate("NO_FEATURES_YET")}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.widget-user -->
|
||||
</div>
|
||||
<!-- /.column -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts_page %}
|
||||
<!-- Include page variables -->
|
||||
<script>
|
||||
{% include "pages/partials/page.js.twig" %}
|
||||
|
||||
// Add user name
|
||||
page = $.extend(
|
||||
true, // deep extend
|
||||
{
|
||||
"group_slug": "{{current_user.group.slug}}"
|
||||
},
|
||||
page
|
||||
);
|
||||
</script>
|
||||
|
||||
<!-- Include page-specific JS -->
|
||||
{{ assets.js('js/pages/dashboard') | raw }}
|
||||
|
||||
{% endblock %}
|
||||
80
templates/pages/group.html.twig
Normal file
80
templates/pages/group.html.twig
Normal file
@@ -0,0 +1,80 @@
|
||||
{% extends "@admin/pages/group.html.twig" %}
|
||||
|
||||
{% block body_matter %}
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div id="view-group" class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{translate('GROUP.SUMMARY')}}</h3>
|
||||
{% if 'tools' not in tools.hidden %}
|
||||
<div class="box-tools pull-right">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-cog"></i> <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu box-tool-menu">
|
||||
{% block tools %}
|
||||
<li>
|
||||
<a href="#" class="js-group-edit" data-slug="{{group.slug}}">
|
||||
<i class="fas fa-edit fa-fw"></i> {{translate('EDIT')}}
|
||||
</a>
|
||||
</li>
|
||||
{% if 'delete' not in tools.hidden %}
|
||||
<li>
|
||||
<a href="#" class="js-group-delete" data-slug="{{group.slug}}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i> {{translate('DELETE')}}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="box-body box-profile">
|
||||
<div class="text-center">
|
||||
<i class="{{group.icon}} fa-5x"></i>
|
||||
</div>
|
||||
|
||||
<h3 class="profile-username text-center">{{group.name}}</h3>
|
||||
|
||||
{% if 'description' not in fields.hidden %}
|
||||
<p class="text-muted">
|
||||
{{group.description}}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if 'users' not in fields.hidden %}
|
||||
<hr>
|
||||
<strong><i class="fas fa-users margin-r-5"></i> {{ translate('USER', 2)}}</strong>
|
||||
<p class="badge bg-blue box-profile-property">
|
||||
{{group.users.count}}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% block group_profile %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div id="widget-group-users" class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><i class="fas fa-fw fa-user"></i> {{translate('USER', 2)}}</h3>
|
||||
{% include "tables/table-tool-menu.html.twig" %}
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{% include "tables/users.html.twig" with {
|
||||
"table" : {
|
||||
"id" : "table-group-users"
|
||||
}
|
||||
}
|
||||
%}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="button" class="btn btn-success js-user-create">
|
||||
<i class="fas fa-plus-square"></i> {{translate("USER.CREATE")}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
108
templates/pages/role.html.twig
Normal file
108
templates/pages/role.html.twig
Normal file
@@ -0,0 +1,108 @@
|
||||
{% extends "@admin/pages/role.html.twig" %}
|
||||
|
||||
{% block body_matter %}
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div id="view-role" class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{translate('ROLE.SUMMARY')}}</h3>
|
||||
{% if 'tools' not in tools.hidden %}
|
||||
<div class="box-tools pull-right">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-cog"></i> <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu box-tool-menu">
|
||||
{% block tools %}
|
||||
{% if (checkAccess('update_role_field', { fields: ['slug','name','description'] })) %}
|
||||
<li>
|
||||
<a href="#" class="js-role-edit" data-slug="{{role.slug}}">
|
||||
<i class="fas fa-edit fa-fw"></i> {{translate('EDIT')}}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if 'permissions' not in tools.hidden %}
|
||||
{% if (checkAccess('update_role_permissions', { role: role })) %}
|
||||
<li>
|
||||
<a href="#" class="js-role-permissions" data-slug="{{role.slug}}">
|
||||
<i class="fas fa-key"></i> {{translate("PERMISSION.MANAGE")}}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if 'delete' not in tools.hidden %}
|
||||
{% if (checkAccess('delete_role')) %}
|
||||
<li>
|
||||
<a href="#" class="js-role-delete" data-slug="{{role.slug}}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i> {{translate('DELETE')}}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="box-body box-profile">
|
||||
<div class="text-center">
|
||||
<i class="fas fa-id-card fa-5x"></i>
|
||||
</div>
|
||||
|
||||
<h3 class="profile-username text-center">{{role.name}}</h3>
|
||||
|
||||
{% if 'description' not in fields.hidden %}
|
||||
<p class="text-muted">
|
||||
{{role.description}}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if 'users' not in fields.hidden %}
|
||||
<hr>
|
||||
<strong><i class="fas fa-users margin-r-5"></i> {{ translate('USER', 2)}}</strong>
|
||||
<p class="badge bg-blue box-profile-property">
|
||||
{{role.users.count}}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
{% if (checkAccess('view_role_field', { property: 'permissions' })) %}
|
||||
<div id="widget-role-permissions" class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><i class="fas fa-fw fa-key"></i> {{translate('PERMISSION', 2)}}</h3>
|
||||
{% include "tables/table-tool-menu.html.twig" %}
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{% include "tables/permissions.html.twig" with {
|
||||
"table" : {
|
||||
"id" : "table-role-permissions"
|
||||
}
|
||||
}
|
||||
%}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
{% if (checkAccess('view_role_field', { property: 'users' })) %}
|
||||
<div id="widget-role-users" class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><i class="fas fa-fw fa-key"></i> {{translate('USER', 2)}}</h3>
|
||||
{% include "tables/table-tool-menu.html.twig" %}
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{% include "tables/users.html.twig" with {
|
||||
"table" : {
|
||||
"id" : "table-role-users",
|
||||
"columns" : ["last_activity"]
|
||||
}
|
||||
}
|
||||
%}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
29
templates/pages/roles.html.twig
Normal file
29
templates/pages/roles.html.twig
Normal file
@@ -0,0 +1,29 @@
|
||||
{% extends "@admin/pages/roles.html.twig" %}
|
||||
|
||||
{% block body_matter %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="widget-roles" class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><i class="fas fa-fw fa-id-card"></i> {{translate('ROLE', 2)}}</h3>
|
||||
{% include "tables/table-tool-menu.html.twig" %}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{% include "tables/roles.html.twig" with {
|
||||
"table" : {
|
||||
"id" : "table-roles"
|
||||
}
|
||||
}
|
||||
%}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{% if (checkAccess('create_role')) %}
|
||||
<button type="button" class="btn btn-success js-role-create">
|
||||
<i class="fas fa-plus-square"></i> {{translate("ROLE.CREATE")}}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
32
templates/pages/users.html.twig
Normal file
32
templates/pages/users.html.twig
Normal file
@@ -0,0 +1,32 @@
|
||||
{% extends "@admin/pages/users.html.twig" %}
|
||||
|
||||
{% block body_matter %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="widget-users" class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title pull-left"><i class="fas fa-fw fa-user"></i> {{translate('USER', 2)}}</h3>
|
||||
{% include "tables/table-tool-menu.html.twig" %}
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{% include "tables/users.html.twig" with {
|
||||
"table" : {
|
||||
"id" : "table-users",
|
||||
"columns" : [
|
||||
(checkAccess('view_user_field', { "property" : 'activities' }) ? "last_activity" : "")
|
||||
]
|
||||
}
|
||||
}
|
||||
%}
|
||||
</div>
|
||||
{% if checkAccess('create_user') %}
|
||||
<div class="box-footer">
|
||||
<button type="button" class="btn btn-success js-user-create">
|
||||
<i class="fas fa-plus-square"></i> {{ translate("USER.CREATE")}}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
80
templates/tables/roles.html.twig
Normal file
80
templates/tables/roles.html.twig
Normal file
@@ -0,0 +1,80 @@
|
||||
{# This partial template renders a table of roles, 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="#role-table-column-info" data-priority="1">{{translate('ROLE')}} <i class="fas fa-sort"></i></th>
|
||||
<th class="sorter-metatext" data-column-name="description" data-column-template="#role-table-column-description" data-priority="2">{{translate('DESCRIPTION')}} <i class="fas fa-sort"></i></th>
|
||||
<th data-column-template="#role-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="role-table-column-info" type="text/x-handlebars-template">
|
||||
<td data-text="{{row.name}}">
|
||||
<strong>
|
||||
<a href="{{site.uri.public}}/roles/r/{{row.slug}}">{{row.name}}</a>
|
||||
</strong>
|
||||
</td>
|
||||
</script>
|
||||
|
||||
<script id="role-table-column-description" type="text/x-handlebars-template">
|
||||
<td>
|
||||
{{row.description}}
|
||||
</td>
|
||||
</script>
|
||||
|
||||
<script id="role-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">
|
||||
{% endverbatim %}{% if (checkAccess('update_role_permissions')) %}{% verbatim %}
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-role-permissions">
|
||||
<i class="fas fa-key"></i> {% endverbatim %}{{translate("PERMISSION.MANAGE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-role-edit">
|
||||
<i class="fas fa-edit"></i> {% endverbatim %}{{translate("ROLE.EDIT")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% endverbatim %}{% if (checkAccess('delete_role')) %}{% verbatim %}
|
||||
<li>
|
||||
<a href="#" data-slug="{{row.slug}}" class="js-role-delete">
|
||||
<i class="fas fa-trash-alt"></i> {% endverbatim %}{{translate("ROLE.DELETE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</script>
|
||||
{% endverbatim %}
|
||||
{% endblock %}
|
||||
156
templates/tables/users.html.twig
Normal file
156
templates/tables/users.html.twig
Normal file
@@ -0,0 +1,156 @@
|
||||
{# This partial template renders a table of users, 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="#user-table-column-info" data-priority="1">{{translate('USER')}} <i class="fas fa-sort"></i></th>
|
||||
{% if 'last_activity' in table.columns %}
|
||||
<th class="sorter-metanum" data-column-name="last_activity" data-column-template="#user-table-column-last-activity" data-priority="3">{{translate("ACTIVITY.LAST")}} <i class="fas fa-sort"></i></th>
|
||||
{% endif %}
|
||||
{% if 'via_roles' in table.columns %}
|
||||
<th data-column-template="#user-table-column-via-roles" data-sorter="false" data-filter="false" data-priority="1">{{translate('PERMISSION.VIA_ROLES')}}</th>
|
||||
{% endif %}
|
||||
<th class="filter-select filter-metatext" data-column-name="status" data-column-template="#user-table-column-status" data-priority="2">{{translate("STATUS")}} <i class="fas fa-sort"></i></th>
|
||||
<th data-column-name="actions" data-column-template="#user-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="user-table-column-info" type="text/x-handlebars-template">
|
||||
<td data-text="{{row.last_name}}">
|
||||
<strong>
|
||||
<a href="{{site.uri.public}}/users/u/{{row.user_name}}">{{row.first_name}} {{row.last_name}} ({{row.user_name}})</a>
|
||||
</strong>
|
||||
<div class="js-copy-container">
|
||||
<span class="js-copy-target">{{row.email}}</span>
|
||||
<button class="btn btn-xs uf-copy-trigger js-copy-trigger"><i class="fas fa-copy"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</script>
|
||||
|
||||
<script id="user-table-column-last-activity" type="text/x-handlebars-template">
|
||||
{{#if row.last_activity }}
|
||||
<td data-num="{{dateFormat row.last_activity.occurred_at format='x'}}">
|
||||
{{dateFormat row.last_activity.occurred_at format="dddd"}}<br>{{dateFormat row.last_activity.occurred_at format="MMM Do, YYYY h:mm a"}}
|
||||
<br>
|
||||
<i>{{row.last_activity.description}}</i>
|
||||
</td>
|
||||
{{ else }}
|
||||
<td data-num="0">
|
||||
<i>{% endverbatim %}{{translate("UNKNOWN")}}{% verbatim %}</i>
|
||||
</td>
|
||||
{{/if }}
|
||||
</script>
|
||||
|
||||
<script id="user-table-column-status" type="text/x-handlebars-template">
|
||||
<td
|
||||
{{#ifx row.flag_enabled '==' 0 }}
|
||||
data-text="disabled"
|
||||
{{ else }}
|
||||
{{#ifx row.flag_verified '==' 0 }}
|
||||
data-text="unactivated"
|
||||
{{ else }}
|
||||
data-text="active"
|
||||
{{/ifx }}
|
||||
{{/ifx }}
|
||||
>
|
||||
{{#ifx row.flag_enabled '==' 0 }}
|
||||
<span class="text-muted">
|
||||
{% endverbatim %}{{translate("DISABLED")}}{% verbatim %}
|
||||
</span>
|
||||
{{ else }}
|
||||
{{#ifx row.flag_verified '==' 0 }}
|
||||
<span class="text-yellow">
|
||||
{% endverbatim %}{{translate("UNACTIVATED")}}{% verbatim %}
|
||||
</span>
|
||||
{{ else }}
|
||||
<span>
|
||||
{% endverbatim %}{{translate("ACTIVE")}}{% verbatim %}
|
||||
</span>
|
||||
{{/ifx }}
|
||||
{{/ifx }}
|
||||
</td>
|
||||
</script>
|
||||
<script id="user-table-column-actions" type="text/x-handlebars-template">
|
||||
<td class="uf-table-fit-width">
|
||||
<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-responsive" role="menu">
|
||||
{{#ifx row.flag_verified '==' 0 }}
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-activate">
|
||||
<i class="fas fa-bolt"></i> {% endverbatim %}{{translate("USER.ACTIVATE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{{/ifx }}
|
||||
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-edit">
|
||||
<i class="fas fa-edit"></i> {% endverbatim %}{{translate("USER.EDIT")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% endverbatim %}{% if checkAccess('uri_roles') %}{% verbatim %}
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-roles">
|
||||
<i class="fas fa-id-card"></i> {% endverbatim %}{{translate("ROLE.MANAGE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
{% endverbatim %}{% endif %}{% verbatim %}
|
||||
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-password">
|
||||
<i class="fas fa-key"></i> {% endverbatim %}{{translate("USER.ADMIN.CHANGE_PASSWORD")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{{#ifx row.flag_enabled '==' 1 }}
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-disable">
|
||||
<i class="fas fa-minus-circle"></i> {% endverbatim %}{{translate("USER.DISABLE")}}{% verbatim %}
|
||||
</a>
|
||||
{{ else }}
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-enable">
|
||||
<i class="fas fa-plus-circle"></i> {% endverbatim %}{{translate("USER.ENABLE")}}{% verbatim %}
|
||||
</a>
|
||||
{{/ifx }}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" data-user_name="{{row.user_name}}" class="js-user-delete">
|
||||
<i class="fas fa-trash-alt"></i> {% endverbatim %}{{translate("USER.DELETE")}}{% verbatim %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</script>
|
||||
|
||||
<script id="user-table-column-via-roles" type="text/x-handlebars-template">
|
||||
<td>
|
||||
{{#each row.roles_via }}
|
||||
<a href="{% endverbatim %}{# Handlebars can't access variables in the global scope, so we have to use Twig to insert the base url #}{{site.uri.public}}{% verbatim %}/roles/r/{{this.slug}}" class="label label-primary" title="{{this.description}}">{{this.name}}</a>
|
||||
{{/each}}
|
||||
</td>
|
||||
</script>
|
||||
{% endverbatim %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user