Commit 0d3d354d authored by fred's avatar fred

add newsletter subscribe form to home page

parent d03ca156
......@@ -19,6 +19,8 @@ from emissions.models import Category, Emission, Episode, Diffusion, SoundFile,
from emissions.utils import whatsonair, period_program
from newsletter.forms import SubscribeForm
from . import utils
......@@ -428,6 +430,8 @@ class Home(TemplateView):
for episode in context['episodes']:
episode.main_sound = soundfiles.get(episode.id)
context['newsletter_form'] = SubscribeForm()
return context
home = Home.as_view()
......
......@@ -14,6 +14,15 @@
<h2><a href="{% url 'program' %}">Cette semaine sur Panik</a></h2>
{% weekview %}
</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 %}
{% block related %}
<div class="wrapper">
......
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