Skip to content

Commit

Permalink
Merge branch 'MDL-68556-master-pluginscheckcss' of git://github.com/m…
Browse files Browse the repository at this point in the history
…udrd8mz/moodle
  • Loading branch information
andrewnicols committed May 7, 2020
2 parents 2cd534a + 1338b9d commit ac53825
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 264 deletions.
76 changes: 42 additions & 34 deletions admin/renderer.php
Expand Up @@ -361,14 +361,15 @@ public function check_for_updates_button(\core\update\checker $checker, $reloadu
$output = '';

if ($checker->enabled()) {
$output .= $this->container_start('checkforupdates');
$output .= $this->container_start('checkforupdates mb-4');
$output .= $this->single_button(
new moodle_url($reloadurl, array('fetchupdates' => 1)),
get_string('checkforupdates', 'core_plugin')
);
if ($timefetched = $checker->get_last_timefetched()) {
$timefetched = userdate($timefetched, get_string('strftimedatetime', 'core_langconfig'));
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin', $timefetched), 'lasttimefetched');
$output .= $this->container(get_string('checkforupdateslast', 'core_plugin', $timefetched),
'lasttimefetched small text-muted mt-1');
}
$output .= $this->container_end();
}
Expand Down Expand Up @@ -1045,7 +1046,7 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar
$displayname = new html_table_cell(
$icon.
html_writer::span($plugin->displayname, 'pluginname').
html_writer::div($plugin->get_dir(), 'plugindir')
html_writer::div($plugin->get_dir(), 'plugindir text-muted small')
);

$versiondb = new html_table_cell($plugin->versiondb);
Expand Down Expand Up @@ -1082,7 +1083,7 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar
break;
case core_plugin_manager::PLUGIN_STATUS_NODB:
case core_plugin_manager::PLUGIN_STATUS_UPTODATE:
$statusclass .= $dependenciesok ? '' : 'badge-warning';
$statusclass .= $dependenciesok ? 'badge-light' : 'badge-warning';
break;
}
$status = html_writer::span(get_string('status_' . $statuscode, 'core_plugin'), $statusclass);
Expand All @@ -1092,7 +1093,7 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar
new moodle_url($this->page->url, array('abortinstall' => $plugin->component)),
get_string('cancelinstallone', 'core_plugin'),
'post',
array('class' => 'actionbutton cancelinstallone')
array('class' => 'actionbutton cancelinstallone d-block mt-1')
);
}

Expand All @@ -1101,7 +1102,7 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar
new moodle_url($this->page->url, array('abortupgrade' => $plugin->component)),
get_string('cancelupgradeone', 'core_plugin'),
'post',
array('class' => 'actionbutton cancelupgradeone')
array('class' => 'actionbutton cancelupgradeone d-block mt-1')
);
}

Expand Down Expand Up @@ -1174,15 +1175,15 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar
}
}

$out .= $this->output->container_start('actions');
$out .= $this->output->container_start('actions mb-2');

$installableupdates = $pluginman->filter_installable($pluginman->available_updates());
if ($installableupdates) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', count($installableupdates)),
'post',
array('class' => 'singlebutton updateavailableinstallall')
array('class' => 'singlebutton updateavailableinstallall mr-1')
);
}

Expand All @@ -1191,7 +1192,7 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar
new moodle_url($this->page->url, array('abortinstallx' => 1)),
get_string('cancelinstallall', 'core_plugin', count($installabortable)),
'post',
array('class' => 'singlebutton cancelinstallall')
array('class' => 'singlebutton cancelinstallall mr-1')
);
}

Expand All @@ -1200,15 +1201,17 @@ public function plugins_check_table(core_plugin_manager $pluginman, $version, ar
new moodle_url($this->page->url, array('abortupgradex' => 1)),
get_string('cancelupgradeall', 'core_plugin', count($upgradeabortable)),
'post',
array('class' => 'singlebutton cancelupgradeall')
array('class' => 'singlebutton cancelupgradeall mr-1')
);
}

$out .= html_writer::div(html_writer::link(new moodle_url($this->page->url, array('showallplugins' => 0)),
get_string('plugincheckattention', 'core_plugin')).' '.html_writer::span($sumattention, 'badge'));
get_string('plugincheckattention', 'core_plugin')).' '.html_writer::span($sumattention, 'badge badge-light'),
'btn btn-link mr-1');

$out .= html_writer::div(html_writer::link(new moodle_url($this->page->url, array('showallplugins' => 1)),
get_string('plugincheckall', 'core_plugin')).' '.html_writer::span($sumtotal, 'badge'));
get_string('plugincheckall', 'core_plugin')).' '.html_writer::span($sumtotal, 'badge badge-light'),
'btn btn-link mr-1');

