Permalink
Browse files

Merge pull request #113 from rossbruniges/dev

Adding in support for 'sticky' posts
  • Loading branch information...
2 parents 59cf974 + d90e9ab commit 66ac338353844f04523b1bd647af4a98006cf5c6 @rossbruniges rossbruniges committed Nov 16, 2012
Showing with 25 additions and 1 deletion.
  1. +8 −1 apps/ignite_resources/views.py
  2. +17 −0 templates_ignite/ignite_resources/object_list.html
View
9 apps/ignite_resources/views.py
@@ -9,15 +9,22 @@
def object_list(request, template='ignite_resources/object_list.html'):
"""Lists the current resources"""
+ sticky = Resource.objects.filter(
+ status=Resource.PUBLISHED,
+ resource_type=2,
+ is_featured=True
+ ).order_by('title')
labs = Resource.objects.filter(
status=Resource.PUBLISHED,
- resource_type=2
+ resource_type=2,
+ is_featured=False
).order_by('-created')
links = Resource.objects.filter(
status=Resource.PUBLISHED,
resource_type=1
).order_by('title')
context = {
+ 'sticky': sticky,
'labs': labs,
'links': links
}
View
17 templates_ignite/ignite_resources/object_list.html
@@ -18,6 +18,23 @@ <h2 class="wimper">Index</h2>
<div class="col box main">
<section id="learning-labs">
<h2>Ignite Learning Labs</h2>
+ <ul class="sticky">
+ {% for stick in sticky %}
+ <li>
+ <article>
+ <a href="/resources/labs/{{ stick.slug }}/">
+ {% if stick.thumbnail %}
+ <div class="frame box">
+ <img src="{{ stick.get_image_src() }}" alt="" />
+ </div>
+ {% endif %}
+ <h3>{{ stick.title }}</h3>
+ </a>
+ <p>{{ stick.body|safe }}</p>
+ </article>
+ </li>
+ {% endfor %}
+ </ul>
<ul>
{% for lab in labs %}
<li>

0 comments on commit 66ac338

Please sign in to comment.