Header for pro-adams theme.

master
Nick Sergeant 2012-08-20 21:48:37 -04:00
parent de3a2b62ed
commit 04dc3ecbd8
12 changed files with 207 additions and 102 deletions

2
.kick
View File

@ -1,7 +1,7 @@
process do |files|
files.take_and_map do |file|
case file
when %r{^(.+).scss$}
when %r{^(.+).s?css$}
execute "scss -t compressed media/css/style.scss media/css/style.css"
execute "scss -t compressed media/css/blog-themes/default/style.scss media/css/blog-themes/default/style.css"
execute "scss -t compressed media/css/blog-themes/pro-adams/style.scss media/css/blog-themes/pro-adams/style.css"

View File

@ -13,7 +13,7 @@
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/blog-themes/pro-adams/style.css?1" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/pro.css?1" />
{% if has_snipts and not detail %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ request.path }}?rss{% if not public %}&api_key={{ request.user.api_key.key }}{% endif %}" />
@ -37,11 +37,15 @@
<body class="{% block body-class %}{% endblock %}">
<div class="frame">
<div class="left-y ruler"></div>
<div class="right-y ruler"></div>
{% block header %}
<header class="main">
<h1>
<a href="/">
<a href="/" class="logo">
<span class="avatar" style="background-image: url('https://secure.gravatar.com/avatar/{{ blog_user.email|md5 }}?s=80');"></span>
</a>
<div class="bio">
<a class="name" href="/">
{% if blog_user.username == 'nick' %}
Nick Sergeant
{% elif blog_user.username == 'blog' %}
@ -50,10 +54,13 @@
{{ blog_user.username }}
{% endif %}
</a>
</h1>
<p>
I'm a front-end developer in Rochester, NY working full-time on the <a href="http://amara.org/">Amara</a> project for <a href="http://pculture.org/">PCF</a>. I founded <a href="https://snipt.net/">Snipt</a>.
</p>
</div>
</header>
{% endblock %}
<!--{% block content %}{% endblock %}-->
</div>
{% if not debug %}
@ -70,17 +77,6 @@
s.parentNode.insertBefore(t, s);
})();
</script>
<script type="text/javascript">
window._idl = {};
_idl.variant = 'modal';
(function() {
var idl = document.createElement('script');
idl.type = 'text/javascript';
idl.async = true;
idl.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'members.internetdefenseleague.org/include/?url=' + (_idl.url || '') + '&campaign=' + (_idl.campaign || '') + '&variant=' + (_idl.variant || 'banner');
document.getElementsByTagName('body')[0].appendChild(idl);
})();
</script>
{% endif %}
</body>

View File

@ -2,15 +2,9 @@
{% load pagination_tags %}
{% block body-class %}{{ block.super }} blog-list{% endblock %}
{% block js %}
{{ block.super }}
window.detail = false;
{% endblock %}
{% block body-class %}list{% endblock %}
{% block content %}
<section class="snipts" id="snipts">
{% autopaginate snipts 10 %}
{% for snipt in snipts %}
{% include "blogs/themes/pro-adams/snipt-list.html" %}
@ -20,26 +14,11 @@
</div>
{% endfor %}
{% paginate %}
</section>
<script type="text/javascript" id="disqus">
var disqus_shortname = 'snipt-net';
{% if debug %}
var disqus_developer = 1;
{% endif %}
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'https://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<script type="text/html" id="disqus-template">
var disqus_shortname = 'snipt-net';
{% if debug %}
var disqus_developer = 1;
{% endif %}
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';

View File

