Skip to content

Commit

Permalink
MDL-56988 report: review and apply boosty styles to all reports
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Nov 23, 2016
1 parent 3fd8400 commit 270b2e4
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion admin/tool/monitor/classes/output/managerules/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function render_table(renderable $renderable) {
protected function render_add_button($courseid) {
global $CFG;

$button = \html_writer::tag('button', get_string('addrule', 'tool_monitor'));
$button = \html_writer::tag('button', get_string('addrule', 'tool_monitor'), ['class' => 'btn btn-primary']);
$addurl = new \moodle_url($CFG->wwwroot. '/admin/tool/monitor/edit.php', array('courseid' => $courseid));
return \html_writer::link($addurl, $button);
}
Expand Down
21 changes: 13 additions & 8 deletions admin/tool/spamcleaner/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@

<div class="mdl-align">

<form method="post" action="index.php">
<form method="post" action="index.php" class="form-inline spamcleanerform">
<div>
<label class="accesshide" for="keyword_el"><?php print_string('spamkeyword', 'tool_spamcleaner') ?></label>
<input type="text" name="keyword" id="keyword_el" value="<?php p($keyword) ?>" />
<input type="text" class="form-control" name="keyword" id="keyword_el" value="<?php p($keyword) ?>" />
<input type="hidden" name="sesskey" value="<?php echo sesskey();?>" />
<input type="submit" value="<?php echo get_string('spamsearch', 'tool_spamcleaner')?>" />
<input type="submit" class="btn btn-primary" value="<?php echo get_string('spamsearch', 'tool_spamcleaner')?>" />
</div>
</form>
<p><?php echo get_string('spameg', 'tool_spamcleaner');?></p>
Expand All @@ -110,7 +110,8 @@

<form method="post" action="index.php">
<div>
<input type="submit" name="autodetect" value="<?php echo get_string('spamauto', 'tool_spamcleaner');?>" />
<input type="submit" class="btn btn-primary" name="autodetect"
value="<?php echo get_string('spamauto', 'tool_spamcleaner');?>" />
</div>
</form>

Expand Down Expand Up @@ -256,7 +257,9 @@ function print_user_list($users_rs, $keywords) {
foreach ($users_rs as $rs){
foreach ($rs as $user) {
if (!$count) {
echo '<table border="1" width="100%" id="data-grid"><tr><th>&nbsp;</th><th>'.get_string('user','admin').'</th><th>'.get_string('spamdesc', 'tool_spamcleaner').'</th><th>'.get_string('spamoperation', 'tool_spamcleaner').'</th></tr>';
echo '<table class="table table-bordered" border="1" width="100%" id="data-grid"><tr><th>&nbsp;</th>
<th>'.get_string('user', 'admin').'</th><th>'.get_string('spamdesc', 'tool_spamcleaner').'</th>
<th>'.get_string('spamoperation', 'tool_spamcleaner').'</th></tr>';
}
$count++;
filter_user($user, $keywords, $count);
Expand All @@ -269,7 +272,7 @@ function print_user_list($users_rs, $keywords) {
} else {
echo '</table>';
echo '<div class="mld-align">
<button id="removeall_btn">'.get_string('spamdeleteall', 'tool_spamcleaner').'</button>
<button id="removeall_btn" class="btn btn-secondary">'.get_string('spamdeleteall', 'tool_spamcleaner').'</button>
</div>';
}
}
Expand Down Expand Up @@ -357,8 +360,10 @@ function print_user_entry($user, $keywords, $count) {

$html .= '<td align="left">'.format_text($user->description, $user->descriptionformat, array('overflowdiv'=>true)).'</td>';
$html .= '<td width="100px" align="center">';
$html .= '<button onclick="M.tool_spamcleaner.del_user(this,'.$user->id.')">'.get_string('deleteuser', 'admin').'</button><br />';
$html .= '<button onclick="M.tool_spamcleaner.ignore_user(this,'.$user->id.')">'.get_string('ignore', 'admin').'</button>';
$html .= '<button class="btn btn-primary" onclick="M.tool_spamcleaner.del_user(this,'.$user->id.')">'.
get_string('deleteuser', 'admin').'</button><br />';
$html .= '<button class="btn btn-secondary" onclick="M.tool_spamcleaner.ignore_user(this,'.$user->id.')">'.
get_string('ignore', 'admin').'</button>';
$html .= '</td>';
$html .= '</tr>';
return $html;
Expand Down
3 changes: 2 additions & 1 deletion comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
$return = $manager->print_comments($page);
// if no comments available, $return will be false
if ($return) {
echo '<input type="submit" id="comments_delete" name="batchdelete" value="'.get_string('delete').'" />';
echo '<input type="submit" class="btn btn-primary" id="comments_delete" name="batchdelete"
value="'.get_string('delete').'" />';
}
echo '</form>';
}
Expand Down
3 changes: 2 additions & 1 deletion comment/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public function print_comments($page = 0) {

$table = new html_table();
$table->head = array (
html_writer::checkbox('selectall', '', false, get_string('selectall'), array('id'=>'comment_select_all', 'class'=>'comment-report-selectall')),
html_writer::checkbox('selectall', '', false, get_string('selectall'), array('id' => 'comment_select_all',
'class' => 'm-r-1')),
get_string('author', 'search'),
get_string('content'),
get_string('action')
Expand Down
2 changes: 1 addition & 1 deletion lib/outputcomponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ public static function select(array $options, $name, $selected = '', $nothing =
$class = str_replace(']', '', $class);
$attributes['class'] = $class;
}
$attributes['class'] = 'select custom-select ' . $attributes['class']; // Add 'select' selector always
$attributes['class'] = 'select custom-select ' . $attributes['class']; // Add 'select' selector always.

$attributes['name'] = $name;

Expand Down
3 changes: 2 additions & 1 deletion report/completion/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@
exit;
}

print '<table id="completion-progress" class="generaltable flexible boxaligncenter completionreport" style="text-align: left" cellpadding="5" border="1">';
print '<table id="completion-progress" class="table table-bordered generaltable flexible boxaligncenter
completionreport" style="text-align: left" cellpadding="5" border="1">';

// Print criteria group names
print PHP_EOL.'<thead><tr style="vertical-align: top">';
Expand Down
9 changes: 6 additions & 3 deletions report/courseoverview/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
print_error('nostatstodisplay', 'error', $CFG->wwwroot.'/course/view.php?id='.$course->id);
}

echo html_writer::start_tag('form', array('action' => 'index.php', 'method' => 'post'));
echo html_writer::start_tag('form', array('action' => 'index.php', 'method' => 'post', 'class' => 'form-inline'));
echo html_writer::start_tag('div');

$table = new html_table();
Expand All @@ -85,8 +85,11 @@
$table->data[] = array(get_string('statsreporttype'),$reporttypemenu,
get_string('statstimeperiod'),$timeoptionsmenu,
html_writer::label(get_string('numberofcourses'), 'numcourses', false, array('class' => 'accesshide')) .
html_writer::empty_tag('input', array('type' => 'text', 'id' => 'numcourses', 'name' => 'numcourses', 'size' => '3', 'maxlength' => '2', 'value' => $numcourses)),
html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('view'))));
html_writer::empty_tag('input', array('type' => 'text', 'class' => 'form-control',
'id' => 'numcourses', 'name' => 'numcourses', 'size' => '3', 'maxlength' => '2',
'value' => $numcourses)),
html_writer::empty_tag('input', array('type' => 'submit', 'class' => 'btn btn-secondary',
'value' => get_string('view'))));

echo html_writer::table($table);
echo html_writer::end_tag('div');
Expand Down
4 changes: 3 additions & 1 deletion report/log/classes/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ public function report_selector_form(report_log_renderable $reportlog) {
'id' => $selectedcourseid, 'date' => $reportlog->date, 'modid' => $reportlog->modid,
'showusers' => 1, 'showcourses' => $reportlog->showcourses));
$a->url = $a->url->out(false);
echo html_writer::start_span('m-x-1');
print_string('logtoomanyusers', 'moodle', $a);
echo html_writer::end_span();
}

// Add date selector.
Expand Down Expand Up @@ -187,7 +189,7 @@ public function report_selector_form(report_log_renderable $reportlog) {
echo html_writer::select($readers, 'logreader', $reportlog->selectedlogreader, false);
}
echo html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('gettheselogs'),
'class' => 'btn btn-primary'));
'class' => 'btn btn-secondary'));
}
echo html_writer::end_div();
echo html_writer::end_tag('form');
Expand Down
16 changes: 3 additions & 13 deletions report/participation/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,25 +220,15 @@ function report_participation_print_filter_form($course, $timefrom, $minlog, $ac
$instanceoptions[] = array(get_string('modulenameplural', $module->name)=>$instances);
}

echo '<form class="participationselectform" action="index.php" method="get"><div>'."\n".
echo '<form class="participationselectform form-inline" action="index.php" method="get"><div>'."\n".
'<input type="hidden" name="id" value="'.$course->id.'" />'."\n";
echo '<div class="form-group">'."\n";
echo '<label for="menuinstanceid">'.get_string('activitymodule').'</label>'."\n";
echo html_writer::select($instanceoptions, 'instanceid', $instanceid);
echo '</div>'."\n";
echo '<div class="form-group form-inline">'."\n";
echo '<div class="form-group">'."\n";
echo '<label for="menutimefrom">'.get_string('lookback').'</label>'."\n";
echo html_writer::select($timeoptions,'timefrom',$timefrom);
echo '</div>'."\n";
echo '<div class="form-group">'."\n";
echo '<label for="menuroleid">'.get_string('showonly').'</label>'."\n";
echo html_writer::select($roleoptions,'roleid',$roleid,false);
echo '</div>'."\n";
echo '<div class="form-group">'."\n";
echo '<label for="menuaction">'.get_string('showactions').'</label>'."\n";
echo html_writer::select($actionoptions,'action',$action,false);
echo '</div>'."\n";
echo '</div>'."\n";
echo '<input type="submit" value="'.get_string('go').'" class="btn btn-primary" />'."\n</div></form>\n";
echo html_writer::select($actionoptions, 'action', $action, false, ['class' => 'm-r-1']);
echo '<input type="submit" value="'.get_string('go').'" class="btn btn-primary"/>'."\n</div></form>\n";
}
5 changes: 5 additions & 0 deletions report/participation/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@
margin-left: 15px;
margin-right: 5px;
}

