Skip to content

Commit

Permalink
MDL-68259 user: add styling to participant filters
Browse files Browse the repository at this point in the history
Part of MDL-67743
  • Loading branch information
Bas Brands authored and andrewnicols committed May 27, 2020
1 parent 110f3eb commit 6881ca3
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 26 deletions.
6 changes: 4 additions & 2 deletions lib/templates/form_autocomplete_input.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
{ "inputID": 1, "suggestionsId": 2, "selectionId": 3, "downArrowId": 4, "placeholder": "Select something" }
}}
{{#showSuggestions}}
<div class="d-inline-block position-relative">
<div class="d-md-inline-block mr-md-2 position-relative">
<input type="text" id="{{inputId}}" class="form-control" list="{{suggestionsId}}" placeholder="{{placeholder}}" role="combobox" aria-expanded="false" autocomplete="off" autocorrect="off" autocapitalize="off" aria-autocomplete="list" aria-owns="{{suggestionsId}} {{selectionId}}" {{#tags}}data-tags="1"{{/tags}}/>
<span class="form-autocomplete-downarrow position-absolute p-1" id="{{downArrowId}}">&#x25BC;</span>
</div>
{{/showSuggestions}}
{{^showSuggestions}}
<input type="text" id="{{inputId}}" placeholder="{{placeholder}}" role="textbox" aria-owns="{{selectionId}}" {{#tags}}data-tags="1"{{/tags}}/>
<div class="d-md-inline-block mr-md-2">
<input type="text" id="{{inputId}}" class="form-control" placeholder="{{placeholder}}" role="textbox" aria-owns="{{selectionId}}" {{#tags}}data-tags="1"{{/tags}}/>
</div>
{{/showSuggestions}}

{{#js}}
Expand Down
6 changes: 6 additions & 0 deletions theme/boost/scss/moodle/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2402,6 +2402,12 @@ body.h5p-embed {
height: 1.5rem;
}

.border-radius {
@if $enable-rounded {
@include border-radius($card-border-radius);
}
}

// Emoji picker.
$picker-width: 350px !default;
$picker-width-xs: 320px !default;
Expand Down
3 changes: 3 additions & 0 deletions theme/classic/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -11772,6 +11772,9 @@ body.h5p-embed .h5pmessages {
color: #343a40;
height: 1.5rem; }

.border-radius {
border-radius: 0.25rem; }

.emoji-picker {
width: 350px;
height: 400px; }
Expand Down
2 changes: 1 addition & 1 deletion user/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
foreach ($enrolbuttons as $enrolbutton) {
$enrolbuttonsout .= $enrolrenderer->render($enrolbutton);
}
echo html_writer::div($enrolbuttonsout, 'float-right', [
echo html_writer::div($enrolbuttonsout, 'd-flex justify-content-end', [
'data-region' => 'wrapper',
'data-table-uniqueid' => $participanttable->uniqueid,
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
], "noSelectionString": "No selection" }
}}
<div{{!
}} class="d-inline-block px-2{{#multiple}} form-autocomplete-multiple{{/multiple}}"{{!
}} class="d-inline-block mb-0{{#multiple}} form-autocomplete-multiple h5{{/multiple}}"{{!
}} id="{{selectionId}}"{{!
}} role="list"{{!
}} aria-atomic="true"{{!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}}
{{#items}}
<span role="listitem" data-value="{{value}}" aria-selected="true"
class="d-inline-block bg-dark text-white rounded font-weight-bold px-1 m-1">
class="badge badge-secondary clickable text-wrap text-break line-height-4 mr-2 my-1">
{{label}}<i class="icon fa fa-times pl-2 mr-0"></i>
</span>
{{/items}}
Expand Down
26 changes: 14 additions & 12 deletions user/templates/local/participantsfilter/filterrow.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,31 @@
}
}}
<div data-filterregion="filter">
<div class="rounded mb-3 p-2 bg-white border border-secondary d-flex align-items-center">
<label for="core_user-local-participantsfilter-filterrow-jointype-{{uniqid}}" class="pt-2">{{#str}}match, core_user{{/str}}</label>
<select class="custom-select" data-filterfield="join" id="core_user-local-participantsfilter-filterrow-jointype-{{uniqid}}">
<option value="0">{{#str}}none{{/str}}</option>
<option selected=selected value="1">{{#str}}any{{/str}}</option>
<option value="2">{{#str}}all{{/str}}</option>
</select>
<div class="border-radius my-2 p-2 bg-white border d-flex flex-column flex-md-row align-items-md-start">
<div class="d-flex flex-column flex-md-row align-items-md-center">
<label for="core_user-local-participantsfilter-filterrow-jointype-{{uniqid}}" class="mr-md-2 mb-md-0">{{#str}}match, core_user{{/str}}</label>
<select class="custom-select mb-1 mb-md-0 mr-md-2" data-filterfield="join" id="core_user-local-participantsfilter-filterrow-jointype-{{uniqid}}">
<option value="0">{{#str}}none{{/str}}</option>
<option selected=selected value="1">{{#str}}any{{/str}}</option>
<option value="2">{{#str}}all{{/str}}</option>
</select>
</div>

<label class="sr-only pt-2" for="core_user-local-participantsfilter-filterrow-filtertype-{{uniqid}}">filtertype</label>
<select class="custom-select" data-filterfield="type" id="core_user-local-participantsfilter-filterrow-filtertype-{{uniqid}}">
<select class="custom-select mb-1 mb-md-0 mr-md-2" data-filterfield="type" id="core_user-local-participantsfilter-filterrow-filtertype-{{uniqid}}">
<option value="">{{#str}}selectfiltertype, core_user{{/str}}</option>
{{#filtertypes}}
<option value="{{name}}">{{title}}</option>
{{/filtertypes}}
</select>

<div data-filterregion="value"></div>
<div data-filterregion="value" class="d-md-flex flex-column align-items-start flex-lg-row"></div>

<button data-filteraction="remove" class="ml-auto btn btn-link text-reset" aria-label="{{#str}}clearfilterrow, core_user{{/str}}">
<i class="icon fa fa-times-circle pt-2"></i>
<button data-filteraction="remove" class="ml-auto icon-no-margin icon-size-4 btn text-reset" aria-label="{{#str}}clearfilterrow, core_user{{/str}}">
<i class="icon fa fa-times-circle"></i>
</button>
</div>
<div data-filterregion="joinadverb">
<div data-filterregion="joinadverb" class="pl-1 text-uppercase font-weight-bold">
<div data-filterverbfor="0">{{#str}}adverbfor_andnot, core_user{{/str}}</div>
<div data-filterverbfor="1">{{#str}}adverbfor_or, core_user{{/str}}</div>
<div data-filterverbfor="2">{{#str}}adverbfor_and, core_user{{/str}}</div>
Expand Down
15 changes: 6 additions & 9 deletions user/templates/participantsfilter.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
}
}}

<div id="core_user-participantsfilter-{{uniqid}}" class="filter-group mt-5 p-3 rounded border border-secondary" data-table-region="{{tableregionid}}" data-table-course-id="{{courseid}}" data-filterverb="1">
<div id="core_user-participantsfilter-{{uniqid}}" class="filter-group my-2 p-2 bg-light border-radius border" data-table-region="{{tableregionid}}" data-table-course-id="{{courseid}}" data-filterverb="1">
<div data-filterregion="filtermatch" class="hidden">
<label for="core_user-local-participantsfilter-jointype-{{uniqid}}" class="pt-2">{{#str}}match, core_user{{/str}}</label>
<label for="core_user-local-participantsfilter-jointype-{{uniqid}}" class="my-0">{{#str}}match, core_user{{/str}}</label>
<select class="custom-select" data-filterfield="join" id="core_user-local-participantsfilter-jointype-{{uniqid}}">
<option value="0">{{#str}}none{{/str}}</option>
<option selected=selected value="1">{{#str}}any{{/str}}</option>
Expand All @@ -54,16 +54,13 @@
{{> core_user/local/participantsfilter/filterrow }}
</div>

<div class="display-block" data-filterregion="actions">
<div class="d-flex" data-filterregion="actions">
&nbsp;
<button type="button" class="btn btn-link d-inline-block float-left" data-filteraction="add">
<button type="button" class="btn btn-link text-reset" data-filteraction="add">
<i class="fa fa-plus"></i><span class="pl-3">{{#str}}addcondition, core_user{{/str}}</span>
</button>

<div class="float-right">
<button data-filteraction="reset" type="button" class="btn btn-light d-inline-block">{{#str}}clearfilters, core_user{{/str}}</button>
<button data-filteraction="apply" type="button" class="btn btn-primary d-inline-block">{{#str}}applyfilters, core_user{{/str}}</button>
</div>
<button data-filteraction="reset" type="button" class="btn btn-secondary ml-auto mr-2">{{#str}}clearfilters, core_user{{/str}}</button>
<button data-filteraction="apply" type="button" class="btn btn-primary">{{#str}}applyfilters, core_user{{/str}}</button>
</div>

{{> core_user/local/participantsfilter/filtertypes}}
Expand Down

0 comments on commit 6881ca3

Please sign in to comment.