aboutsummaryrefslogtreecommitdiffstats
path: root/aggregator/templates
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-05-21 22:26:37 +0200
committerGravatar Tom Willemsen2012-05-21 22:26:37 +0200
commit44cdd17a88595e16a9fd43f55e9dac38a0047e6b (patch)
treeca36baa776f717b1c2b6c0a64be48d034b7a5253 /aggregator/templates
parent8944ff3fba186e71a7349c1a06153f32650e77d4 (diff)
downloadryuslash.org-44cdd17a88595e16a9fd43f55e9dac38a0047e6b.tar.gz
ryuslash.org-44cdd17a88595e16a9fd43f55e9dac38a0047e6b.zip
Move templates
Moved templates into the aggregator app's folder.
Diffstat (limited to 'aggregator/templates')
-rw-r--r--aggregator/templates/aggregator/base.html36
-rw-r--r--aggregator/templates/aggregator/post_content.html34
-rw-r--r--aggregator/templates/aggregator/post_detail.html24
-rw-r--r--aggregator/templates/aggregator/posts.html54
4 files changed, 148 insertions, 0 deletions
diff --git a/aggregator/templates/aggregator/base.html b/aggregator/templates/aggregator/base.html
new file mode 100644
index 0000000..8f752bd
--- /dev/null
+++ b/aggregator/templates/aggregator/base.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>ryuslash</title>
+ <link href="/static/main.css" rel="stylesheet" />
+ <link rel="shortcut icon" href="/static/favicon.png" />
+ {% block head %}{% endblock %}
+ </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?
+ {% for category in categories %}
+ <a class="category"
+ href="/{{ category.name|slugify }}/">{{ category.name }}</a>
+ {% endfor %}
+ </h2>
+ </hgroup>
+ </header>
+
+ {% block menu %}{% endblock %}
+
+ <div id="content">
+ {% block content %}{% endblock %}
+ </div>
+ </body>
+</html>
diff --git a/aggregator/templates/aggregator/post_content.html b/aggregator/templates/aggregator/post_content.html
new file mode 100644
index 0000000..e47de93
--- /dev/null
+++ b/aggregator/templates/aggregator/post_content.html
@@ -0,0 +1,34 @@
+<article class="post {{ post.feed.name|slugify }}">
+ <header>
+ <hgroup>
+ <h1>
+ <a href="/post/{{ post.pk }}/">
+ <img src="{{ post.feed.get_favicon_url }}" />
+ </a>
+ <a href="/post/{{ post.pk }}/">
+ {% if post.feed.uses_title %}
+ {{ post.title }}
+ {% else %}
+ {{ post.updated }}
+ {% endif %}
+ </a>
+ </h1>
+ <h2 class="postsubtitle">
+ Via
+ <a href="{{ post.feed.base_url }}">{{ post.feed.name }}</a>
+ (<a href="{{ post.feed.get_profile_url }}">profile</a>,
+ <a href="{{ post.remote_url }}">origin</a>)
+ </h2>
+ </hgroup>
+ </header>
+
+ <div class="postcontent">
+ {% autoescape off %}
+ {% if post.feed.br2nl %}
+ {{ post.body|linebreaks }}
+ {% else %}
+ {{ post.body }}
+ {% endif %}
+ {% endautoescape %}
+ </div>
+</article>
diff --git a/aggregator/templates/aggregator/post_detail.html b/aggregator/templates/aggregator/post_detail.html
new file mode 100644
index 0000000..eb39f95
--- /dev/null
+++ b/aggregator/templates/aggregator/post_detail.html
@@ -0,0 +1,24 @@
+{% 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
new file mode 100644
index 0000000..37edf12
--- /dev/null
+++ b/aggregator/templates/aggregator/posts.html
@@ -0,0 +1,54 @@
+{% extends "aggregator/base.html" %}
+
+{% block head %}
+<link href="/feeds/posts/" rel="alternate" type="application/rss+xml"
+ title="All posts" />
+{% endblock %}
+
+{% block menu %}
+<div id="feeds">
+ {% for feed in feeds %}
+ <a href="{{ feed.get_profile_url }}">
+ <img src="{{ feed.get_favicon_url }}">
+ {{ feed.name }}
+ </a>
+ {% endfor %}
+</div>
+{% 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" %}
+ {% endfor %}
+{% endfor %}
+
+<div id="pager">
+ {% if list.has_previous %}
+ <div class="nav-prev">
+ <a href="/{{ category }}/{{ list.previous_page_number }}/"
+ id="previous">previous</a>
+ </div>
+ {% endif %}
+
+ {% if list.has_next %}
+ <div class="nav-next">
+ <a href="/{{ category }}/{{ list.next_page_number }}/"
+ id="next">next</a>
+ </div>
+ {% endif %}
+
+ <div id="current">
+ {{ list.number }} / {{ list.paginator.num_pages }}
+ </div>
+</div>
+{% endblock %}