fix settings list - refs #2681

pull/2818/head
Alex Aragón 6 years ago
parent 57a6f11b3b
commit 0616eb1c49
  1. 22
      assets/css/scss/_base.scss
  2. 4
      assets/css/scss/_variables.scss
  3. 307
      main/admin/index.php
  4. 9
      main/template/default/admin/index.html.twig

@ -23,7 +23,7 @@ h5,
h6 {
font-family: $font-secondary;
letter-spacing: 0.5px;
line-height: 1.5;
line-height: 1.2;
a {
font-family: $font-secondary;
@ -34,7 +34,9 @@ h6 {
color: lighten($default-dark, 5%);
}
}
h5, h6{
font-size: .875rem;
}
p {
font-family: $font-primary;
line-height: 1.9;
@ -283,9 +285,20 @@ hr {
}
.card{
border: 1px solid rgba(0, 0, 0, 0.125);
border: 1px solid $card-border-color;
border-radius: 0.25rem;
margin-bottom: 10px;
box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.025);
.card-header{
padding: .75rem 1.25rem;
margin-bottom: 0;
color: inherit;
background-color: #fff;
border-bottom: 1px solid #e5e9f2;
.card-title{
margin-bottom: 0;
}
}
.card-body{
.tools{
width: 160px;
@ -503,6 +516,9 @@ hr {
.card{
display: inline-block;
width: 100%;
.card-description{
color: $grey-700;
}
}
.list-group{
.list-group-item{

@ -47,7 +47,7 @@ $default-black : #000000;
// ---------------------------------------------------------
// linear-gradient(120deg, #00a5e4, #4a71d0);
$page-background : #FFFFFF;
$page-background : #fcfcfc;
$menu-background : #FFFFFF;
$menu-secondary : #ff3c7e;
@ -69,7 +69,7 @@ $select-color : #ced4da;
$collapsed-size : 70px;
$header-height : 65px;
$offscreen-size : 280px;
$card-border-color : #e5e9f2;
// ---------------------------------------------------------
// FONTS
// ---------------------------------------------------------

@ -60,12 +60,13 @@ if (!empty($hook)) {
/* Users */
$blocks['users']['icon'] = Display::return_icon(
'members.png',
get_lang('Users'),
get_lang('User management'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['users']['label'] = api_ucfirst(get_lang('Users'));
$blocks['users']['description'] = get_lang('Here you can manage registered users within your platform');
$blocks['users']['label'] = api_ucfirst(get_lang('User management'));
$blocks['users']['class'] = 'block-admin-users';
$search_form = '
@ -95,6 +96,9 @@ if (api_is_platform_admin()) {
}
$items[] = ['url' => 'extra_fields.php?type=user', 'label' => get_lang('ManageUserFields')];
$items[] = ['url' => 'usergroups.php', 'label' => get_lang('Classes')];
if (!api_get_configuration_value('disable_gdpr')) {
$items[] = ['url' => 'user_list_consent.php', 'label' => get_lang('Users in consents list')];
}
if (api_get_configuration_value('show_link_request_hrm_user')) {
$items[] = ['url' => 'user_linking_requests.php', 'label' => get_lang('UserLinkingRequests')];
}
@ -106,6 +110,7 @@ if (api_is_platform_admin()) {
['url' => 'usergroups.php', 'label' => get_lang('Classes')],
];
if (api_is_session_admin()) {
if ('true' === api_get_setting('limit_session_admin_role')) {
$items = array_filter($items, function (array $item) {
@ -132,12 +137,13 @@ if (api_is_platform_admin()) {
/* Courses */
$blocks['courses']['icon'] = Display::return_icon(
'course.png',
get_lang('Courses'),
get_lang('Course management'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['courses']['label'] = api_ucfirst(get_lang('Courses'));
$blocks['courses']['label'] = api_ucfirst(get_lang('Course management'));
$blocks['courses']['description'] = get_lang('Create and manage your courses in a simple way');
$blocks['courses']['class'] = 'block-admin-courses';
$blocks['courses']['editable'] = true;
$search_form = ' <form method="get" class="form-inline" action="course_list.php">
@ -176,11 +182,140 @@ if (api_is_platform_admin()) {
}
$items[] = ['url' => 'extra_fields.php?type=course', 'label' => get_lang('ManageCourseFields')];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'admin/teacher_time_report.php',
'label' => get_lang('TeacherTimeReport'),
];
$blocks['courses']['items'] = $items;
$blocks['courses']['extra'] = null;
/* Sessions */
$blocks['sessions']['icon'] = Display::return_icon(
'session.png',
get_lang('Sessions management'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['sessions']['label'] = api_ucfirst(get_lang('Sessions management'));
$blocks['sessions']['description'] = get_lang('Create course packages for a certain time with training sessions.');
$blocks['sessions']['class'] = 'block-admin-sessions';
if (api_is_platform_admin()) {
$blocks['sessions']['editable'] = true;
}
$sessionPath = api_get_path(WEB_CODE_PATH) . 'session/';
$search_form = ' <form method="GET" class="form-inline" action="' . $sessionPath . 'session_list.php">
<div class="form-group mb-2">
<input class="form-control"
type="text"
name="keyword"
value=""
aria-label="' . get_lang('Search') . '">
</div>
<button class="btn btn-primary mb-2" type="submit">
<em class="fa fa-search"></em> ' . get_lang('Search') . '
</button>
</form>';
$blocks['sessions']['search_form'] = $search_form;
$items = [];
$items[] = ['url' => $sessionPath . 'session_list.php', 'label' => get_lang('ListSession')];
$items[] = ['url' => $sessionPath . 'session_add.php', 'label' => get_lang('AddSession')];
$items[] = ['url' => $sessionPath . 'session_category_list.php', 'label' => get_lang('ListSessionCategory')];
$items[] = ['url' => $sessionPath . 'session_import.php', 'label' => get_lang('ImportSessionListXMLCSV')];
$items[] = ['url' => $sessionPath . 'session_import_drh.php', 'label' => get_lang('ImportSessionDrhList')];
if (isset($extAuthSource) && isset($extAuthSource['ldap']) && count($extAuthSource['ldap']) > 0) {
$items[] = [
'url' => 'ldap_import_students_to_session.php',
'label' => get_lang('ImportLDAPUsersIntoSession'),
];
}
$items[] = [
'url' => $sessionPath . 'session_export.php',
'label' => get_lang('ExportSessionListXMLCSV'),
];
if (api_is_global_platform_admin()) {
$items[] = [
'url' => '../coursecopy/copy_course_session.php',
'label' => get_lang('CopyFromCourseInSessionToAnotherSession'),
];
}
$allowCareer = api_get_configuration_value('allow_session_admin_read_careers');
if (api_is_platform_admin() || ($allowCareer && api_is_session_admin())) {
// option only visible in development mode. Enable through code if required
if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) {
$items[] = ['url' => 'user_move_stats.php', 'label' => get_lang('MoveUserStats')];
}
$items[] = ['url' => 'career_dashboard.php', 'label' => get_lang('CareersAndPromotions')];
$items[] = ['url' => 'extra_fields.php?type=session', 'label' => get_lang('ManageSessionFields')];
}
$blocks['sessions']['items'] = $items;
$blocks['sessions']['extra'] = null;
// Skills
if (Skill::isToolAvailable()) {
$blocks['skills']['icon'] = Display::return_icon(
'skill-badges.png',
get_lang('Skills'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['skills']['label'] = get_lang('Skills and gradebook');
$blocks['skills']['description'] = get_lang('Manage the skills of your users, through courses and badges');
$blocks['skills']['class'] = 'block-admin-skills';
$items = [];
$items[] = [
'url' => 'skills_wheel.php',
'label' => get_lang('SkillsWheel'),
];
$items[] = [
'url' => 'skills_import.php',
'label' => get_lang('SkillsImport'),
];
$items[] = [
'url' => 'skill_list.php',
'label' => get_lang('ManageSkills'),
];
$items[] = [
'url' => 'skill.php',
'label' => get_lang('ManageSkillsLevels'),
];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'social/skills_ranking.php',
'label' => get_lang('SkillsRanking'),
];
$items[] = [
'url' => 'skills_gradebook.php',
'label' => get_lang('SkillsAndGradebooks'),
];
/*$items[] = array(
'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
'label' => get_lang('Badges')
);*/
$allow = api_get_configuration_value('gradebook_dependency');
if (!$allow) {
$items[] = [
'url' => 'gradebook_list.php',
'label' => get_lang('List of qualifications'),
];
}
$blocks['skills']['items'] = $items;
$blocks['skills']['extra'] = null;
$blocks['skills']['search_form'] = null;
}
/* Platform */
$blocks['platform']['icon'] = Display::return_icon(
'platform.png',
get_lang('Platform'),
@ -189,6 +324,7 @@ if (api_is_platform_admin()) {
false
);
$blocks['platform']['label'] = api_ucfirst(get_lang('Platform'));
$blocks['platform']['description'] = get_lang('Configure your platform, view reports, publish and send announcements globally');
$blocks['platform']['class'] = 'block-admin-platform';
$blocks['platform']['editable'] = true;
$search_form = ' <form method="get" action="' . api_get_path(WEB_PUBLIC_PATH) . 'admin/settings/search_settings' . '" class="form-inline">
@ -224,10 +360,6 @@ if (api_is_platform_admin()) {
'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/company_reports.php',
'label' => get_lang('Reports'),
];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH).'admin/teacher_time_report.php',
'label' => get_lang('TeacherTimeReport'),
];
if (api_get_configuration_value('chamilo_cms')) {
$items[] = [
@ -261,74 +393,6 @@ if (api_is_platform_admin()) {
$blocks['platform']['extra'] = null;
}
/* Sessions */
$blocks['sessions']['icon'] = Display::return_icon(
'session.png',
get_lang('Sessions'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['sessions']['label'] = api_ucfirst(get_lang('Sessions'));
$blocks['sessions']['class'] = 'block-admin-sessions';
if (api_is_platform_admin()) {
$blocks['sessions']['editable'] = true;
}
$sessionPath = api_get_path(WEB_CODE_PATH).'session/';
$search_form = ' <form method="GET" class="form-inline" action="'.$sessionPath.'session_list.php">
<div class="form-group mb-2">
<input class="form-control"
type="text"
name="keyword"
value=""
aria-label="'.get_lang('Search').'">
</div>
<button class="btn btn-primary mb-2" type="submit">
<em class="fa fa-search"></em> '.get_lang('Search').'
</button>
</form>';
$blocks['sessions']['search_form'] = $search_form;
$items = [];
$items[] = ['url' => $sessionPath.'session_list.php', 'label' => get_lang('ListSession')];
$items[] = ['url' => $sessionPath.'session_add.php', 'label' => get_lang('AddSession')];
$items[] = ['url' => $sessionPath.'session_category_list.php', 'label' => get_lang('ListSessionCategory')];
$items[] = ['url' => $sessionPath.'session_import.php', 'label' => get_lang('ImportSessionListXMLCSV')];
$items[] = ['url' => $sessionPath.'session_import_drh.php', 'label' => get_lang('ImportSessionDrhList')];
if (isset($extAuthSource) && isset($extAuthSource['ldap']) && count($extAuthSource['ldap']) > 0) {
$items[] = [
'url' => 'ldap_import_students_to_session.php',
'label' => get_lang('ImportLDAPUsersIntoSession'),
];
}
$items[] = [
'url' => $sessionPath.'session_export.php',
'label' => get_lang('ExportSessionListXMLCSV'),
];
if (api_is_global_platform_admin()) {
$items[] = [
'url' => '../coursecopy/copy_course_session.php',
'label' => get_lang('CopyFromCourseInSessionToAnotherSession'),
];
}
$allowCareer = api_get_configuration_value('allow_session_admin_read_careers');
if (api_is_platform_admin() || ($allowCareer && api_is_session_admin())) {
// option only visible in development mode. Enable through code if required
if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
$items[] = ['url' => 'user_move_stats.php', 'label' => get_lang('MoveUserStats')];
}
$items[] = ['url' => 'career_dashboard.php', 'label' => get_lang('CareersAndPromotions')];
$items[] = ['url' => 'extra_fields.php?type=session', 'label' => get_lang('ManageSessionFields')];
}
$blocks['sessions']['items'] = $items;
$blocks['sessions']['extra'] = null;
/* Settings */
if (api_is_platform_admin()) {
$blocks['settings']['icon'] = Display::return_icon(
@ -339,6 +403,7 @@ if (api_is_platform_admin()) {
false
);
$blocks['settings']['label'] = api_ucfirst(get_lang('System'));
$blocks['settings']['description'] = get_lang('View the status of your server, perform performance tests');
$blocks['settings']['class'] = 'block-admin-settings';
$items = [];
@ -395,74 +460,6 @@ if (api_is_platform_admin()) {
$blocks['settings']['extra'] = null;
$blocks['settings']['search_form'] = null;
// Skills
if (Skill::isToolAvailable()) {
$blocks['skills']['icon'] = Display::return_icon(
'skill-badges.png',
get_lang('Skills'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['skills']['label'] = get_lang('Skills');
$blocks['skills']['class'] = 'block-admin-skills';
$items = [];
$items[] = [
'url' => 'skills_wheel.php',
'label' => get_lang('SkillsWheel'),
];
$items[] = [
'url' => 'skills_import.php',
'label' => get_lang('SkillsImport'),
];
$items[] = [
'url' => 'skill_list.php',
'label' => get_lang('ManageSkills'),
];
$items[] = [
'url' => 'skill.php',
'label' => get_lang('ManageSkillsLevels'),
];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH).'social/skills_ranking.php',
'label' => get_lang('SkillsRanking'),
];
$items[] = [
'url' => 'skills_gradebook.php',
'label' => get_lang('SkillsAndGradebooks'),
];
/*$items[] = array(
'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
'label' => get_lang('Badges')
);*/
$blocks['skills']['items'] = $items;
$blocks['skills']['extra'] = null;
$blocks['skills']['search_form'] = null;
}
$allow = api_get_configuration_value('gradebook_dependency');
if ($allow) {
$blocks['gradebook']['icon'] = Display::return_icon(
'gradebook.png',
get_lang('Gradebook'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['gradebook']['label'] = get_lang('Gradebook');
$blocks['gradebook']['class'] = 'block-admin-gradebook';
$items = [];
$items[] = [
'url' => 'gradebook_list.php',
'label' => get_lang('List'),
];
$blocks['gradebook']['items'] = $items;
$blocks['gradebook']['extra'] = null;
$blocks['gradebook']['search_form'] = null;
}
}
if (api_is_platform_admin()) {
@ -509,29 +506,7 @@ if (api_is_platform_admin()) {
}
}
if (!api_get_configuration_value('disable_gdpr')) {
// Data protection
$blocks['data_privacy']['icon'] = Display::return_icon(
'platform.png',
get_lang('Platform'),
[],
ICON_SIZE_MEDIUM,
false
);
$blocks['data_privacy']['label'] = api_ucfirst(get_lang('PersonalDataPrivacy'));
$blocks['data_privacy']['class'] = 'block-admin-platform';
$blocks['data_privacy']['editable'] = false;
$items = [];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH).'admin/user_list_consent.php',
'label' => get_lang('UserList'),
];
$blocks['data_privacy']['items'] = $items;
$blocks['data_privacy']['extra'] = null;
$blocks['data_privacy']['search_form'] = null;
}
/* Chamilo.org */
$blocks['chamilo']['icon'] = Display::return_icon(
'platform.png',

@ -5,12 +5,17 @@
<div class="list-settings">
{% for block_item in blocks_admin %}
<div id="tabs-{{ loop.index }}" class="item-setting">
<div class="card">
<div class="card-body">
<div class="card mb-3">
<div class="card-header">
<h5 class="card-title">{{ block_item.icon }} {{ block_item.label }}</h5>
</div>
<div class="card-body">
<div class="card-search">
{{ block_item.search_form }}
</div>
<div class="card-description mp-3 mb-3">
{{ block_item.description }}
</div>
{% if block_item.items is not empty %}
<ul class="list-group">
{% for url in block_item.items %}

Loading…
Cancel
Save