Commit 5b1088c6 authored by fred's avatar fred

topiks: use a flat list for pages

parent 2fbe0105
......@@ -16,6 +16,8 @@ from datetime import datetime, timedelta
from emissions.models import Emission, Episode, NewsItem, SoundFile, Focus
from emissions.utils import period_program
from panikombo.models import Topik
from panikweb import utils
from panikweb import search
......@@ -348,3 +350,13 @@ def get_focus_url(object):
@register.filter
def facet_tag(tag):
return tag.name
@register.filter
def image_file(page):
try:
matching_topik = Topik.objects.get(page=page)
return matching_topik.image
except Topik.DoesNotExist:
pass
return None
......@@ -19,8 +19,20 @@
{% endif %}
<div class="text">{% placeholder "content" %}</div>
</div>
<div id="fiber-nav" class="sub rightPart custom marged">
{% block menu %}{% show_menu level=1 depth=2 %}{% endblock %}
<div class="sub rightPart custom marged">
<ul class="custom list">
{% for page in page.get_parents_and_self.0.get_children %}
{% if page.public and not page.exclude_from_navigation %}
{% if page.has_children %}
{% for subpage in page.get_children %}
{% include "combo/topik_menu_item.html" with page=subpage only %}
{% endfor %}
{% else %}
{% include "combo/topik_menu_item.html" with page=page only %}
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% placeholder "sidebar" %}
</div>
</div>
......
{% load combo paniktags thumbnail %}
<li class="item">
<div class="topik inline cf">
<div class="logo">
{% with page|image_file as logo %}
{% if logo %}
{% thumbnail logo "60x60" crop="50% 25%" as im %}
<img width="60" height="60" src="{{im.url}}"/>
{% endthumbnail %}
{% else %}
<img src="/static/img/sound.png" width="60" height="60">
{% endif %}
{% endwith %}
</div>
<div class="content">
<div class="title">
<h5 class="title"><a href="{{page.get_online_url}}">{{page.title}}</a></h5>
</div>
<div class="smooth metas">
<span class="categories">{{page.title}}</span>
</div>
</div>
</div>
</li>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment