Changeset - 5368c0a8b784
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 8 years ago 2015-12-18 20:06:57
bkuhn@ebb.org
Actually implement up to 5 blogs in template.

The early change to frontpage.py was not sufficient; the template
obviously needs to make use of those five blog posts as well.

Note the cascading effect here. We only put lots on the front page if
they are recent.
1 file changed with 41 insertions and 1 deletions:
0 comments (0 inline, 0 general)
www/conservancy/templates/frontpage.html
Show inline comments
...
 
@@ -96,14 +96,54 @@
 
<p><span class="continued"><a href="{{ blog.0.get_absolute_url }}">Read More from {{ blog.0.author.casual_name }} on this&hellip;</a></span></p>
 
{% if blog.1.is_recent %}
 
<hr/>
 
<h3><a href="{{ blog.1.get_absolute_url }}">{{ blog.1.headline|safe }}</a></h3>
 
<p class="date">Posted by {{ blog.1.author.formal_name }} on {{ blog.1.pub_date|date:"F j, Y" }}</p>
 
{{ blog.1.summary|safe }}
 
<p><span class="continued"><a href="{{ blog.0.get_absolute_url }}">Read More from {{ blog.1.author.casual_name }} on this&hellip;</a></span></p>
 
<p><span class="continued"><a href="{{ blog.1.get_absolute_url }}">Read More from {{ blog.1.author.casual_name }} on this&hellip;</a></span></p>
 
{% endif %}
 
{% if blog.2.is_recent %}
 
{% if blog.2.pub_date|date_within_past_days:20 %}
 
<hr/>
 
<h3><a href="{{ blog.2.get_absolute_url }}">{{ blog.2.headline|safe }}</a></h3>
 
<p class="date">Posted by {{ blog.2.author.formal_name }} on {{ blog.2.pub_date|date:"F j, Y" }}</p>
 
{{ blog.1.summary|safe }}
 
<p><span class="continued"><a href="{{ blog.2.get_absolute_url }}">Read More from {{ blog.2.author.casual_name }} on this&hellip;</a></span></p>
 
{% endif %}
 
{% endif %}
 

	
 
{% if blog.3.is_recent %}
 
{% if blog.3.pub_date|date_within_past_days:15 %}
 
<hr/>
 
<h3><a href="{{ blog.3.get_absolute_url }}">{{ blog.3.headline|safe }}</a></h3>
 
<p class="date">Posted by {{ blog.3.author.formal_name }} on {{ blog.3.pub_date|date:"F j, Y" }}</p>
 
{{ blog.1.summary|safe }}
 
<p><span class="continued"><a href="{{ blog.3.get_absolute_url }}">Read More from {{ blog.3.author.casual_name }} on this&hellip;</a></span></p>
 
{% endif %}
 
{% endif %}
 

	
 
{% if blog.4.is_recent %}
 
{% if blog.4.pub_date|date_within_past_days:10 %}
 
<hr/>
 
<h3><a href="{{ blog.4.get_absolute_url }}">{{ blog.4.headline|safe }}</a></h3>
 
<p class="date">Posted by {{ blog.4.author.formal_name }} on {{ blog.4.pub_date|date:"F j, Y" }}</p>
 
{{ blog.1.summary|safe }}
 
<p><span class="continued"><a href="{{ blog.4.get_absolute_url }}">Read More from {{ blog.4.author.casual_name }} on this&hellip;</a></span></p>
 
{% endif %}
 
{% endif %}
 

	
 
{% if blog.5.is_recent %}
 
{% if blog.5.pub_date|date_within_past_days:7 %}
 
<hr/>
 
<h3><a href="{{ blog.5.get_absolute_url }}">{{ blog.5.headline|safe }}</a></h3>
 
<p class="date">Posted by {{ blog.5.author.formal_name }} on {{ blog.5.pub_date|date:"F j, Y" }}</p>
 
{{ blog.1.summary|safe }}
 
<p><span class="continued"><a href="{{ blog.5.get_absolute_url }}">Read More from {{ blog.5.author.casual_name }} on this&hellip;</a></span></p>
 
{% endif %}
 
{% endif %}
 

	
 
</div>
 
{% endif %}
 
<p><span class="continued"><a href="/blog/">Conservancy Blog Archive&hellip;</a></span></p>
 
</div>
 
</div>
 
{% endblock %}
0 comments (0 inline, 0 general)