Commit 7714ff12 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Add a link to go back as admin on mobile (bug:1509605)"

parents 051e37bf 46f9cb32
......@@ -816,10 +816,8 @@ EOF;
if ($USER->get('parentuser')) {
$smarty->assign('USERMASQUERADING', true);
$smarty->assign('masqueradedetails', get_string('youaremasqueradingas', 'mahara', display_name($USER)));
$smarty->assign('becomeyouagain',
' <a href="' . hsc($wwwroot) . 'admin/users/changeuser.php?restore=1">'
. get_string('becomeadminagain', 'admin', hsc($USER->get('parentuser')->name))
. '</a>');
$smarty->assign('becomeyoulink', hsc($wwwroot) . 'admin/users/changeuser.php?restore=1');
$smarty->assign('becomeyouagain', get_string('becomeadminagain', 'admin', hsc($USER->get('parentuser')->name)));
}
// Define additional html content
......
......@@ -59,6 +59,18 @@
}
}
}
.backto-be-admin {
@media (min-width: $screen-sm-min) {
display: none;
}
a {
@media (max-width: $screen-sm-min) {
color: darken($theme-primary-color, 10%);
background-color: transparent;
}
}
}
}
......
......@@ -13,7 +13,8 @@
{if $USERMASQUERADING}
<div class="site-message alert alert-warning" role="alert">
<span class="icon icon-lg icon-exclamation-triangle left"></span>
{$masqueradedetails} {$becomeyouagain|safe}
<span>{$masqueradedetails}</span>
<a href="{$becomeyoulink}">{$becomeyouagain}</a>
</div>
{/if}
{if !$PRODUCTIONMODE}
......
......@@ -14,6 +14,15 @@
.top-nav.navbar-nav {
background: none;
.backto-be-admin {
a {
@media (max-width: $screen-sm-min) {
background-color: transparent;
color: $state-warning-bg;
}
}
}
}
.navbar-form.navbar-right.navbar-collapse.collapse.in {
......
......@@ -7,4 +7,12 @@
color: #FFFFFF;
}
}
.backto-be-admin {
a {
@media (max-width: $screen-sm-min) {
background-color: transparent;
color: #bed8e1;
}
}
}
}
......@@ -86,4 +86,13 @@
padding: 0;
}
}
.backto-be-admin {
a {
@media (max-width: $screen-sm-min) {
background-color: transparent;
color: #f29907;
}
}
}
}
......@@ -6,7 +6,7 @@
margin: 7px 0 0;
background-color: #efefef;
border-radius: 0 0 3px 3px;
padding: 0 10px;
padding: 0 10px 0 0;
&.with-languageform {
background-color: transparent;
......@@ -58,7 +58,7 @@
>li {
float: left;
>a {
padding: 10px 5px;
padding: 10px;
@media (min-width: $screen-md-min) {
padding: 10px 15px;
}
......@@ -76,14 +76,27 @@
padding: 7px 15px;
}
}
.icon {
margin-right:5px;
}
.nav-title{
.nav-title {
display:none; //if icon - hide title on mobile
@media (min-width: $screen-md-min) {
display:inline-block;
margin-left: 5px;
display:inline-block;
}
}
.navcount {
margin-left: 5px;
}
}
.backto-be-admin {
@media (min-width: $screen-sm-min) {
display: none;
}
a {
@media (max-width: $screen-sm-min) {
background-color: $state-warning-bg;
}
}
}
......
......@@ -15,7 +15,8 @@
{if $USERMASQUERADING}
<div class="site-message alert alert-warning" role="alert">
<span class="icon icon-lg icon-exclamation-triangle left"></span>
{$masqueradedetails} {$becomeyouagain|safe}
<span>{$masqueradedetails}</span>
<a href="{$becomeyoulink}">{$becomeyouagain}</a>
</div>
{/if}
{if !$PRODUCTIONMODE}
......
<ul class="nav navbar-nav navbar-right top-nav {if $languageform}with-languageform{/if}">
{strip}
{if $USERMASQUERADING && $LOGGEDIN}
<li class="backto-be-admin has-icon">
<a href="{$becomeyoulink}" title="{$becomeyouagain}">
<span class="icon icon-undo"></span>
<span class="nav-title">{$becomeyouagain}</span>
</a>
</li>
{/if}
{if $LOGGEDIN}
<li class="identity has-icon">
<a href="{profile_url($USER)}">
......
......@@ -71,6 +71,11 @@
<div id="sbdatapeer"><a href="{$sbdata.peer.wwwroot}" class="panel-body">{$sbdata.peer.name}</a></div>
{/if}
{if $USERMASQUERADING}
<div id="changeuser" class="panel-footer"><span class="icon icon-lg left icon-user-secret"></span> {$becomeyouagain|safe}</div>
<div id="changeuser" class="panel-footer">
<a href="{$becomeyoulink}">
<span class="icon icon-lg left icon-undo"></span>
<span>{$becomeyouagain}</span>
</a>
</div>
{/if}
</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