cleanup vue debug settings

This commit is contained in:
vabene1111
2020-06-22 12:23:49 +02:00
parent 315b4521b6
commit 743d7bf608
5 changed files with 31 additions and 7 deletions

View File

@ -0,0 +1,13 @@
{% load static %}
{% load custom_tags %}
{% is_debug as DEBUG %}
{% if DEBUG %}
<script src="{% static 'js/vue.js' %}"></script>
{% else %}
<script src="{% static 'js/vue.min.js' %}"></script>
{% endif %}
<script src="{% static 'js/vue-resource.js' %}"></script>
<script src="{% static 'js/js.cookie.min.js' %}"></script>

View File

@ -6,13 +6,8 @@
{% block extra_head %}
{% if DEBUG %}
<script src="{% static 'js/vue.js' %}"></script>
{% else %}
<script src="{% static 'js/vue.min.js' %}"></script>
{% endif %}
{% include 'include/vue_base.html' %}
<script src="{% static 'js/vue-resource.js' %}"></script>
<script src="{% static 'js/moment-with-locales.min.js' %}"></script>
<script src="{% static 'js/Sortable.min.js' %}"></script>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$Title$</title>
</head>
<body>
$END$
</body>
</html>

View File

@ -8,6 +8,7 @@ from django.urls import reverse, NoReverseMatch
from cookbook.helper.mdx_attributes import MarkdownFormatExtension
from cookbook.helper.mdx_urlize import UrlizeExtension
from cookbook.models import get_model_name, CookLog
from recipes import settings
register = template.Library()
@ -66,3 +67,8 @@ def recipe_last(recipe, user):
return last.created_at
else:
return ''
@register.simple_tag
def is_debug():
return settings.DEBUG

View File

@ -148,7 +148,7 @@ def get_days_from_week(start, end):
@group_required('user')
def meal_plan(request):
return render(request, 'meal_plan.html', {'DEBUG': settings.DEBUG})
return render(request, 'meal_plan.html', {})
@group_required('user')