User profile tab.
parent
f99d0303a4
commit
7644a17fa3
File diff suppressed because one or more lines are too long
1236
media/css/style.css
1236
media/css/style.css
File diff suppressed because one or more lines are too long
|
@ -154,6 +154,7 @@ header.main {
|
||||||
}
|
}
|
||||||
nav.public {
|
nav.public {
|
||||||
float: left;
|
float: left;
|
||||||
|
width: 435px;
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -193,6 +194,10 @@ header.main {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.add-snipt {
|
||||||
|
float: right;
|
||||||
|
margin-right: 13px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,14 +206,91 @@ header.main {
|
||||||
float: right;
|
float: right;
|
||||||
height: 65px;
|
height: 65px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
position: relative;
|
||||||
width: 189px;
|
width: 189px;
|
||||||
|
|
||||||
|
a.mini-profile {
|
||||||
|
display: block;
|
||||||
|
padding: 14px 13px 11px 13px;
|
||||||
|
|
||||||
|
span.avatar {
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
border: 1px solid #3A5E67;
|
||||||
|
display: inline-block;
|
||||||
|
height: 35px;
|
||||||
|
width: 35px;
|
||||||
|
@include border-radius();
|
||||||
|
}
|
||||||
|
span.username {
|
||||||
|
color: #FFF;
|
||||||
|
display: inline-block;
|
||||||
|
font: 500 14px $Helvetica;
|
||||||
|
margin-left: 8px;
|
||||||
|
max-width: 88px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
vertical-align: 14px;
|
||||||
|
}
|
||||||
|
i {
|
||||||
|
display: inline-block;
|
||||||
|
opacity: .3;
|
||||||
|
margin-left: 8px;
|
||||||
|
vertical-align: 12px;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background: rgba(#5C8086, .2);
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
i {
|
||||||
|
background-position: -313px -119px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ul {
|
ul {
|
||||||
|
background: transparent url('/media/images/aside-nav-open-bottom-bg.gif') top left repeat;
|
||||||
|
display: none;
|
||||||
|
left: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
padding: 10px 0;
|
||||||
|
position: absolute;
|
||||||
|
top: 65px;
|
||||||
|
width: 189px;
|
||||||
|
@include multi-border-radius(0, 0, 10px, 10px);
|
||||||
|
|
||||||
li {
|
li {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #B0D7DD;
|
||||||
|
display: block;
|
||||||
|
font: bold 12px $Helvetica;
|
||||||
|
padding: 7px 0 7px 37px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(#103A42, .5);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
i {
|
||||||
|
margin-right: 9px;
|
||||||
|
opacity: .3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.open {
|
||||||
|
a.mini-profile {
|
||||||
|
background: transparent url('/media/images/aside-nav-open-top-bg.gif') top left repeat-x;
|
||||||
|
opacity: 1;
|
||||||
|
|
||||||
|
span.avatar {
|
||||||
|
border-color: #92B6BD;
|
||||||
|
}
|
||||||
|
i {
|
||||||
|
background-position: -288px -120px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 14 KiB |
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,8 @@
|
||||||
this.$body = $(this.el);
|
this.$body = $(this.el);
|
||||||
this.$html = $('html');
|
this.$html = $('html');
|
||||||
this.$html_body = this.$body.add(this.$html);
|
this.$html_body = this.$body.add(this.$html);
|
||||||
|
this.$aside_nav = $('aside.nav', this.$body);
|
||||||
|
this.$aside_nav_ul = $('ul', this.$aside_nav);
|
||||||
this.$search_form = $('form.search', this.$body);
|
this.$search_form = $('form.search', this.$body);
|
||||||
this.$search_query = $('input#search-query', this.$body);
|
this.$search_query = $('input#search-query', this.$body);
|
||||||
this.$search_page_query = $('input.search-query', this.$body);
|
this.$search_page_query = $('input.search-query', this.$body);
|
||||||
|
@ -57,6 +59,8 @@
|
||||||
var SniptListView = Snipt.SniptListView;
|
var SniptListView = Snipt.SniptListView;
|
||||||
this.snipt_list = new SniptListView({ 'snipts': this.$snipts });
|
this.snipt_list = new SniptListView({ 'snipts': this.$snipts });
|
||||||
|
|
||||||
|
var that = this;
|
||||||
|
|
||||||
this.$body.click(function() {
|
this.$body.click(function() {
|
||||||
if (!window.ui_halted && !window.from_modal && window.$selected) {
|
if (!window.ui_halted && !window.from_modal && window.$selected) {
|
||||||
window.$selected.trigger('deselect');
|
window.$selected.trigger('deselect');
|
||||||
|
@ -64,6 +68,11 @@
|
||||||
if (window.from_modal) {
|
if (window.from_modal) {
|
||||||
window.from_modal = false;
|
window.from_modal = false;
|
||||||
}
|
}
|
||||||
|
that.$aside_nav.removeClass('open');
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$aside_nav_ul.click(function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
$search_queries = this.$search_queries;
|
$search_queries = this.$search_queries;
|
||||||
|
@ -86,7 +95,8 @@
|
||||||
window.ui_halted = false;
|
window.ui_halted = false;
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
'showKeyboardShortcuts': 'showKeyboardShortcuts'
|
'showKeyboardShortcuts': 'showKeyboardShortcuts',
|
||||||
|
'click a.mini-profile': 'toggleMiniProfile'
|
||||||
},
|
},
|
||||||
|
|
||||||
keyboardShortcuts: function() {
|
keyboardShortcuts: function() {
|
||||||
|
@ -149,6 +159,10 @@
|
||||||
showKeyboardShortcuts: function() {
|
showKeyboardShortcuts: function() {
|
||||||
this.$keyboard_shortcuts.modal('toggle');
|
this.$keyboard_shortcuts.modal('toggle');
|
||||||
},
|
},
|
||||||
|
toggleMiniProfile: function(e) {
|
||||||
|
this.$aside_nav.toggleClass('open');
|
||||||
|
return false;
|
||||||
|
},
|
||||||
inFieldLabels: function () {
|
inFieldLabels: function () {
|
||||||
$('div.infield label', this.$body).inFieldLabels({
|
$('div.infield label', this.$body).inFieldLabels({
|
||||||
fadeDuration: 200
|
fadeDuration: 200
|
||||||
|
|
|
@ -102,19 +102,42 @@
|
||||||
<li>
|
<li>
|
||||||
<a href="/public/" {% if '/public/' in request.path or public %} class="active"{% endif %}>Public snipts</a>
|
<a href="/public/" {% if '/public/' in request.path or public %} class="active"{% endif %}>Public snipts</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="add-snipt">
|
||||||
<a href="/logout/?next={{ request.path }}">Log out</a>
|
<button class="btn btn-info btn-large" id="add-snipt">
|
||||||
|
Add {% if request.user.username == 'blog' %}Post{% else %}Snipt{% endif %}
|
||||||
|
<i class="icon-search icon-plus icon-white"></i>
|
||||||
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{% if request.user.username == 'blog' %}
|
|
||||||
<li><button class="btn btn-info btn-large" id="add-snipt">Add Post <i class="icon-search icon-plus icon-white"></i></button></li>
|
|
||||||
{% else %}
|
|
||||||
<li><button class="btn btn-info btn-large" id="add-snipt">Add Snipt <i class="icon-search icon-plus icon-white"></i></button></li>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
{% if request.user.is_authenticated and has_snipts %}
|
{% if request.user.is_authenticated %}
|
||||||
<aside class="nav"></aside>
|
<aside class="nav">
|
||||||
|
<a href="#" class="mini-profile">
|
||||||
|
<span class="avatar" style="background-image: url('https://secure.gravatar.com/avatar/{{ user.email|md5 }}?s=35');"></span>
|
||||||
|
<span class="username">{{ request.user.username }}</span>
|
||||||
|
<i class="icon-cog icon-white"></i>
|
||||||
|
</a>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="/{{ request.user.username }}/">
|
||||||
|
<i class="icon-user icon-white"></i>
|
||||||
|
View profile</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/password/change/">
|
||||||
|
<i class="icon-wrench icon-white"></i>
|
||||||
|
Change password
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/logout/?next={{ request.path }}">
|
||||||
|
<i class="icon-off icon-white"></i>
|
||||||
|
Log out
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</aside>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
@ -301,10 +324,6 @@
|
||||||
s.parentNode.insertBefore(t, s);
|
s.parentNode.insertBefore(t, s);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
{% else %}
|
|
||||||
<script type="text/javascript">
|
|
||||||
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
|
|
Loading…
Reference in New Issue