kopia lustrzana https://github.com/wagtail/wagtail
Account settings button (#2805)
rodzic
769ad6deb8
commit
2992d90e97
|
@ -18,6 +18,7 @@ Changelog
|
|||
* Added ability to limit access to form submissions (Mikalai Radchuk)
|
||||
* Added the ability to configure the number of days search logs are kept for (Stephen Rice)
|
||||
* `SnippetChooserBlock` now supports passing the model name as a string (Nick Smith)
|
||||
* Redesigned account settings / logout area in the sidebar for better clarity (Janneke Janssen)
|
||||
* Fix: Migrations for wagtailcore and project template are now reversible (Benjamin Bach)
|
||||
* Fix: Migrations no longer depend on wagtailcore and taggit's `__latest__` migration, logically preventing those apps from receiving new migrations (Matt Westcott)
|
||||
* Fix: The default image format label text ('Full width', 'Left-aligned', 'Right-aligned') is now localised (Mikalai Radchuk)
|
||||
|
|
|
@ -48,6 +48,7 @@ Minor features
|
|||
* Added ability to limit access to form submissions - see :ref:`filter_form_submissions_for_user` (Mikalai Radchuk)
|
||||
* Added the ability to configure the number of days search logs are kept for, through the :ref:`WAGTAILSEARCH_HITS_MAX_AGE <wagtailsearch_hits_max_age>` setting (Stephen Rice)
|
||||
* ``SnippetChooserBlock`` now supports passing the model name as a string (Nick Smith)
|
||||
* Redesigned account settings / logout area in the sidebar for better clarity (Janneke Janssen)
|
||||
|
||||
|
||||
Bug fixes
|
||||
|
|
|
@ -582,6 +582,8 @@
|
|||
|
||||
<p><span class="avatar icon icon-user"><img src="{% gravatar_url "david@torchbox.com" %}" /></span> Gravatar set (normal)</p>
|
||||
<p><span class="avatar icon icon-user"><img src="{% gravatar_url "aeon@torchbox.com" %}" /></span> Gravatar not set (normal)</p>
|
||||
<p><span class="avatar square icon icon-user"><img src="{% gravatar_url "david@torchbox.com" %}" /></span> Gravatar set (square)</p>
|
||||
<p><span class="avatar square icon icon-user"><img src="{% gravatar_url "aeon@torchbox.com" %}" /></span> Gravatar not set (square)</p>
|
||||
<p><span class="avatar small icon icon-user"><img src="{% gravatar_url "david@torchbox.com" %}" /></span> Gravatar set (small)</p>
|
||||
<p><span class="avatar small icon icon-user"><img src="{% gravatar_url "aeon@torchbox.com" %}" /></span> Gravatar not set (small)</p>
|
||||
|
||||
|
@ -680,6 +682,7 @@
|
|||
<li class="icon icon-openquote">openquote</li>
|
||||
<li class="icon icon-chain-broken">chain-broken</li>
|
||||
<li class="icon icon-table">table</li>
|
||||
<li class="icon icon-logout">logout</li>
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
|
|
File diff suppressed because one or more lines are too long
Plik binarny nie jest wyświetlany.
|
@ -79,6 +79,7 @@
|
|||
<glyph unicode="" glyph-name="pilcrow" d="M384 960h512v-128h-128v-896h-128v896h-128v-896h-128v512c-141.384 0-256 114.616-256 256s114.616 256 256 256z" />
|
||||
<glyph unicode="" glyph-name="embed" horiz-adv-x="1280" d="M832 224l96-96 320 320-320 320-96-96 224-224zM448 672l-96 96-320-320 320-320 96 96-224 224zM701.298 809.481l69.468-18.944-191.987-704.026-69.468 18.944 191.987 704.026z" />
|
||||
<glyph unicode="" glyph-name="chain-broken" horiz-adv-x="951" d="M250.857 224.571l-146.286-146.286q-5.714-5.143-13.143-5.143-6.857 0-13.143 5.143-5.143 5.714-5.143 13.143t5.143 13.143l146.286 146.286q5.714 5.143 13.143 5.143t13.143-5.143q5.143-5.714 5.143-13.143t-5.143-13.143zM347.429 201.143v-182.857q0-8-5.143-13.143t-13.143-5.143-13.143 5.143-5.143 13.143v182.857q0 8 5.143 13.143t13.143 5.143 13.143-5.143 5.143-13.143zM219.429 329.143q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143 5.143 13.143 13.143 5.143h182.857q8 0 13.143-5.143t5.143-13.143zM941.714 256q0-68.571-48.571-116l-84-83.429q-47.429-47.429-116-47.429-69.143 0-116.571 48.571l-190.857 191.429q-12 12-24 32l136.571 10.286 156-156.571q15.429-15.429 38.857-15.714t38.857 15.143l84 83.429q16 16 16 38.286 0 22.857-16 38.857l-156.571 157.143 10.286 136.571q20-12 32-24l192-192q48-49.143 48-116.571zM589.143 669.714l-136.571-10.286-156 156.571q-16 16-38.857 16-22.286 0-38.857-15.429l-84-83.429q-16-16-16-38.286 0-22.857 16-38.857l156.571-156.571-10.286-137.143q-20 12-32 24l-192 192q-48 49.143-48 116.571 0 68.571 48.571 116l84 83.429q47.429 47.429 116 47.429 69.143 0 116.571-48.571l190.857-191.429q12-12 24-32zM950.857 621.714q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143 5.143 13.143 13.143 5.143h182.857q8 0 13.143-5.143t5.143-13.143zM640 932.571v-182.857q0-8-5.143-13.143t-13.143-5.143-13.143 5.143-5.143 13.143v182.857q0 8 5.143 13.143t13.143 5.143 13.143-5.143 5.143-13.143zM872.571 846.286l-146.286-146.286q-6.286-5.143-13.143-5.143t-13.143 5.143q-5.143 5.714-5.143 13.143t5.143 13.143l146.286 146.286q5.714 5.143 13.143 5.143t13.143-5.143q5.143-5.714 5.143-13.143t-5.143-13.143z" />
|
||||
<glyph unicode="" glyph-name="logout" d="M956.335 950.857h-602.22c-36.088 0-65.41-29.322-65.41-65.41s29.322-65.41 65.41-65.41h536.811v-757.85h-536.811c-36.088 0-65.41-29.322-65.41-65.41s29.322-65.41 65.41-65.41h602.22c36.088 0 65.41 29.322 65.41 65.41v888.67c2.256 36.088-29.322 65.41-65.41 65.41zM322.537 274.205l-99.242 99.242h471.401c36.088 0 65.41 29.322 65.41 65.41s-29.322 65.41-65.41 65.41h-473.656l99.242 99.242c24.811 24.811 24.811 65.41 0 92.476-11.278 11.278-29.322 18.044-45.11 18.044-18.044 0-33.833-6.767-45.11-18.044l-212.018-209.762c-6.767-9.022-13.533-18.044-15.789-31.577v-4.511c-2.256-2.256-2.256-6.767-2.256-11.278s0-9.022 0-11.278v-4.511c2.256-11.278 9.022-22.555 15.789-29.322l212.018-209.762c11.278-11.278 29.322-18.044 45.11-18.044 18.044 0 33.833 6.767 45.11 18.044 29.322 24.811 29.322 65.41 4.511 90.22z" />
|
||||
<glyph unicode="" glyph-name="text-height" d="M0 657.714v218.857l46.286 0.571 30.857-15.429q6.857-2.857 120.571-2.857 25.143 0 75.429 1.143t75.429 1.143q20.571 0 61.429-0.286t61.429-0.286h167.429q3.429 0 12-0.286t11.714 0 9.143 1.714 10 5.143 8.571 10l24 0.571q2.286 0 8-0.286t8-0.286q1.143-64 1.143-192 0-45.714-2.857-62.286-22.286-8-38.857-10.286-14.286 25.143-30.857 73.143-1.714 5.143-6.286 27.429t-8.286 42-4.286 20.286q-3.429 4.571-6.857 7.143t-8.857 3.429-7.429 1.429-10.286 0.286-9.429-0.286q-9.714 0-38 0.286t-42.571 0.286-36.571-1.143-40.571-3.429q-5.143-46.286-4.571-77.714 0-53.714 1.143-221.714t1.143-260q0-9.143-1.429-40.857t0-52.286 7.143-39.429q22.857-12 70.857-24.286t68.571-21.429q2.857-22.857 2.857-28.571 0-8-1.714-16.571l-19.429-0.571q-43.429-1.143-124.571 4.571t-118.286 5.714q-28.571 0-86.286-5.143t-86.857-5.143q-1.714 29.143-1.714 29.714v5.143q9.714 15.429 35.143 24.571t56.286 16.571 44.571 15.429q10.857 24 10.857 218.857 0 57.714-1.714 173.143t-1.714 173.143v66.857q0 1.143 0.286 8.857t0.286 14.286-0.571 14.571-1.714 13.714-2.857 8q-6.286 6.857-92.571 6.857-18.857 0-53.143-6.857t-45.714-14.857q-10.857-7.429-19.429-41.429t-18-63.429-24.286-30.571q-24 14.857-32 25.143zM808 135.714q5.143 10.571 24 10.571h45.714v585.143h-45.714q-18.857 0-24 10.571t6.286 25.429l72 92.571q11.429 14.857 28 14.857t28-14.857l72-92.571q11.429-14.857 6.286-25.429t-24-10.571h-45.714v-585.143h45.714q18.857 0 24-10.571t-6.286-25.429l-72-92.571q-11.429-14.857-28-14.857t-28 14.857l-72 92.571q-11.429 14.857-6.286 25.429z" />
|
||||
<glyph unicode="" glyph-name="table" horiz-adv-x="951" d="M292.571 164.571v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM292.571 384v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM585.143 164.571v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM292.571 603.428v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM585.143 384v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM877.714 164.571v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM585.143 603.428v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM877.714 384v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM877.714 603.428v109.714q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h182.857q8 0 13.143 5.143t5.143 13.143zM950.857 786.286v-621.714q0-37.714-26.857-64.571t-64.571-26.857h-768q-37.714 0-64.571 26.857t-26.857 64.571v621.714q0 37.714 26.857 64.571t64.571 26.857h768q37.714 0 64.571-26.857t26.857-64.571z" />
|
||||
</font></defs></svg>
|
Przed Szerokość: | Wysokość: | Rozmiar: 70 KiB Po Szerokość: | Wysokość: | Rozmiar: 70 KiB |
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -93,12 +93,18 @@ $(function() {
|
|||
}
|
||||
});
|
||||
|
||||
// Enable toggle to open/close user settings
|
||||
$(document).on('click', '#account-settings', function() {
|
||||
$('#footer').toggleClass('footer-open');
|
||||
$(this).find('em').toggleClass('icon-arrow-down-after icon-arrow-up-after');
|
||||
});
|
||||
|
||||
// Resize nav to fit height of window. This is an unimportant bell/whistle to make it look nice
|
||||
var fitNav = function() {
|
||||
$('.nav-wrapper').css('min-height', $(window).height());
|
||||
$('.nav-main').each(function() {
|
||||
var thisHeight = $(this).height();
|
||||
var footerHeight = $('.footer', $(this)).height();
|
||||
var footerHeight = $('#footer', $(this)).height();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -74,14 +74,12 @@ $icons: (
|
|||
'openquote': '“',
|
||||
'horizontalrule': '\2014',
|
||||
'chain-broken': '\e900',
|
||||
'table': '\f0ce'
|
||||
'table': '\f0ce',
|
||||
'logout': '\e901'
|
||||
);
|
||||
|
||||
$icons-after: (
|
||||
'arrow-down-after': 'q',
|
||||
'arrow-up-after': 'e',
|
||||
'arrow-right-after': 'n'
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
left: 0;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
|
||||
&.small {
|
||||
vertical-align: middle;
|
||||
margin: 0 0.5em;
|
||||
|
@ -51,6 +51,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
&.square {
|
||||
border-radius: 0;
|
||||
|
||||
img {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
&:before {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.avatar-on-dark:before {
|
||||
color: $color-grey-2;
|
||||
border-color: $color-grey-2;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
$selected-highlight: darken($color-grey-1, 10%);
|
||||
$submenu-color: darken($color-grey-1, 5%);
|
||||
$footer-account: $selected-highlight;
|
||||
$footer-submenu: $submenu-color;
|
||||
|
||||
.nav-wrapper {
|
||||
position: relative;
|
||||
|
@ -101,18 +103,23 @@ $submenu-color: darken($color-grey-1, 5%);
|
|||
}
|
||||
}
|
||||
|
||||
.footer-submenu {
|
||||
a {
|
||||
border-left: 3px solid transparent;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
&:before {
|
||||
font-size: 1rem;
|
||||
margin-right: 0.5em;
|
||||
vertical-align: -10%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.account {
|
||||
@include clearfix();
|
||||
|
||||
.avatar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: normal;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,34 +302,67 @@ body.explorer-open {
|
|||
.nav-main {
|
||||
position: absolute;
|
||||
top: 175px; // WARNING - magic number - the height of the logo plus search box
|
||||
margin-bottom: 116px; // WARNING - magic number - the height of the .footer
|
||||
margin-bottom: 127px; // WARNING - magic number - the height of the .footer
|
||||
|
||||
.footer {
|
||||
padding-top: 1em;
|
||||
position: fixed;
|
||||
width: $menu-width - 7;
|
||||
width: $menu-width;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.footer-open .footer-submenu {
|
||||
max-height: 127px; // WARNING - magic number - the height of the .footer
|
||||
}
|
||||
|
||||
.footer-submenu {
|
||||
@include transition(max-height 0.2s ease);
|
||||
background-color: $footer-submenu;
|
||||
overflow: hidden;
|
||||
max-height: 0;
|
||||
}
|
||||
|
||||
.account {
|
||||
@include clearfix();
|
||||
padding-right: 0;
|
||||
padding-left: 15px;
|
||||
@include clearfix;
|
||||
background: $footer-account;
|
||||
color: $color-menu-text;
|
||||
text-transform: uppercase;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
outline: none;
|
||||
background-color: rgba(100, 100, 100, 0.15);
|
||||
color: $color-white;
|
||||
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
margin: 0 0.7em 0 0;
|
||||
border: 0;
|
||||
float: left;
|
||||
margin-right: 0.9em;
|
||||
|
||||
&:before {
|
||||
text-shadow: none;
|
||||
color: inherit;
|
||||
border-color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
em {
|
||||
width: 120px;
|
||||
box-sizing: border-box;
|
||||
padding-right: 1.8em;
|
||||
margin-top: 1.2em;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
width: 110px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
float: left;
|
||||
|
||||
&:after {
|
||||
font-size: 1.5em;
|
||||
position: absolute;
|
||||
right: 0.25em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,21 @@
|
|||
<ul>
|
||||
{{ menu_html }}
|
||||
|
||||
<li class="footer">
|
||||
<a href="{% url 'wagtailadmin_account' %}" title="{% trans 'Edit your account' %}" class="account"><span class="avatar small avatar-on-dark icon icon-user">{% if request.user.email %}<img src="{% gravatar_url request.user.email 25 %}" />{% endif %}</span> <em>{{ request.user.get_full_name|default:request.user.get_username }}</em></a>
|
||||
<div class="menu-item"><a href="{% url 'wagtailadmin_logout' %}" class="icon icon-arrow-left">{% trans "Log out" %}</a></div>
|
||||
<li class="footer" id="footer">
|
||||
<div class="account" id="account-settings" title="{% trans 'Edit your account' %}">
|
||||
<span class="avatar square avatar-on-dark icon icon-user">
|
||||
{% if request.user.email %}
|
||||
<img src="{% gravatar_url request.user.email 25 %}" />
|
||||
{% endif %}
|
||||
</span>
|
||||
<em class="icon icon-arrow-up-after">{{ request.user.first_name|default:request.user.get_username }}</em>
|
||||
</div>
|
||||
|
||||
<ul class="footer-submenu">
|
||||
<li><a href="{% url 'wagtailadmin_account' %}" class="icon icon-user">{% trans "Account settings" %}</a></li>
|
||||
<li><a href="{% url 'wagtailadmin_logout' %}" class="icon icon-logout">{% trans "Log out" %}</a></li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
Ładowanie…
Reference in New Issue