From 11288e1598f7491645a64e6f975cff3c4adaad0c Mon Sep 17 00:00:00 2001 From: Bas Brands Date: Thu, 24 Jun 2021 12:16:48 +0200 Subject: [PATCH 1/2] MDL-71947 theme_boost: fix styles for vertical forms --- lib/form/templates/element-template.mustache | 2 +- theme/boost/scss/moodle/forms.scss | 16 +++++++++++++++- theme/boost/style/moodle.css | 12 +++++++++++- theme/classic/style/moodle.css | 12 +++++++++++- 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/lib/form/templates/element-template.mustache b/lib/form/templates/element-template.mustache index b77408b761d..8f6097f25cc 100644 --- a/lib/form/templates/element-template.mustache +++ b/lib/form/templates/element-template.mustache @@ -56,7 +56,7 @@ {{/element.staticlabel}} {{/ label }}{{/ label}} -
+
{{#required}}
{{#pix}}req, core, {{#str}}required{{/str}}{{/pix}} diff --git a/theme/boost/scss/moodle/forms.scss b/theme/boost/scss/moodle/forms.scss index 128228e5ba0..519d7c40d34 100644 --- a/theme/boost/scss/moodle/forms.scss +++ b/theme/boost/scss/moodle/forms.scss @@ -365,7 +365,8 @@ textarea[data-auto-rows] { margin-right: 0; & > .col-md-3, & > .col-md-9 { - float: none; + flex: 0 0 100%; + max-width: 100%; width: inherit; padding-right: 0; padding-left: 0; @@ -373,6 +374,19 @@ textarea[data-auto-rows] { &.femptylabel > .col-md-3 { display: none; } + .form-control { + width: 100%; + } + } +} + +.mform .col-form-label .form-label-addon { + margin-left: 0.25rem; +} + +@include media-breakpoint-up(sm) { + .mform:not(.full-width-labels) .col-form-label .form-label-addon { + margin-left: auto; } } diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 4cd39038e7c..8d7d4f9c522 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -16673,12 +16673,22 @@ textarea[data-auto-rows] { margin-right: 0; } .mform.full-width-labels .fitem.row > .col-md-3, .mform.full-width-labels .fitem.row > .col-md-9 { - float: none; + flex: 0 0 100%; + max-width: 100%; width: inherit; padding-right: 0; padding-left: 0; } .mform.full-width-labels .fitem.row.femptylabel > .col-md-3 { display: none; } + .mform.full-width-labels .fitem.row .form-control { + width: 100%; } + +.mform .col-form-label .form-label-addon { + margin-left: 0.25rem; } + +@media (min-width: 576px) { + .mform:not(.full-width-labels) .col-form-label .form-label-addon { + margin-left: auto; } } /** Allow wrapping an mform in a div with the form-inline class to have an inline, responsive form. */ @media (min-width: 768px) { diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index d444630f39d..a8917453e7a 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -16907,12 +16907,22 @@ textarea[data-auto-rows] { margin-right: 0; } .mform.full-width-labels .fitem.row > .col-md-3, .mform.full-width-labels .fitem.row > .col-md-9 { - float: none; + flex: 0 0 100%; + max-width: 100%; width: inherit; padding-right: 0; padding-left: 0; } .mform.full-width-labels .fitem.row.femptylabel > .col-md-3 { display: none; } + .mform.full-width-labels .fitem.row .form-control { + width: 100%; } + +.mform .col-form-label .form-label-addon { + margin-left: 0.25rem; } + +@media (min-width: 576px) { + .mform:not(.full-width-labels) .col-form-label .form-label-addon { + margin-left: auto; } } /** Allow wrapping an mform in a div with the form-inline class to have an inline, responsive form. */ @media (min-width: 768px) { From 72a7171b5c314faa4ab7a8c33540eb63e4e9eac4 Mon Sep 17 00:00:00 2001 From: Bas Brands Date: Thu, 24 Jun 2021 12:31:13 +0200 Subject: [PATCH 2/2] MDL-71947 core_quiz: vertical forms for access rule popups --- mod/quiz/accessmanager_form.php | 1 + mod/quiz/styles.css | 21 +-------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/mod/quiz/accessmanager_form.php b/mod/quiz/accessmanager_form.php index dd3b48ffb1e..e2e6fc5e241 100644 --- a/mod/quiz/accessmanager_form.php +++ b/mod/quiz/accessmanager_form.php @@ -56,6 +56,7 @@ class mod_quiz_preflight_check_form extends moodleform { } $this->add_action_buttons(true, get_string('startattempt', 'quiz')); + $this->set_display_vertical(); $mform->setDisableShortforms(); } diff --git a/mod/quiz/styles.css b/mod/quiz/styles.css index f4763f9d1d7..e3a70a77e39 100644 --- a/mod/quiz/styles.css +++ b/mod/quiz/styles.css @@ -303,33 +303,14 @@ table.quizattemptsummary .noreviewmessage { .moodle-dialogue-base .moodle-dialogue.mod_quiz_preflight_popup { width: 600px; } - .moodle-dialogue-base .moodle-dialogue.mod_quiz_preflight_popup .moodle-dialogue-wrap { overflow: hidden; } .moodle-dialogue-base .moodle-dialogue.mod_quiz_preflight_popup .moodle-dialogue-bd { - padding: 0; + padding: 1rem; } -.moodle-dialogue-base .moodle-dialogue.mod_quiz_preflight_popup .moodle-dialogue-bd #mod_quiz_preflight_form legend { - padding: 0 10px; - margin: 0; - border: 0 none; -} - -.moodle-dialogue-base .moodle-dialogue.mod_quiz_preflight_popup .moodle-dialogue-bd #mod_quiz_preflight_form .fitem { - margin-left: 10px; -} - -.moodle-dialogue-base .moodle-dialogue.mod_quiz_preflight_popup .moodle-dialogue-bd #mod_quiz_preflight_form #fgroup_id_buttonar { - padding: 10px 0 0; - margin: 0; -} - -.moodle-dialogue-base .moodle-dialogue.mod_quiz_preflight_popup .moodle-dialogue-content .moodle-dialogue-ft { - margin: 0; -} /* Standard Moodle rule that needs to be more specific here. */ .moodle-dialogue-bd #mod_quiz_preflight_form fieldset.hidden { display: inherit;