summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 22:02:30 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 22:02:30 -0400
commit2ea4e6f4d5245dd5e43c90d54635477c6e7dd6a7 (patch)
treed0994cde414fffd3389d036f5a043327aae3af39 /templates
parent05430050147c87818c08373e9930756da4d6b5ac (diff)
parente5fc7cd53f6082f2911bc6c8cf8ea4f4ca4addc8 (diff)
Merge tag 'release_2014-11-08.2' into archweb-generic
Todolist pagination and sitemap, news sitemap
Diffstat (limited to 'templates')
-rw-r--r--templates/news/list.html3
-rw-r--r--templates/sitemaps/news_sitemap.xml.jinja14
-rw-r--r--templates/sitemaps/sitemap.xml.jinja9
-rw-r--r--templates/todolists/list.html7
-rw-r--r--templates/todolists/paginator.html22
5 files changed, 52 insertions, 3 deletions
diff --git a/templates/news/list.html b/templates/news/list.html
index 3295e333..93cd20e6 100644
--- a/templates/news/list.html
+++ b/templates/news/list.html
@@ -10,7 +10,7 @@
{% block content %}
<div id="news-article-list" class="box">
- <h2>News Archives</h2>
+ <h2>Arch Linux News Archives</h2>
{% if perms.news.add_news %}
<ul class="admin-actions">
@@ -54,6 +54,5 @@
</table>
{% include "news/paginator.html" %}
-
</div>
{% endblock %}
diff --git a/templates/sitemaps/news_sitemap.xml.jinja b/templates/sitemaps/news_sitemap.xml.jinja
new file mode 100644
index 00000000..97dd17b5
--- /dev/null
+++ b/templates/sitemaps/news_sitemap.xml.jinja
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
+{% for url in urlset %}<url>
+<loc>{{ url.location }}</loc>
+{% if url.lastmod %}<lastmod>{{ url.lastmod|date("Y-m-d") }}</lastmod>{% endif %}
+{% if url.changefreq %}<changefreq>{{ url.changefreq }}</changefreq>{% endif %}
+{% if url.priority %}<priority>{{ url.priority }}</priority>{% endif %}
+<news:news>
+ <news:publication><news:name>Arch Linux News</news:name><news:language>en</news:language></news:publication>
+ {% if url.item.postdate %}<news:publication_date>{{ url.item.postdate|date("c") }}</news:publication_date>{% endif %}
+ {% if url.item.title %}<news:title>{{ url.item.title }}</news:title>{% endif %}
+</news:news>
+</url>{% endfor %}
+</urlset>
diff --git a/templates/sitemaps/sitemap.xml.jinja b/templates/sitemaps/sitemap.xml.jinja
new file mode 100644
index 00000000..0808a7de
--- /dev/null
+++ b/templates/sitemaps/sitemap.xml.jinja
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+{% for url in urlset %}<url>
+<loc>{{ url.location }}</loc>
+{% if url.lastmod %}<lastmod>{{ url.lastmod|date("Y-m-d") }}</lastmod>{% endif %}
+{% if url.changefreq %}<changefreq>{{ url.changefreq }}</changefreq>{% endif %}
+{% if url.priority %}<priority>{{ url.priority }}</priority>{% endif %}
+</url>{% endfor %}
+</urlset>
diff --git a/templates/todolists/list.html b/templates/todolists/list.html
index 0f1ccfd7..5cfd6a02 100644
--- a/templates/todolists/list.html
+++ b/templates/todolists/list.html
@@ -16,7 +16,10 @@
<p>Todo lists are used by the developers when a rebuild of a set of
packages is needed. This is common when a library has a version bump,
during a toolchain rebuild, or a general cleanup of packages in the
- repositories. The progress can be tracked here.</p>
+ repositories. The progress can be tracked here, and completed todo lists
+ can be browsed as well.</p>
+
+ {% include "todolists/paginator.html" %}
<table id="dev-todo-lists" class="results todo-table">
<thead>
@@ -46,6 +49,8 @@
{% endfor %}
</tbody>
</table>
+
+ {% include "todolists/paginator.html" %}
</div>
{% endblock %}
diff --git a/templates/todolists/paginator.html b/templates/todolists/paginator.html
new file mode 100644
index 00000000..3b077419
--- /dev/null
+++ b/templates/todolists/paginator.html
@@ -0,0 +1,22 @@
+{% if is_paginated %}
+<div class="pagination">
+ <p>{{ paginator.count }} todo lists, viewing page {{ page_obj.number }} of {{ paginator.num_pages }}.</p>
+ <p class="todolist-nav">
+ {% if page_obj.has_previous %}
+ <a class="prev" href="?page={{ page_obj.previous_page_number }}"
+ title="Go to previous page">&lt; Prev</a>
+ {% endif %}
+ {% for num in paginator.page_range %}
+ {% ifequal num page_obj.number %}
+ <span>{{ num }}</span>
+ {% else %}
+ <a href="?page={{ num }}" title="Go to page {{ num }}">{{ num }}</a>
+ {% endifequal %}
+ {% endfor %}
+ {% if page_obj.has_next %}
+ <a class="next" href="?page={{ page_obj.next_page_number }}"
+ title="Go to next page">Next &gt;</a>
+ {% endif %}
+ </p>
+</div>
+{% endif %}