Starting pro-adams theme.
parent
373ca85331
commit
109cafbcf6
|
@ -0,0 +1,61 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block body-class %}blog-site{% endblock %}
|
||||
{% block html-class %}blog-site{% endblock %}
|
||||
|
||||
{% block page-title %}{% if blog_user.username == 'nick' %}// Nick Sergeant {% elif blog_user.username == 'blog' %}// Snipt Blog{% else %}// {{ blog_user.username }}{% endif %}{% endblock %}
|
||||
|
||||
{% block page-description %}{% endblock %}
|
||||
{% block rochester-made %}{% endblock %}
|
||||
{% block keyboard-shortcuts %}{% endblock %}
|
||||
{% block intercom %}{% endblock %}
|
||||
{% block js %}
|
||||
{{ block.super }}
|
||||
window.blog_post = true;
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<header class="main">
|
||||
<div class="inner group">
|
||||
<h1>
|
||||
<a href="/">
|
||||
{% if blog_user.username == 'nick' %}
|
||||
Nick Sergeant
|
||||
{% elif blog_user.username == 'blog' %}
|
||||
Snipt Blog
|
||||
{% else %}
|
||||
{{ blog_user.username }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
{% endblock %}
|
||||
{% block sub-header %}
|
||||
<header class="sub">
|
||||
<div class="inner group">
|
||||
<ul class="bcrumb">
|
||||
<li class="prompt">//</li>
|
||||
<li><a href="/">blog</a></li>
|
||||
{% block breadcrumb %}{% endblock %}
|
||||
<li class="rss">
|
||||
<a href="/?rss">RSS</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
{% endblock %}
|
||||
{% block aside %}
|
||||
<aside class="main">
|
||||
{% if sidebar %}
|
||||
<section class="sidebar">
|
||||
{{ sidebar.stylized|safe }}
|
||||
</section>
|
||||
{% endif %}
|
||||
<nav class="footer {% if sidebar %}with-sidebar{% endif %}">
|
||||
<ul class="powered">
|
||||
<li class="snipt"><a href="https://snipt.net/">Blog powered by Snipt</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
{% endblock %}
|
|
@ -0,0 +1,50 @@
|
|||
{% extends "blogs/themes/pro-adams/base.html" %}
|
||||
|
||||
{% load pagination_tags %}
|
||||
|
||||
{% block body-class %}{{ block.super }} blog-list{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{{ block.super }}
|
||||
window.detail = false;
|
||||
{% 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>
|
||||
<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';
|
||||
s.src = 'https://' + disqus_shortname + '.disqus.com/count.js';
|
||||
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
|
||||
}());
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -0,0 +1,39 @@
|
|||
{% 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 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 }};
|
||||
|
||||
(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>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{% extends "snipts/snipt-list.html" %}
|
||||
|
||||
{% load humanize %}
|
||||
|
||||
{% block aside %}{% endblock %}
|
||||
{% block author %}{% endblock %}
|
||||
{% block lexer %}{% endblock %}
|
|
@ -1,12 +1,10 @@
|
|||
from django.shortcuts import get_object_or_404, render_to_response
|
||||
from django.template import RequestContext
|
||||
from annoying.decorators import render_to
|
||||
from annoying.functions import get_object_or_None
|
||||
|
||||
from snipts.models import Snipt
|
||||
|
||||
|
||||
@render_to('blogs/themes/default/list.html')
|
||||
def blog_list(request, username_or_custom_slug=None):
|
||||
|
||||
if username_or_custom_slug:
|
||||
|
@ -30,9 +28,17 @@ def blog_list(request, username_or_custom_slug=None):
|
|||
context['snipts'] = context['snipts'][:20]
|
||||
return rss(request, context)
|
||||
|
||||
return context
|
||||
if request.blog_user.profile.is_pro:
|
||||
template = 'blogs/themes/pro-adams/list.html'
|
||||
else:
|
||||
template = 'blogs/themes/default/list.html'
|
||||
|
||||
return render_to_response(
|
||||
template,
|
||||
context,
|
||||
context_instance=RequestContext(request)
|
||||
)
|
||||
|
||||
@render_to('blogs/themes/default/post.html')
|
||||
def blog_post(request, username_or_custom_slug):
|
||||
|
||||
snipt = get_object_or_404(Snipt, user=request.blog_user,
|
||||
|
@ -54,7 +60,16 @@ def blog_post(request, username_or_custom_slug):
|
|||
'snipt': snipt,
|
||||
}
|
||||
|
||||
return context
|
||||
if request.blog_user.profile.is_pro:
|
||||
template = 'blogs/themes/pro-adams/post.html'
|
||||
else:
|
||||
template = 'blogs/themes/default/post.html'
|
||||
|
||||
return render_to_response(
|
||||
template,
|
||||
context,
|
||||
context_instance=RequestContext(request)
|
||||
)
|
||||
|
||||
def rss(request, context):
|
||||
return render_to_response(
|
||||
|
|
|
@ -106,7 +106,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 == 10325:
|
||||
return 'http://snipt.joshhudnall.com/{}/'.format(self.slug)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue