Commit 47d3dd0f authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells
Browse files

Admin area fixes (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: Ie28d14609edb7e7ca929d5891b50a499acc3f31b
parent 82c62011
......@@ -26,13 +26,15 @@ else {
$reloadform = pieform(array(
'name' => 'reloadfilters',
'renderer' => 'table',
'renderer' => 'div',
'plugintype' => 'core',
'pluginname' => 'admin',
'autofocus' => false,
'elements' => array(
'reload' => array(
'type' => 'submit',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-success',
'value' => get_string('install', 'admin'),
),
),
......
......@@ -45,6 +45,7 @@ $newform = pieform(array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'value' => get_string('add'),
),
),
......@@ -77,6 +78,7 @@ foreach ($iframesources as $url => $name) {
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-primary btn-sm',
'value' => get_string('save'),
),
);
......@@ -94,18 +96,20 @@ foreach ($iframesources as $url => $name) {
'name' => 'deleteurl_' . $i,
'successcallback' => 'deleteurl_submit',
'renderer' => 'div',
'class' => 'form-inline',
'class' => 'form-inline form-as-button pull-left last',
'elements' => array(
'url' => array(
'type' => 'hidden',
'value' => $url,
),
'submit' => array(
'type' => 'submit',
'value' => get_string('deletespecific', 'mahara', $name),
'type' => 'button',
'class' => 'btn btn-default btn-sm',
'usebuttontag' => true,
'value' => '<span class="icon icon-trash icon-lg text-danger"></span><span class="sr-only">'. get_string('delete') . '</span>',
'confirm' => get_string('confirmdeletemenuitem', 'admin'),
),
'url' => array(
'type' => 'hidden',
'value' => $url,
)
),
)),
);
......
......@@ -85,18 +85,27 @@ foreach ($authinstances as $authinstance) {
// Suspend users
$suspendform = pieform(array(
'name' => 'suspend',
'class' => 'bulkactionform',
'renderer' => 'oneline',
'class' => 'bulkactionform form-inline form-as-button',
'renderer' => 'div',
'elements' => array(
'users' => $userelement,
'reason' => array(
'type' => 'text',
'title' => get_string('suspendedreason', 'admin') . ': ',
),
'suspend' => array(
'type' => 'submit',
'value' => get_string('Suspend', 'admin'),
),
'suspendgroup' => array(
'type' => 'fieldset',
'class' => 'input-group',
'elements' => array (
'reason' => array(
'type' => 'text',
'class' => 'input-small',
'title' => get_string('suspendedreason', 'admin') . ': ',
),
'suspend' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default input-group-btn no-label',
'value' => get_string('Suspend', 'admin'),
)
)
)
),
));
......@@ -105,25 +114,29 @@ $changeauthform = null;
if (count($options) > 1) {
$changeauthform = pieform(array(
'name' => 'changeauth',
'class' => 'bulkactionform',
'renderer' => 'oneline',
'class' => 'bulkactionform form-inline form-as-button',
'renderer' => 'div',
'dieaftersubmit' => false,
'elements' => array(
'users' => $userelement,
'title' => array(
'type' => 'html',
'class' => 'bulkaction-title',
'value' => get_string('changeauthmethod', 'admin') . ': ',
),
'authinstance' => array(
'type' => 'select',
'options' => $options,
'defaultvalue' => $default,
),
'changeauth' => array(
'type' => 'submit',
'value' => get_string('submit'),
),
'authgroup' => array(
'type' => 'fieldset',
'class' => 'input-group',
'elements' => array (
'authinstance' => array(
'type' => 'select',
'class' => 'no-label',
'options' => $options,
'defaultvalue' => $default,
),
'changeauth' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default input-group-btn no-label',
'value' => get_string('changeauthmethod', 'admin')
)
)
)
),
));
}
......@@ -133,8 +146,8 @@ $probationform = null;
if (is_using_probation()) {
$probationform = pieform(array(
'name' => 'probation',
'class' => 'bulkactionform',
'renderer' => 'oneline',
'class' => 'bulkactionform form-inline form-as-button',
'renderer' => 'div',
'elements' => array(
'users' => $userelement,
'probationpoints' => array(
......@@ -145,6 +158,7 @@ if (is_using_probation()) {
),
'setprobation' => array(
'type' => 'submit',
'class' => 'btn btn-primary',
'confirm' => get_string('probationbulkconfirm', 'admin'),
'value' => get_string('probationbulkset', 'admin'),
)
......@@ -155,19 +169,16 @@ if (is_using_probation()) {
// Delete users
$deleteform = pieform(array(
'name' => 'delete',
'class' => 'bulkactionform delete',
'renderer' => 'oneline',
'class' => 'bulkactionform delete form-inline form-as-button',
'renderer' => 'div',
'elements' => array(
'users' => $userelement,
'title' => array(
'type' => 'html',
'class' => 'bulkaction-title',
'value' => get_string('deleteusers', 'admin') . ': ',
),
'delete' => array(
'type' => 'submit',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default no-label',
'confirm' => get_string('confirmdeleteusers', 'admin'),
'value' => get_string('delete'),
'value' => '<span class="icon icon-lg icon-user-times prs text-danger"></span>' . get_string('deleteusers', 'admin'),
),
),
));
......
......@@ -33,7 +33,14 @@ if ($pagenames = array_merge($corepagenames, $localpagenames)) {
}
$pageoptions = array();
$s = institution_selector_for_page(param_alphanum('institution', false),
get_config('wwwroot') . 'admin/users/institutionpages.php');
$institutionelement = get_institution_selector(true);
if (!empty($institutionelement['options']) && sizeof($institutionelement['options']) > 1) {
$institutionelement['defaultvalue'] = key($institutionelement['options']);
}
......@@ -96,6 +103,7 @@ $form = pieform(array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'value' => get_string('savechanges', 'admin')
),
)
......@@ -148,19 +156,11 @@ function editsitepage_submit(Pieform $form, $values) {
$form->reply(PIEFORM_OK, get_string('pagesaved', 'admin'));
}
$institutionselector = pieform(array(
'name' => 'usertypeselect',
'class' => 'pull-right form-inline',
'elements' => array(
'institution' => $institutionelement,
)
));
$smarty = smarty(array('adminsitepages'), array(), array('admin' => array('discardpageedits')));
setpageicon($smarty, 'icon-university');
$smarty->assign('noinstitutionsadmin', (($USER->admin) ? get_string('noinstitutionstaticpagesadmin', 'admin', get_config('wwwroot') . 'admin/site/pages.php') : false));
$smarty->assign('pageeditform', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('institutionselector', $institutionselector);
$smarty->assign('institutionselector', $s['institutionselector']);
$smarty->display('admin/site/pages.tpl');
......@@ -110,6 +110,7 @@ if ($users && !$USER->get('admin')) {
$userids = array_keys($users);
if ($selected == 'users') {
$subheading = get_string('users');
$smarty = smarty_core();
$smarty->assign_by_ref('users', $users);
$smarty->assign_by_ref('USER', $USER);
......@@ -126,7 +127,11 @@ if ($selected == 'users') {
$csv = true;
}
else if ($selected == 'accesslist') {
$subheading = get_string('accesslist', 'view');
require_once(get_config('libroot') . 'view.php');
$accesslists = View::get_accesslists(array_keys($users));
foreach ($accesslists['collections'] as $k => $c) {
if (!isset($users[$c['owner']]->collections)) {
......@@ -146,6 +151,9 @@ else if ($selected == 'accesslist') {
$userlisthtml = $smarty->fetch('admin/users/accesslists.tpl');
}
else if ($selected == 'loginaslog') {
$subheading = get_string('loginaslog', 'admin');
$ph = array_merge($userids, $userids);
$log = get_records_sql_array('
SELECT *
......@@ -181,7 +189,8 @@ else if ($selected == 'loginaslog') {
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('tabs', $tabs);
$smarty->assign('subsectionheading', $subheading);
$smarty->assign('sectiontabs', $tabs);
$smarty->assign('users', $users);
$smarty->assign('userlisthtml', $userlisthtml);
$smarty->assign('csv', isset($csv));
......
......@@ -1426,7 +1426,7 @@ function activate_plugin_form($plugintype, $plugin) {
'renderer' => 'div',
'elementclasses' => false,
'successcallback' => 'activate_plugin_submit',
'class' => 'form-inline',
'class' => 'form-inline form-as-button pull-left last',
'jsform' => false,
'action' => get_config('wwwroot') . 'admin/extensions/pluginconfig.php',
'elements' => array(
......@@ -1435,8 +1435,9 @@ function activate_plugin_form($plugintype, $plugin) {
'disable' => array('type' => 'hidden', 'value' => $plugin->active),
'enable' => array('type' => 'hidden', 'value' => 1-$plugin->active),
'submit' => array(
'type' => 'submit',
'class' => 'linkbtn',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'title' => ($plugin->active ? get_string('hide') : get_string('show')) . ' ' . $plugintype . ' ' . $plugin->name,
'hiddenlabel' => true,
'value' => $plugin->active ? get_string('hide') : get_string('show')
......
......@@ -413,7 +413,7 @@ $navbar-default-toggle-border-color: #ddd !default;
// Inverted navbar
// Reset inverted navbar basics
$navbar-inverse-color: #fff !default;
$navbar-inverse-bg: #ddd !default;
$navbar-inverse-bg: #F1F1F1 !default;
$navbar-inverse-border: darken($navbar-inverse-bg, 5%) !default;
// Inverted navbar links
......
......@@ -8,4 +8,7 @@ $arrow-link-hover-color: $text-color;
$arrow-link-active-color: $brand-primary;
// color for the secondary title in sections (cf. groups)
$section-heading-color: #999;
\ No newline at end of file
$section-heading-color: #999;
$admin-title-color: #fff;
$admin-title-bg: $brand-primary;
\ No newline at end of file
This diff is collapsed.
......@@ -17,7 +17,7 @@
}
.nav-inpage.nav > li {
> a {
> a, > button {
color: $arrow-link-color;
&:hover,
&:focus {
......@@ -25,7 +25,7 @@
}
}
&.active {
a {
a, > button {
color: $arrow-link-active-color;
}
}
......@@ -64,3 +64,31 @@
text-align: right;
}
}
.nav-inpage {
&.nav > li {
> a, button {
@include border-radius($border-radius-base);
@include transition-duration(0.3s);
padding: 0 8px;
line-height: 2em;
margin-top: 9px;
&:hover,
&:focus {
@include transition-duration(0.3s);
background: #fff;
color: $link-color;
}
}
&.active > a,
&.active > button, {
color: $text-color;
background: #fff;
&:hover,
&:focus {
color: $link-color;
}
}
}
}
\ No newline at end of file
......@@ -278,6 +278,10 @@ td.btn-group {
}
}
.btn-group .form-as-button.last + script + .btn {
margin-left: -1px;
}
.btn {
.icon-chevron-down {
opacity: 0.5;
......
......@@ -28,16 +28,16 @@
clear: none;
line-height: 1em;
margin-left: 25px;
background-color: lighten($brand-default, 2%);
background-color: $admin-title-bg;
padding: 25px 15px 5px 40px;
@media (min-width: 768px) {
display: inline-block;
}
a {
color:#777;
color: $admin-title-color;
}
&:before {
position: absolute;
position: absolute;
left: 0;
top: 0px;
content: "";
......@@ -57,7 +57,7 @@
height: 0;
border-style: solid;
border-width: 32.5px 0 32.5px 20px;
border-color: transparent transparent transparent lighten($brand-default, 2%);
border-color: transparent transparent transparent $admin-title-bg;
}
}
}
......@@ -2,30 +2,6 @@
* Modificatiosn to bootstraps default navbar components
*/
.nav-inpage {
&.nav > li {
> a {
@include transition-duration(0.3s);
padding: 0 8px;
line-height: 2em;
margin-top: 9px;
&:hover,
&:focus {
@include transition-duration(0.3s);
background: #fff;
color: $link-color;
}
}
&.active > a {
color: $text-color;
background: #fff;
&:hover,
&:focus {
color: $link-color;
}
}
}
}
.navbar-secondary {
background-color: darken($brand-default, 5%);
......
......@@ -414,21 +414,21 @@ $navbar-default-toggle-border-color: #ddd !default;
// Inverted navbar
// Reset inverted navbar basics
$navbar-inverse-color: #fff !default;
$navbar-inverse-bg: $mahara-green-light !default;
$navbar-inverse-bg: #F1F1F1 !default;
$navbar-inverse-border: darken($navbar-inverse-bg, 5%) !default;
// Inverted navbar links
$navbar-inverse-link-color: rgba(255,255,255,0.8) !default;
$navbar-inverse-link-hover-color: #fff !default;
$navbar-inverse-link-color: $text-color !default;
$navbar-inverse-link-hover-color: $link-hover-color !default;
$navbar-inverse-link-hover-bg: rgba(darken($navbar-inverse-bg, 7%), 0.5) !default;
$navbar-inverse-link-active-color: $navbar-inverse-bg !default;
$navbar-inverse-link-active-color: $text-color !default;
$navbar-inverse-link-active-bg: #fff !default;
$navbar-inverse-link-disabled-color: #444 !default;
$navbar-inverse-link-disabled-bg: transparent !default;
// Inverted navbar brand label
$navbar-inverse-brand-color: $navbar-inverse-link-color !default;
$navbar-inverse-brand-hover-color: #fff !default;
$navbar-inverse-brand-hover-color: $navbar-inverse-link-hover-color !default;
$navbar-inverse-brand-hover-bg: transparent !default;
// Inverted navbar toggle
......
......@@ -9,3 +9,6 @@ $arrow-link-active-color: $text-color;
// color for the secondary title in sections (cf. groups)
$section-heading-color: #999;
$admin-title-color: #fff;
$admin-title-bg: $brand-primary;
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{include file='header.tpl'}
<div class="panel panel-default panel-body">
<p>{str tag=htmlfiltersdescription section=admin}</p>
<p class="lead">{str tag=htmlfiltersdescription section=admin}</p>
<div class="panel panel-default panel-body">
{if $filters}
<h3>{str tag=installed section=admin}:</h3>
<ul>
......
{include file="header.tpl"}
<div class="panel panel-default panel-body">
<p>{str tag=allowediframesitesdescription section=admin}</p>
<p>{str tag=allowediframesitesdescriptiondetail section=admin}</p>
<p class="lead">{str tag=allowediframesitesdescription section=admin}</p>
<p class="lead">{str tag=allowediframesitesdescriptiondetail section=admin}</p>
<div class="panel panel-default">
{if $editurls}
<table class="iframesources fullwidth">
<table class="iframesources fullwidth table">
<thead>
<tr>
<th>{str tag=Site}</th>
<th>{str tag=displayname}</th>
<th>{str tag=Site}</th>
<th><span class="accessible-hidden sr-only">{str tag=edit}</span></th>
</tr>
</thead>
<tbody>
{foreach from=$editurls item=item name=urls}
<tr class="{cycle values='r0,r1' advance=false}">
<td><strong>{$item.url}</strong></td>
<td><img src="{$item.icon}" alt="{$item.name}" title="{$item.name}">&nbsp;{$item.name}</td>
<th><img src="{$item.icon}" alt="{$item.name}" title="{$item.name}">&nbsp;{$item.name}</th>
<td>{$item.url}</td>
<td class="right buttonscell control-buttons">
<a id="edit-{$item.id}" class="url-open-editform nojs-hidden-inline" title="{str tag=edit}" href="">
<img src="{theme_url filename="images/btn_edit.png"}" alt="{str(tag=editspecific arg1=$item.name)|escape:html|safe}">
</a>
{$item.deleteform|safe}
<div class="btn-group">
{$item.deleteform|safe}
<a id="edit-{$item.id}" class="url-open-editform btn btn-default btn-sm pull-left prs" title="{str tag=edit}" href="">
<span class="icon icon-pencil"></span>
<span class="icon icon-chevron-down icon-sm"></span>
<span class="sr-only">{str(tag=editspecific arg1=$item.name)|escape:html|safe}</span>
</a>
</div>
</td>
</tr>
<tr class="editrow {cycle} url-editform js-hidden" id="edit-{$item.id}-form">
<tr class="editrow {cycle} url-editform js-hidden active" id="edit-{$item.id}-form">
<td colspan=3>{$item.editform|safe}</td>
</tr>
{/foreach}
......@@ -31,6 +38,9 @@
</table>
{/if}
{$newform|safe}
<div class="panel-body">
{$newform|safe}
</div>
</div>
{include file="footer.tpl"}
{include file='header.tpl'}
<div class="panel panel-default panel-body">
<div id="adminplugin">
<b>{str tag='pluginexplainaddremove'}
<br/><br/>{str tag='pluginexplainartefactblocktypes'}<br/><br/></b>
<ul class="adminpluginstypes">
{foreach from=$plugins key='plugintype' item='plugins'}
<li><h4>{str tag='plugintype'}: {$plugintype}</h4>
{assign var="installed" value=$plugins.installed}
{assign var="notinstalled" value=$plugins.notinstalled}
<ul>
{if $notinstalled}
<li class="notinstalled"><b>{str tag='notinstalledplugins'}</b>
<ul id="{$plugintype}.notinstalled">
{foreach from=$notinstalled key='plugin' item='data'}
<li id="{$plugintype}.{$plugin}">{$plugin}
{if $data.notinstallable}
{str tag='notinstallable'}: {$data.notinstallable}
{else}
<span id="{$plugintype}.{$plugin}.install">(<a href="" onClick="{$installlink}('{$plugintype}.{$plugin}'); return false;">{str tag='install' section='admin'} <span class="accessible-hidden sr-only">{$plugintype} {$plugin}</span></a>)</span>
{/if}
<span id="{$plugintype}.{$plugin}.message"></span>
</li>
{/foreach}
</ul>
<p class="lead">{str tag='pluginexplainaddremove'} {str tag='pluginexplainartefactblocktypes'}</p>
<div class="panel-items js-masonry" data-masonry-options='{ "itemSelector": ".panel" }'>
{foreach from=$plugins key='plugintype' item='plugins'}
<div class="panel panel-default">
<h2 class="panel-heading">{str tag='plugintype'}: {$plugintype}</h2>
{assign var="installed" value=$plugins.installed}
{assign var="notinstalled" value=$plugins.notinstalled}
{if $notinstalled}
<ul class="notinstalled list-group" id="{$plugintype}.notinstalled">
<li class="list-group-item list-group-item-heading mb0 list-group-item-warning">
<h3 class="list-group-item-heading h4">{str tag='notinstalledplugins'}</h3>
</li>
{foreach from=$notinstalled key='plugin' item='data'}
<li class="list-group-item list-group-item-danger" id="{$plugintype}.{$plugin}">{$plugin}
{if $data.notinstallable}
{str tag='notinstallable'}: {$data.notinstallable}
{else}
<span id="{$plugintype}.{$plugin}.install">(<a href="" onClick="{$installlink}('{$plugint