$out .= $this->output->container_end(); // End of .actions container.
$out .= $this->output->container_end(); // End of #plugins-check-info container.
Expand Down Expand Up @@ -1276,12 +1279,13 @@ protected function missing_dependencies(core_plugin_manager $pluginman) {
}
}

$out = $this->output->container_start('plugins-check-dependencies');
$out = $this->output->container_start('plugins-check-dependencies mb-4');

if ($unavailable or $unknown) {
$out .= $this->output->heading(get_string('misdepsunavail', 'core_plugin'));
if ($unknown) {
$out .= $this->output->notification(get_string('misdepsunknownlist', 'core_plugin', implode(', ', $unknown)));
$out .= $this->output->render((new \core\output\notification(get_string('misdepsunknownlist', 'core_plugin',
implode(', ', $unknown))))->set_show_closebutton(false));
}
if ($unavailable) {
$unavailablelist = array();
Expand All @@ -1295,31 +1299,32 @@ protected function missing_dependencies(core_plugin_manager $pluginman) {
}
$unavailablelist[] = $unavailablelistitem;
}
$out .= $this->output->notification(get_string('misdepsunavaillist', 'core_plugin',
implode(', ', $unavailablelist)));
$out .= $this->output->render((new \core\output\notification(get_string('misdepsunavaillist', 'core_plugin',
implode(', ', $unavailablelist))))->set_show_closebutton(false));
}
$out .= $this->output->container_start('plugins-check-dependencies-actions');
$out .= $this->output->container_start('plugins-check-dependencies-actions mb-4');
$out .= ' '.html_writer::link(new moodle_url('/admin/tool/installaddon/'),
get_string('dependencyuploadmissing', 'core_plugin'));
get_string('dependencyuploadmissing', 'core_plugin'), array('class' => 'btn btn-secondary'));
$out .= $this->output->container_end(); // End of .plugins-check-dependencies-actions container.
}

if ($available) {
$out .= $this->output->heading(get_string('misdepsavail', 'core_plugin'));
$out .= $this->output->container_start('plugins-check-dependencies-actions');
$out .= $this->output->container_start('plugins-check-dependencies-actions mb-2');

$installable = $pluginman->filter_installable($available);
if ($installable) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installdepx' => 1)),
get_string('dependencyinstallmissing', 'core_plugin', count($installable)),
'post',
array('class' => 'singlebutton dependencyinstallmissing')
array('class' => 'singlebutton dependencyinstallmissing d-inline-block mr-1')
);
}

$out .= html_writer::div(html_writer::link(new moodle_url('/admin/tool/installaddon/'),
get_string('dependencyuploadmissing', 'core_plugin')), 'dependencyuploadmissing');
get_string('dependencyuploadmissing', 'core_plugin'), array('class' => 'btn btn-link')),
'dependencyuploadmissing d-inline-block mr-1');

$out .= $this->output->container_end(); // End of .plugins-check-dependencies-actions container.

Expand Down Expand Up @@ -1360,7 +1365,7 @@ protected function available_missing_dependencies_list(core_plugin_manager $plug
if ($CFG->branch == str_replace('.', '', $moodle->release)) {
$supportedmoodles[] = html_writer::span($moodle->release, 'badge badge-success');
} else {
$supportedmoodles[] = html_writer::span($moodle->release, 'label');
$supportedmoodles[] = html_writer::span($moodle->release, 'badge badge-light');
}
}

