Commit 503ca7040495c48e14a815eb6e3c266be8227f24

Authored by Sergio Oliveira
1 parent a5af9f38

Allowing to disable feedzilla

colab/planet/context_processors.py 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +
  2 +from django.conf import settings
  3 +
  4 +
  5 +def feedzilla(request):
  6 + return {'feedzilla': getattr(settings, 'FEEDZILLA_ENABLED', False)}
colab/settings.py
@@ -51,6 +51,7 @@ INSTALLED_APPS = ( @@ -51,6 +51,7 @@ INSTALLED_APPS = (
51 'i18n_model', 51 'i18n_model',
52 'mptt', 52 'mptt',
53 'dpaste', 53 'dpaste',
  54 + 'taggit',
54 55
55 # Own apps 56 # Own apps
56 'colab.home', 57 'colab.home',
@@ -61,11 +62,6 @@ INSTALLED_APPS = ( @@ -61,11 +62,6 @@ INSTALLED_APPS = (
61 'colab.search', 62 'colab.search',
62 'colab.badger', 63 'colab.badger',
63 'colab.tz', 64 'colab.tz',
64 -  
65 - # Feedzilla and deps  
66 - 'feedzilla',  
67 - 'taggit',  
68 - 'common',  
69 ) 65 )
70 66
71 ROOT_URLCONF = 'colab.urls' 67 ROOT_URLCONF = 'colab.urls'
@@ -202,6 +198,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( @@ -202,6 +198,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
202 'colab.proxy.context_processors.proxied_apps', 198 'colab.proxy.context_processors.proxied_apps',
203 'colab.home.context_processors.robots', 199 'colab.home.context_processors.robots',
204 'colab.home.context_processors.ribbon', 200 'colab.home.context_processors.ribbon',
  201 + 'colab.planet.context_processors.feedzilla',
205 ) 202 )
206 203
207 MIDDLEWARE_CLASSES = ( 204 MIDDLEWARE_CLASSES = (
@@ -252,6 +249,8 @@ FEEDZILLA_PAGE_SIZE = 5 @@ -252,6 +249,8 @@ FEEDZILLA_PAGE_SIZE = 5
252 FEEDZILLA_SITE_TITLE = _(u'Planet Colab') 249 FEEDZILLA_SITE_TITLE = _(u'Planet Colab')
253 FEEDZILLA_SITE_DESCRIPTION = _(u'Colab blog aggregator') 250 FEEDZILLA_SITE_DESCRIPTION = _(u'Colab blog aggregator')
254 251
  252 +FEEDZILLA_ENABLED = True
  253 +
255 # Mailman API settings 254 # Mailman API settings
256 MAILMAN_API_URL = 'http://localhost:9000' 255 MAILMAN_API_URL = 'http://localhost:9000'
257 256
@@ -301,6 +300,13 @@ if locals().get('RAVEN_DSN', False): @@ -301,6 +300,13 @@ if locals().get('RAVEN_DSN', False):
301 } 300 }
302 INSTALLED_APPS += ('raven.contrib.django.raven_compat',) 301 INSTALLED_APPS += ('raven.contrib.django.raven_compat',)
303 302
  303 +if FEEDZILLA_ENABLED:
  304 + INSTALLED_APPS += (
  305 + # Feedzilla and deps
  306 + 'feedzilla',
  307 + 'common',
  308 + )
  309 +
304 proxied_apps = locals().get('PROXIED_APPS') or {} 310 proxied_apps = locals().get('PROXIED_APPS') or {}
305 for app_label in proxied_apps.keys(): 311 for app_label in proxied_apps.keys():
306 INSTALLED_APPS += ('colab.proxy.{}'.format(app_label),) 312 INSTALLED_APPS += ('colab.proxy.{}'.format(app_label),)
colab/templates/base.html
@@ -91,9 +91,13 @@ @@ -91,9 +91,13 @@
91 <li> 91 <li>
92 <a href="{% url 'thread_list' %}">{% trans "Groups" %}</a> 92 <a href="{% url 'thread_list' %}">{% trans "Groups" %}</a>
93 </li> 93 </li>
  94 +
  95 + {% if feedzilla %}
94 <li> 96 <li>
95 <a href="{% url "feedzilla_index" %}">{% trans "Blogs" %}</a> 97 <a href="{% url "feedzilla_index" %}">{% trans "Blogs" %}</a>
96 </li> 98 </li>
  99 + {% endif %}
  100 +
97 {% if proxy.gitlab %} 101 {% if proxy.gitlab %}
98 <li class="dropdown"> 102 <li class="dropdown">
99 <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Repository" %} <b class="caret"></b></a> 103 <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Repository" %} <b class="caret"></b></a>