From 9a9b5c19d8c07026b104ed81838145454bfa9fc9 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 12 Apr 2015 17:03:20 +0200 Subject: It is now possible to add a new feed from any page via a dropdown menu. --- pyaggr3g470r/views/views.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pyaggr3g470r/views/views.py') diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py index e06e1a9d..06b234cd 100644 --- a/pyaggr3g470r/views/views.py +++ b/pyaggr3g470r/views/views.py @@ -138,6 +138,16 @@ def get_timezone(): except: return conf.TIME_ZONE["en"] +@app.context_processor +def inject_feed_form(): + """ + Injects the 'AddFeedForm' objects in all templates. + + Context processors run before the template is rendered and have the + ability to inject new values into the template context. + """ + return dict(create_feed_form=AddFeedForm()) + # # Views. # -- cgit