From 3cf8da647eb7fd6db15b1d51202ec03718cfdd72 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 12 Apr 2015 18:50:06 +0200 Subject: Do not display the search button on Heroku. --- pyaggr3g470r/templates/layout.html | 4 +++- pyaggr3g470r/templates/management.html | 2 +- pyaggr3g470r/views/views.py | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/templates/layout.html b/pyaggr3g470r/templates/layout.html index 5aa62c3e..b5259d3b 100644 --- a/pyaggr3g470r/templates/layout.html +++ b/pyaggr3g470r/templates/layout.html @@ -65,7 +65,7 @@ {% else %}
  • {{ _('Favorites') }}
  • {% endif %} - {% if not conf.ON_HEROKU or g.user.is_admin() %} + {% if not ON_HEROKU or g.user.is_admin() %}
  • {{ _('Fetch') }}
  • {% endif %}
  • {{ _('Logout') }}
  • + {% if not ON_HEROKU %} + {% endif %} {% else %}
  •  {{ _('About') }}
  • {% endif %} diff --git a/pyaggr3g470r/templates/management.html b/pyaggr3g470r/templates/management.html index b9d02de5..b28267f8 100644 --- a/pyaggr3g470r/templates/management.html +++ b/pyaggr3g470r/templates/management.html @@ -5,7 +5,7 @@

    {{ _('Your subscriptions') }}

    {{ _('You are subscribed to') }} {{ nb_feeds }} {{ _('feeds') }}. {{ _('Add a') }} {{ _('feed') }}.

    {{ nb_articles }} {{ _('articles are stored in the database with') }} {{ nb_unread_articles }} {{ _('unread articles') }}.

    - {% if not_on_heroku %} + {% if not conf.ON_HEROKU %} {{ _('Index database') }} {% endif %} {{ _('Delete articles older than 10 weeks') }} diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py index 06b234cd..fa6bd2a0 100644 --- a/pyaggr3g470r/views/views.py +++ b/pyaggr3g470r/views/views.py @@ -146,7 +146,8 @@ def inject_feed_form(): 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()) + return dict(create_feed_form=AddFeedForm(), + on_HEROKU=conf.ON_HEROKU) # # Views. @@ -539,8 +540,8 @@ def management(): nb_articles = articles.count() nb_unread_articles = articles.filter(Article.readed == False).count() return render_template('management.html', user=g.user, form=form, - nb_feeds=nb_feeds, nb_articles=nb_articles, nb_unread_articles=nb_unread_articles, - not_on_heroku = not conf.ON_HEROKU) + nb_feeds=nb_feeds, nb_articles=nb_articles, + nb_unread_articles=nb_unread_articles) @app.route('/history', methods=['GET']) @app.route('/history/', methods=['GET']) -- cgit