Add new pages for managing tags, tasks, transitions, users, user groups, and their respective JavaScript functionalities
- Implemented tag management page with filtering, data table, and AJAX functionality.
- Created task management page with task listing, filtering, and AJAX data loading.
- Developed transition management page with a data table for transitions.
- Added user management page with comprehensive user details, filtering options, and AJAX support.
- Introduced user group management page with filtering and data table for user groups.
- Enhanced JavaScript for data tables, including state saving, filtering, and AJAX data fetching for all new pages.
2026-02-06 23:54:21 -05:00
{ #
/*
* OTS Signs Theme - User Group Page
* Based on Xibo CMS usergroup-page.twig with OTS styling
*/
#}
{% extends "authed.twig" %}
{% import "inline.twig" as inline %}
{% block title %} {{ "User Groups" | trans }} | {% endblock %}
{% block actionMenu %} {% endblock %}
{% block pageContent %}
<div class="ots-displays-page">
<div class="page-header ots-page-header">
<h1> {% trans "User Groups" %} </h1>
<p class="text-muted"> {% trans "Manage user groups and permissions." %} </p>
</div>
<div class="widget dashboard-card ots-displays-card">
<div class="widget-body ots-displays-body">
<div class="XiboGrid" id=" {{ random ( ) }} " data-grid-name="userGroupView">
<div class="XiboFilter card mb-3 bg-light dashboard-card ots-filter-card">
<div class="ots-filter-header">
<h3 class="ots-filter-title"> {% trans "Filter User Groups" %} </h3>
<button type="button" class="ots-filter-toggle" id="ots-filter-collapse-btn" title=" {% trans 'Toggle filter panel' %} ">
<i class="fa fa-chevron-up"></i>
</button>
</div>
<div class="ots-filter-content" id="ots-filter-content">
<div class="FilterDiv card-body" id="Filter">
<form class="form-inline">
{% set title %} {% trans "Name" %} {% endset %}
{{ inline .inputNameGrid ( 'userGroup' , title ) }}
</form>
</div>
</div>
</div>
<div class="XiboData card pt-3 dashboard-card ots-table-card">
<div class="ots-table-toolbar">
{% if currentUser .isSuperAdmin ( ) %}
Refactor toolbar buttons across various pages to unify styling
- Updated button classes for consistency in the playersoftware-page, playlist-page, resolution-page, schedule-page, settings-page, syncgroup-page, tag-page, task-page, template-page, transition-page, user-page, and usergroup-page.
- Removed unnecessary text from button titles and ensured all buttons have the 'ots-toolbar-btn' class for uniformity.
- Cleaned up the code by removing commented-out sections and ensuring proper indentation.
2026-02-07 14:50:40 -05:00
<button class="btn btn-sm btn-success ots-toolbar-btn XiboFormButton" title=" {% trans "Add a new User Group" %} " href=" {{ url_for ( "group.add.form" ) }} "><i class="fa fa-users" aria-hidden="true"></i></button>
Add new pages for managing tags, tasks, transitions, users, user groups, and their respective JavaScript functionalities
- Implemented tag management page with filtering, data table, and AJAX functionality.
- Created task management page with task listing, filtering, and AJAX data loading.
- Developed transition management page with a data table for transitions.
- Added user management page with comprehensive user details, filtering options, and AJAX support.
- Introduced user group management page with filtering and data table for user groups.
- Enhanced JavaScript for data tables, including state saving, filtering, and AJAX data fetching for all new pages.
2026-02-06 23:54:21 -05:00
{% endif %}
Refactor toolbar buttons across various pages to unify styling
- Updated button classes for consistency in the playersoftware-page, playlist-page, resolution-page, schedule-page, settings-page, syncgroup-page, tag-page, task-page, template-page, transition-page, user-page, and usergroup-page.
- Removed unnecessary text from button titles and ensured all buttons have the 'ots-toolbar-btn' class for uniformity.
- Cleaned up the code by removing commented-out sections and ensuring proper indentation.
2026-02-07 14:50:40 -05:00
<button class="btn btn-sm btn-primary ots-toolbar-btn" id="refreshGrid" title=" {% trans "Refresh the Table" %} " href="#"><i class="fa fa-refresh" aria-hidden="true"></i></button>
Add new pages for managing tags, tasks, transitions, users, user groups, and their respective JavaScript functionalities
- Implemented tag management page with filtering, data table, and AJAX functionality.
- Created task management page with task listing, filtering, and AJAX data loading.
- Developed transition management page with a data table for transitions.
- Added user management page with comprehensive user details, filtering options, and AJAX support.
- Introduced user group management page with filtering and data table for user groups.
- Enhanced JavaScript for data tables, including state saving, filtering, and AJAX data fetching for all new pages.
2026-02-06 23:54:21 -05:00
</div>
<table id="userGroups" class="table table-striped" data-state-preference-name="userGroupGrid">
<thead>
<tr>
<th> {% trans "User Group" %} </th>
<th> {% trans "Description" %} </th>
<th> {% trans "Library Quota" %} </th>
<th> {% trans "Receive System Notifications?" %} </th>
<th> {% trans "Receive Display Notifications?" %} </th>
<th> {% trans "Receive Custom Notifications?" %} </th>
<th> {% trans "Receive DataSet Notifications?" %} </th>
<th> {% trans "Receive Layout Notifications?" %} </th>
<th> {% trans "Receive Library Notifications?" %} </th>
<th> {% trans "Receive Report Notifications?" %} </th>
<th> {% trans "Receive Schedule Notifications?" %} </th>
<th> {% trans "Is shown for Add User?" %} </th>
<th class="rowMenu"></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block javaScript %}
<script type="text/javascript" nonce=" {{ cspNonce }} ">
$(document).ready(function() {
var table = $("#userGroups").DataTable( {
"language": dataTablesLanguage,
dom: dataTablesTemplate,
serverSide: true,
stateSave: true,
stateDuration: 0,
responsive: true,
stateLoadCallback: dataTableStateLoadCallback,
stateSaveCallback: dataTableStateSaveCallback,
searchDelay: 3000,
filter: false,
order: [[0, 'asc']],
ajax: {
url: " {{ url_for ( 'group.search' ) }} ",
data: function (d) {
$.extend(d, $('#userGroups').closest('.XiboGrid').find('.FilterDiv form').serializeObject());
}
},
"columns": [
{ data: 'group', render: dataTableSpacingPreformatted, responsivePriority: 2 },
{ data: 'description', visible: false },
{
name: 'libraryQuota',
data: null,
render: { '_': 'libraryQuota', 'display': 'libraryQuotaFormatted', 'sort': 'libraryQuota'}
},
{
data: 'isSystemNotification',
render: dataTableTickCrossColumn
},
{
data: 'isDisplayNotification',
render: dataTableTickCrossColumn
},
{
data: 'isDataSetNotification',
render: dataTableTickCrossColumn,
visible: false
},
{
data: 'isLayoutNotification',
render: dataTableTickCrossColumn,
visible: false
},
{
data: 'isLibraryNotification',
render: dataTableTickCrossColumn,
visible: false
},
{
data: 'isReportNotification',
render: dataTableTickCrossColumn,
visible: false
},
{
data: 'isScheduleNotification',
render: dataTableTickCrossColumn,
visible: false
},
{
data: 'isCustomNotification',
render: dataTableTickCrossColumn,
visible: false
},
{
data: "isShownForAddUser",
render: dataTableTickCrossColumn
},
{
"orderable": false,
responsivePriority: 1,
"data": dataTableButtonsColumn
}
]
});
table.on('draw', dataTableDraw);
table.on('processing.dt', dataTableProcessing);
dataTableAddButtons(table, $('#userGroups_wrapper').find('.dataTables_buttons'));
$("#refreshGrid").click(function () {
table.ajax.reload();
});
});
function handleLibraryQuotaField(libraryQuotaField, libraryQuotaUnitsField) {
var libraryQuota = libraryQuotaField.val();
if (libraryQuotaUnitsField.val() === 'mb') {
libraryQuota = libraryQuota * 1024;
} else if (libraryQuotaUnitsField.val() === 'gb') {
libraryQuota = libraryQuota * 1024 * 1024;
}
libraryQuotaField.prop('value', libraryQuota);
}
function userGroupFormOpen() {
var $userGroupForm = $('.UserGroupForm');
forms.validateForm(
$userGroupForm,
$userGroupForm.parents('.modal-body'),
{
submitHandler: function (form) {
handleLibraryQuotaField(
$(form).find('input[name=libraryQuota]'),
$(form).find('select[name=libraryQuotaUnits]')
);
XiboFormSubmit(form);
},
},
);
}
</script>
{% endblock %}