aboutsummaryrefslogtreecommitdiffstats
path: root/aggregator
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-05-28 15:20:58 +0200
committerGravatar Tom Willemsen2012-05-28 15:20:58 +0200
commit9caad3f69f9086fd5dd5a3adf9af8925bb75553e (patch)
treeb9f79b9a2a047f428462bc28ebab1a06fdf02c4a /aggregator
parente8c245eb7091366ef1384c97db97ff34c6d4fbf3 (diff)
downloadryuslash.org-9caad3f69f9086fd5dd5a3adf9af8925bb75553e.tar.gz
ryuslash.org-9caad3f69f9086fd5dd5a3adf9af8925bb75553e.zip
Change design
Make it look more lispy
Diffstat (limited to 'aggregator')
-rw-r--r--aggregator/templates/aggregator/base.html40
-rw-r--r--aggregator/templates/aggregator/post_content.html16
-rw-r--r--aggregator/templates/aggregator/post_detail.html24
-rw-r--r--aggregator/templates/aggregator/posts.html26
-rw-r--r--aggregator/templatetags/__init__.py0
-rw-r--r--aggregator/templatetags/posts_extras.py12
6 files changed, 52 insertions, 66 deletions
diff --git a/aggregator/templates/aggregator/base.html b/aggregator/templates/aggregator/base.html
index 8585b8c..215ec7e 100644
--- a/aggregator/templates/aggregator/base.html
+++ b/aggregator/templates/aggregator/base.html
@@ -10,22 +10,36 @@
</head>
<body>
- <a href="/"><img src="/static/logo.png" id="logo"></a>
-
<header>
- <hgroup>
- <h1 id="sitetitle">
- <span id="blue">ryu</span><span id="orange">slash</span>
- </h1>
- <h2 id="sitesubtitle">
- Will this ever really be my website?
- <a class="category" href="/activity/">Activities</a>
- <a class="category" href="/post/">Posts</a>
- </h2>
- </hgroup>
+ <img src="/static/logo.png" alt="ryuslash.org" title="ryuslash.org"/>
+ <h1>
+ <a href="http://ryuslash.org">
+ <span id="logo-blue">ryu</span><span id="logo-orange">slash</span>
+ </a>
+ </h1>
+
+ <nav>
+ <ul>
+ {% if category == 'post' %}
+ <li class="selected top">
+ {% else %}
+ <li class="top">
+ {% endif %}
+ <a href="/">posts</a>
+ </li>
+
+ {% if category == 'activity' %}
+ <li class="selected bottom">
+ {% else %}
+ <li class="bottom">
+ {% endif %}
+ <a href="/activity/">activities</a>
+ </li>
+ </ul>
+ </nav>
</header>
- <div id="content">
+ <section class="content">
{% block content %}{% endblock %}
</div>
</body>
diff --git a/aggregator/templates/aggregator/post_content.html b/aggregator/templates/aggregator/post_content.html
deleted file mode 100644
index 46e642f..0000000
--- a/aggregator/templates/aggregator/post_content.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<article class="post">
- <header>
- <h1>
- <a href="{{ post.link }}">
- <img src="/static/images/logos/{{ post.icon }}" />
- {{ post.title }}
- </a>
- </h1>
- </header>
-
- <div class="postcontent">
- {% autoescape off %}
- {{ post.content }}
- {% endautoescape %}
- </div>
-</article>
diff --git a/aggregator/templates/aggregator/post_detail.html b/aggregator/templates/aggregator/post_detail.html
deleted file mode 100644
index eb39f95..0000000
--- a/aggregator/templates/aggregator/post_detail.html
+++ /dev/null
@@ -1,24 +0,0 @@
-{% extends "aggregator/base.html" %}
-
-{% block content %}
-{% include "aggregator/post_content.html" with post=object %}
-
-<div id="pager">
- {% with next=object.get_next_by_updated previous=object.get_previous_by_updated %}
- {% if previous %}
- <div class="nav-prev">
- <a href="/post/{{ previous.pk }}/" id="previous">
- {{ previous.title }}</a>
- </div>
- {% endif %}
-
- {% if next %}
- <div class="nav-next">
- <a href="/post/{{ next.pk }}/" id="next">{{ next.title }}</a>
- </div>
- {% endif %}
- {% endwith %}
- <div class="clear"></div>
-
-</div>
-{% endblock %}
diff --git a/aggregator/templates/aggregator/posts.html b/aggregator/templates/aggregator/posts.html
index 0763ed2..094ad25 100644
--- a/aggregator/templates/aggregator/posts.html
+++ b/aggregator/templates/aggregator/posts.html
@@ -1,4 +1,5 @@
{% extends "aggregator/base.html" %}
+{% load posts_extras %}
{% block head %}
<link href="/feeds/posts/" rel="alternate" type="application/rss+xml"
@@ -6,20 +7,19 @@
{% endblock %}
{% block content %}
-{% regroup list.object_list by updated.date as grouped_list %}
-{% for group in grouped_list %}
- <header>
- <h2>
- <time datetime="{{ group.grouper|date:"Y-m-d" }}">
- {{ group.grouper }}
- </time>
- </h2>
- </header>
-
- {% for post in group.list %}
- {% include "aggregator/post_content.html" %}
+ {% for post in list.object_list %}
+ <article class="post">
+ (<span class="keyword">defpost</span>
+ <a href="{{ post.link }}"
+ class="variable-name">{{ post.title|slugify|nameless }}</a>
+ (<img src="/static/images/logos/{{ post.icon }}" width="16"
+ height="16"/>)
+ <div class="doc">
+ {% autoescape off %}{{ post.content }}{% endautoescape %}
+ </div>
+ <span class="string">&quot;{{ post.updated }}&quot;</span>)
+ </article>
{% endfor %}
-{% endfor %}
<div id="pager">
{% if list.has_previous %}
diff --git a/aggregator/templatetags/__init__.py b/aggregator/templatetags/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/aggregator/templatetags/__init__.py
diff --git a/aggregator/templatetags/posts_extras.py b/aggregator/templatetags/posts_extras.py
new file mode 100644
index 0000000..ca241b1
--- /dev/null
+++ b/aggregator/templatetags/posts_extras.py
@@ -0,0 +1,12 @@
+import re
+
+from django import template
+from django.template.defaultfilters import stringfilter
+
+register = template.Library()
+
+@stringfilter
+def nameless(value):
+ return re.sub(r'^(ryuslash|tom)[- ]?', '', value)
+
+register.filter('nameless', nameless)