Expand All @@ -1374,7 +1379,7 @@ protected function available_missing_dependencies_list(core_plugin_manager $plug
}
$info = html_writer::div(
get_string('requiredby', 'core_plugin', implode(', ', $requriedby)),
'requiredby'
'requiredby mb-1'
);
} else {
$info = '';
Expand All @@ -1385,35 +1390,36 @@ protected function available_missing_dependencies_list(core_plugin_manager $plug
$info .= html_writer::div(
html_writer::link('https://moodle.org/plugins/view.php?plugin='.$plugin->component,
get_string('misdepinfoplugin', 'core_plugin')),
'misdepinfoplugin'
'misdepinfoplugin d-inline-block mr-3 mb-1'
);

$info .= html_writer::div(
html_writer::link('https://moodle.org/plugins/pluginversion.php?id='.$plugin->version->id,
get_string('misdepinfoversion', 'core_plugin')),
'misdepinfoversion'
'misdepinfoversion d-inline-block mr-3 mb-1'
);

$info .= html_writer::div(html_writer::link($plugin->version->downloadurl, get_string('download')), 'misdepdownload');
$info .= html_writer::div(html_writer::link($plugin->version->downloadurl, get_string('download')),
'misdepdownload d-inline-block mr-3 mb-1');

if ($pluginman->is_remote_plugin_installable($plugin->component, $plugin->version->version, $reason)) {
$info .= $this->output->single_button(
new moodle_url($this->page->url, array('installdep' => $plugin->component)),
get_string('dependencyinstall', 'core_plugin'),
'post',
array('class' => 'singlebutton dependencyinstall')
array('class' => 'singlebutton dependencyinstall mr-3 mb-1')
);
} else {
$reasonhelp = $this->info_remote_plugin_not_installable($reason);
if ($reasonhelp) {
$info .= html_writer::div($reasonhelp, 'reasonhelp dependencyinstall');
$info .= html_writer::div($reasonhelp, 'reasonhelp dependencyinstall d-inline-block mr-3 mb-1');
}
}

$info .= $this->output->container_end(); // End of .actions container.

$table->data[] = array(
html_writer::div($plugin->name, 'name').' '.html_writer::div($plugin->component, 'component'),
html_writer::div($plugin->name, 'name').' '.html_writer::div($plugin->component, 'component text-muted small'),
$plugin->version->release,
$plugin->version->version,
implode(' ', $supportedmoodles),
Expand Down Expand Up @@ -1461,7 +1467,7 @@ protected function required_column(\core\plugininfo\base $plugin, core_plugin_ma
foreach ($requirements as $reqname => $reqinfo) {
if ($reqname === 'core') {
if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OK) {
$class = 'requires-ok';
$class = 'requires-ok text-muted';
$label = '';
} else {
$class = 'requires-failed';
Expand Down Expand Up @@ -1490,7 +1496,7 @@ protected function required_column(\core\plugininfo\base $plugin, core_plugin_ma

if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OK) {
$label = '';
$class = 'requires-ok';
$class = 'requires-ok text-muted';

} else if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_MISSING) {
if ($reqinfo->availability == $pluginman::REQUIREMENT_AVAILABLE) {
Expand Down Expand Up @@ -1544,13 +1550,14 @@ protected function required_column(\core\plugininfo\base $plugin, core_plugin_ma
return '';
}

$out = html_writer::tag('ul', implode("\n", $requires));
$out = html_writer::tag('ul', implode("\n", $requires), array('class' => 'm-0'));

if ($displayuploadlink) {
$out .= html_writer::div(
html_writer::link(
new moodle_url('/admin/tool/installaddon/'),
get_string('dependencyuploadmissing', 'core_plugin')
get_string('dependencyuploadmissing', 'core_plugin'),
array('class' => 'btn btn-secondary btn-sm m-1')
),
'dependencyuploadmissing'
);
Expand All @@ -1560,7 +1567,8 @@ protected function required_column(\core\plugininfo\base $plugin, core_plugin_ma
$out .= html_writer::div(
html_writer::link(
new moodle_url($this->page->url, array('sesskey' => sesskey(), 'fetchupdates' => 1)),
get_string('checkforupdates', 'core_plugin')
get_string('checkforupdates', 'core_plugin'),
array('class' => 'btn btn-secondary btn-sm m-1')
),
'checkforupdates'
);
Expand Down
104 changes: 0 additions & 104 deletions theme/boost/scss/moodle/admin.scss
Expand Up @@ -486,119 +486,15 @@

// Plugins check page displayed during upgrade.
#plugins-check-page {
.page-description {
color: $text-muted;
}

// Check for updates.
.checkforupdates {
.singlebutton {
margin: 5px 0;
padding: 0;

div,
input {
margin: 0 3px 0 0;
}
}
}

// Section before the plugins check table.
#plugins-check-info {
.actions {
> div {
display: inline-block;
margin-right: 1em;
}

.singlebutton {
margin: 5px 0;
padding: 0;

div,
input {
margin: 0 3px 0 0;
}
}
}
}

// Plugins check table.
#plugins-check {
.requires-ok {
color: $text-muted;
}

.status-missing,
.status-downgrade {
td {
background-color: $state-danger-bg;
}
}

.displayname {
.plugindir {
color: $text-muted;
font-size: $font-size-sm;
}
}

.requires ul {
margin-left: 13px; // To undo the default 25px, does not look that great inside a table cell;
}

.status {
.actionbutton {
margin: 5px 0;
padding: 0;

input {
margin: 0;
}
}
}
}

.plugins-check-dependencies-actions {
> div {
display: inline-block;
margin-right: 1em;
}

.singlebutton {
margin: 5px 0;
padding: 0;

div,
input {
margin: 0 3px 0 0;
}
}
}

// List of available dependencies on the plugins check page.
#plugins-check-available-dependencies {
.displayname .component {
font-size: $font-size-sm;
color: $text-muted;
}

.info .actions {
> div {
display: inline-block;
margin-right: 1em;
}

.dependencyinstall {
display: block;
margin: 5px 0;
padding: 0;

input {
margin: 0;
}
}
}
}
}

Expand Down

0 comments on commit ac53825

Please sign in to comment.