A bunch of blog stuff.

master
Nick Sergeant 2012-06-05 15:46:37 -04:00
parent 6219446445
commit 16f2c8ff23
11 changed files with 1382 additions and 96 deletions

View File

@ -1,7 +1,5 @@
{% extends "base.html" %}
{% load compress %}
{% block meta %}
{% if 'page' in request.get_full_path %}
<meta name="robots" content="noindex, follow" />
@ -11,21 +9,11 @@
{% block body-class %}blog-site{% endblock %}
{% block html-class %}blog-site{% endblock %}
{% block css %}
{% compress css %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/bootstrap.css" />
<link rel="stylesheet" type="text/x-scss" href="{{ STATIC_URL }}css/style.scss" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/themes.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/chosen.css" />
<link rel="stylesheet" type="text/x-scss" href="{{ STATIC_URL }}css/blog-themes/default/style.scss" />
{% endcompress %}
{% endblock %}
{% block page-title %}
{% if blog_user.username == 'nick' %}
Nick Sergeant
{% else %}
{{ blog_user.username }}'s blog - Powered by Snipt.net
{{ blog_user.username }}'s blog
{% endif %}
{% endblock %}
@ -38,13 +26,20 @@
<nav class="footer">
<ul>
<li class="blog">
{% if blog_user.username == 'nick' %}
<a href="/">Nick Sergeant</a>
{% else %}
<a href="/">{{ blog_user.username }}'s blog</a>
{% endif %}
<a href="/">
{% if blog_user.username == 'nick' %}
Nick Sergeant
{% elif blog_user.username == 'blog' %}
Snipt Blog
{% else %}
{{ blog_user.username }}'s blog
{% endif %}
</a>
</li>
</ul>
<ul class="powered">
<li class="snipt"><a href="https://snipt.net/">Blog powered by Snipt</a></li>
</ul>
</nav>
</aside>
{% endif %}

View File

@ -1,7 +1,7 @@
{% extends "blogs/themes/default/base.html" %}
{% block html-class %}detail{% endblock %}
{% block body-class %}detail{% endblock %}
{% block html-class %}detail blog-site{% endblock %}
{% block body-class %}detail blog-site{% endblock %}
{% block js %}
{{ block.super }}

View File

@ -0,0 +1,33 @@
body.blog-detail section.main div.inner section.snipts article.snipt div.container {
width: 940px;
}
body.blog-detail div#disqus_thread {
width: 925px;
}
body.blog-site article.snipt div.group div.container {
width: 708px;
}
body.blog-site article.snipt div.group div.container header {
min-height: 0;
}
body.blog-site article.snipt div.group div.container header h1 {
margin: 11px 15px;
}
body.blog-site section.main aside.main nav.footer ul.powered {
border-top: 1px solid #C0C0C0;
margin-top: 40px;
padding-top: 40px;
}
body.blog-site section.main aside.main nav.footer ul.powered li {
background: transparent url("/static/images/favicon.png") center left no-repeat;
}
body.blog-site section.main aside.main nav.footer ul.powered li a {
border: none;
color: #3E6B73;
font-style: italic;
}
body.blog-site section.main aside.main nav.footer ul.powered li a:hover {
border-bottom: 1px solid #333;
color: #333;
}

View File

@ -1,19 +1,4 @@
article.snipt {
div.group {
div.container {
width: 708px;
header {
min-height: 0;
h1 {
margin: 11px 15px;
}
}
}
}
}
body.detail {
body.blog-detail {
section.main {
div.inner {
section.snipts {
@ -29,3 +14,46 @@ body.detail {
width: 925px;
}
}
body.blog-site {
article.snipt {
div.group {
div.container {
width: 708px;
header {
min-height: 0;
h1 {
margin: 11px 15px;
}
}
}
}
}
section.main {
aside.main {
nav.footer {
ul.powered {
border-top: 1px solid #C0C0C0;
margin-top: 40px;
padding-top: 40px;
li {
background: transparent url('/static/images/favicon.png') center left no-repeat;
a {
border: none;
color: #3E6B73;
font-style: italic;
&:hover {
border-bottom: 1px solid #333;
color: #333;
}
}
}
}
}
}
}
}

View File

@ -1,24 +0,0 @@
html, body {
background: #f5f2f3 url("/static/images/bg.gif") top left repeat;
}
body {
color: #666;
font: normal 14px/16px "Helvetica Neue", Helvetica, Arial, "Liberation Sans", FreeSans, sans-serif;
text-rendering: optimizeLegibility;
}
body li {
line-height: normal;
}
.group:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.hidden {
display: none;
}

File diff suppressed because it is too large Load Diff

BIN
media/images/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -68,7 +68,10 @@ MEDIA_URL = '/media/uploads/'
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(BASE_PATH, 'static')
STATIC_URL = '/static/'
if DEBUG:
STATIC_URL = '/media/'
else:
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
@ -121,6 +124,7 @@ TEMPLATE_DIRS = (
INSTALLED_APPS = (
'gunicorn',
#'grappelli',
'django.contrib.auth',
'django.contrib.contenttypes',
@ -211,14 +215,10 @@ ABSOLUTE_URL_OVERRIDES = {
# CSS / JS Compression
COMPRESS_OUTPUT_DIR = 'cache'
COMPRESS_JS_FILTERS = []
COMPRESS_ENABLED = True
if DEBUG:
COMPRESS_ROOT = os.path.join(BASE_PATH, 'media')
else:
COMPRESS_ROOT = STATIC_ROOT
COMPRESS_PRECOMPILERS = (
('text/x-scss', 'scss {infile} {outfile}'),
)
# Search
HAYSTACK_CONNECTIONS = {

View File

@ -2,7 +2,7 @@
{% block page-title %}/ {% if snipt.title %}{{ snipt.title }}{% else %}Untitled{% endif %} / {{ user.username }} - {{ block.super }}{% endblock %}
{% block html-class %}detail{% endblock %}
{% block body-class %}{% if request.path == '/api/' and request.user.is_authenticated %}api{% else %}detail{% endif %}{% endblock %}
{% block body-class %}{% if request.path == '/api/' %}api{% else %}detail{% endif %}{% endblock %}
{% block js %}
{{ block.super }}
@ -15,18 +15,24 @@
{% endblock %}
{% block aside %}
{% if request.path == '/api/' and request.user.is_authenticated %}
{% if request.path == '/api/' %}
{{ block.super }}
<aside class="api-info api-creds">
<div class="api-inner">
<h5>Your API credentials:</h5>
<ul>
<li>Username: <strong>{{ request.user.username }}</strong></li>
<li>User ID: <strong>{{ request.user.id }}</strong></li>
<li>API Key: <br /><input type="text" value="{{ request.user.api_key.key }}" /></li>
</ul>
</div>
</aside>
{% endif %}
{% endblock %}
{% block aside-inner %}
{% if request.path == '/api/' %}
{% if request.user.is_authenticated %}
<aside class="api-info api-creds">
<div class="api-inner">
<h5>Your API credentials:</h5>
<ul>
<li>Username: <strong>{{ request.user.username }}</strong></li>
<li>User ID: <strong>{{ request.user.id }}</strong></li>
<li>API Key: <br /><input type="text" value="{{ request.user.api_key.key }}" /></li>
</ul>
</div>
</aside>
{% endif %}
<aside class="api-info immediate-help">
<div class="api-inner">
<h5>Need immediate help?</h5>

View File

@ -2,7 +2,7 @@
{% snipt_is_favorited_by_user as 'is_favorited' %}
<article id="snipt-{{ snipt.pk }}" class="snipt {% if snipt.blog_post %}blog-post {% endif %}{% if not snipt.public %} private-snipt{% endif %}{% if snipt.line_count > 8 and not detail and user.username != 'blog' %} expandable{% endif %}{% if snipt.user == request.user %} editable{% endif %}{% if is_favorited %} favorited" data-favorite-id="{{ is_favorited }}"{% else %}"{% endif %}>
<article id="snipt-{{ snipt.pk }}" class="snipt {% if snipt.blog_post %}blog-post {% endif %}{% if not snipt.public %} private-snipt{% endif %}{% if snipt.line_count > 8 and not detail %} expandable{% endif %}{% if snipt.user == request.user %} editable{% endif %}{% if is_favorited %} favorited" data-favorite-id="{{ is_favorited }}"{% else %}"{% endif %}>
<div class="number">#{{ snipt.pk }}</div>
<div class="group">
<div class="container">
@ -21,7 +21,7 @@
{% else %}
{{ snipt.stylized|safe }}
{% endif %}
{% if snipt.line_count > 8 and not detail and user.username != 'blog' %}
{% if snipt.line_count > 8 and not detail %}
<a href="#" class="expand">
<span class="expand">Expand</span>
<span class="collapse">Collapse</span>

View File

@ -12,14 +12,13 @@
{% block meta %}{% endblock %}
{% block css %}
{% compress css %}
{% compress css %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/bootstrap.css" />
<link rel="stylesheet" type="text/x-scss" href="{{ STATIC_URL }}css/style.scss" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/style.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/themes.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/chosen.css" />
{% endcompress %}
{% endblock %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/blog-themes/default/style.css" />
{% endcompress %}
{% compress js %}
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/underscore.js"></script>
@ -141,7 +140,7 @@
<a href="/api/" {% if '/api/' in request.path %}class="active"{% endif %}>API</a>
</li>
<li class="blog">
<a href="/blog/" {% if '/blog/' in request.path %}class="active"{% endif %}>Blog</a>
<a href="https://blog.snipt.net/">Blog</a>
</li>
<li class="roadmap">
<a href="/todo/" {% if '/todo/' in request.path %}class="active"{% endif %}>Roadmap</a>
@ -152,6 +151,7 @@
</ul>
</nav>
{% block tags %}{% endblock %}
{% block aside-inner %}{% endblock %}
</aside>
{% endblock %}
<div class="inner">