changeset 61:15df2b1a0e88

Articles page now displays an index with links to all articles.
author Brian Neal <bgneal@gmail.com>
date Thu, 12 Apr 2012 18:00:05 -0500
parents 2322664cf934
children 275e62422c9e
files madeira/articles/urls.py madeira/templates/articles/article_detail.html madeira/templates/articles/article_list.html
diffstat 3 files changed, 20 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/madeira/articles/urls.py	Wed Apr 11 20:27:21 2012 -0500
+++ b/madeira/articles/urls.py	Thu Apr 12 18:00:05 2012 -0500
@@ -12,7 +12,6 @@
    url(r'^$',
        ListView.as_view(
            model=Article,
-           paginate_by=10,
            context_object_name='article_list'),
        name='articles-index'),
    url(r'^(?P<pk>\d+)/$',
--- a/madeira/templates/articles/article_detail.html	Wed Apr 11 20:27:21 2012 -0500
+++ b/madeira/templates/articles/article_detail.html	Thu Apr 12 18:00:05 2012 -0500
@@ -1,19 +1,22 @@
 {% extends 'base.html' %}
+{% load url from future %}
 {% block title %}The Madeira | Press | {{ article.title }}{% endblock %}
 {% block content %}
-<h1>{{ article.title }}</h1>
+<h1>Madeira Press, Articles, &amp; Reviews</h1>
+<h2>{{ article.title }}</h2>
 <div>{{ article.text|safe }}</div>
 <div class="article-source">{{ article.source|safe }}</div>
-{% if article.url %}
-<a href="{{ article.url }}">Original article</a>
-{% endif %}
-{% if article.pdf and article.url %}
-|
-{% endif %}
-{% if article.pdf %}
-<a href="{{ article.pdf.url }}" target="_blank">Original article as PDF</a>
-<a href="http://www.adobe.com/products/acrobat/readstep2.html">
-   <img src="{{ STATIC_URL }}images/get_adobe_reader.gif" alt="Adobe Reader" title="Get Adobe Reader" border="0"
-   align="middle" /></a>
-{% endif %}
+<div>
+   {% if article.url or article.pdf %}
+   <ul>
+      {% if article.url %}
+         <li><a href="{{ article.url }}">Original article</a></li>
+      {% endif %}
+      {% if article.pdf %}
+         <li><a href="{{ article.pdf.url }}" target="_blank">Original article as PDF</a></li>
+      {% endif %}
+   </ul>
+   {% endif %}
+</div>
+<p><a href="{% url 'articles-index' %}">&laquo; Back to press index</a></p>
 {% endblock %}
--- a/madeira/templates/articles/article_list.html	Wed Apr 11 20:27:21 2012 -0500
+++ b/madeira/templates/articles/article_list.html	Thu Apr 12 18:00:05 2012 -0500
@@ -3,27 +3,12 @@
 {% block content %}
 <h1>Madeira Press, Articles, &amp; Reviews</h1>
 {% if article_list %}
+   <ul>
    {% for article in article_list %}
-      <h2><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h2>
-      <div>{{ article.text|safe }}</div>
-      <div class="article-source">{{ article.source|safe }}</div>
-      {% if article.url %}
-      <a href="{{ article.url }}" target="_blank">Original article</a>
-      {% endif %}
-      {% if article.pdf and article.url %}
-      |
-      {% endif %}
-      {% if article.pdf %}
-      <a href="{{ article.pdf.url }}">Original article as PDF</a>
-      <a href="http://www.adobe.com/products/acrobat/readstep2.html">
-         <img src="{{ STATIC_URL }}images/get_adobe_reader.gif" alt="Adobe Reader" title="Get Adobe Reader" border="0"
-         align="middle" /></a>
-      {% endif %}
+      <li><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></li>
    {% endfor %}
-
-   {% include 'pagination.html' %}
-
+   </ul>
 {% else %}
-<p>No articles at this time.</p>
+   <p>No articles at this time.</p>
 {% endif %}
 {% endblock %}