diff --git a/context_processors.py b/context_processors.py index 0f6834c..4418487 100644 --- a/context_processors.py +++ b/context_processors.py @@ -36,3 +36,13 @@ """ This function is a wrapper to render the Mailman Theme Variable from Settings """ return {"MAILMAN_THEME":MAILMAN_THEME} + +def extend_ajax(request): + """ This function checks if the request was made using AJAX + Using Ajax template_extend will base_ajax.html else it will be base.html + """ + if request.is_ajax(): + extend_template = "mailman-django/base_ajax.html" + else: + extend_template = "mailman-django/base.html" + return {"extend_template":extend_template} diff --git a/templates/mailman-django/base_ajax.html b/templates/mailman-django/base_ajax.html new file mode 100644 index 0000000..75ddf24 --- /dev/null +++ b/templates/mailman-django/base_ajax.html @@ -0,0 +1,3 @@ + +{% load i18n %} + {% block header%}{% endblock %} diff --git a/templates/mailman-django/domain_index.html b/templates/mailman-django/domain_index.html new file mode 100644 index 0000000..3d943bc --- /dev/null +++ b/templates/mailman-django/domain_index.html @@ -0,0 +1,41 @@ +{% extends "mailman-django/base.html" %} +{% load i18n %} + +{% block heading %} + {% trans "Add a new Domain" %} +{% endblock %} + +{% block smallBoxLeft %} + {% for domain in domains %} +