Profile
parent
ab6f1230af
commit
560ceac176
|
@ -373,7 +373,7 @@ section.main {
|
|||
}
|
||||
}
|
||||
section.tags {
|
||||
margin: 0 15px 45px 15px;
|
||||
margin: 0 0 45px 15px;
|
||||
|
||||
h1 {
|
||||
background: transparent url('/static/images/tags-icon.png') 0 0 no-repeat;
|
||||
|
@ -752,7 +752,20 @@ article.snipt {
|
|||
}
|
||||
}
|
||||
&.author {
|
||||
background: transparent url('/static/images/author-icon.png') 0 1px no-repeat;
|
||||
background-image: none;
|
||||
padding-left: 0;
|
||||
|
||||
span {
|
||||
background-color: transparent;
|
||||
background-position: top left;
|
||||
background-repeat: no-repeat;
|
||||
display: inline-block;
|
||||
height: 15px;
|
||||
margin-right: 7px;
|
||||
vertical-align: -3px;
|
||||
width: 15px;
|
||||
@include border-radius(3px);
|
||||
}
|
||||
}
|
||||
&.comments {
|
||||
background: transparent url('/static/images/comments-icon.png') 0 2px no-repeat;
|
||||
|
@ -922,6 +935,41 @@ div.modal {
|
|||
max-height: 514px;
|
||||
}
|
||||
}
|
||||
div.profile {
|
||||
background: rgba(128, 128, 128, .15);
|
||||
margin: 0 0 30px 15px;
|
||||
padding: 10px;
|
||||
@include border-radius(8px);
|
||||
|
||||
span.avatar {
|
||||
background-color: transparent;
|
||||
background-position: top left;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
float: left;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
@include border-radius(5px);
|
||||
}
|
||||
div.meta {
|
||||
display: block;
|
||||
float: left;
|
||||
font: bold 14px $Helvetica;
|
||||
margin: 0 0 0 10px;
|
||||
|
||||
div.username {
|
||||
max-width: 95px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
div.member-since {
|
||||
color: #909090;
|
||||
font: bold 10px $Helvetica;
|
||||
margin-top: 6px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Pages
|
||||
body.detail {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block page-title %}/ {{ snipt.title }} / {{ user.username }} - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}/ {% if snipt.title %}{{ snipt.title }}{% else %}Untitled{% endif %} / {{ user.username }} - {{ block.super }}{% endblock %}
|
||||
{% block html-class %}detail{% endblock %}
|
||||
{% block body-class %}detail{% endblock %}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{% extends "snipts/list.html" %}
|
||||
|
||||
{% load snipt_tags %}
|
||||
|
||||
{% block breadcrumb %}
|
||||
<li><a href="/{{ user.username }}/">{{ user.username }}</a></li>
|
||||
{% if tag %}
|
||||
|
@ -8,5 +10,18 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block tags %}
|
||||
<div class="profile group" title="{{ user.username }}">
|
||||
<span class="avatar" style="background-image: url('http://www.gravatar.com/avatar/{{ user.email|md5 }}?s=50');"></span>
|
||||
<div class="meta">
|
||||
<div class="username">
|
||||
{{ user.username }}
|
||||
</div>
|
||||
{% if user.username == 'nick' %}
|
||||
<div class="member-since">Snipt Founder<br />in {{ user.date_joined|date:"Y" }}</div>
|
||||
{% else %}
|
||||
<div class="member-since">Member since<br />{{ user.date_joined|date:"Y" }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% include "snipts/tags-user.html" %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -65,7 +65,10 @@
|
|||
</div>
|
||||
<footer>
|
||||
<ul class="attrs">
|
||||
<li class="author"><a href="{{ snipt.user.get_absolute_url }}">{{ snipt.user.username }}</a></li>
|
||||
<li class="author">
|
||||
<span style="background-image: url('http://www.gravatar.com/avatar/{{ snipt.user.email|md5 }}?s=15&d=http%3A%2F%2Fsnipt.net%2Fstatic%2Fimages%2Fauthor-icon.png');"></span>
|
||||
<a href="{{ snipt.user.get_absolute_url }}">{{ snipt.user.username }}</a>
|
||||
</li>
|
||||
<li class="created" title="{{ snipt.created|date:"Y-m-d\TH:i:s" }}">{{ snipt.created|naturalday }}</li>
|
||||
<li class="comments"><a href="{{ snipt.get_full_absolute_url }}#disqus_thread" data-disqus-identifier="{{ snipt.pk }}"></a></li>
|
||||
</ul>
|
||||
|
|
|
@ -5,6 +5,8 @@ from templatetag_sugar.parser import Variable, Constant
|
|||
|
||||
from snipts.models import Favorite
|
||||
|
||||
import hashlib
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
|
@ -26,3 +28,7 @@ def snipt_is_favorited_by_user(context, asvar):
|
|||
context[asvar] = is_favorited
|
||||
|
||||
return ''
|
||||
|
||||
@register.filter
|
||||
def md5(string):
|
||||
return hashlib.md5(string.lower()).hexdigest()
|
||||
|
|
Loading…
Reference in New Issue