-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from maykinmedia/develop
Develop to master
- Loading branch information
Showing
7 changed files
with
90 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends "admin/change_form.html" %} | ||
|
||
|
||
{% block extrahead %} | ||
{{ block.super }} | ||
<script> | ||
django.jQuery(document).ready(function() { | ||
$('#id_template_type').change(function(){ | ||
$.get('{% url "mail_editor:template_variables" original.template_type %}', function(data, textStatus, jqXHR) { | ||
$('.field-get_variable_help_text').innerHTML = data | ||
}); | ||
}); | ||
}); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.conf.urls import url | ||
|
||
from .views import TemplateVariableView | ||
|
||
# Add app_name to support django 2.0+ | ||
app_name = "mail_editor" | ||
|
||
urlpatterns = [ | ||
url(r'^(?P<template_type>[-\w]+)/$', TemplateVariableView.as_view(), name='template_variables'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.http import HttpResponse | ||
from django.views.generic import View | ||
|
||
from .utils import variable_help_text | ||
|
||
|
||
class TemplateVariableView(View): | ||
def get(self, request, *args, **kwargs): | ||
variables = variable_help_text(kwargs.get('template_type')) | ||
return HttpResponse(variables) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters