Commit a0bc11a1 authored by Simon Daron's avatar Simon Daron
Browse files

News view extend news

parent 09270903
......@@ -22,7 +22,7 @@ urlpatterns = patterns('',
url(r'^get$', 'panikweb.views.get', name='get'),
url(r'^listen$', 'panikweb.views.listen', name='listen'),
url(r'^news/$', 'panikweb.views.news', name='news'),
url(r'^news/(?P<slug>[\w,-]+)$', 'panikweb.views.newsitem', name='news-view'),
url(r'^news/(?P<slug>[\w,-]+)$', 'panikweb.views.newsitemview', name='news-view'),
url(r'^search/', 'panikweb.search.view', name='search'),
......
......@@ -364,15 +364,15 @@ class Home(TemplateView):
home = Home.as_view()
class NewsItemDetailView(DetailView):
class NewsItemView(DetailView):
model = NewsItem
def get_context_data(self, **kwargs):
context = super(NewsItemView, self).get_context_data(**kwargs)
context['sectionName'] = "News"
context = super(NewsItemDetailView, self).get_context_data(**kwargs)
context['news'] = list(NewsItem.objects.all().order_by('-datetime')[:60])
context['categories'] = list(NewsCategory.objects.all())
return context
newsitem = NewsItemDetailView.as_view()
newsitemview = NewsItemView.as_view()
class News(TemplateView):
template_name = 'news.html'
......
......@@ -6,6 +6,10 @@
<span class="icon-home" ></span>
<span class="iconLabel">Home</span>
</a></li>
<li><a href="{% url 'news' %}">
<span class="icon-bullhorn" ></span>
<span class="iconLabel">News</span>
</a></li>
<li><a href="{% url 'listen' %}">
<span class="icon-headphones" ></span>
<span class="iconLabel">Listen</span>
......@@ -17,10 +21,6 @@
<!--
-->
<!--
<li><a href="{% url 'news' %}">
<span class="icon-group" ></span>
<span class="iconLabel">News</span>
</a></li>
<li><a href="{% url 'grid' %}">
<span class="icon-th-large" ></span>
<span class="iconLabel">Grid</span>
......
......@@ -15,8 +15,9 @@
</div>
{% endblock %}
{% block links %}
<div class="wrapper">
<ul class="news columns padded">
<div class="wrapper">
<div class="padded ">
<ul class="news columns padded list custom">
{% for NewsItem in news %}
<li class="item ellipsis small ">
<a href="{% url 'news-view' slug=NewsItem.slug %}">
......@@ -26,4 +27,5 @@
{% endfor %}
</ul>
</div>
</div>
{% endblock %}
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