master
Nick Sergeant 2012-09-02 19:47:02 -04:00
parent aaa36a5bf4
commit 2805b9669c
7 changed files with 95 additions and 32 deletions

View File

@ -57,7 +57,7 @@
{% endif %} {% endif %}
</a> </a>
<p> <p>
I'm a front-end web developer in Rochester, NY working on the <a href="http://amara.org/">Amara</a> project for <a href="http://pculture.org/">PCF</a>. I also built <a href="https://snipt.net/">Snipt</a>. I'm a front-end web developer in Rochester, NY working on the <a href="http://amara.org/">Amara</a> project for <a href="http://pculture.org/">PCF</a>. I also created <a href="https://snipt.net/">Snipt</a>.
</p> </p>
</div> </div>
</header> </header>
@ -90,7 +90,7 @@
<h1>Recent snipts</h1> <h1>Recent snipts</h1>
<ul> <ul>
{% for snipt in normal_snipts %} {% for snipt in normal_snipts %}
<li><a href="{{ snipt.get_absolute_url }}">{{ snipt.title }}</a></li> <li><a href="{{ snipt.get_full_absolute_url }}">{{ snipt.title }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
</section> </section>

View File

@ -1,34 +1,35 @@
{% load snipt_tags typogrify_tags %} {% load snipt_tags typogrify_tags %}
<article class="group {% if detail %}detail{% endif %}"> <article class="group {% if detail %}detail{% endif %}">
<div class="gutter"></div> <div class="gutter">
<a href="{{ snipt.get_full_absolute_url }}">
<time pubdate datetime="{{ snipt.publish_date|date:'c' }}">
<span class="id">
#{{ snipt.id }}
</span>
<span class="mon-day">
{{ snipt.publish_date|date:'M' }} {{ snipt.publish_date|date:'j' }}
</span>
<span class="year">{{ snipt.publish_date|date:'Y' }}</span>
</time>
</a>
</div>
<div class="content-inner"> <div class="content-inner">
<h1><a href="{{ snipt.get_full_absolute_url }}">{% firstof snipt.title|typogrify 'Untitled' %}</a></h1> <h1><a href="{{ snipt.get_full_absolute_url }}">{% firstof snipt.title|typogrify 'Untitled' %}</a></h1>
<div class="post-content autumn"> <div class="post-content autumn">
{% if snipt.lexer == 'markdown' %} {% if snipt.lexer == 'markdown' %}
<div class="markdown"> <div class="markdown">
{{ snipt.stylized|safe }} {% if detail %}
{{ snipt.stylized|safe }}
{% else %}
{{ snipt.stylized|truncatewords_html:70|safe }}
{% endif %}
</div> </div>
{% else %} {% else %}
{% if 'linenos' not in snipt.stylized %} {% if detail %}
<table class="highlighttable fakenos">
<tbody>
<tr>
<td class="linenos">
<div class="linenodiv">
<pre>
{% generate_line_numbers for snipt.line_count %}
</pre>
</div>
</td>
<td class="code">
{{ snipt.stylized|safe }}
</td>
</tr>
</tbody>
</table>
{% else %}
{{ snipt.stylized|safe }} {{ snipt.stylized|safe }}
{% else %}
{{ snipt.stylized|truncatewords_html:100|safe }}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if detail %} {% if detail %}

View File

@ -41,7 +41,7 @@ def blog_list(request, username_or_custom_slug=None):
context['snipts'] = context['snipts'][:20] context['snipts'] = context['snipts'][:20]
return rss(request, context) return rss(request, context)
if request.blog_user.profile.is_pro and settings.DEBUG: if request.blog_user.profile.is_pro and request.blog_user.username == 'nick':
template = 'blogs/themes/pro-adams/list.html' template = 'blogs/themes/pro-adams/list.html'
else: else:
template = 'blogs/themes/default/list.html' template = 'blogs/themes/default/list.html'
@ -65,16 +65,22 @@ def blog_post(request, username_or_custom_slug):
user=request.blog_user, user=request.blog_user,
title='Blog Sidebar') title='Blog Sidebar')
normal_snipts = Snipt.objects.filter(blog_post=False, user=request.blog_user, public=True).order_by('-created')
normal_snipts = normal_snipts.exclude(title__in=[''])
normal_snipts = normal_snipts.exclude(tags__name__in=['tmp'])
normal_snipts = normal_snipts[:3]
context = { context = {
'blog_user': request.blog_user, 'blog_user': request.blog_user,
'detail': True, 'detail': True,
'has_snipts': True, 'has_snipts': True,
'normal_snipts': normal_snipts,
'public': True, 'public': True,
'sidebar': sidebar, 'sidebar': sidebar,
'snipt': snipt, 'snipt': snipt,
} }
if request.blog_user.profile.is_pro and settings.DEBUG: if request.blog_user.profile.is_pro and request.blog_user.username == 'nick':
template = 'blogs/themes/pro-adams/post.html' template = 'blogs/themes/pro-adams/post.html'
else: else:
template = 'blogs/themes/default/post.html' template = 'blogs/themes/default/post.html'

File diff suppressed because one or more lines are too long

View File

@ -158,7 +158,7 @@ header.main {
font: 500 12px $Helvetica; font: 500 12px $Helvetica;
line-height: 18px; line-height: 18px;
margin-top: 1px; margin-top: 1px;
max-width: 400px; max-width: 340px;
a { a {
color: #B7B7B7; color: #B7B7B7;
@ -206,6 +206,8 @@ section.main {
margin-bottom: 10px; margin-bottom: 10px;
} }
ul { ul {
margin: 0;
li { li {
margin: 0; margin: 0;
@ -251,6 +253,58 @@ div.pagination {
article { article {
margin: 40px 0; margin: 40px 0;
div.gutter {
a {
text-decoration: none;
time {
background: #FFF;
border: 1px solid #EAEAEA;
display: block;
margin-top: -14px;
position: relative;
z-index: 51;
@include border-radius(3px);
span {
display: block;
text-align: center;
&.id {
background: #F9F9F9;
border-bottom: 1px solid #EAEAEA;
color: #CCC;
font: normal 11px $Helvetica;
padding: 2px 0;
}
&.mon-day {
color: #999;
font: normal 17px $Helvetica;
letter-spacing: -1px;
padding-top: 9px;
text-transform: uppercase;
}
&.year {
color: #999;
font: normal 12px $Helvetica;
letter-spacing: -1px;
padding-bottom: 9px;
text-transform: uppercase;
}
}
&:after {
background: transparent url('/static/images/date-arrow.gif') top left no-repeat;
content: "";
display: block;
height: 11px;
position: absolute;
right: -6px;
top: 22px;
width: 6px;
}
}
}
}
h1 { h1 {
margin-bottom: 20px; margin-bottom: 20px;
@ -273,7 +327,7 @@ article {
div.post-content { div.post-content {
color: #666; color: #666;
font: normal 14px/22px $Helvetica; font: normal 14px/22px $Helvetica;
max-height: 200px; max-height: 150px;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@ -294,10 +348,12 @@ article {
color: #000; color: #000;
} }
} }
ul { li {
li { line-height: 20px;
line-height: 22px; margin: 10px 0;
margin: 10px 0;
p:first-of-type {
margin-bottom: 0;
} }
} }
table.highlighttable { table.highlighttable {

File diff suppressed because one or more lines are too long

BIN
media/images/date-arrow.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB