Browse Source

Header for pro-adams theme.

master
Nick Sergeant 10 years ago
parent
commit
04dc3ecbd8
  1. 2
      .kick
  2. 30
      blogs/templates/blogs/themes/pro-adams/base.html
  3. 41
      blogs/templates/blogs/themes/pro-adams/list.html
  4. 49
      blogs/templates/blogs/themes/pro-adams/post.html
  5. 10
      blogs/templates/blogs/themes/pro-adams/snipt-list.html
  6. 20
      blogs/views.py
  7. 2
      media/css/blog-themes/pro-adams/style.css
  8. 79
      media/css/blog-themes/pro-adams/style.scss
  9. 4
      media/css/compile-css.sh
  10. 34
      media/css/pro.css
  11. 33
      media/css/reset.css
  12. 5
      snipts/models.py

2
.kick

@ -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"

30
blogs/templates/blogs/themes/pro-adams/base.html

@ -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>

41
blogs/templates/blogs/themes/pro-adams/list.html

@ -2,44 +2,23 @@
{% 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" %}
{% empty %}
<div class="empty-snipts">
{{ blog_user.username }} has no public blog posts.
</div>
{% endfor %}
{% paginate %}
</section>
{% autopaginate snipts 10 %}
{% for snipt in snipts %}
{% include "blogs/themes/pro-adams/snipt-list.html" %}
{% empty %}
<div class="empty-snipts">
{{ blog_user.username }} has no public blog posts.
</div>
{% endfor %}
{% paginate %}
<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';

49
blogs/templates/blogs/themes/pro-adams/post.html

@ -1,39 +1,28 @@
{% 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 %}
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'snipt-net';
{% if debug %}
var disqus_developer = 1;
{% endif %}
var disqus_url = '{{ snipt.get_full_absolute_url }}{% if not snipt.public %}?key={{ snipt.key }}{% endif %}';
var disqus_title = '{{ snipt.title }}';
var disqus_identifier = {{ snipt.id }};
{% with 'true' as detail %}
{% include "blogs/themes/pro-adams/snipt-list.html" %}
{% endwith %}
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'snipt-net';
{% if debug %}
var disqus_developer = 1;
{% endif %}
var disqus_url = '{{ snipt.get_full_absolute_url }}{% if not snipt.public %}?key={{ snipt.key }}{% endif %}';
var disqus_title = '{{ snipt.title }}';
var disqus_identifier = {{ snipt.id }};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</section>
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
{% endblock %}

10
blogs/templates/blogs/themes/pro-adams/snipt-list.html

@ -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 %}

20
blogs/views.py

@ -35,12 +35,10 @@ 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'
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(
template,
@ -70,12 +68,10 @@ 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'
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(
template,

2
media/css/blog-themes/pro-adams/style.css

@ -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}

79
media/css/blog-themes/pro-adams/style.scss

@ -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;
}
}
}
}
}

4
media/css/compile-css.sh

@ -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

@ -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

@ -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;
}

5
snipts/models.py

@ -134,7 +134,10 @@ class Snipt(models.Model):
if self.blog_post:
if self.user.id == 3:
return 'http://nicksergeant.com/{}/'.format(self.slug)
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)
elif self.user.id == 10325:

Loading…
Cancel
Save