Skip to content

Commit

Permalink
MDL-56677 cohort: Fix cohort search box misalignment
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Nov 3, 2016
1 parent 5d0299e commit 18bb288
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cohort/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}

// Add search form.
$search = html_writer::start_tag('form', array('id'=>'searchcohortquery', 'method'=>'get', 'class' => 'form-inline'));
$search = html_writer::start_tag('form', array('id'=>'searchcohortquery', 'method'=>'get', 'class' => 'form-inline search-cohort'));
$search .= html_writer::start_div('m-b-1');
$search .= html_writer::label(get_string('searchcohort', 'cohort'), 'cohort_search_q', true,
array('class' => 'm-r-1')); // No : in form labels!
Expand Down
19 changes: 19 additions & 0 deletions theme/bootstrapbase/less/moodle/buttons.less
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,25 @@ input[type="reset"] {
.btn-lineup;
}

// The above buttons rules are really dumb and muck things up for simple pages using bootstrap correctly.
// e.g. cohort search form.
// Undo the above silly rules one by one for pages we know to be broken by them.
form.search-cohort input[type="text"],
form.search-cohort input[type="submit"],
form.search-cohort label {
.m-t-1
}

form.search-cohort label {
margin-bottom: 0;
vertical-align: middle;
}

form.search-cohort input[type="submit"] {
margin-bottom: 0;
margin-left: 0;
}

button {
&.yui3-button {
&.closebutton {
Expand Down
14 changes: 14 additions & 0 deletions theme/bootstrapbase/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -15818,6 +15818,20 @@ input[type="submit"],
input[type="reset"] {
margin: 0 0 10px 5px;
}
form.search-cohort input[type="text"],
form.search-cohort input[type="submit"],
form.search-cohort label {
margin-top: 14px !important;
/* stylelint-disable-line declaration-no-important */
}
form.search-cohort label {
margin-bottom: 0;
vertical-align: middle;
}
form.search-cohort input[type="submit"] {
margin-bottom: 0;
margin-left: 0;
}
button.yui3-button.closebutton {
background-position: 0 0;
}
Expand Down

0 comments on commit 18bb288

Please sign in to comment.