]> git.0d.be Git - panikdb.git/commitdiff
add settings to disable topiks
authorFrédéric Péters <fpeters@0d.be>
Sun, 3 Nov 2019 18:33:14 +0000 (19:33 +0100)
committerFrédéric Péters <fpeters@0d.be>
Sun, 3 Nov 2019 18:50:42 +0000 (19:50 +0100)
panikdb/context_processors.py
panikdb/settings.py
panikdb/templates/combo/manager_base.html

index 58641afec5910dd15a250100a5971d05e6744e2b..96926bd5766dc7553f53d93ce20286d1ab3990ec 100644 (file)
@@ -5,3 +5,8 @@ def internal_ip(request):
                request.META.get('HTTP_X_REAL_IP') or \
                request.META.get('REMOTE_ADDR')
     return {'internal_ip': internal_ip in settings.INTERNAL_IPS}
+
+def site_settings(request):
+    return {
+        'enable_topiks': settings.ENABLE_TOPIKS,
+    }
index 04223c2f9e2402c2e15fde1df0c654b10aea600d..c8d7dced2113070aba09e4b543dde92cba61bf3b 100644 (file)
@@ -108,6 +108,7 @@ TEMPLATES = [
                 'django.template.context_processors.tz',
                 'django.contrib.messages.context_processors.messages',
                 'panikdb.context_processors.internal_ip',
+                'panikdb.context_processors.site_settings',
             ],
         },
     },
@@ -257,6 +258,8 @@ TEMPLATE_VARS = {}
 FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o755
 FILE_UPLOAD_PERMISSIONS = 0o644
 
+ENABLE_TOPIKS = True
+
 try:
     from .local_settings import *
 except ImportError:
index 114451fd94b56e0129705d01e74d16f07e273078..6e0fc4271cc1dfa1d7a4c737dbd20dce3184d0ff 100644 (file)
@@ -12,6 +12,7 @@
 {% block more-user-links %}
 {{ block.super }}
 <a href="{% url 'combo-manager-homepage' %}">Pages</a>
+{% if enable_topiks %}
 {% if object|is_page %}
 {% if object|has_topik %}
   {% with object|topik_id as topik_id %}
@@ -21,6 +22,7 @@
   <a href="{% url 'make-topik' page_pk=object.id %}">Transformer en Topik</a>
 {% endif %}
 {% endif %}
+{% endif %}
 {% endblock %}
 
 {% block bodyattr %}class="combo"{% endblock %}