Merge branch 'MDL-47576-master' of git://github.com/jethac/moodle

Conflicts:
	theme/bootstrapbase/style/moodle.css
This commit is contained in:
Dan Poltawski 2014-10-15 16:59:06 +01:00
commit 529e38d141
3 changed files with 266 additions and 133 deletions

View file

@ -3040,10 +3040,9 @@ EOD;
$am = new action_menu(); $am = new action_menu();
$am->initialise_js($this->page); $am->initialise_js($this->page);
$am->set_menu_trigger(html_writer::span( $am->set_menu_trigger(
get_string('usermenu', 'moodle'), $returnstr
"accesshide" );
));
$am->set_alignment(action_menu::TR, action_menu::BR); $am->set_alignment(action_menu::TR, action_menu::BR);
if ($withlinks) { if ($withlinks) {
$navitemcount = count($opts->navitems); $navitemcount = count($opts->navitems);
@ -3072,10 +3071,6 @@ EOD;
} }
return html_writer::div( return html_writer::div(
html_writer::div(
$returnstr,
'userinfo'
) .
$this->render($am), $this->render($am),
$usermenuclasses $usermenuclasses
); );

View file

@ -343,107 +343,101 @@ div#dock {
// Usermenu // Usermenu
.usermenu { .usermenu {
font-size: 14px;
&.withoutlinks {
.withoutlinks {
display: none;
}
}
.login { .login {
color: @navbarText; color: @navbarText;
line-height: 40px; line-height: 40px;
a { a {
color: @navbarLinkColor; color: @linkColor;
} &:hover,
} &:focus {
> .moodle-actionmenu > .menubar { color: @linkColorHover;
display: block; text-decoration: underline;
margin: -40px 0px 2px 0px;
li {
display: block;
a {
line-height: 40px;
} }
} }
} }
> div { .moodle-actionmenu {
height: 40px;
}
.toggle-display {
color: @navbarLinkColor;
outline: none;
}
.userbutton {
height: 40px;
line-height: 40px;
.avatars{
display: inline-block;
height: 36px;
vertical-align: middle;
margin-right: 6px;
.avatar, .toggle-display {
img { display: block;
display: block; opacity: 1;
color: @navbarLinkColor;
line-height: 40px;
height: 40px;
&:hover {
color: @navbarLinkColorHover;
} }
}
.usertext { .userbutton {
display: inline-block; height: 40px;
vertical-align: middle; line-height: 40px;
line-height: 1em; .avatars{
.meta, display: inline-block;
.role { height: 36px;
display: block; width: 36px;
font-size: 12px; vertical-align: middle;
.value { margin-right: 6px;
font-weight: bold; margin-left: 6px;
.avatar,
img {
display: block;
}
}
.usertext {
display: inline-block;
vertical-align: middle;
line-height: 1em;
color: inherit;
.meta,
.role {
display: block;
font-size: 12px;
.value {
font-weight: bold;
}
}
.role {
font-weight: bold;
}
} }
} }
.role {
font-weight: bold; // Hide caret when JS is disabled.
.caret {
display: none;
} }
} }
}
.moodle-actionmenu[data-enhanced].show .menu a {
white-space: nowrap; // A little bit of visual feedback for the action menu when Javascript is disabled.
} .menu {
.menu .filler { .menu-action.icon {
width: auto; img {
height: 1px; border-radius: 0;
margin: 4px 0px; background: transparent;
display: block; box-shadow: none;
background: #e5e5e5; }
} &:hover img {
} background: #fff;
.userloggedinas .usermenu .userbutton .avatars { border-radius: 4px;
.avatar { box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.125);
&.current { }
position: relative; }
top: 4px;
left: 4px;
width: 20px;
height: 20px;
margin-top: 11px;
border: 1px solid #fff;
border-radius: 50%;
box-shadow: -2px -2px 16px rgba(0,0,0,0.25);
} }
img { &[data-enhanced] .menu {
width: inherit; .menu-action.icon,
height: inherit; .menu-action.icon:hover {
img {
border-radius: 0;
background: transparent;
box-shadow: none;
}
}
} }
display: inline-block;
overflow: hidden;
} }
} }
.jsenabled .usermenu .moodle-actionmenu[data-enhanced] .toggle-display.textmenu { .navbar-inverse {
position: relative;
.caret {
margin-top: 0;
vertical-align: middle;
}
}
.jsenabled .navbar-inverse {
.usermenu { .usermenu {
.login { .login {
color: @navbarInverseText; color: @navbarInverseText;
@ -454,57 +448,174 @@ div#dock {
} }
} }
} }
.toggle-display { .moodle-actionmenu {
color: @navbarInverseLinkColor; .toggle-display {
} color: @navbarInverseLinkColor;
.userinfo .usertext {
color: @navbarInverseLinkColor;
.meta {
color: @navbarInverseText;
.value {
color: @navbarInverseLinkColor;
}
} }
} .userbutton {
&:hover { .usertext {
.userinfo .usertext { color: @navbarInverseLinkColor;
color: @navbarInverseLinkColorHover; .meta {
.meta { color: @navbarInverseText;
color: @navbarInverseText; .value {
.value { color: @navbarInverseLinkColor;
color: @navbarInverseLinkColorHover; }
} }
} }
} }
.moodle-actionmenu[data-enhanced] .toggle-display.textmenu { &:hover {
.usertext {
color: @navbarInverseLinkColorHover;
.meta {
color: @navbarInverseText;
.value {
color: @navbarInverseLinkColorHover;
}
}
}
}
&[data-enhanced] .toggle-display.textmenu {
.caret { .caret {
border-top-color: @navbarInverseLinkColorHover; border-top-color: @navbarInverseLinkColorHover;
} }
} }
// A little bit of visual feedback for the action menu when Javascript is disabled.
.menu {
.menu-action.icon {
img {
border-radius: 0;
background: transparent;
box-shadow: none;
}
&:hover img {
background: #333;
border-radius: 4px;
box-shadow: 0px 0px 16px rgba(255, 255, 255, 1);
}
}
}
&[data-enhanced] .menu {
.menu-action.icon,
.menu-action.icon:hover {
img {
border-radius: 0;
background: transparent;
box-shadow: none;
}
}
}
} }
} }
} }
.jsenabled {
.usermenu {
.moodle-actionmenu {
.toggle-display {
display: block;
&.textmenu {
padding-left: 8px;
padding-right: 8px;
}
// Show caret when JS is enabled.
.caret {
display: inline-block;
position: relative;
top: 9px;
}
}
> .menubar {
display: block;
margin: 0px 0px 2px 0px;
}
> .menu {
min-width: 160px;
.filler {
display: block;
.nav-divider();
}
}
&.show {
background-color: @navbarLinkBackgroundActive;
.menu {
padding: 5px 0;
margin: 2px 0 0;
background-clip: padding-box;
&:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: @dropdownBorder;
position: absolute;
top: -7px;
}
&:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid @dropdownBackground;
position: absolute;
top: -6px;
}
a {
white-space: nowrap;
border-radius: 0;
&:hover {
#gradient > .vertical(@dropdownLinkBackgroundHover, darken(@dropdownLinkBackgroundHover, 5%));
}
}
&.align-tr-br {
margin-top: 2px;
}
.box-shadow (0 5px 10px rgba(0, 0, 0, 0.2));
}
&:hover .toggle-display {}
}
}
}
.navbar-inverse {
.usermenu {
.moodle-actionmenu {
&.show {
background-color: @navbarInverseLinkBackgroundActive;
}
}
}
}
}
.dir-ltr { .dir-ltr {
.usermenu { .usermenu {
float: right; float: right;
.userinfo { > .moodle-actionmenu {
padding-left: 20px; > .menu {
} &:before {
.userbutton { right: 9px;
margin-right: 4px; }
padding-right: 8px; &:after {
.avatars{ right: 10px;
margin-left: 6px; }
}
> .menubar li a {
text-align: right;
} }
}
> .moodle-actionmenu > .menubar li a {
text-align: right;
} }
} }
&.userloggedinas .usermenu .userbutton .avatars { &.userloggedinas .usermenu .userbutton .avatars {
.avatar { .avatar {
&.current { &.current {
margin-right: -34px; left: 16px;
} }
} }
} }
@ -513,22 +624,49 @@ div#dock {
.dir-rtl { .dir-rtl {
.usermenu { .usermenu {
float: left; float: left;
.userbutton { > .moodle-actionmenu {
margin-left: 4px; > .menu {
padding-left: 8px; margin-right: 0px;
.avatars{ &:before {
margin-right: 6px; left: 9px;
}
&:after {
left: 10px;
}
}
> .menubar li a {
text-align: left;
} }
}
> .moodle-actionmenu > .menubar li a {
text-align: left;
} }
} }
&.userloggedinas .usermenu .userbutton .avatars { &.userloggedinas .usermenu .userbutton .avatars {
.avatar { .avatar {
&.current { &.current {
margin-left: -42px; left: -14px;
} }
} }
} }
} }
.userloggedinas .usermenu .userbutton .avatars {
.avatar {
&.current {
position: relative;
top: 4px;
left: 4px;
width: 20px;
height: 20px;
margin-top: 11px;
margin-bottom: -34px;
border: 1px solid #fff;
border-radius: 50%;
box-shadow: -2px -2px 16px rgba(0,0,0,0.25);
}
img {
width: inherit;
height: inherit;
}
overflow: hidden;
}
}

File diff suppressed because one or more lines are too long