Commit 4c7356a2 authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells

Admin areas (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: Ida951e4e4350ba68734dbc3726eeab8c80f5f599
parent 4daa7827
......@@ -18,16 +18,19 @@ define('TITLE', get_string('groupcategories', 'admin'));
$optionform = pieform(array(
'name' => 'groupcategories',
'renderer' => 'table',
'renderer' => 'div',
'class' => '',
'plugintype' => 'core',
'pluginname' => 'admin',
'elements' => array(
'allowgroupcategories' => array(
'class' => 'last pb0 pt0',
'type' => 'switchbox',
'title' => get_string('enablegroupcategories', 'admin'),
'defaultvalue' => get_config('allowgroupcategories'),
),
'submit' => array(
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('submit'),
),
......@@ -88,7 +91,7 @@ function formatrow (item) {
'type':'button',
'title':{$getstring['edit']},
'alt':{$getstring['editspecific']}.replace('%s', item.name)},
SPAN({'class':'icon icon-cog'}),
SPAN({'class':'icon icon-cog icon-lg'}),
SPAN({'class':'sr-only'}, {$getstring['editspecific']}.replace('%s', item.name))
);
......@@ -101,7 +104,7 @@ function formatrow (item) {
'type':'button',
'title':{$getstring['delete']},
'alt':{$getstring['deletespecific']}.replace('%s', item.name)},
SPAN({'class':'icon icon-trash text-danger'}),
SPAN({'class':'icon icon-trash text-danger icon-lg'}),
SPAN({'class':'sr-only'}, {$getstring['deletespecific']}.replace('%s', item.name))
);
......@@ -132,7 +135,7 @@ function editform(item) {
// Either a save, a cancel button, or both.
var savecancel = [];
var save = INPUT({'type':'button','class':'button'});
var save = INPUT({'type':'button','class':'button btn btn-sm btn-default mtl'});
connect(save, 'onclick', function () { saveitem(item.id); });
var rowtype = 'add';
......@@ -147,7 +150,7 @@ function editform(item) {
// The save button says 'update' and there's a cancel button.
var rowtype = 'edit';
setNodeAttribute(save,'value',{$getstring['update']});
var cancel = INPUT({'type':'button','class':'button','value':{$getstring['cancel']}});
var cancel = INPUT({'type':'button','class':'button btn btn-sm btn-default','value':{$getstring['cancel']}});
connect(cancel, 'onclick', closeopenedits);
savecancel = [save,cancel];
item.label = {$getstring['edit']};
......@@ -155,7 +158,7 @@ function editform(item) {
// A text field for the name
var label = LABEL({'for':'name'+item.id,'class':'accessible-hidden'}, null, item.label);
var name = INPUT({'type':'text','class':'text','id':'name'+item.id,'value':item.name});
var name = INPUT({'type':'text','class':'text form-control input-sm','id':'name'+item.id,'value':item.name});
connect(name, 'onkeydown', function(e) {
if (keypressKeyCode(e) == 13) {
signal(save, 'onclick');
......
......@@ -29,7 +29,7 @@ $data = build_grouplist_html($query, $limit, $offset);
$searchform = pieform(array(
'name' => 'search',
'renderer' => 'div',
'class' => 'form-inline mbl',
'class' => 'form-inline with-heading',
'elements' => array(
'inputgroup' => array(
'type' => 'fieldset',
......@@ -43,7 +43,7 @@ $searchform = pieform(array(
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-success input-group-btn',
'class' => 'btn btn-primary input-group-btn',
'value' => get_string('search'),
)
),
......
......@@ -69,6 +69,7 @@ $form = array(
),
'updategroups' => array(
'type' => 'switchbox',
'class' => 'last',
'title' => get_string('updategroups', 'admin'),
'description' => get_string('updategroupsdescription1', 'admin'),
'defaultvalue' => false,
......@@ -80,6 +81,7 @@ $form = array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'value' => get_string('uploadgroupcsv', 'admin')
)
)
......
......@@ -42,6 +42,7 @@ $form = array(
'institution' => get_institution_selector(),
'file' => array(
'type' => 'file',
'class' => 'last',
'title' => get_string('csvfile', 'admin'),
'description' => get_string('groupmemberscsvfiledescription', 'admin'),
'accept' => '.csv, text/csv, application/csv, text/comma-separated-values',
......@@ -55,6 +56,7 @@ $form = array(
'readonly' => TRUE,
),
'submit' => array(
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('uploadgroupmemberscsv', 'admin')
)
......
......@@ -139,7 +139,7 @@ unset($prefs);
$form = pieform(array(
'name' => 'adduser',
'class' => 'panel panel-body pts',
'class' => 'panel panel-default panel-body pts',
'autofocus' => false,
'template' => 'adduser.php',
'templatedir' => pieform_template_dir('adduser.php'),
......
......@@ -45,6 +45,7 @@ $form = pieform(array(
)
),
'submit' => array(
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('submit')
)
......
......@@ -58,6 +58,7 @@ $form = array(
'value' => $institution,
),
'submit' => array(
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('submit')
)
......
......@@ -616,7 +616,7 @@ else {
$searchform = pieform(array(
'name' => 'search',
'renderer' => 'div',
'class' => 'form-inline mbl',
'class' => 'form-inline with-heading',
'elements' => array(
'inputgroup' => array(
'type' => 'fieldset',
......@@ -630,7 +630,7 @@ else {
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-success input-group-btn',
'class' => 'btn btn-primary input-group-btn',
'value' => get_string('search'),
)
),
......
......@@ -59,6 +59,7 @@ $form = array(
'value' => $institution,
),
'submit' => array(
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('submit')
)
......
......@@ -147,6 +147,7 @@ $userlistform = array(
'rules' => array('regex' => '/^[a-z]+$/')
),
'submit' => array(
'class' => 'btn btn-success',
'type' => 'submit',
'value' => $submittext
)
......@@ -164,12 +165,14 @@ if ($usertype == 'lastinstitution') {
if ($usertype == 'requesters') {
$userlistform['elements']['reject'] = array(
'type' => 'submit',
'class' => 'btn btn-default',
'value' => get_string('declinerequests', 'admin'),
);
}
if (($usertype == 'nonmembers' || $usertype == 'lastinstitution') && $USER->get('admin')) {
$userlistform['elements']['add'] = array(
'type' => 'submit',
'class' => 'btn btn-default',
'value' => get_string('addmembers', 'admin'),
);
}
......
......@@ -77,9 +77,14 @@ $locked = array_merge($sitelocked, $instlocked);
// Figure out the form elements in the configuration form
$elements = array();
$possibleitems = artefact_get_progressbar_items();
$possibleitemscount = count($possibleitems);
$i = 0;
foreach($possibleitems as $plugin => $itemlist) {
$subelements = array();
$fscollapsed = true;
$class = $i === $possibleitemscount - 1 ? 'last' : '';
$i++;
foreach($itemlist as $artefact) {
$pbname = "progressbaritem_{$artefact->plugin}_{$artefact->name}";
......@@ -136,6 +141,7 @@ foreach($possibleitems as $plugin => $itemlist) {
}
$elements["fs{$plugin}"] = array(
'type' => 'fieldset',
'class' => $class,
'collapsible' => true,
'collapsed' => $fscollapsed,
'legend' => get_string('pluginname', "artefact.{$plugin}"),
......@@ -149,6 +155,7 @@ $elements['institution'] = array(
);
$elements['submit'] = array(
'type' => 'submit',
'class' => 'btn btn-success',
'value' => get_string('submit')
);
......
......@@ -27,7 +27,6 @@ $staffusers = get_column('usr', 'id', 'staff', 1, 'deleted', 0);
$form = pieform(array(
'name' => 'staffusers',
// 'class' => 'panel panel-body',
'elements' => array(
'users' => array(
'type' => 'userlist',
......@@ -43,6 +42,7 @@ $form = pieform(array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'value' => get_string('submit')
)
)
......
......@@ -86,21 +86,25 @@ EOF
$form = new Pieform(array(
'name' => 'buttons',
'renderer' => 'oneline',
'renderer' => 'div',
'class' => 'btn-group',
'autofocus' => false,
'elements' => array(
'unsuspend' => array(
'class' => 'btn btn-default pt0',
'type' => 'submit',
'name' => 'unsuspend',
'value' => get_string('unsuspendusers', 'admin')
),
'delete' => array(
'class' => 'btn btn-default pt0',
'type' => 'submit',
'confirm' => get_string('confirmdeleteusers', 'admin'),
'name' => 'delete',
'value' => get_string('deleteusers', 'admin')
),
'unexpire' => array(
'class' => 'btn btn-default pt0',
'type' => 'submit',
'name' => 'unexpire',
'value' => get_string('unexpireusers', 'admin')
......
......@@ -911,6 +911,7 @@ function institution_selector_for_page($institution, $page) {
$institutionselector = pieform(array(
'name' => 'institutionselect',
'class' => 'last',
'checkdirtychange' => false,
'elements' => array(
'institution' => $institutionelement,
......
This diff is collapsed.
......@@ -57,18 +57,13 @@
}
}
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) > .btn {
border-radius: 0;
}
// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
.btn-group > .btn:first-child > .btn {
margin-left: 0;
}
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) > .btn {
@include border-right-radius(0);
}
// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
......@@ -120,8 +115,8 @@
&:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
&:first-child:not(:last-child) > .btn,
&:first-child:not(:last-child):not(.dropdown-toggle) > .btn {
&:first-child:not(:last-child) > .btn.btn.btn,
&:first-child:not(:last-child):not(.dropdown-toggle) > .btn.btn {
border-top-right-radius: $border-radius-base;
@include border-bottom-radius(0);
}
......
......@@ -22,6 +22,9 @@ label,
max-width: 100%;
padding-right: 10px;
font-weight:normal;
&.input-inline {
display: inline;
}
&.sr-only {
min-width: 0;
width:0;
......@@ -87,6 +90,10 @@ label,
margin-left: 16px;
}
// for multiselect buttons
.select-col {
width : 100px;
}
.align-with-input {
display: inline-block;
......
//
// Extenstion to input groups so we can use them in pieforms
// --------------------------------------------------
.form-inline {
// if one item in an input group has a label, push others down
.no-label {
margin-top: 17px;
}
}
.pieform .input-group {
max-width:100%;
.pieform-fieldset > .form-group {
border: none;
padding: 0;
......
......@@ -2,12 +2,20 @@
max-width: 100%;
.footer-nav {
font-size: $font-size-small;
&.nav-pills {
margin-bottom: 20px;
}
}
.footer-performance-info {
font-size: $font-size-small;
}
.footer-inner {
margin-bottom: 15px;
.admin & {
@include border-radius($border-radius-base);
padding: 10px;
background: #FCFCFC;
border: 1px solid #ddd;
}
}
}
......@@ -28,7 +28,8 @@ h1 {
~ .with-heading {
margin-top: -16px;
}
~ form.with-heading {
~ form.with-heading,
~ .form.with-heading {
@include border-bottom-radius(3px);
margin-top: -20px;
background-color: #f7f7f7;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{include file='header.tpl'}
<div class="panel panel-body">
<div class="panel panel-default panel-body">
<p>{str tag=htmlfiltersdescription section=admin}</p>
......
{include file="header.tpl"}
<div class="panel panel-body">
<div class="panel panel-default panel-body">
<p>{str tag=allowediframesitesdescription section=admin}</p>
<p>{str tag=allowediframesitesdescriptiondetail section=admin}</p>
{if $editurls}
......
{include file='header.tpl'}
<div class="panel panel-body">
<div class="panel panel-default panel-body">
<div id="adminplugin">
<b>{str tag='pluginexplainaddremove'}
<br/><br/>{str tag='pluginexplainartefactblocktypes'}<br/><br/></b>
......
{include file="header.tpl"}
<div class="panel panel-body">
<form action="{$WWWROOT}admin/groups/archive.php" method="post">
{if $search->sortby}
<input type="hidden" name="sortby" id="sortby" value="{$search->sortby}">
{/if}
{if $search->sortdir}
<input type="hidden" name="sortdir" id="sortdir" value="{$search->sortdir}">
{/if}
{if $limit}
<input type="hidden" name="limit" id="limit" value="{$limit}">
{/if}
<div class="fr">
<a id="csvlink" href="{$WWWROOT}admin/groups/archivescsvdownload.php{if $.request.institution}?institution={$.request.institution}{/if}" target="_blank">{str tag=exportdataascsv section=admin}</a>
</div>
<div class="usersearchform">
<label for="query">{str tag='usersearch' section='admin'}:</label>
<input type="text" name="query" id="query"{if $search->query} value="{$search->query}"{/if}>
<form class="form-inline pieform form with-heading" action="{$WWWROOT}admin/groups/archive.php" method="post">
{if $search->sortby}
<input type="hidden" name="sortby" id="sortby" value="{$search->sortby}">
{/if}
{if $search->sortdir}
<input type="hidden" name="sortdir" id="sortdir" value="{$search->sortdir}">
{/if}
{if $limit}
<input type="hidden" name="limit" id="limit" value="{$limit}">
{/if}
<div class="dropdown-group js-dropdown-group form-group">
<fieldset class="pieform-fieldset dropdown-group js-dropdown-group">
<div class="usersearchform with-dropdown js-with-dropdown text form-group">
<label for="query">{str tag='usersearch' section='admin'}: </label>
<input class="form-control with-dropdown js-with-dropdown text" type="text" name="query" id="query"{if $search->query} value="{$search->query}"{/if}>
</div>
{if count($institutions) > 1}
<span class="institutions">
<label for="institution">{str tag='Institution' section='admin'}:</label>
<select name="institution" id="institution">
<option value="all"{if !$.request.institution} selected="selected"{/if}>{str tag=All}</option>
{foreach from=$institutions item=i}
<option value="{$i->name}"{if $i->name == $.request.institution}" selected="selected"{/if}>{$i->displayname}</option>
{/foreach}
</select>
</span>
<div class="dropdown-connect js-dropdown-connect select form-group">
<label for="institution">{str tag='Institution' section='admin'}:</label>
<span class="picker">
<select class="form-control dropdown-connect js-dropdown-connect select" name="institution" id="institution">
<option value="all"{if !$.request.institution} selected="selected"{/if}>{str tag=All}</option>
{foreach from=$institutions item=i}
<option value="{$i->name}"{if $i->name == $.request.institution}" selected="selected"{/if}>{$i->displayname}</option>
{/foreach}
</select>
</span>
</div>
{/if}
<button id="query-button" class="btn-search" type="submit">{str tag="go"}</button>
</div>
<script type="application/javascript">
jQuery(function($) {
var csvlink = '{$WWWROOT}admin/groups/archivescsvdownload.php';
$('#institution').on('change', function() {
if ($(this).val() != 'all') {
$('#csvlink').attr('href', csvlink + '?institution=' + $j(this).val());
}
else {
$('#csvlink').attr('href', csvlink);
}
});
</fieldset>
</div>
<div class="no-label text-inline form-group">
<button id="query-button" class="btn-search btn btn-primary" type="submit">{str tag="search"}</button>
</div>
<script type="application/javascript">
jQuery(function($) {
var csvlink = '{$WWWROOT}admin/groups/archivescsvdownload.php';
$('#institution').on('change', function() {
if ($(this).val() != 'all') {
$('#csvlink').attr('href', csvlink + '?institution=' + $j(this).val());
}
else {
$('#csvlink').attr('href', csvlink);
}
});
</script>
</form>
<div id="results" class="section">
<h2 id="resultsheading">{str tag="Results"}</h2>
});
</script>
</form>
<div class="panel panel-default mtxl" id="results" >
<h2 class="panel-heading" id="resultsheading">{str tag="Results"}</h2>
{if $results}
<table id="searchresults" class="tablerenderer fullwidth listing">
<thead>
......@@ -74,10 +82,21 @@
{$results|safe}
</tbody>
</table>
{$pagination|safe}
<div class="panel-body">
{$pagination|safe}
</div>
<a class="panel-footer" id="csvlink" href="{$WWWROOT}admin/groups/archivescsvdownload.php{if $.request.institution}?institution={$.request.institution}{/if}" target="_blank">
<span class="icon icon-table prs"></span>
{str tag=exportdataascsv section=admin}
</a>
{else}
<div>{str tag="noresultsfound"}</div>
<div class="panel-body">
<p class="lead mtxl ptxl pbxl text-center"> {str tag="noresultsfound"}</p>
</div>
{/if}
</div>
</div>
{include file="footer.tpl"}
{include file="header.tpl"}
<div class="panel panel-body">
<div class="panel panel-default panel-body">
{$optionform|safe}
<h3>{str tag=addcategories section=admin}</h3>
<p>{str tag=groupcategoriespagedescription section=admin}</p>
<div id="editmenus">
<div id="menuitemlist"></div>
</div>
<div class="panel panel-default">
<h3 class="panel-heading">{str tag=addcategories section=admin}</h3>
<div class="panel-body">
<p class="lead text-small">{str tag=groupcategoriespagedescription section=admin}</p>
<div id="editmenus">
<div id="menuitemlist"></div>
</div>
</div>
</div>
{include file="footer.tpl"}
......
{include file="header.tpl"}
<div class="panel panel-body">
{$searchform|safe}
<div class="panel panel-default panel-body mtl">
<table id="admgroupslist" class="fullwidth table table-striped mbm">
<thead>
<tr>
......
......@@ -13,12 +13,14 @@
{/if}
<td>{$group->visibility}</td>
<td class="right">
<a class="mrl" title="{str tag="groupmanage" section="admin"}" href="{$WWWROOT}admin/groups/manage.php?id={$group->id}">
<span class="icon icon-cog icon-lg"></span><span class="sr-only">{str(tag=groupmanagespecific section=admin arg1=$group->name)|escape:html|safe}</span>
</a>
<a title="{str tag="delete"}" href="{$WWWROOT}admin/groups/delete.php?id={$group->id}">
<span class="icon icon-trash text-danger icon-lg"></span><span class="sr-only">{str(tag=deletespecific arg1=$group->name)|escape:html|safe}</span>
</a>
<div class="btn-group">
<a class="btn btn-default btn-sm" title="{str tag="groupmanage" section="admin"}" href="{$WWWROOT}admin/groups/manage.php?id={$group->id}">
<span class="icon icon-cog icon-lg"></span><span class="sr-only">{str(tag=groupmanagespecific section=admin arg1=$group->name)|escape:html|safe}</span>
</a>
<a class="btn btn-default btn-sm" title="{str tag="delete"}" href="{$WWWROOT}admin/groups/delete.php?id={$group->id}">
<span class="icon icon-trash text-danger icon-lg"></span><span class="sr-only">{str(tag=deletespecific arg1=$group->name)|escape:html|safe}</span>
</a>
</div>
</td>
</tr>
{/foreach}
{include file="header.tpl"}
<div class="panel panel-body">
<div class="panel panel-default panel-body">
{$uploadcsvpagedescription|safe}
{$uploadcsvform|safe}
{include file="progress_meter.tpl"}
......
{include file="header.tpl"}
<div class="panel panel-body">
<p>{str tag="adminuserspagedescription1" section="admin"}</p>
<div class="lead">
{str tag="adminuserspagedescription1" section="admin"}
</div>
<div class="panel panel-default panel-body">