Commit 3f1452f6 authored by Liam Sharpe's avatar Liam Sharpe Committed by Robert Lyon
Browse files

Style add user (BUG 1465107)

Change-Id: I5b3e2150ec4b4000b9f19de4102dfd4533abdf53
parent 0d4e6826
......@@ -54,7 +54,7 @@ if (empty($upgrades['settings']['disablelogin'])) {
unset($upgrades['settings']);
if (!$upgrades) {
die_info(get_string('noupgrades', 'admin'));
die_info('<p class="text-center lead mtxl ptxl">' . get_string('noupgrades', 'admin') . '</p>');
}
$start = time();
......@@ -85,10 +85,10 @@ if (empty($upgrades['core']->install)) {
}
}
$loadingicon = 'icon icon-spinner icon-pulse';
$successicon = 'icon icon-check text-success';
$failureicon = 'icon icon-exclaimation-triangle';
$warningicon = 'icon icon-exclaimation-triangle';
$loadingicon = 'icon icon-spinner icon-pulse prs';
$successicon = 'icon icon-check text-success prs';
$failureicon = 'icon icon-exclaimation-triangle prs';
$warningicon = 'icon icon-exclaimation-triangle prs';
// Remove all files in the smarty and dwoo caches
......
......@@ -277,57 +277,62 @@ function general_account_prefs_form_elements($prefs) {
$sitedefaultlabel = get_string('sitedefault', 'admin') . ' (' . $languages[get_config('lang')] . ')';
}
if (isset($elements['type'])) {
$elements['lang'] = array(
'type' => 'select',
'defaultvalue' => $prefs->lang,
'title' => get_string('language', 'account'),
'options' => array_merge(array('default' => $sitedefaultlabel), $languages),
'help' => true,
'ignore' => count($languages) < 2,
);
$sitethemes = array();
// Get all available standard site themes
if (get_config('sitethemeprefs') && !in_admin_section()) {
// get_user_accessible_themes() returns 'sitedefault' to mean fall back to the site or
// institution theme. This won't work for account prefs, where 'sitedefault' is just
// a theme that doesn't exist. So change the 'sitedefault' key to '', and the empty
// preference will be interpreted as "No theme selected".
$sitethemes = array_reverse(get_user_accessible_themes());
unset($sitethemes['sitedefault']);
$sitethemes = array_reverse($sitethemes);
}
// Get all user's institution themes
$institutionthemes = array();
global $USER;
if ($institutions = $USER->get('institutions')) {
$allthemes = get_all_theme_objects();
foreach ($institutions as $i) {
if (empty($i->theme)) {
$institutionthemes['sitedefault' . '/' . $i->institution] = $i->displayname . ' - ' . get_string('sitedefault', 'admin');
}
else {
$institutionthemes[$i->theme . '/' . $i->institution] = $i->displayname . ' - ' . $allthemes[$i->theme]->displayname;
}
$elements['lang'] = array(
'type' => 'select',
'defaultvalue' => $prefs->lang,
'title' => get_string('language', 'account'),
'options' => array_merge(array('default' => $sitedefaultlabel), $languages),
'help' => true,
'ignore' => count($languages) < 2,
);
$sitethemes = array();
// Get all available standard site themes
if (get_config('sitethemeprefs') && !in_admin_section()) {
// get_user_accessible_themes() returns 'sitedefault' to mean fall back to the site or
// institution theme. This won't work for account prefs, where 'sitedefault' is just
// a theme that doesn't exist. So change the 'sitedefault' key to '', and the empty
// preference will be interpreted as "No theme selected".
$sitethemes = array_reverse(get_user_accessible_themes());
unset($sitethemes['sitedefault']);
$sitethemes = array_reverse($sitethemes);
}
// Get all user's institution themes
$institutionthemes = array();
if ($institutions = $USER->get('institutions')) {
$allthemes = get_all_theme_objects();
foreach ($institutions as $i) {
if (empty($i->theme)) {
$institutionthemes['sitedefault' . '/' . $i->institution] = $i->displayname . ' - ' . get_string('sitedefault', 'admin');
}
else {
$institutionthemes[$i->theme . '/' . $i->institution] = $i->displayname . ' - ' . $allthemes[$i->theme]->displayname;
}
}
$themes = array_merge($sitethemes, $institutionthemes);
natcasesort($themes);
$currenttheme = $USER->get_themedata();
if (!isset($currenttheme->basename)) {
$defaulttheme = 'sitedefault';
}
else {
$defaulttheme = $currenttheme->basename;
}
if (isset($currenttheme->institutionname)) {
$defaulttheme = $defaulttheme . '/' . $currenttheme->institutionname;
}
if (!array_key_exists($defaulttheme, $themes)) {
reset($themes);
$defaulttheme = key($themes);
}
}
$themes = array_merge($sitethemes, $institutionthemes);
natcasesort($themes);
$currenttheme = $USER->get_themedata();
if (!isset($currenttheme->basename)) {
$defaulttheme = 'sitedefault';
}
else {
$defaulttheme = $currenttheme->basename;
}
if (isset($currenttheme->institutionname)) {
$defaulttheme = $defaulttheme . '/' . $currenttheme->institutionname;
}
if (!array_key_exists($defaulttheme, $themes)) {
reset($themes);
$defaulttheme = key($themes);
}
$elements['theme'] = array(
'type' => 'select',
'defaultvalue' => $defaulttheme,
'title' => get_string('theme'),
'options' => $themes,
'ignore' => count($themes) < 2,
'help' => true,
);
$elements['addremovecolumns'] = array(
'type' => 'switchbox',
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -17,7 +17,7 @@ echo $form_tag;
<?php echo $elements[$field]['html']; ?>
<?php if ($elements[$field]['error']) { ?>
<p class="text-danger"><?php echo $elements[$field]['error']; ?></p>
<p class="text-danger"><?php echo $elements[$field]['error']; ?></p>
<?php } ?>
</div>
<?php } ?>
......@@ -43,14 +43,14 @@ echo $form_tag;
<div class="panel-body">
<?php foreach (array('username', 'password', 'staff', 'admin', 'authinstance', 'quota', 'institutionadmin') as $field) { ?>
<?php if (isset($elements[$field]['type'])) { ?>
<div class="form-group <?php echo $elements[$field]['type']; ?>">
<?php echo $elements[$field]['labelhtml']; ?>
<?php echo $elements[$field]['html']; ?>
<?php if (isset($elements[$field]['error'])) { ?>
<p class="text-danger"><?php echo $elements[$field]['error']; ?></p>
<?php } ?>
</div>
<div class="form-group <?php echo $elements[$field]['type']; ?>">
<?php echo $elements[$field]['labelhtml']; ?>
<?php echo $elements[$field]['html']; ?>
<?php if (isset($elements[$field]['error'])) { ?>
<p class="text-danger"><?php echo $elements[$field]['error']; ?></p>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
</div>
......@@ -59,11 +59,11 @@ echo $form_tag;
<div class="step step3 panel panel-default">
<h3 class="panel-heading"><?php echo get_string('create', 'admin'); ?></h3>
<div class="panel-body">
<!-- Button trigger modal -->
<button type="button" class="btn btn-link pl0" data-toggle="modal" data-target="#general-account-options">
<span class="icon icon-cog prs text-default"></span>
<?php echo get_string('accountoptionsdesc', 'account'); ?>
</button>
<!-- Button trigger modal -->
<button type="button" class="btn btn-link pl0" data-toggle="modal" data-target="#general-account-options">
<span class="icon icon-cog prs text-default"></span>
<?php echo get_string('accountoptionsdesc', 'account'); ?>
</button>
<div class="mtl">
<?php echo $elements['submit']['html']; ?>
......@@ -72,45 +72,46 @@ echo $form_tag;
</div>
</div>
</div>
<div class="modal fade" id="general-account-options" tabindex="-1" role="dialog" aria-labelledby="#general-account-options-label">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="general-account-options-title" id="general-account-options-label"><?php echo get_string('accountoptionsdesc', 'account'); ?></h4>
</div>
</div>
<div class="modal-body">
<?php
<div class="modal-body">
<?php
// Render account preferences with a renderer (inside this template :D)
$accountprefs = (object) expected_account_preferences();
$accountprefs = array_keys(general_account_prefs_form_elements($accountprefs));
$fieldset_elements = array();
foreach ($accountprefs as $p) {
// Render account preferences with a renderer (inside this template :D)
$accountprefs = (object) expected_account_preferences();
$accountprefs = array_keys(general_account_prefs_form_elements($accountprefs));
$fieldset_elements = array();
foreach ($accountprefs as $p) {
$fieldset_elements[] = $elements[$p];
}
}
$accountoptions_fieldset = array(
'name' => 'generalaccountoptions',
'type' => 'fieldset',
'class' => 'last',
'elements' => $fieldset_elements,
);
$accountoptions_fieldset = array(
'name' => 'generalaccountoptions',
'type' => 'fieldset',
'class' => 'last',
'elements' => $fieldset_elements,
);
$this->include_plugin('renderer', $this->data['renderer']);
$this->include_plugin('element', 'fieldset');
$this->build_element_html($accountoptions_fieldset);
$this->include_plugin('renderer', $this->data['renderer']);
$this->include_plugin('element', 'fieldset');
$this->build_element_html($accountoptions_fieldset);
echo pieform_render_element($this, $accountoptions_fieldset);
echo pieform_render_element($this, $accountoptions_fieldset);
echo $hidden_elements;
echo $hidden_elements;
?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
......
.option-alt {
// background-color: $panel-default-heading-bg;
border-top: 1px solid $panel-default-border;
min-height: 157px;
position: relative;
......@@ -15,4 +14,4 @@
left: 43%;
text-align: center;
padding: 0 10px;
}
\ No newline at end of file
}
......@@ -64,7 +64,7 @@
z-index: 2;
}
select {
appearance: none;
@include appearance(none);
background: transparent;
height: $input-height-base;
left: 0;
......
......@@ -21,7 +21,7 @@
z-index: 2;
}
select.form-control {
appearance: none;
@include appearance(none);
position: relative;
padding-right: 30px;
background: transparent;
......@@ -78,5 +78,5 @@
height: $input-height-base;
line-height: $input-height-base / 2;
}
}
}
\ No newline at end of file
}
}
......@@ -29,12 +29,12 @@
.form-condensed & {
padding: 7px 0;
border: 0;
.form-group { //nested form groups
.form-group { //nested form groups
padding: 0;
}
&.fieldset {
&.fieldset {
.form-group {
padding: 20px 0;
padding: 20px 0;
}
}
}
......
......@@ -129,4 +129,4 @@ label,
.form-control:disabled {
color: #aaa;
}
\ No newline at end of file
}
......@@ -60,4 +60,9 @@
border-color: transparent transparent transparent $admin-title-bg;
}
}
+ .container {
// if container is directly after header, then it will need a margin
margin-top: 50px;
}
}
......@@ -23,4 +23,4 @@
}
}
}
}
}
\ No newline at end of file
......@@ -36,7 +36,7 @@
}
}
.fieldset-body,
.fieldset-body,
.collapse {
clear: both;
border: 0;
......@@ -54,3 +54,8 @@
text-overflow: ellipsis;
}
@mixin appearance($var) {
appearance: $var;
-webkit-appearance: $var;
-moz-appearance: $var;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{include file='header.tpl' nosearch='true'}
<h2 class="center">{$upgradeheading}</h2>
<div class="center js-hidden" id="jsrequiredforupgrade">{str tag=jsrequiredforupgrade section=admin}</div>
<table id="" class="table">
<thead>
<tr>
<th>{str section=admin tag=component}</th>
<th>{str section=admin tag=fromversion}</th>
<th>{str section=admin tag=toversion}</th>
<th id="msgscol">{str section=admin tag=information}</th>
</tr>
</thead>
<tbody>
{foreach from=$upgrades key=name item=upgrade}
<tr class="{cycle name=rows values='r0,r1'}">
<td>{$name}</td>
{if $name == 'firstcoredata' || $name == 'lastcoredata'}
<td></td>
<td></td>
{else}
<td>{if $upgrade->install} {str section='admin' tag='notinstalled'} {else} {$upgrade->fromrelease} {/if} </td>
<td>{$upgrade->torelease}</td>
{/if}
<td id="{$name}" class="msgscol">&nbsp;</td>
</tr>
{/foreach}
</tbody>
</table>
<div id="" class="nojs-hidden-block">{str section=admin tag=successfullyinstalled} <a href="{$WWWROOT}admin/upgrade.php?finished=1">{str section=admin tag=continue}</a></div>
<h1 class="mtxl">{$upgradeheading}</h1>
<div class="center js-hidden alert alert-danger" id="jsrequiredforupgrade">{str tag=jsrequiredforupgrade section=admin}</div>
<div class="panel panel-default">
<table id="" class="table">
<thead>
<tr>
<th>{str section=admin tag=component}</th>
<th>{str section=admin tag=fromversion}</th>
<th>{str section=admin tag=toversion}</th>
<th id="msgscol">{str section=admin tag=information}</th>
</tr>
</thead>
<tbody>
{foreach from=$upgrades key=name item=upgrade}
<tr class="{cycle name=rows values='r0,r1'}">
<td>{$name}</td>
{if $name == 'firstcoredata' || $name == 'lastcoredata'}
<td></td>
<td></td>
{else}
<td>{if $upgrade->install} {str section='admin' tag='notinstalled'} {else} {$upgrade->fromrelease} {/if} </td>
<td>{$upgrade->torelease}</td>
{/if}
<td id="{$name}" class="msgscol">&nbsp;</td>
</tr>
{/foreach}
</tbody>
</table>
<div id="" class="nojs-hidden-block panel-body">{str section=admin tag=successfullyinstalled} <a href="{$WWWROOT}admin/upgrade.php?finished=1">{str section=admin tag=continue}</a></div>
</div>
{include file='admin/upgradefooter.tpl'}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment