Commit 0d3d354d authored by fred's avatar fred
Browse files

add newsletter subscribe form to home page

parent d03ca156
...@@ -19,6 +19,8 @@ from emissions.models import Category, Emission, Episode, Diffusion, SoundFile, ...@@ -19,6 +19,8 @@ from emissions.models import Category, Emission, Episode, Diffusion, SoundFile,
from emissions.utils import whatsonair, period_program from emissions.utils import whatsonair, period_program
from newsletter.forms import SubscribeForm
from . import utils from . import utils
...@@ -428,6 +430,8 @@ class Home(TemplateView): ...@@ -428,6 +430,8 @@ class Home(TemplateView):
for episode in context['episodes']: for episode in context['episodes']:
episode.main_sound = soundfiles.get(episode.id) episode.main_sound = soundfiles.get(episode.id)
context['newsletter_form'] = SubscribeForm()
return context return context
home = Home.as_view() home = Home.as_view()
......
...@@ -14,6 +14,15 @@ ...@@ -14,6 +14,15 @@
<h2><a href="{% url 'program' %}">Cette semaine sur Panik</a></h2> <h2><a href="{% url 'program' %}">Cette semaine sur Panik</a></h2>
{% weekview %} {% weekview %}
</div> </div>
<div class="padded">
<form method="post" action="{% url 'newsletter-subscribe' %}" class="big center" id="subscribe-form">
<p>Tous les lundis, l'actualité de la semaine de Panik :</p>
{% csrf_token %}
{{ newsletter_form.as_table }}
<button>M'inscrire</button>
</form>
</div>
{% endblock %} {% endblock %}
{% block related %} {% block related %}
<div class="wrapper"> <div class="wrapper">
......
Bla bla bla. Bla bla bla.
Token : {{ token }} Confirmez l'abonnement en suivant ce lien :
http://www.radiopanik.org{% url 'newsletter-confirmation' token=token %}
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