Commit 50031f15 authored by Naomi Guyer's avatar Naomi Guyer Committed by Robert Lyon

Bootstrap bug fixes (bootstrap) BUG 1465107

* Standardised delete form
* Applied styling to institution edit form

Change-Id: I2ee7fa8c07ece3ad56cf0c29d3b10d4dd19319bf
parent 03abd36b
......@@ -26,7 +26,7 @@ $deleteform = pieform(array(
'pluginname' => 'account',
'elements' => array(
'submit' => array(
'class' => 'btn btn-danger',
'class' => 'btn btn-default',
'type' => 'submit',
'value' => get_string('deleteaccount', 'mahara', display_username($USER), full_name($USER)),
),
......
......@@ -29,6 +29,7 @@ $form = pieform(array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-default',
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'admin/groups/groups.php',
)
......
......@@ -22,6 +22,8 @@ define('TITLE', get_string('administergroups', 'admin'));
$quotasform = pieform(array(
'name' => 'groupquotasform',
'class' => 'form-inline',
'renderer' => 'div',
'elements' => array(
'groupid' => array(
'type' => 'hidden',
......@@ -30,13 +32,14 @@ $quotasform = pieform(array(
'quota' => array(
'type' => 'bytes',
'title' => get_string('filequota1', 'admin'),
'description' => get_string('groupfilequotadescription', 'admin'),
'defaultvalue' => $group->quota,
),
'submit' => array(
'type' => 'submit',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-primary no-label',
'value' => get_string('save'),
),
)
),
));
......@@ -73,7 +76,7 @@ $admins = get_column_sql(
$groupadminsform = pieform(array(
'name' => 'groupadminsform',
'renderer' => 'table',
'renderer' => 'div',
'plugintype' => 'core',
'pluginname' => 'admin',
'elements' => array(
......@@ -86,6 +89,7 @@ $groupadminsform = pieform(array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'value' => get_string('save'),
),
),
......
......@@ -54,7 +54,7 @@ $closeform = pieform(array(
'submit' => array(
'type' => 'submit',
'value' => get_string($closed ? 'Open' : 'Close', 'admin'),
'class' => $closed ? 'btn btn-success' : 'btn btn-danger'
'class' => $closed ? 'btn btn-success' : 'btn btn-default'
),
),
));
......
......@@ -730,7 +730,7 @@ $siteoptionform = array(
),
'loggingsettings' => array(
'iconclass'=>'exclamation-triangle',
'class' => 'last',
'class' => 'last mbxl',
'type' => 'fieldset',
'collapsible' => true,
'collapsed' => true,
......@@ -764,8 +764,9 @@ $siteoptionform = array(
);
$siteoptionform['elements']['submit'] = array(
'type' => 'submit',
'class' => 'btn btn-success mtm',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-success',
'value' => get_string('updatesiteoptions', 'admin')
);
......
......@@ -79,6 +79,7 @@ if ($institution && $plugin) {
$form['elements']['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('submit'), get_string('cancel')),
'goto' => 'addauthority.php?c=1'
);
......
......@@ -189,6 +189,7 @@ if ($institution || $add) {
),
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-default',
'value' => array(get_string('yes'), get_string('no'))
)
)
......@@ -532,6 +533,7 @@ if ($institution || $add) {
$elements['lockedfields'] = array(
'type' => 'fieldset',
'class' => 'last',
'legend' => get_string('Lockedfields', 'admin'),
'collapsible' => true,
'collapsed' => true,
......@@ -551,11 +553,6 @@ if ($institution || $add) {
'disabled' => $institution != 'mahara' && in_array($field, $sitelockedfields)
);
}
$elements['lockedfieldshelp'] = array(
'value' => '<tr id="lockedfieldshelp"><th colspan="2">'
. get_help_icon('core', 'admin', 'institution', 'lockedfields')
. '</th></tr>'
);
// Check for active plugins institution settings.
$elements['pluginsfields'] = array(
......@@ -582,6 +579,7 @@ if ($institution || $add) {
$elements['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('submit'), get_string('cancel'))
);
......@@ -1059,6 +1057,8 @@ if ($institution && $institution != 'mahara') {
$suspendformdef = array(
'name' => 'institution_suspend',
'plugintype' => 'core',
'renderer' => 'div',
'class' => 'form-as-button last',
'pluginname' => 'admin',
'elements' => array(
'i' => array(
......@@ -1066,9 +1066,10 @@ if ($institution && $institution != 'mahara') {
'value' => $institution,
),
'submit' => array(
'type' => 'submit',
'value' => get_string('suspendinstitution','admin'),
'description' => get_string('suspendinstitutiondescription','admin'),
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => '<span class="icon icon-lg text-danger icon-ban prm"></span>' . get_string('suspendinstitution','admin'),
),
)
);
......@@ -1079,6 +1080,7 @@ if ($institution && $institution != 'mahara') {
$suspendformdef = array(
'name' => 'institution_unsuspend',
'plugintype' => 'core',
'renderer' => 'div',
'pluginname' => 'admin',
'elements' => array(
'i' => array(
......@@ -1086,8 +1088,10 @@ if ($institution && $institution != 'mahara') {
'value' => $institution,
),
'submit' => array(
'type' => 'submit',
'value' => get_string('unsuspendinstitution','admin'),
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => '<span class="icon icon-lg text-success icon-check prm"></span>' . get_string('unsuspendinstitution','admin'),
'description' => get_string('unsuspendinstitutiondescription','admin'),
),
)
......@@ -1136,6 +1140,7 @@ jQuery(function($) {
$smarty = smarty();
setpageicon($smarty, 'icon-university');
$smarty->assign('INLINEJAVASCRIPT', $themeoptionsjs);
$smarty->assign('institution_form', $institutionform);
$smarty->assign('instancestring', $instancestring);
......@@ -1154,6 +1159,7 @@ if (isset($suspended)) {
}
$smarty->assign('PAGEHEADING', get_string('admininstitutions', 'admin'));
$smarty->assign('subsectionheading', get_field('institution', 'displayname', 'name', $institution));
$smarty->display('admin/users/institutions.tpl');
function theme_sort($a, $b) {
......
......@@ -56,7 +56,7 @@ if ($delete) {
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-danger',
'class' => 'btn btn-default',
'value' => array(get_string('deleteprofile','artefact.internal'), get_string('cancel')),
'goto' => get_config('wwwroot') . '/artefact/internal/index.php?fs=social',
),
......
......@@ -154,7 +154,7 @@ class PluginAuthBrowserid extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -210,7 +210,7 @@ class PluginAuthImap extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -1967,7 +1967,7 @@ class PluginAuthLdap extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -462,7 +462,7 @@ class PluginAuthSaml extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -835,7 +835,7 @@ class PluginAuthXmlrpc extends PluginAuth {
return array(
'elements' => $elements,
'renderer' => 'table'
'renderer' => 'div'
);
}
......
......@@ -204,10 +204,7 @@ function export_submit(Pieform $form, $values) {
}
$smarty = smarty(
$jsfiles,
array('<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'theme/views.css') . '">'),
array(),
array('stylesheets' => array('style/views.css'))
$jsfiles
);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('pagedescription', get_string('exportportfoliodescription', 'export'));
......
......@@ -1496,7 +1496,8 @@ EOF;
else {
$labelclass = '';
}
$nolabeltypes = array('radio', 'emaillist', 'date', 'files', 'checkboxes');
$nolabeltypes = array('radio', 'emaillist', 'date', 'files', 'checkboxes', 'bytes');
if (!empty($element['nolabel']) || in_array($element['type'], $nolabeltypes)) {
// Don't bother with a label for the element.
// Special 'nolabeltypes' have their own label(s) added direct to the form field(s).
......
......@@ -65,16 +65,19 @@ function pieform_element_bytes(Pieform $form, $element) {/*{{{*/
// @todo probably create with an actual input element, as tabindex doesn't work here for one thing
// Same with the select. And do the events using mochikit signal instead of dom events
$numberinput = '<input';
$numberinput = '<div class="with-dropdown js-with-dropdown text">';
$numberinput .= '<label for="' . $formname . '_' . $name . '">' . Pieform::hsc($element['title']) . ': </label><input';
$numberinput .= ' type="text" size="6" name="' . $name . '"';
$numberinput .= ' id="' . $formname . '_' . $name . '" value="' . Pieform::hsc($values['number']) . '" tabindex="' . Pieform::hsc($element['tabindex']) . '"';
$numberinput .= (isset($element['error']) ? ' class="error"' : '');
$numberinput .= 'class="with-dropdown js-with-dropdown form-control text'. (isset($element['error']) ? ' error"' : '') . '"';
if (isset($element['description'])) {
$numberinput .= ' aria-describedby="' . $form->element_descriptors($element) . '"';
}
$numberinput .= ">\n";
$uselect = '<label for="' . $formname . '_' . $name . '_units" class="accessible-hidden sr-only">' . get_string('units') . '</label>';
$uselect .= '<select name="' . $name . '_units" id="' . $formname . '_' . $name . '_units"' . ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
$numberinput .= "></div>\n";
$uselect = '<div class="dropdown-connect js-dropdown-connect select">';
$uselect .= '<label for="' . $formname . '_' . $name . '_units" class="accessible-hidden sr-only">' . get_string('units') . '</label>';
$uselect .= '<span class="picker"><select class="form-control dropdown-connect js-dropdown-connect select" name="' . $name . '_units" id="' . $formname . '_' . $name . '_units"' . ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
if (isset($element['description'])) {
$uselect .= ' aria-describedby="' . $form->element_descriptors($element) . '"';
}
......@@ -83,9 +86,15 @@ function pieform_element_bytes(Pieform $form, $element) {/*{{{*/
$uselect .= "\t<option value=\"$u\"" . (($values['units'] == $u) ? ' selected="selected"' : '') . '>'
. $form->i18n('element', 'bytes', $u, $element) . "</option>\n";
}
$uselect .= "</select>\n";
$uselect .= "</select></span></div>\n";
$fieldset = '<div id="' . $formname . '_' . $name . '_fieldset" class="dropdown-group js-dropdown-group form-group">'
. '<fieldset class="pieform-fieldset dropdown-group js-dropdown-group">'
. $numberinput
. $uselect
. '</fieldset></div>';
return $numberinput . $uselect;
return $fieldset;
}/*}}}*/
/**
......
This diff is collapsed.
{include file="header.tpl"}
<div class="deletemessage">
<h2>{$subheading}</h2>
<p class="lead">{$message}</p>
{$form|safe}
<div class="panel panel-danger mtxl">
<h2 class="panel-heading">{$subheading}</h2>
<div class="panel-body">
<p>{$message}</p>
{$form|safe}
</div>
</div>
{include file="footer.tpl"}
......@@ -7,7 +7,11 @@
}
&.form-group {
margin-left: 15px;
margin-left: 11px;
.with-heading & {
margin-left: 15px;
}
}
.with-dropdown {
position: absolute;
......
......@@ -16,6 +16,12 @@
padding: 20px 0;
position: relative;
&.bytes {
.pseudolabel {
display: none;
}
}
&.fake-form {
border: 0;
padding: 0;
......
......@@ -21,8 +21,8 @@ $gray-lighter: lighten($gray-base, 93.5%) !default; // #eee
$brand-default: #ECECEC !default;
$brand-primary: $mahara-green-bright !default;
$brand-success: $mahara-green-bright !default;
$brand-primary: darken($mahara-green-bright, 2%) !default;
$brand-success: darken($mahara-green-bright, 2%) !default;
$brand-info: #5bc0de !default;
$brand-warning: #f0ad4e !default;
$brand-danger: #d9534f !default;
......@@ -183,10 +183,10 @@ $btn-default-border: #ccc !default;
$btn-primary-color: #fff !default;
$btn-primary-bg: $brand-primary !default;
$btn-primary-border: darken($btn-primary-bg, 5%) !default;
$btn-primary-border: darken($btn-primary-bg, 8%) !default;
$btn-success-color: #fff !default;
$btn-success-bg: $mahara-green-light !default;
$btn-success-bg: $brand-primary !default;
$btn-success-border: darken($btn-success-bg, 5%) !default;
$btn-info-color: $state-info-text !default;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -45,7 +45,7 @@
</table>
<div class="right activity-buttons">
<input class="submit btn btn-success" type="submit" value="{str tag='markasread' section='activity'}" />
<input class="submit btn btn-danger" type="button" value="{str tag='delete'}" onClick="markread(document.notificationlist, 'del'); return false;" />
<input class="submit btn btn-default" type="button" value="{str tag='delete'}" onClick="markread(document.notificationlist, 'del'); return false;" />
</div>
{$activitylist.pagination|safe}
</form>
......
{include file="header.tpl"}
<div id="deleteaccount">
<h1>
{str tag=deleteaccount section=account}
</h1>
<p class="lead">
{str tag=deleteaccountdescription section=account}
</p>
{$form|safe}
<div class="panel panel-danger mtxl">
<h2 class="panel-heading">{str tag=deleteaccount section=account}</h2>
<div class="panel-body">
<p>{str tag=deleteaccountdescription section=account}</p>
{$delete_form|safe}
</div>
</div>
</div>
{include file="footer.tpl"}
{include file="footer.tpl"}
\ No newline at end of file
{include file="header.tpl"}
<h3>{str tag=groupquotas section=admin args=$groupname}</h3>
<p>{str tag=managegroupquotadescription1 section=admin}</p>
<div>
<div class="panel panel-default">
<h2 class="panel-heading">{str tag=groupquotas section=admin args=$groupname}</h2>
<div class="panel-body">
<p class="lead text-small">{str tag=managegroupquotadescription1 section=admin}</p>
{$quotasform|safe}
</div>
<h3>{str tag=groupadminsforgroup section=admin args=$groupname}</h3>
<p>{str tag=managegroupdescription1 section=admin}</p>
<div class="userlistform">
{$managegroupform|safe}
</div>
</div>
</div>
<div class="panel panel-default">
<h2 class="panel-heading">{str tag=groupadminsforgroup section=admin args=$groupname}</h2>
<div class="panel-body userlistform">
<p class="lead text-small">{str tag=managegroupdescription1 section=admin}</p>
{$managegroupform|safe}
</div>
</div>
{include file="footer.tpl"}
{include file="microheader.tpl"}
<h3>{str tag="adminauthorities" section="admin"}</h3>
{$auth_imap_form|safe}
{include file="microfooter.tpl"}
{include file="header.tpl"}
<div class="panel panel-default">
<h3 class="panel-heading">{str tag="adminauthorities" section="admin"}</h3>
<div class="panel-body">
{$auth_imap_form|safe}
</div>
</div>
{include file="footer.tpl"}
{include file="header.tpl"}
{if $delete_form}
{if $suspendform}
<div class="btn-group btn-group-top">{$suspendform|safe}</div>
<p class="lead">{str tag="suspendinstitutiondescription" section="admin"}</p>
{/if}
<h3>{str tag="deleteinstitution" section="admin"}</h3>
<p><strong>{$institutionname}</strong></p>
<p>{str tag="deleteinstitutionconfirm" section="admin"}</p>
{$delete_form|safe}
{if $delete_form}
<div class="panel panel-danger mtxl">
<h2 class="panel-heading">{str tag="deleteinstitution" section="admin"}</h2>
<div class="panel-body">
<p><strong>{$institutionname}</strong></p>
<p>{str tag="deleteinstitutionconfirm" section="admin"}</p>
{$delete_form|safe}
</div>
</div>
{elseif $institution_form}
<div class="panel panel-default">
{if $suspended}
<div class="">
<h3 class="title">{$suspended}</h2>
<div class="detail">
{if $USER->get('admin')}
<p>{str tag="unsuspendinstitutiondescription_top" section="admin"}</p>
{else}
<p>{str tag="unsuspendinstitutiondescription_top_instadmin" section="admin"}</p>
{/if}
<h2 class="title panel-heading">{$suspended}</h2>
<div class="panel-body">
<div class="detail">
{if $USER->get('admin')}
<p>{str tag="unsuspendinstitutiondescription_top" section="admin"}</p>
{else}
<p>{str tag="unsuspendinstitutiondescription_top_instadmin" section="admin"}</p>
{/if}
</div>
<div>{$suspendform_top|safe}</div>
</div>
<div>{$suspendform_top|safe}</div>
</div>
{/if}
{if $add}
<h3 class="title">{str tag="addinstitution" section="admin"}</h3>
<h2 class="title panel-heading">{str tag="addinstitution" section="admin"}</h2>
{/if}
{if $suspendform}
<div id="suspendinstitution">
<h3 class="title">{str tag="suspendinstitution" section=admin}</h3>
<div class="detail">{$suspendform|safe}</div>
<h2 class="title panel-heading">{str tag="institution" section="admin"}</h2>
<div class="panel-body">
{$institution_form|safe}
</div>
{/if}
{$institution_form|safe}
</div>
{else}
<div class="btn-group btn-group-top">
......@@ -80,7 +90,6 @@
{$searchform|safe}
<div class="panel panel-default mtl">
<div class="table-responsive">
<table id="adminstitutionslist" class="fullwidth table table-striped">
<thead>
......@@ -99,9 +108,9 @@
</tbody>
</table>
</div>
</div>
<div class="center">
{$results.pagination|safe}
</div>
......
{include file="header.tpl"}
<div class=" delete ">
<p class="lead">{$message}</p>
{$form|safe}
<div class="panel panel-danger mtxl">
<h2 class="panel-heading">{str tag=delete}</h2>
<div class="panel-body">
<p>{$message}</p>
{$form|safe}
</div>
</div>
{include file="footer.tpl"}
......@@ -4,7 +4,9 @@
{elseif $pagedescriptionhtml}
{$pagedescriptionhtml|safe}
{/if}
<div class="panel panel-default panel-body">
{if $ADMIN}<div class="panel panel-default panel-body">{/if}
{$form|safe}
</div>
{if $ADMIN}</div>{/if}
{include file="footer.tpl"}
\ No newline at end of file
......@@ -56,14 +56,14 @@
for(i = 0; i < displayArray.length; i++) {
if(displayArray.length > 1) {
if (i + 1 != displayArray.length) {
getFirstElementByTagAndClassName('span', 'authIcons', displayArray[i]).innerHTML += '<a href="" onclick="move_down('+outputArray[i]+'); return false;"><img class="inline-button" alt="'+get_string('moveitemdown')+'" src="{{theme_url filename="images/btn_movedown.png"}}" /></a>'+"\n";
getFirstElementByTagAndClassName('span', 'authIcons', displayArray[i]).innerHTML += '<a class="btn btn-link" href="" onclick="move_down('+outputArray[i]+'); return false;"><span class="icon icon-long-arrow-down"></span><span class="sr-only">'+get_string('moveitemdown')+'</span></a>'+"\n";
}
if(i != 0) {
getFirstElementByTagAndClassName('span', 'authIcons', displayArray[i]).innerHTML += '<a href="" onclick="move_up('+outputArray[i]+'); return false;"><img class="inline-button" alt="'+get_string('moveitemup')+'" src="{{theme_url filename="images/btn_moveup.png"}}" /></a>'+"\n";
getFirstElementByTagAndClassName('span', 'authIcons', displayArray[i]).innerHTML += '<a class="btn btn-link" href="" onclick="move_up('+outputArray[i]+'); return false;"><span class="icon icon-long-arrow-up"></span><span class="sr-only">'+get_string('moveitemup')+'</span></a>'+"\n";
}
}
getFirstElementByTagAndClassName('span', 'authIcons', displayArray[i]).innerHTML += '<a href="" onclick="removeAuth('+outputArray[i]+'); return false;"><img class="inline-button" alt="'+get_string('deleteitem')+'" src="{{theme_url filename="images/btn_deleteremove.png"}}" /></a>'+"\n";
getFirstElementByTagAndClassName('span', 'authIcons', displayArray[i]).innerHTML += '<a class="btn btn-default btn-sm" href="" onclick="removeAuth('+outputArray[i]+'); return false;"><span class="icon icon-trash icon-lg text-danger"></span><span class="sr-only">'+get_string('deleteitem')+'</span></a>'+"\n";
instanceListDiv.appendChild(displayArray[i]);
}
......@@ -191,20 +191,34 @@ IMPORTANT: do not introduce any new whitespace into the instanceList div.
</label>
<span class="authIcons" id="arrows{{$instance->id}}">
{{if $instance->index + 1 < $instance->total}}
<a href="" onclick="move_down({{$instance->id}}); return false;"><img class="inline-button" alt="{{str tag=moveitemdown}}" src="{{theme_url filename="images/btn_movedown.png"}}" /></a>
<a href="" onclick="move_down({{$instance->id}}); return false;">
<span class="icon icon-arrow-long-down"></span>
<span class="sr-only">{{str tag=moveitemdown}}</span>
</a>
{{/if}}
{{if $instance->index != 0 }}
<a href="" onclick="move_up({{$instance->id}}); return false;"><img class="inline-button" alt="{{str tag=moveitemup}}" src="{{theme_url filename="images/btn_moveup.png"}}" /></a>
<a href="" onclick="move_up({{$instance->id}}); return false;">
<span class="icon icon-arrow-long-up"></span>
<span class="sr-only">{{str tag=moveitemup}}</span>
</a>
{{/if}}