diff --git a/assets/css/app.scss b/assets/css/app.scss index 3bc7254fb5..c5d99b6eaa 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -606,7 +606,9 @@ form .field { } .freeze + label, - .advmultiselect + label { + .advmultiselect + label, + textarea + label.settings-label + { font-size: 13px; @apply absolute top-0 left-0 text-support-3 text-caption px-1 bg-white text-primary; } diff --git a/assets/vue/views/ccalendarevent/CCalendarEventList.vue b/assets/vue/views/ccalendarevent/CCalendarEventList.vue index 1afed113d8..442c9104b5 100644 --- a/assets/vue/views/ccalendarevent/CCalendarEventList.vue +++ b/assets/vue/views/ccalendarevent/CCalendarEventList.vue @@ -79,7 +79,7 @@ v-if="allowToEdit && showEditButton" :label="t('Edit')" type="secondary" - icon="delete" + icon="edit" @click="dialog = true" /> diff --git a/public/main/my_space/myStudents.php b/public/main/my_space/myStudents.php index 71a645370d..1532d24c1a 100644 --- a/public/main/my_space/myStudents.php +++ b/public/main/my_space/myStudents.php @@ -2182,7 +2182,7 @@ if ($allowMessages) { 'javascript: void(0);', [ 'onClick' => "$('#compose_message').show();", - 'class' => 'btn btn--plain', + 'class' => 'btn btn--plain mb-6', ] ); diff --git a/src/CoreBundle/Settings/AbstractSettingsSchema.php b/src/CoreBundle/Settings/AbstractSettingsSchema.php index e4a3f82828..d512ff6244 100644 --- a/src/CoreBundle/Settings/AbstractSettingsSchema.php +++ b/src/CoreBundle/Settings/AbstractSettingsSchema.php @@ -9,6 +9,7 @@ namespace Chamilo\CoreBundle\Settings; use Doctrine\ORM\EntityRepository; use Sylius\Bundle\SettingsBundle\Schema\AbstractSettingsBuilder; use Sylius\Bundle\SettingsBundle\Schema\SchemaInterface; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Contracts\Translation\TranslatorInterface; @@ -62,26 +63,37 @@ abstract class AbstractSettingsSchema implements SchemaInterface { $settingsInfo = $this->getSettingsInfoFromDatabase(); foreach ($builder->all() as $fieldName => $field) { + $options = $field->getOptions(); + $labelAttributes = $options['label_attr'] ?? []; + $labelAttributes['class'] = (isset($labelAttributes['class']) ? $labelAttributes['class'] . ' ' : '') . 'settings-label'; + $options['label_attr'] = $labelAttributes; + if (isset($settingsInfo[$fieldName])) { $fieldConfig = $settingsInfo[$fieldName]; - $options = $field->getOptions(); $labelFromDb = $this->translator->trans($fieldConfig['label']); $helpFromDb = $this->translator->trans($fieldConfig['help']); $existingHelp = $options['help'] ?? ''; - if (!empty($existingHelp)) { - $combinedHelp = $helpFromDb.'
'.$existingHelp; - } else { - $combinedHelp = $helpFromDb; - } + $combinedHelp = !empty($existingHelp) ? $helpFromDb . '
' . $existingHelp : $helpFromDb; $options['label'] = $labelFromDb; $options['help'] = $combinedHelp; - - $builder->remove($fieldName); - $builder->add($fieldName, \get_class($field->getType()->getInnerType()), $options); + $options['label_html'] = true; + $options['help_html'] = true; + + if ($field->getType()->getInnerType() instanceof ChoiceType && isset($options['choices'])) { + $translatedChoices = []; + foreach ($options['choices'] as $key => $value) { + $readableKey = ucfirst(strtolower(str_replace('_', ' ', $key))); + $translatedChoices[$this->translator->trans($readableKey)] = $value; + } + $options['choices'] = $translatedChoices; + } } + + $builder->remove($fieldName); + $builder->add($fieldName, \get_class($field->getType()->getInnerType()), $options); } } } diff --git a/src/CoreBundle/Settings/CourseSettingsSchema.php b/src/CoreBundle/Settings/CourseSettingsSchema.php index cd35fd87a9..e0f476bc0f 100644 --- a/src/CoreBundle/Settings/CourseSettingsSchema.php +++ b/src/CoreBundle/Settings/CourseSettingsSchema.php @@ -170,9 +170,9 @@ class CourseSettingsSchema extends AbstractSettingsSchema [ 'choices' => [ 'No' => 'false', - 'IconsOnly' => 'icons', - 'TextOnly' => 'text', - 'IconsText' => 'iconstext', + 'Icons only' => 'icons', + 'Text only' => 'text', + 'Icons text' => 'iconstext', ], ] ) @@ -182,10 +182,10 @@ class CourseSettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'CourseHomepage' => 'course_home', - 'CourseCode' => 'course_code', - 'CourseTitle' => 'course_title', - 'SessionNameAndCourseTitle' => 'session_name_and_course_title', + 'Course homepage' => 'course_home', + 'Course code' => 'course_code', + 'Course title' => 'course_title', + 'Session name and course title' => 'session_name_and_course_title', ], ] ) diff --git a/src/CoreBundle/Settings/DisplaySettingsSchema.php b/src/CoreBundle/Settings/DisplaySettingsSchema.php index d5435d9e63..1dc67ef5c9 100644 --- a/src/CoreBundle/Settings/DisplaySettingsSchema.php +++ b/src/CoreBundle/Settings/DisplaySettingsSchema.php @@ -97,10 +97,10 @@ class DisplaySettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'DoNotShow' => 'do_not_show', - 'ShowToAdminsOnly' => 'show_to_admin', - 'ShowToAdminsAndTeachers' => 'show_to_admin_and_teachers', - 'ShowToAllUsers' => 'show_to_all', + 'Do not show' => 'do_not_show', + 'Show to admins only' => 'show_to_admin', + 'Show to admins and teachers' => 'show_to_admin_and_teachers', + 'Show to all users' => 'show_to_all', ], ] ) diff --git a/src/CoreBundle/Settings/DocumentSettingsSchema.php b/src/CoreBundle/Settings/DocumentSettingsSchema.php index 646f7d7e65..4ff0114882 100644 --- a/src/CoreBundle/Settings/DocumentSettingsSchema.php +++ b/src/CoreBundle/Settings/DocumentSettingsSchema.php @@ -91,8 +91,8 @@ class DocumentSettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'Blacklist' => 'blacklist', - 'Whitelist' => 'whitelist', + 'Black list' => 'blacklist', + 'White list' => 'whitelist', ], ] ) @@ -107,9 +107,9 @@ class DocumentSettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'ShowGlossaryInDocumentsIsNone' => 'none', - 'ShowGlossaryInDocumentsIsManual' => 'ismanual', - 'ShowGlossaryInDocumentsIsAutomatic' => 'isautomatic', + 'Show glossary in documents is none' => 'none', + 'Show glossary in documents is manual' => 'ismanual', + 'Show glossary in documents is automatic' => 'isautomatic', ], ] ) diff --git a/src/CoreBundle/Settings/ExerciseSettingsSchema.php b/src/CoreBundle/Settings/ExerciseSettingsSchema.php index f25bb2a24c..33d2bea02f 100644 --- a/src/CoreBundle/Settings/ExerciseSettingsSchema.php +++ b/src/CoreBundle/Settings/ExerciseSettingsSchema.php @@ -139,10 +139,10 @@ class ExerciseSettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'none' => '0', - 'SCORE_AVERAGE' => '1', - 'SCORE_PERCENT' => '2', - 'SCORE_DIV_PERCENT' => '3', + 'None' => '0', + 'Score average' => '1', + 'Score percent' => '2', + 'Score div percent' => '3', ], ], ) diff --git a/src/CoreBundle/Settings/GlossarySettingsSchema.php b/src/CoreBundle/Settings/GlossarySettingsSchema.php index f3a88fed9d..190f6faf38 100644 --- a/src/CoreBundle/Settings/GlossarySettingsSchema.php +++ b/src/CoreBundle/Settings/GlossarySettingsSchema.php @@ -42,7 +42,7 @@ class GlossarySettingsSchema extends AbstractSettingsSchema 'None' => 'none', 'Exercise' => 'exercise', 'LearningPath' => 'lp', - 'ExerciseAndLearningPath' => 'exercise_and_lp', + 'Exercise and LearningPath' => 'exercise_and_lp', ], ] ) diff --git a/src/CoreBundle/Settings/PlatformSettingsSchema.php b/src/CoreBundle/Settings/PlatformSettingsSchema.php index b1d26d8c02..c15d51ff8c 100644 --- a/src/CoreBundle/Settings/PlatformSettingsSchema.php +++ b/src/CoreBundle/Settings/PlatformSettingsSchema.php @@ -144,10 +144,10 @@ class PlatformSettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'CatalogueHide' => '-1', - 'CatalogueShowOnlyCourses' => '0', - 'CatalogueShowOnlySessions' => '1', - 'CatalogueShowCoursesAndSessions' => '2', + 'Catalogue hide' => '-1', + 'Catalogue show only courses' => '0', + 'Catalogue show only sessions' => '1', + 'Catalogue show courses and sessions' => '2', ], ] ) diff --git a/src/CoreBundle/Settings/RegistrationSettingsSchema.php b/src/CoreBundle/Settings/RegistrationSettingsSchema.php index 4d09f14f49..0ea9ed0e72 100644 --- a/src/CoreBundle/Settings/RegistrationSettingsSchema.php +++ b/src/CoreBundle/Settings/RegistrationSettingsSchema.php @@ -96,7 +96,7 @@ class RegistrationSettingsSchema extends AbstractSettingsSchema 'choices' => [ 'Yes' => 'true', 'No' => 'false', - 'MailConfirmation' => 'confirmation', + 'Mail confirmation' => 'confirmation', 'Approval' => 'approval', ], ] @@ -108,9 +108,9 @@ class RegistrationSettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'CampusHomepage' => 'index.php', - 'MyCourses' => 'user_portal.php', - 'CourseCatalog' => 'main/auth/courses.php', + 'Campus homepage' => 'index.php', + 'My courses' => 'user_portal.php', + 'Course catalog' => 'main/auth/courses.php', ], ] ) diff --git a/src/CoreBundle/Settings/SearchSettingsSchema.php b/src/CoreBundle/Settings/SearchSettingsSchema.php index e73a8f229f..caa8a519d3 100644 --- a/src/CoreBundle/Settings/SearchSettingsSchema.php +++ b/src/CoreBundle/Settings/SearchSettingsSchema.php @@ -38,8 +38,8 @@ class SearchSettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'SearchShowUnlinkedResults' => 'true', - 'SearchHideUnlinkedResults' => 'false', + 'Search show unlinked results' => 'true', + 'Search hide unlinked results' => 'false', ], ] ) diff --git a/src/CoreBundle/Settings/SurveySettingsSchema.php b/src/CoreBundle/Settings/SurveySettingsSchema.php index ba977d6053..5106b32655 100644 --- a/src/CoreBundle/Settings/SurveySettingsSchema.php +++ b/src/CoreBundle/Settings/SurveySettingsSchema.php @@ -48,8 +48,8 @@ class SurveySettingsSchema extends AbstractSettingsSchema ChoiceType::class, [ 'choices' => [ - 'CourseCoachEmailSender' => 'coach', - 'NoReplyEmailSender' => 'noreply', + 'Course coach email sender' => 'coach', + 'No reply email sender' => 'noreply', ], ] )