Commit 4cccccfb authored by Liam Sharpe's avatar Liam Sharpe

User account settings page styling - Bug #1465107

behatnotneeded

Change-Id: I2fdce51d18e81fd08d96c35df9ddb1de2d9694c0
parent f101aac5
......@@ -69,7 +69,6 @@ require_once('pieforms/pieform.php');
$form = array(
'name' => 'masqueradereason',
'renderer' => 'table',
'plugintype' => 'core',
'pluginname' => 'core',
'elements' => array(
......@@ -91,7 +90,8 @@ $form = array(
),
'submit' => array(
'type' => 'submit',
'value' => get_string('masquerade', 'admin')
'value' => get_string('masquerade', 'admin'),
'class' => 'btn-success'
),
),
);
......
......@@ -106,6 +106,7 @@ $elements['maildisabled'] = array(
);
$elements['expiry'] = array(
'type' => 'date',
'class' => 'form-condensed',
'title' => get_string('accountexpiry', 'admin'),
'description' => get_string('accountexpirydescription', 'admin'),
'minyear' => $currentdate['year'] - 2,
......@@ -120,6 +121,7 @@ if ($USER->get('admin') || get_config_plugin('artefact', 'file', 'institutionalo
'description' => get_string('filequotadescription','admin') . '<br>' . $quotaused,
'rules' => array('integer' => true,
'minvalue' => 1),
'class' => 'form-inline mls',
'defaultvalue' => $user->quota,
);
}
......@@ -129,6 +131,7 @@ else {
'disabled' => true,
'title' => get_string('filequota1', 'admin'),
'description' => get_string('filequotadescription', 'admin') . '<br>' . $quotaused,
'class' => 'form-inline mls',
'value' => display_size($user->quota),
);
}
......@@ -231,6 +234,7 @@ if (count($authinstances) > 1) {
$elements['externalauthjs'] = array(
'type' => 'html',
'class' => 'hidden',
'value' => $js,
);
}
......@@ -247,6 +251,7 @@ $elements['tags'] = array(
$elements['submit'] = array(
'type' => 'submit',
'class' => 'btn-success mbm',
'value' => get_string('savechanges','admin'),
);
......@@ -603,6 +608,7 @@ if (empty($suspended)) {
),
'submit' => array(
'type' => 'submit',
'class' => 'btn-default',
'value' => get_string('suspenduser','admin'),
),
)
......@@ -669,6 +675,7 @@ $deleteform = pieform(array(
),
'submit' => array(
'type' => 'submit',
'class' => 'btn-default',
'value' => get_string('deleteuser', 'admin'),
'confirm' => get_string('confirmdeleteuser', 'admin'),
),
......@@ -719,15 +726,20 @@ if ( !$USER->get('admin') ) { // for institution admins
}
$allinstitutions = get_records_assoc('institution', '', '', 'displayname', 'name, displayname');
$institutionloop = 0;
$institutionlength = count($institutions);
foreach ($institutions as $i) {
$elements[$i->institution.'_settings'] = array(
'type' => 'fieldset',
'legend' => $i->displayname,
'legend' => get_string('institutionsettings', 'admin').' - '.$i->displayname,
'collapsible' => true,
'collapsed' => true,
'elements' => array(
$i->institution.'_expiry' => array(
'type' => 'date',
'title' => get_string('membershipexpiry', 'admin'),
'description' => get_string('membershipexpirydescription', 'admin'),
'class' => 'form-condensed',
'minyear' => $currentdate['year'],
'maxyear' => $currentdate['year'] + 20,
'defaultvalue' => $i->membership_expiry
......@@ -752,14 +764,20 @@ foreach ($institutions as $i) {
$i->institution.'_submit' => array(
'type' => 'submit',
'value' => get_string('update'),
'class' => 'btn-success'
),
$i->institution.'_remove' => array(
'type' => 'submit',
'class' => 'btn-default',
'value' => get_string('removeuserfrominstitution', 'admin'),
'confirm' => get_string('confirmremoveuserfrominstitution', 'admin'),
),
),
)
)
);
if ($institutionloop == $institutionlength - 1) {
$elements[$i->institution.'_settings']['class'] = 'last mbl';
}
$institutionloop++;
}
// Only site admins can add institutions; institutional admins must invite
......@@ -774,7 +792,7 @@ if ($USER->get('admin')
if (!empty($options)) {
$elements['addinstitutionheader'] = array(
'type' => 'markup',
'value' => '<tr><td colspan="2"><h4>' . get_string('addusertoinstitution', 'admin') . '</h4></td></tr>',
'value' => '<h4>' . get_string('addusertoinstitution', 'admin') . '</h4>',
);
$elements['addinstitution'] = array(
'type' => 'select',
......@@ -783,6 +801,7 @@ if ($USER->get('admin')
);
$elements['add'] = array(
'type' => 'submit',
'class' => 'btn-success mbs',
'value' => get_string('addusertoinstitution', 'admin'),
);
}
......
......@@ -800,7 +800,7 @@ $string['probationreportcolumn'] = 'Probation';
$string['addusertoinstitution'] = 'Add user to institution';
$string['removeuserfrominstitution'] = 'Remove user from this institution';
$string['confirmremoveuserfrominstitution'] = 'Are you sure you want to remove the user from this institution?';
$string['usereditdescription'] = 'Here you can view and set details for this user account. Below, you can also <a href="#suspend">suspend or delete this account</a> or change settings for this user in the <a href="#institutions">institutions they are in</a>.';
$string['usereditdescription'] = 'Here you can view and set details for this user account. Below, you can also suspend or delete this account or change settings for this user in the institutions they are in.';
$string['usereditwarning'] = 'NOTE: Saving the account changes will cause the user to be logged out (if currently logged in).';
$string['suspenduserdescription'] = 'A suspended user is unable to log in until the account is unsuspended.';
$string['deleteusernote'] = 'Please note that this operation <strong>cannot be undone</strong>.';
......@@ -944,6 +944,7 @@ $string['settingsfor'] = 'Settings for:';
$string['institutionmembers'] = 'Institution members';
$string['notadminforinstitution'] = 'You are not an administrator for that institution.';
$string['institutionmemberspagedescription'] = 'On this page, you can see users who have requested membership of your institution and add them as members. You can also remove users from your institution and invite users to join.';
$string['suspendordeletethisuser'] = 'Suspend or delete this user';
$string['institutionusersinstructionsrequesters1'] = 'The list of users in the "%1$s" field shows all users who have asked to join your institution. You can use the search box to reduce the number of users displayed. If you would like to add users to the institution or decline their membership requests, first move some users to the "%2$s" field by selecting one or more users and then clicking on the right arrow. The "Add members" button will add all the users in the "%2$s" field to the institution. The "Decline requests" button will remove the membership requests of the users in the "%2$s" field.';
$string['institutionusersinstructionsnonmembers1'] = 'The list of users in the "%1$s" field shows all users who are not yet members of your institution. You can use the search box to reduce the number of users displayed. To invite users to join the institution, first move some users to the "%2$s" field by selecting one or more users and then clicking on the right arrow button to move those users to the "%2$s" field. The "Invite users" button will send invitations to all the users in the "%2$s" field. These users will not be associated with the institution until they accept the invitation.';
......
{include file="header.tpl"}
<p class="lead">{str tag="usereditdescription" section="admin"}</p>
<div id="edituser">
{if $suspended}
<div class="suspendederror">
<h3 class="title">{$suspendedby}</h3>
{if $user->get('suspendedreason')}
<div class="detail">
<strong>{str tag="suspendedreason" section="admin"}:</strong> {$user->suspendedreason}
</div>
{/if}
{$suspendform2|safe}
</div>
{/if}
{if $suspended}
<div class="suspendederror admin-warning alert alert-warning">
<h3 class="title">{$suspendedby}</h3>
{if $user->get('suspendedreason')}
<div class="detail mbl">
<strong>{str tag="suspendedreason" section="admin"}: </strong>
{$user->suspendedreason}
</div>
{/if}
{$suspendform2|safe}
</div>
{/if}
<div class="row">
<div class="col-md-9 main">
<div class="panel panel-body">
<h2>{str tag="siteaccountsettings" section="admin"}</h2>
<p class="errmsg">{str tag="usereditwarning" section="admin"}</p>
{$siteform|safe}
{if ($institutions)}
{$institutionform|safe}
{/if}
</div>
</div>
<div class="fullwidth" id="useraccountsettings">
<div id="useraccountsettingsright">
{if $suspendable}
<div id="suspenddelete">
<div id="suspend">
<h3>{str tag="suspenduser" section=admin}</h3>
<p>{str tag="suspenduserdescription" section=admin}</p>
{$suspendform|safe}
</div>
{if $deletable}
<div id="delete">
<h3>{str tag=deleteuser section=admin}</h3>
<p>{str tag=deleteusernote section=admin}</p>
{$deleteform|safe}
<div class="col-md-3">
<div class="user-panel">
<div class="panel panel-default">
<h3 class="panel-heading profile-block">
<a href="{profile_url($user)}">
{$user|display_name}
</a>
<a href="{profile_url($user)}" class="user-icon">
<img src="{profile_icon_url user=$user maxheight=100 maxwidth=100}" alt="{str tag=profileimagetext arg1=$user|display_default_name}">
</a>
</h3>
{if $loginas}
<div id="loginas">
<a class="btn btn-link" href="{$WWWROOT}admin/users/changeuser.php?id={$user->id}">
{str tag=loginas section=admin}
</a>
</div>
{/if}
<div class="list-group">
{if $suspendable && $deletable}
<button type="button" class="btn btn-link" data-toggle="modal" data-target="#suspenddeletemodal">
{str tag=suspendordeletethisuser section=admin}
</button>
{/if}
</div>
</div>
{/if}
</div>
{/if}
</div>
<div id="useraccountsettingsleft">
<div id="profilepict">
<a href="{profile_url($user)}"><img src="{profile_icon_url user=$user maxheight=100 maxwidth=100}" alt="{str tag=profileimagetext arg1=$user|display_default_name}"></a>
<div id="profilename"><a href="{profile_url($user)}">{$user|display_name}</a></div>
{if $loginas}
<div id="loginas"><a class="btn" href="{$WWWROOT}admin/users/changeuser.php?id={$user->id}">{str tag=loginas section=admin}</a></div>
</div>
<!-- Modal -->
<div class="modal fade" id="suspenddeletemodal" tabindex="-1" role="dialog" aria-labelledby="suspenddeletemodaltitle">
<div class="modal-dialog" 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>
<h4 id="suspenddeletemodaltitle" class="modal-title">{str tag=suspendordeletethisuser section=admin}</h4>
</div>
<div class="modal-body">
{if $suspendable}
<div id="suspenddelete">
<div id="suspend">
<h3>{str tag="suspenduser" section=admin}</h3>
<p>{str tag="suspenduserdescription" section=admin}</p>
{$suspendform|safe}
</div>
</div>
{/if}
{if $deletable}
<div id="delete">
<h3>{str tag=deleteuser section=admin}</h3>
<p>{str tag=deleteusernote section=admin}</p>
{$deleteform|safe}
</div>
{/if}
</div>
<h2>{str tag="siteaccountsettings" section="admin"}</h2>
<p>{str tag="usereditdescription" section="admin"}</p>
<p class="errmsg">{str tag="usereditwarning" section="admin"}</p>
{$siteform|safe}
{if ($institutions)}
<div id="institutions">
<h2>{str tag="institutionsettings" section="admin"}</h2>
<p>{str tag="institutionsettingsdescription" section="admin"}</p>
{$institutionform|safe}
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
{/if}
</div>
<div class="cb"></div>
</div>
</div>
......
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