Skip to content

Commit

Permalink
MDL-61019 Theme boost: lesson display issues with buttons/progress bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Jul 13, 2018
1 parent 8c51626 commit 9004441
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mod/lesson/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,14 @@ public function progress_bar(lesson $lesson, $progress = null) {
$progress = $lesson->calculate_progress();
}

// print out the Progress Bar. Attempted to put as much as possible in the style sheets.
$content = '<br />' . html_writer::tag('div', $progress . '%', array('class' => 'progress_bar_completed', 'style' => 'width: '. $progress . '%;'));
$printprogress = html_writer::tag('div', get_string('progresscompleted', 'lesson', $progress) . $content, array('class' => 'progress_bar'));

$content = html_writer::start_tag('div');
$content .= html_writer::start_tag('div', array('class' => 'progress'));
$content .= html_writer::start_tag('div', array('class' => 'progress-bar bar', 'role' => 'progressbar',
'style' => 'width: ' . $progress .'%', 'aria-valuenow' => $progress, 'aria-valuemin' => 0, 'aria-valuemax' => 100));
$content .= $progress . "%";
$content .= html_writer::end_tag('div');
$content .= html_writer::end_tag('div');
$printprogress = html_writer::tag('div', get_string('progresscompleted', 'lesson', $progress) . $content);
return $this->output->box($printprogress, 'progress_bar');
}

Expand Down
9 changes: 9 additions & 0 deletions theme/boost/scss/moodle/modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ div#dock {
#page-mod-lesson-view .branchbuttoncontainer .singlebutton button[type="submit"] {
white-space: normal;
}
#page-mod-lesson-view {
.vertical .singlebutton {
display: block;
+ .singlebutton {
margin-left: 0;
margin-top: 1rem;
}
}
}
.path-mod-lesson .generaltable td {
vertical-align: middle;
label {
Expand Down
6 changes: 6 additions & 0 deletions theme/boost/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -15414,6 +15414,12 @@ div#dock {
#page-mod-lesson-view .branchbuttoncontainer .singlebutton button[type="submit"] {
white-space: normal; }

#page-mod-lesson-view .vertical .singlebutton {
display: block; }
#page-mod-lesson-view .vertical .singlebutton + .singlebutton {
margin-left: 0;
margin-top: 1rem; }

.path-mod-lesson .generaltable td {
vertical-align: middle; }
.path-mod-lesson .generaltable td label {
Expand Down

0 comments on commit 9004441

Please sign in to comment.