site = Site.objects.get_current()
dictionary = {
'form_tag': self.form_tag,
- 'site_name': site.name,
- 'site_domain': site.domain,
+ 'site_name': getattr(self, 'site_name', site.name),
+ 'site_domain': getattr(self, 'site_domain', site.domain),
'contact': contact,
}
context = RequestContext(request)
-{% load pretty_print from contact_tags %}Wypełniono formularz {{ form_tag }} na stronie {{ site_name }}.
+{% load pretty_print from contact_tags %}{% load subdomainurls %}Wypełniono formularz {{ form_tag }} na stronie {{ site_name }}.
-http://{{ site_domain }}{% url 'admin:contact_contact_change' contact.pk %}
+{% url 'admin:contact_contact_change' None contact.pk %}
{% for k, v in contact.body.items %}
{{ k }}:
-{% extends form.base_template|default:"base.html" %}
+{% extends base_template|default:"base.html" %}
{% load i18n %}
{% block title %}{% trans "Thank you" %}{% endblock %}
def thanks(request, form_tag):
- if form_tag not in contact_forms:
+ try:
+ form_class = contact_forms[form_tag]
+ except KeyError:
raise Http404
return render(request,
- ['contact/%s/thanks.html' % form_tag, 'contact/thanks.html']
+ ['contact/%s/thanks.html' % form_tag, 'contact/thanks.html'],
+ dict(base_template = getattr(form_class, 'base_template', None))
)
from_title = 'Mil'
submit_label = _('Submit')
base_template = 'base_mil.html'
+ site_name = site_domain = 'katalog.nowoczesnapolska.org.pl'
name = forms.CharField(label = _('Name and Surname'), max_length = 255)
contact = forms.EmailField(label = _('E-mail'), max_length = 255)