/* Die to css conflicts with form-inline, we have to create a specific class to fix submit button alignment on clean */
#page-report-participation-index .participationselectform input[type="submit"] {
margin-bottom: 0;
}
2 changes: 1 addition & 1 deletion report/questioninstances/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
echo '<p><label for="menuqtype"> ' . get_string('questiontype', 'admin') . '</label> ';
echo html_writer::select($qtypechoices, 'qtype', $requestedqtype, array('_all_'=>get_string('all')));
echo '</p>';
echo '<p><input type="submit" id="settingssubmit" value="' .
echo '<p><input type="submit" class="btn btn-secondary" id="settingssubmit" value="' .
get_string('getreport', 'report_questioninstances') . '" /></p>';
echo '</div></form>';
echo $OUTPUT->box_end();
Expand Down
6 changes: 3 additions & 3 deletions report/stats/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,18 @@ function report_stats_report($course, $report, $mode, $user, $roleid, $time) {
html_writer::label(get_string('users'), 'menuuserid'), html_writer::select($users, 'userid', $userid, false),
html_writer::label(get_string('statsreporttype'), 'menureport'), html_writer::select($reportoptions, 'report', ($report == 5) ? $report.$roleid : $report, false),
html_writer::label(get_string('statstimeperiod'), 'menutime'), html_writer::select($timeoptions, 'time', $time, false),
'<input type="submit" value="'.get_string('view').'" />') ;
'<input type="submit" class="btn btn-secondary" value="'.get_string('view').'" />');
} else if ($mode == STATS_MODE_RANKED) {
$table->align = array('left','left','left','left','left','left');
$table->data[] = array(html_writer::label(get_string('statsreporttype'), 'menureport'), html_writer::select($reportoptions, 'report', ($report == 5) ? $report.$roleid : $report, false),
html_writer::label(get_string('statstimeperiod'), 'menutime'), html_writer::select($timeoptions, 'time', $time, false),
'<input type="submit" value="'.get_string('view').'" />') ;
'<input type="submit" class="btn btn-secondary" value="'.get_string('view').'" />');
} else if ($mode == STATS_MODE_GENERAL) {
$table->align = array('left','left','left','left','left','left','left');
$table->data[] = array(html_writer::label(get_string('course'), 'menucourse'), html_writer::select($courseoptions, 'course', $course->id, false),
html_writer::label(get_string('statsreporttype'), 'menureport'), html_writer::select($reportoptions, 'report', ($report == 5) ? $report.$roleid : $report, false),
html_writer::label(get_string('statstimeperiod'), 'menutime'), html_writer::select($timeoptions, 'time', $time, false),
'<input type="submit" value="'.get_string('view').'" />') ;
'<input type="submit" class="btn btn-secondary" value="'.get_string('view').'" />');
}

echo '<form action="index.php" method="post">'."\n"
Expand Down
4 changes: 3 additions & 1 deletion theme/bootstrapbase/less/moodle/admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ img.iconsmall {
margin-left: auto;
margin-right: auto;
}

#page-admin-tool-spamcleaner-index .spamcleanerform input[type="submit"] {
margin-bottom: 0;
}
.path-admin-roles .capabilitysearchui input[type="button"] {
margin-bottom: 0;
}
Expand Down
3 changes: 3 additions & 0 deletions theme/bootstrapbase/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -2751,6 +2751,9 @@ img.iconsmall {
margin-left: auto;
margin-right: auto;
}
#page-admin-tool-spamcleaner-index .spamcleanerform input[type="submit"] {
margin-bottom: 0;
}
.path-admin-roles .capabilitysearchui input[type="button"] {
margin-bottom: 0;
}
Expand Down

0 comments on commit 270b2e4

Please sign in to comment.