Commit 0cb71655 authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells

Admin regression fixes (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: If744da7a2fc236fcb6d6eca7015fe649a4687a31
parent 6ef7c9ae
......@@ -49,6 +49,7 @@ $form = pieform(array(
'elements' => array(
'cookietypes' => array(
'type' => 'checkboxes',
'class' => 'stacked',
'title' => get_string('cookietypes','cookieconsent'),
'description' => get_string('cookietypesdesc','cookieconsent'),
'labelwidth' => 20,
......
......@@ -66,6 +66,7 @@ $elements = array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'value' => get_string('licensesave', 'admin'),
),
);
......
......@@ -271,6 +271,7 @@ $footerelements = array();
foreach ($all as $k => $v) {
$footerelements[$k] = array(
'type' => 'switchbox',
'class' => 'last pb0',
'title' => $v['title'],
'defaultvalue' => in_array($k, $active),
'onclick' => "getElement('footerlinks_{$k}_link').disabled = !this.checked;",
......
......@@ -26,6 +26,7 @@ $opensslext = extension_loaded('openssl');
$curlext = extension_loaded('curl');
$xmlrpcext = extension_loaded('xmlrpc');
if (!$opensslext || !$curlext || !$xmlrpcext) {
$smarty = smarty();
setpageicon($smarty, 'icon-exchange');
......@@ -86,21 +87,33 @@ $networkingform = pieform(
),
'promiscuousmode' => array(
'type' => 'switchbox',
'class' => 'last',
'title' => get_string('promiscuousmode','admin'),
'description' => get_string('promiscuousmodedescription','admin'),
'defaultvalue' => get_config('promiscuousmode'),
'options' => $yesno,
),
'submit' => array(
'class' => 'btn btn-success',
'type' => 'submit',
'value' => get_string('savechanges','admin')
),
'deletesubmit' => array(
'class' => 'btn btn-danger',
'type' => 'submit',
'title' => get_string('deletekey', 'admin'),
'value' => get_string('delete')
'submitbuttons' => array(
'type' => 'fieldset',
'class' => 'btn-group',
'elements' => array (
'submit' => array(
'class' => 'btn btn-success',
'name' => 'submit',
'type' => 'button',
'usebuttontag' => true,
'content' => get_string('savechanges','admin'),
'value' => 'submit'
),
'deletesubmit' => array(
'class' => 'btn btn-default',
'name' => 'submit', // must be called submit so we can access it's value
'type' => 'button',
'usebuttontag' => true,
'content' => '<span class="icon icon-refresh icon-lg prs text-danger"></span> '. get_string('deletekey', 'admin'),
'value' => 'deletekey'
)
)
)
)
)
......@@ -113,10 +126,11 @@ function networkingform_fail(Pieform $form) {
));
}
function networkingform_submit(Pieform $form, $values) {
$reply = '';
if (isset($values['deletesubmit'])) {
if ($form->get_submitvalue() === 'deletekey') {
global $SESSION;
$openssl = OpenSslRepo::singleton();
$openssl->get_keypair(true);
......
......@@ -22,5 +22,6 @@ $smarty = smarty();
setpageicon($smarty, 'icon-key');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('accesslists', $accesslists);
$smarty->display('view/share.tpl');
......@@ -219,7 +219,7 @@ function deletenote_form($id, $notedata) {
'usebuttontag' => true,
'class' => 'btn btn-default btn-xs last',
'elementtitle' => get_string('delete'),
'value' => '<span class="icon icon-trash text-danger"></span> ',
'value' => '<span class="icon icon-trash text-danger icon-lg"></span> ',
),
),
);
......
......@@ -1102,7 +1102,7 @@ EOF;
SPAN({'class': 'sr-only'}, {$editstr}));
var dellink =
A({'href': '', 'title': {$delstr}, 'class': 'btn btn-default btn-xs'},
SPAN({'class': 'icon icon-trash text-danger'}),
SPAN({'class': 'icon icon-trash text-danger icon-lg'}),
SPAN({'class': 'sr-only'}, {$deljsstr}));
connect(dellink, 'onclick', function (e) {
e.stop();
......
......@@ -114,7 +114,7 @@ $form = pieform(array(
));
$smarty = smarty();
setpageicon($smarty, 'icon-bookmark');
setpageicon($smarty, 'icon-folder-open');
if (!empty($groupid)) {
$smarty->assign('PAGESUBHEADING', SUBTITLE);
$smarty->assign('PAGEHELPNAME', '0');
......
......@@ -27,7 +27,7 @@ $groupid = param_integer('group', 0);
$institutionname = param_alphanum('institution', false);
$urlparams = array();
$pageIcon = 'icon-bookmark';
$pageIcon = 'icon-folder-open';
$subsectionheading = false;
if (!empty($groupid)) {
......
......@@ -79,7 +79,7 @@ if (get_config('allowgroupcategories')
}
$elements['search'] = array(
'type' => 'submit',
'class' => 'btn btn-primary mtm',
'class' => 'btn btn-primary',
'value' => get_string('search'));
$searchform = pieform(array(
'name' => 'search',
......
......@@ -110,25 +110,32 @@ $searchform = pieform(array(
'type' => 'hidden',
'value' => $setlimit
),
'query' => array(
'title' => get_string('search') . ': ',
'type' => 'text',
'class' => 'input-small',
'defaultvalue' => $query
),
'sortoption' => array(
'type' => 'select',
'class' => 'sortoption input-small',
'title' => get_string('sortedby'),
'multiple' => false,
'size' => 1,
'defaultvalue' => $sortoptionidx,
'options' => $sortoptions
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-primary mtm',
'value' => get_string('search')
'inputgroup' => array (
'type' => 'fieldset',
'class' => 'input-group',
'elements' => array(
'query' => array(
'title' => get_string('search') . ': ',
'type' => 'text',
'class' => 'input-small',
'defaultvalue' => $query
),
'sortoption' => array(
'type' => 'select',
'class' => 'sortoption input-small',
'title' => get_string('sortedby'),
'multiple' => false,
'size' => 1,
'defaultvalue' => $sortoptionidx,
'options' => $sortoptions
),
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-primary no-label input-group-btn',
'value' => get_string('search')
)
)
)
)
));
......
......@@ -148,6 +148,8 @@ class Pieform {/*{{{*/
*/
private $submitted_by_dropzone = false;
private $submitvalue = 'submit';
/*}}}*/
/**
......@@ -463,9 +465,12 @@ class Pieform {/*{{{*/
// Check if the form was submitted, and if so, validate and process it
$global = ($this->data['method'] == 'get') ? $_GET: $_POST;
if ($this->data['validate'] && isset($global['pieform_' . $this->name] )) {
if ($this->data['submit']) {
$this->submitted = true;
$this->submitvalue = $global['submit'];
// If the hidden value the JS code inserts into the form is
// present, then the form was submitted by JS
......@@ -594,6 +599,15 @@ class Pieform {/*{{{*/
return $this->name;
}/*}}}*/
/**
* Returns the value of a submit button
*
* @return string
*/
public function get_submitvalue() {/*{{{*/
return $this->submitvalue;
}/*}}}*/
/**
* Returns a generic property. This can be used to retrieve any property
* set in the form data array, so developers can pass in random stuff and
......
......@@ -45,10 +45,26 @@ function pieform_element_button(Pieform $form, $element) {/*{{{*/
if (isset($element['usebuttontag']) && $element['usebuttontag'] === true) {
$value = '';
$action = '';
$type = 'type="submit" ';
if (isset($element['content'])) {
$content = $element['content'];
$value = 'value="'. Pieform::hsc($element['value']) . '" ';
} else {
$content = $element['value'];
}
if (isset($element['action'])) {
$action = 'formaction="' . Pieform::hsc($element['action']) . '" ';
}
$button = '<button '
. $value . $action . $type
. $form->element_attributes($element)
. '">'
. $element['value']
. '>'
. $content
. '</button>';
} else {
......
This diff is collapsed.
......@@ -19,7 +19,7 @@
{if $institution}
{if $institution && !ADMIN}
<div class="row">
<div class='col-md-10'>
{/if}
......@@ -28,7 +28,7 @@
{$form|safe}
{if $institution}
{if $institution && !ADMIN}
</div>
</div>
{/if}
......
......@@ -148,8 +148,8 @@
</div>
{/if}
<div class="filelist-wrapper panel panel-secondary">
<h3 id="{$prefix}_foldernav" class="panel-heading ptm pbm mtl mbl pll ">
<div class="filelist-wrapper mtl panel panel-secondary">
<h3 id="{$prefix}_foldernav" class="panel-heading ptm pbm mbl pll ">
{include file="artefact:file:form/folderpath.tpl" path=$path querybase=$querybase owner=$tabs.owner ownerid=$tabs.ownerid}
</h3>
......
......@@ -106,7 +106,7 @@
{elseif !$file->isparent}
{if !isset($file->can_edit) || $file->can_edit !== 0}
<button name="{$prefix}_edit[{$file->id}]" class="btn btn-default btn-xs">
<span class="icon icon-pencil"></span>
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">{$edittext|escape:html|safe}</span>
</button>
{/if}
......@@ -127,7 +127,7 @@
<div class="btn-group">
{if $file->artefacttype == 'archive'}
<a href="{$WWWROOT}artefact/file/extract.php?file={$file->id}" title="{str tag=Decompress section=artefact.file}" class="btn btn-default btn-xs">
<span class="icon icon-file-archive-o "></span>
<span class="icon icon-file-archive-o icon-lg"></span>
<span class="sr-only">
{str(tag=decompressspecific section=artefact.file arg1=$displaytitle)|escape:html|safe}
</span>
......@@ -143,12 +143,12 @@
{/if}
<button name="{$prefix}_edit[{$file->id}]" class="btn btn-default btn-xs">
<span class="icon icon-pencil"></span>
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">{$edittext|escape:html|safe}</span>
</button>
<button name="{$prefix}_delete[{$file->id}]" class="btn btn-default btn-xs">
<span class="icon icon-trash text-danger"></span>
<span class="icon icon-trash text-danger icon-lg"></span>
<span class="sr-only">{$deletetext|escape:html|safe}</span>
</button>
</div>
......
......@@ -37,12 +37,12 @@
<td class="control-buttons">
<div class="btn-group">
<a href="{$WWWROOT}artefact/internal/socialprofile.php?id={$row->id}" title="{str tag='edit'}" class="btn btn-default btn-xs">
<span class="icon icon-pencil"></span>
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">{str tag='edit'}</span>
</a>
{if $candelete}
<a href="{$WWWROOT}artefact/internal/socialprofile.php?id={$row->id}&delete=1" title="{str tag='delete'}" class="btn btn-default btn-xs">
<span class="icon icon-trash text-danger"></span>
<span class="icon icon-trash text-danger icon-lg"></span>
<span class="sr-only">{str tag='delete'}</span>
</a>
{/if}
......
......@@ -16,7 +16,7 @@
{str tag=managetasks section=artefact.plans}
</a>
<a href="{$WWWROOT}artefact/plans/delete/index.php?id={$plan->id}" title="{str(tag=deletespecific arg1=$plan->title)|escape:html|safe}" class="btn btn-default btn-sm">
<span class="icon icon-trash text-danger"></span>
<span class="icon icon-trash text-danger icon-lg"></span>
{str tag=delete}
</a>
</div>
......
......@@ -38,11 +38,11 @@
<td class="planscontrols control-buttons text-right">
<div class="btn-group">
<a href="{$WWWROOT}artefact/plans/edit/task.php?id={$task->task}" title="{str tag=edit}" class="btn btn-default btn-xs">
<span class="icon icon-pencil"></span>
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">{str(tag=editspecific arg1=$task->title)|escape:html|safe}</span>
</a>
<a href="{$WWWROOT}artefact/plans/delete/task.php?id={$task->task}" title="{str tag=delete}" class="btn btn-default btn-xs">
<span class="icon icon-trash text-danger"></span>
<span class="icon icon-trash text-danger icon-lg"></span>
<span class="sr-only">{str(tag=deletespecific arg1=$task->title)|escape:html|safe}</span>
</a>
</div>
......
......@@ -68,13 +68,13 @@
{if $moderator}
<div class="btn-group">
<a href="{$WWWROOT}interaction/forum/edittopic.php?id={$topic->id}&amp;returnto=view" class="btn btn-default btn-xs" title="{str tag="edit"}">
<span class="icon icon-pencil"></span>
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">
{str tag=edittopicspecific section=interaction.forum arg1=$topic->subject}
</span>
</a>
<a href="{$WWWROOT}interaction/forum/deletetopic.php?id={$topic->id}&amp;returnto=view" class="btn btn-default btn-xs" title="{str tag="delete"}">
<span class="icon icon-trash text-danger"></span>
<span class="icon icon-trash text-danger icon-lg"></span>
<span class="sr-only">
{str tag=deletetopicspecific section=interaction.forum arg1=$topic->subject}
</span>
......
......@@ -75,6 +75,9 @@
@include sr-only;
}
}
~ .btn {
margin-top: 16px;
}
}
......@@ -118,6 +121,7 @@
background: rgba(0,0,0,0.03);
}
}
}
.input-sm {
......@@ -153,5 +157,7 @@
}
}
}
\ No newline at end of file
......@@ -98,6 +98,9 @@ label,
.form-inline {
position: relative;
label {
display: block;
}
.form-group {
padding: 0;
}
......
......@@ -2,6 +2,9 @@
.panel-secondary {
@include box-shadow(none);
.admin & {
border-color: #ddd;
}
> .panel-heading {
font-family: $font-family-serif;
}
......
......@@ -29,10 +29,17 @@ h1 {
margin-top: -16px;
}
~ form.with-heading {
@include border-bottom-radius(3px);
margin-top: -20px;
background-color: #f7f7f7;
padding: 10px;
border-bottom: 1px solid #eee;
.admin & {
background-color: #fcfcfc;
border-color: #ddd;
border-left: 1px solid #eee;
border-right: 1px solid #eee;
}
~ form.with-heading {
padding-top: 0;
margin-top: -1px;
......
// Custom component variables (non-bootstrap components)
//Arrow compoanent variables
$arrow-color: lighten(desaturate($brand-primary, 22%), 43%);
$arrow-color: lighten(desaturate($brand-primary, 80%), 55%);
$arrow-text-color: $text-color;
$arrow-link-color: $link-color;
$arrow-link-hover-color: $text-color;
......
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"}
<p>{str tag=sitelicensesdescription section=admin}</p>
{if !$enabled}
<p>{str tag=sitelicensesdisablednote section=admin args=$WWWROOT}</p>
{/if}
{$form|safe}
<p class="lead">{str tag=sitelicensesdescription section=admin}</p>
<div class="panel panel-default">
<div class="panel-body">
{if !$enabled}
<p class="alert alert-warning">{str tag=sitelicensesdisablednote section=admin args=$WWWROOT}</p>
{/if}
{$form|safe}
</div>
</div>
{include file="footer.tpl"}
......@@ -34,19 +34,25 @@
<td>{$l->shortname}</td>
<td><a href="{$l->name}">{$l->name}</a></td>
<td class="control-buttons">
<a href="license-edit.php?edit={$l->name|escape:url}" title="{str tag=edit}" class="btn btn-default btn-xs">
<span class="icon icon-pencil"></span>
<span class="sr-only">{str(tag=editspecific arg1=$l->shortname)|escape:html|safe}</span>
</a>
<span class="input-as-icon icon-trash">
<input class="input-as-icon icon-trash submit" type="submit" title="{str tag=delete}" value="{str tag=delete}" name="license_delete[{$l->name}]" alt="{str(tag=deletespecific arg1=$l->shortname)|escape:html|safe}">
</span>
<div class="btn-group">
<a href="license-edit.php?edit={$l->name|escape:url}" title="{str tag=edit}" class="btn btn-default btn-xs">
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">{str(tag=editspecific arg1=$l->shortname)|escape:html|safe}</span>
</a>
<button class="btn btn-default btn-xs" type="submit" title="{str tag=delete}" name="license_delete[{$l->name}]" alt="{str(tag=deletespecific arg1=$l->shortname)|escape:html|safe}">
<span class="icon icon-trash text-danger icon-lg"></span>
<span class="sr-only">{str tag=delete}</span>
</button>
</div>
</td>
</tr>
{/foreach}
</tbody>
</table>
<a href="license-edit.php?add=add" class="btn">{str tag=addsitelicense section=admin}</a>
<a href="license-edit.php?add=add" class="btn btn-default">
<span class="icon icon-plus text-success prs"></span>
{str tag=addsitelicense section=admin}
</a>
{if $extralicenses}
<p>{str tag=extralicensesdescription section=admin}</p>
<ul>
......
......@@ -2,5 +2,13 @@
{if $GROUP}
<h2>{$PAGESUBHEADING}{if $SUBPAGEHELPNAME}<span class="page-help-icon">{$PAGEHELPICON|safe}</span>{/if}</h2>
{/if}
{if $ADMIN}
<div class="panel panel-default">
<div class="panel-body">
{$form|safe}
</div>
</div>
{else}
{$form|safe}
{/if}
{include file="footer.tpl"}
......@@ -64,10 +64,20 @@
</div>
{$pagination|safe}
{else}
<div class="mtxl ptxl">
<p class="lead mtxl ptxl text-center ">
{str tag=nocollections section=collection}{if $addonelink} <a href={$addonelink}>{str tag=addone}</a>{/if}
</p>
{if ADMIN}
<div class="panel panel-default">
<div class="panel-body ptxl pbxl">
<p class="lead mtxl ptxl pbxl text-center ">
{str tag=nocollections section=collection}{if $addonelink} <a href={$addonelink}>{str tag=addone}</a>{/if}
</p>
</div>
</div>
{else}
<div class="mtxl ptxl">
<p class="lead mtxl ptxl text-center ">
{str tag=nocollections section=collection}{if $addonelink} <a href={$addonelink}>{str tag=addone}</a>{/if}
</p>
</div>
{/if}
{/if}
{include file="footer.tpl"}
......@@ -49,7 +49,7 @@
<div class="skin-controls panel-footer">
{if $skin.editable}
<a href="{$WWWROOT}skin/design.php?id={$skin.id}{if $skin.type == 'site'}&site=1{/if}" title="{str tag='editthisskin' section='skin'}" {if $skin.type == 'site'} onclick="return confirm('{str tag='editsiteskin?' section='skin'}');"{/if} class="btn btn-default btn-xs">
<span class="icon icon-pencil"></span>
<span class="icon icon-pencil icon-lg"></span>
<span class="sr-only">
{str tag=editspecific arg1=$skin.title}
</span>
......@@ -59,14 +59,14 @@
{if $skin.removable}
<a href="{$WWWROOT}skin/export.php?id={$skin.id}" title="{str tag='exportthisskin' section='skin'}" class="btn btn-default btn-xs">
<span class="icon icon-external-link"></span>
<span class="icon icon-external-link icon-lg"></span>
<span class="sr-only">
{str tag=exportspecific section=skin arg1=$skin.title}
</span>
</a>
<a href="{$WWWROOT}skin/delete.php?id={$skin.id}{if $skin.type == 'site'}&site=1{/if}" title="{str tag='deletethisskin' section='skin'}" class="btn btn-default btn-xs">
<span class="icon icon-trash text-danger"></span>
<a href="{$WWWROOT}skin/delete.php?id={$skin.id}{if $skin.type == 'site'}&site=1{/if}" title="{str tag='deletethisskin' section='skin'}" class="btn btn-default btn-xs icon-lg">
<span class="icon icon-trash text-danger icon-lg"></span>
<span class="sr-only">
{str tag=deletespecific arg1=$skin.title}
</span>
......@@ -77,7 +77,7 @@
{if $skin.type == 'public' && $skin.owner != $user}
{if !$skin.favorite}
<a href="{$WWWROOT}skin/favorite.php?add={$skin.id}" title="{str tag='addtofavorites' section='skin'}" class="btn btn-default btn-xs">
<span class="icon icon-heart-o"></span>
<span class="icon icon-heart-o icon-lg"></span>
<span class="sr-only">
{str tag=addtofavoritesspecific section=skin arg1=$skin.title}
</span>
......@@ -85,7 +85,7 @@
{else}
<a href="{$WWWROOT}skin/favorite.php?del={$skin.id}" title="{str tag='removefromfavorites' section='skin'}" class="btn btn-default btn-xs">
<span class="icon icon-heart"></span>
<span class="icon icon-heart icon-lg"></span>
<span class="sr-only">
{str tag=removefromfavoritesspecific section=skin arg1=$skin.title}
</span>
......
......@@ -4,6 +4,7 @@
<div id="blocksinstruction" class="lead ">
{str tag='blocksintructionnoajax' section='view'}
</div>
<div class="row" selected='content' data-target="col-collapse">
{if $columns}
......@@ -88,7 +89,6 @@