From 198b7da149d111a86f71f4132b88316b4fd50486 Mon Sep 17 00:00:00 2001 From: christianbeeznst Date: Wed, 20 Mar 2024 22:49:11 -0500 Subject: [PATCH] Course: Improve UI and fix bugs in user tool --- assets/css/app.scss | 38 ++++++++++++++++++++ public/main/inc/ajax/model.ajax.php | 6 ++-- public/main/inc/lib/display.lib.php | 2 +- public/main/inc/lib/sortable_table.class.php | 2 +- public/main/user/class.php | 2 +- public/main/user/subscribe_user.php | 6 +++- public/main/user/user.php | 14 +++++--- 7 files changed, 58 insertions(+), 12 deletions(-) diff --git a/assets/css/app.scss b/assets/css/app.scss index 0238dd1cbd..183fb95de4 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -124,6 +124,44 @@ } } + .sortable-container { + width: 100%; + overflow: auto; + } + + .toolbar-action { + .p-toolbar-group-start.p-toolbar-group-left { + display: flex; + padding: 10px; + background: #f0f0f0; + border-radius: 5px; + } + + .p-toolbar-group-start.p-toolbar-group-left .btn { + padding: 10px 20px; + text-decoration: none; + color: #333; + background-color: #e7e7e7; + border: 1px solid #ddd; + border-radius: 5px; + transition: background-color 0.3s; + } + + .p-toolbar-group-start.p-toolbar-group-left .btn:hover { + background-color: #ddd; + } + + .p-toolbar-group-start.p-toolbar-group-left .btn.active { + background-color: #007bff; + color: white; + border-color: #007bff; + } + + .p-toolbar-group-start.p-toolbar-group-left .btn + .btn { + margin-left: 10px; + } + } + .sortable-buttons-actions { @apply bg-gray-5 border border-gray-20 rounded shadow; diff --git a/public/main/inc/ajax/model.ajax.php b/public/main/inc/ajax/model.ajax.php index d806fb0d71..f207beb611 100644 --- a/public/main/inc/ajax/model.ajax.php +++ b/public/main/inc/ajax/model.ajax.php @@ -2552,8 +2552,8 @@ switch ($action) { ]); break; case 'get_usergroups_teacher': - $columns = ['name', 'users', 'status', 'group_type', 'actions']; - $options['order'] = "name $sord"; + $columns = ['title', 'users', 'status', 'group_type', 'actions']; + $options['order'] = "title $sord"; $options['limit'] = "$start , $limit"; $options['session_id'] = $sessionId; switch ($type) { @@ -2564,7 +2564,7 @@ switch ($action) { $options['where'] = [' (session_id IS NULL OR session_id != ?) ' => $sessionId]; } if (!empty($keyword)) { - $options['where']['AND name like %?% '] = $keyword; + $options['where']['AND title like %?% '] = $keyword; } $result = $obj->getUserGroupNotInCourse( $options, diff --git a/public/main/inc/lib/display.lib.php b/public/main/inc/lib/display.lib.php index 09ff76688b..b80d6ea0b5 100644 --- a/public/main/inc/lib/display.lib.php +++ b/public/main/inc/lib/display.lib.php @@ -2180,7 +2180,7 @@ class Display } - return '