Commit eaf0cda4 authored by Simon Daron's avatar Simon Daron

merging...

parents e77c2629 dd741b96
import email.utils
import datetime
import re
import time
import urllib2
import uuid
......@@ -185,3 +188,10 @@ class FormatSearchResultNode(template.Node):
@register.inclusion_tag('includes/piwik.html')
def piwik():
return {'enabled': settings.ENABLE_PIWIK}
@register.filter
def rfc822(datetime):
if datetime is None:
return ''
return email.utils.formatdate(time.mktime(datetime.timetuple()))
......@@ -26,6 +26,9 @@ urlpatterns = patterns('',
url(r'^search/', 'panikweb.search.view', name='search'),
url(r'^podcasts.rss', 'panikweb.views.podcasts_feed', name='podcasts-feed'),
url(r'^newsletter/', include('newsletter.urls')),
(r'^api/v2/', include('fiber.rest_api.urls')),
(r'^admin/fiber/', include('fiber.admin_urls')),
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', {'packages': ('fiber',),}),
......
......@@ -404,7 +404,7 @@ class Archives(TemplateView):
def get_context_data(self, **kwargs):
context = super(Archives, self).get_context_data(**kwargs)
context['sectionName'] = "Emissions"
context['emissions'] = Emission.objects.all().filter(archived=True).order_by('title')
context['emissions'] = Emission.objects.prefetch_related('categories').filter(archived=True).order_by('title')
return context
archives = Archives.as_view()
......@@ -478,3 +478,17 @@ class NewsItemDetailView(DetailView):
model = NewsItem
newsitem = NewsItemDetailView.as_view()
class PodcastsFeedView(TemplateView):
template_name = 'podcasts.html'
content_type = 'application/rss+xml'
def get_context_data(self, **kwargs):
context = super(PodcastsFeedView, self).get_context_data(**kwargs)
context['base_url'] = self.request.build_absolute_uri('/')[:-1]
context['soundfiles'] = SoundFile.objects.select_related().filter(
podcastable=True).order_by('-creation_timestamp')
return context
podcasts_feed = PodcastsFeedView.as_view()
......@@ -835,3 +835,18 @@ div.program span.nonstop {
font-size: 80%;
color:#CCC;
}
#subscribe-form {
position: relative;
}
#subscribe-form ul.errorlist {
position: absolute;
bottom: -2em;
text-align: center;
display: block;
width: 100%;
padding: 0;
list-style: none;
color: #800;
}
......@@ -200,6 +200,9 @@ $(function() {
$('[data-toggle].icon-check-empty').each(function(){
$(this).trigger('uncheck');
});
if ($('input#id_q').val() == '') {
$('input#id_q').focus();
}
}
init();
});
{% extends "emissions.html" %}
{% load paniktags %}
{% block bodyID %}Emissions{% endblock %}
{% block title %}Archives{% endblock %}
{% block nav %}
{% emission_nav with klass="archives" %}
{% endblock %}
......@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8" />
<title>Radio Panik {% block title %}{% endblock %}</title>
<title>Radio Panik - {% block title %}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="{{ STATIC_URL }}img/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="{{ STATIC_URL}}img/touch-icon.png">
......
{% extends "base.html" %}
{% load paniktags %}
{% block bodyID %}Emissions{% endblock %}
{% block title %}Emissions{% endblock %}
{% block title %}Émissions{% endblock %}
{% block nav %}
{% emission_nav with klass="emissions" %}
{% endblock %}
......
......@@ -3,6 +3,7 @@
{% load thumbnails %}
{% load staticfiles %}
{% block bodyID %}Emissions{% endblock %}
{% block title %}{{ emission.title }}{% endblock %}
{% block nav %}
{% emission_nav %}
{% endblock %}
......
{% extends "emissions/emission_detail.html" %}
{% load paniktags %}
{% load thumbnails %}
{% load staticfiles %}
{% block title %}{{ episode.title }} - {{ episode.emission.title }} {% endblock %}
{% block main %}
<div class="wrapper {% if episodes %}sided{% endif %}">
<div id="Emission-container" class="emission padded">
......
......@@ -4,7 +4,7 @@
<ul class="inline">
<li><a href="{% url 'emissions' %}" class="{% if class != "program" and class != "grid" and class != "archives" %}active{% endif %}">
<span class="icon-microphone" ></span>
<span class="iconLabel">Emissions</span>
<span class="iconLabel">Émissions</span>
</a></li>
<li><a href="{% url 'program' %}" class="{% if class = "program" %}active{% endif %}">
<span class="icon-calendar" ></span>
......@@ -62,7 +62,8 @@
<a href="{% url 'emission-view' slug=emission.slug %}">En bref</a>
</li>
<li>
<a href="{% url 'emissionEpisodes' slug=emission.slug %}">Episodes ({{ episodes.count }})</a>
<a href="{% url 'emissionEpisodes' slug=emission.slug %}">Épisodes ({{ episodes.count }})</a>
</li>
</ul>
</nav>
......
{% extends "news.html" %}
{% load thumbnails %}
{% load paniktags %}
{% block title %}{{ newsitem.title }}{% endblock %}
{% block nav %}
{% news_nav %}
{% endblock %}
......
......@@ -34,7 +34,7 @@
{% endblock %}
{% block links %}
<div class="wrapper padded">
<h2>Emissions</h2>
<h2>Émissions</h2>
<ul class="custom list columns padded">
{% for emission in emissions %}
<li class="item ellipsis">
......
Abonnement aux actus de Radio Panik, demande de confirmation
{% extends "base.html" %}
{% block title %}Newsletter{% endblock %}
{% block main %}
<div class="padded">
<p>
Et voilà, c'est fait.
</p>
</div>
{% endblock %}
{% extends "base.html" %}
{% block title %}Newsletter{% endblock %}
{% block main %}
<div class="padded">
<form method="post" class="big center" id="subscribe-form">
<p>
Tous les lundis, l'actualité de Radio Panik.
</p>
{% csrf_token %}
{{ form.as_table }}
<button>S'abonner</button>
</form>
</div>
{% endblock %}
{% extends "base.html" %}
{% block title %}Newsletter{% endblock %}
{% block main %}
<div class="padded">
<p>
Un courriel de confirmation vous a été envoyé; suivez l'adresse qui y
est contenue pour valider votre abonnement.
</p>
</div>
{% endblock %}
{% load paniktags %}{% load soundfiles %}<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>Radio Panik{% if title %} - {{ title }}{% endif %}</title>
<link>{{ base_url }}</link>
<description></description>
<lastBuildDate>{{ soundfiles.0.creation_timestamp|rfc822 }}</lastBuildDate>
{% for soundfile in soundfiles|slice:":20" %}<item>
<title>{% if soundfile.fragment %}{{ soundfile.title }} - {% endif %}{{ soundfile.episode.title }}</title>
<link>{{ base_url }}{% url 'episode-view' slug=soundfile.episode.slug emission_slug=soundfile.episode.emission.slug %}</link>
<description>{{ soundfile.episode.text|striptags }}</description>
<enclosure url="{{ base_url }}{{ soundfile|format_url:'mp3' }}" length="{{ soundfile|format_length:'mp3' }}" type="audio/mpeg"/>
<guid>{{ base_url }}{{ soundfile.episode.get_absolute_url }}#{{ soundfile.id }}</guid>
<pubDate>{{ soundfile.episode.creation_timestamp|rfc822 }}</pubDate>
</item>
{% endfor %}
</channel>
</rss>
{% extends "base.html" %}
{% load fiber_tags %}
{% block player-class %}small-player{% endblock %}
{% block title %}{{ fiber_page.title }}{% endblock %}
{% block nav %}
<div id="fiber-nav">
......
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