From 560ceac176c85001c341ad06f0ea9f95453b0504 Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Fri, 13 Apr 2012 13:01:28 -0400 Subject: [PATCH] Profile --- media/css/style.scss | 52 ++++++++++++++++++++++++- snipts/templates/snipts/detail.html | 2 +- snipts/templates/snipts/list-user.html | 15 +++++++ snipts/templates/snipts/snipt-list.html | 5 ++- snipts/templatetags/snipt_tags.py | 6 +++ 5 files changed, 76 insertions(+), 4 deletions(-) diff --git a/media/css/style.scss b/media/css/style.scss index 2dbe5f3..c8f1e9d 100644 --- a/media/css/style.scss +++ b/media/css/style.scss @@ -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 { diff --git a/snipts/templates/snipts/detail.html b/snipts/templates/snipts/detail.html index 0948892..531a1ef 100644 --- a/snipts/templates/snipts/detail.html +++ b/snipts/templates/snipts/detail.html @@ -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 %} diff --git a/snipts/templates/snipts/list-user.html b/snipts/templates/snipts/list-user.html index 7952fb6..e349a31 100644 --- a/snipts/templates/snipts/list-user.html +++ b/snipts/templates/snipts/list-user.html @@ -1,5 +1,7 @@ {% extends "snipts/list.html" %} +{% load snipt_tags %} + {% block breadcrumb %}
  • {{ user.username }}
  • {% if tag %} @@ -8,5 +10,18 @@ {% endblock %} {% block tags %} +
    + +
    +
    + {{ user.username }} +
    + {% if user.username == 'nick' %} +
    Snipt Founder
    in {{ user.date_joined|date:"Y" }}
    + {% else %} +
    Member since
    {{ user.date_joined|date:"Y" }}
    + {% endif %} +
    +
    {% include "snipts/tags-user.html" %} {% endblock %} diff --git a/snipts/templates/snipts/snipt-list.html b/snipts/templates/snipts/snipt-list.html index 235112c..ff23a49 100644 --- a/snipts/templates/snipts/snipt-list.html +++ b/snipts/templates/snipts/snipt-list.html @@ -65,7 +65,10 @@