@ -1,20 +1,10 @@
{% extends "blogs/themes/pro-adams/base.html" %}
{% block html-class %}blog-site blog-detail{% endblock %}
{% block body-class %}blog-site blog-detail{% endblock %}
{% block js %}
{{ block.super }}
window.detail = true;
{% endblock %}
{% block body-class %}detail{% endblock %}
{% block page-title %}// {{ snipt.title }} {{ block.super }}{% endblock %}
{% block breadcrumb %}
<li><span class="prompt">//</span> <a href="{{ snipt.get_absolute_url }}">{{ snipt.title }}</a></li>
{% endblock %}
{% block content %}
<section class="snipts" id="snipts">
{% with 'true' as detail %}
{% include "blogs/themes/pro-adams/snipt-list.html" %}
{% endwith %}
@ -34,6 +24,5 @@
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</section>
{% endblock %}

View File

@ -1,7 +1,5 @@
{% extends "snipts/snipt-list.html" %}
<a href="{{ snipt.get_full_absolute_url }}">{{ snipt.title }}</a><br />
{% load humanize %}
{% block aside %}{% endblock %}
{% block author %}{% endblock %}
{% block lexer %}{% endblock %}
{% if detail %}
{{ snipt.stylized|safe }}
{% endif %}

View File

@ -35,11 +35,9 @@ def blog_list(request, username_or_custom_slug=None):
context['snipts'] = context['snipts'][:20]
return rss(request, context)
#if request.blog_user.profile.is_pro and settings.DEBUG:
#template = 'blogs/themes/pro-adams/list.html'
#else:
#template = 'blogs/themes/default/list.html'
if request.blog_user.profile.is_pro and settings.DEBUG:
template = 'blogs/themes/pro-adams/list.html'
else:
template = 'blogs/themes/default/list.html'
return render_to_response(
@ -70,11 +68,9 @@ def blog_post(request, username_or_custom_slug):
'snipt': snipt,
}
#if request.blog_user.profile.is_pro and settings.DEBUG:
#template = 'blogs/themes/pro-adams/post.html'
#else:
#template = 'blogs/themes/default/post.html'
if request.blog_user.profile.is_pro and settings.DEBUG:
template = 'blogs/themes/pro-adams/post.html'
else:
template = 'blogs/themes/default/post.html'
return render_to_response(

View File

@ -1 +1 @@
html,body{background:#F2F2F2;margin:0;padding:0}body{color:#666;font:normal 14px/16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-rendering:optimizeLegibility}.group:after{content:".";display:block;height:0;clear:both;visibility:hidden}.hidden{display:none}
html,body{background:#FFF}body{color:#666;font:normal 14px/16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-rendering:optimizeLegibility}.group:after{content:".";display:block;height:0;clear:both;visibility:hidden}.hidden{display:none}div.frame{margin:0 auto;position:relative;width:980px}div.frame div.ruler{background:#EAEAEA;height:100%;position:fixed;top:0;width:1px;z-index:49}div.frame div.left-y{margin-left:40px}div.frame div.right-y{margin-left:760px}header.main{padding:20px 0;position:relative;z-index:50}header.main a.logo{display:inline-block}header.main a.logo span.avatar{display:inline-block;height:80px;width:80px;-webkit-background-clip:padding-box;-webkit-border-radius:80px;-moz-background-clip:padding-box;-moz-border-radius:80px;border-radius:80px;background-clip:padding-box}header.main div.bio{display:inline-block;margin:9px 0 0 12px;vertical-align:top}header.main div.bio a.name{color:#666;font:500 18px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-decoration:none;-webkit-transition:color .08s linear;-moz-transition:color .08s linear;-o-transition:color .08s linear;transition:color .08s linear}header.main div.bio a.name:hover{color:black}header.main div.bio p{color:#B7B7B7;font:500 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;line-height:18px;margin-top:1px;max-width:400px}header.main div.bio p a{color:#B7B7B7;font-weight:bold;-webkit-transition:color .08s linear;-moz-transition:color .08s linear;-o-transition:color .08s linear;transition:color .08s linear}header.main div.bio p a:hover{color:#666}

View File

@ -60,9 +60,7 @@ $Consolas: Consolas, Menlo, "Courier New", monospace;
// Page
html, body {
background: #F2F2F2;
margin: 0;
padding: 0;
background: #FFF;
}
body {
color: #666;
@ -83,3 +81,78 @@ body {
}
// Global
div.frame {
margin: 0 auto;
position: relative;
width: 980px;
div.ruler {
background: #EAEAEA;
height: 100%;
position: fixed;
top: 0;
width: 1px;
z-index: 49;
}
div.left-y {
margin-left: 40px;
}
div.right-y {
margin-left: 760px;
}
}
header.main {
padding: 20px 0;
position: relative;
z-index: 50;
a.logo {
display: inline-block;
span.avatar {
display: inline-block;
height: 80px;
width: 80px;
@include border-radius(80px);
}
}
div.bio {
display: inline-block;
margin: 9px 0 0 12px;
vertical-align: top;
a.name {
color: #666;
font: 500 18px $Helvetica;
text-decoration: none;
-webkit-transition: color .08s linear;
-moz-transition: color .08s linear;
-o-transition: color .08s linear;
transition: color .08s linear;
&:hover {
color: black;
}
}
p {
color: #B7B7B7;
font: 500 12px $Helvetica;
line-height: 18px;
margin-top: 1px;
max-width: 400px;
a {
color: #B7B7B7;
font-weight: bold;
-webkit-transition: color .08s linear;
-moz-transition: color .08s linear;
-o-transition: color .08s linear;
transition: color .08s linear;
&:hover {
color: #666;
}
}
}
}
}

View File

@ -1,5 +1,9 @@
#!/bin/bash
cat media/css/reset.css \
media/css/blog-themes/pro-adams/style.css \
> media/css/pro.css
cat media/css/bootstrap.css \
media/css/style.css \
media/css/themes.css \

34
media/css/pro.css Normal file
View File

@ -0,0 +1,34 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html,body{background:#FFF}body{color:#666;font:normal 14px/16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-rendering:optimizeLegibility}.group:after{content:".";display:block;height:0;clear:both;visibility:hidden}.hidden{display:none}div.frame{margin:0 auto;position:relative;width:980px}div.frame div.ruler{background:#EAEAEA;height:100%;position:fixed;top:0;width:1px;z-index:49}div.frame div.left-y{margin-left:40px}div.frame div.right-y{margin-left:760px}header.main{padding:20px 0;position:relative;z-index:50}header.main a.logo{display:inline-block}header.main a.logo span.avatar{display:inline-block;height:80px;width:80px;-webkit-background-clip:padding-box;-webkit-border-radius:80px;-moz-background-clip:padding-box;-moz-border-radius:80px;border-radius:80px;background-clip:padding-box}header.main div.bio{display:inline-block;margin:9px 0 0 12px;vertical-align:top}header.main div.bio a.name{color:#666;font:500 18px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-decoration:none;-webkit-transition:color .08s linear;-moz-transition:color .08s linear;-o-transition:color .08s linear;transition:color .08s linear}header.main div.bio a.name:hover{color:black}header.main div.bio p{color:#B7B7B7;font:500 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;line-height:18px;margin-top:1px;max-width:400px}header.main div.bio p a{color:#B7B7B7;font-weight:bold;-webkit-transition:color .08s linear;-moz-transition:color .08s linear;-o-transition:color .08s linear;transition:color .08s linear}header.main div.bio p a:hover{color:#666}

33
media/css/reset.css Normal file
View File

@ -0,0 +1,33 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

View File

@ -134,6 +134,9 @@ class Snipt(models.Model):
if self.blog_post:
if self.user.id == 3:
if settings.DEBUG:
return 'http://nick.snipt.localhost/{}/'.format(self.slug)
else:
return 'http://nicksergeant.com/{}/'.format(self.slug)
elif self.user.id == 2156:
return 'http://rochacbruno.com.br/{}/'.format(self.slug)