diff --git a/extras/website/website/static/css/style.css b/extras/website/website/static/css/style.css index 6c236ee66..08a401717 100755 --- a/extras/website/website/static/css/style.css +++ b/extras/website/website/static/css/style.css @@ -125,3 +125,26 @@ footer a:hover { color: #FFFFFF; text-decoration: underline; } + +ul.errorlist { + margin: 0; + padding: 0; + list-style: none outside none; +} +.errorlist li { + color: #DA3939; + font-size: 9px; + font-style: italic; + height: 13px; + padding: 0; +} +form .error { + color: #DA3939; + font-weight: bold; +} +form p.error { + margin-top: 0; +} +form .error input, form .error textarea { + border: 1px solid #DA3939; +} diff --git a/extras/website/website/templates/contact.html b/extras/website/website/templates/contact.html index 1d0895361..f88500af1 100644 --- a/extras/website/website/templates/contact.html +++ b/extras/website/website/templates/contact.html @@ -13,6 +13,12 @@ Kontaktmöglichkeiten zur OpenSlides Community {% block content %} +
+OpenSlides bietet öffentliche Mailinglisten zur Koordination der Entwicklung @@ -71,4 +77,4 @@ Kanal: #openslides
Bitte nutzen Sie unser Ticketsystem um Problem mit OpenSlides zu berichten.
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/extras/website/website/urls.py b/extras/website/website/urls.py index f7cc764e8..75aae77eb 100644 --- a/extras/website/website/urls.py +++ b/extras/website/website/urls.py @@ -1,6 +1,7 @@ from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.views.generic import TemplateView +from website import views #from views import TemplateView # Uncomment the next two lines to enable the admin: @@ -18,7 +19,8 @@ urlpatterns = i18n_patterns('', url(r'^download/$', TemplateView.as_view(template_name="download.html"), name='download',), url(r'^support/$', TemplateView.as_view(template_name="support.html"), name='support',), url(r'^development/$', TemplateView.as_view(template_name="development.html"), name='development',), - url(r'^contact/$', TemplateView.as_view(template_name="contact.html"), name='contact',), + url(r'^contact/$', 'website.views.contact', name='contact',), + #url(r'^contact/$', TemplateView.as_view(template_name="contact.html"), name='contact',), url(r'^demo/$', TemplateView.as_view(template_name="demo.html"), name='demo',), url(r'^impressum/$', TemplateView.as_view(template_name="impressum.html"), name='impressum',), ) diff --git a/extras/website/website/utils.py b/extras/website/website/utils.py deleted file mode 100644 index 62815b463..000000000 --- a/extras/website/website/utils.py +++ /dev/null @@ -1,7 +0,0 @@ - -# Oskar -class TemplateView(_TemplateView): - def get_context_data(self, **kwargs): - context = super(TemplateView, self).get_context_data(**kwargs) - context[request] = self.request - return context \ No newline at end of file diff --git a/extras/website/website/views.py b/extras/website/website/views.py index 76b50a6bf..11e935f80 100644 --- a/extras/website/website/views.py +++ b/extras/website/website/views.py @@ -1,9 +1,34 @@ -from django.views.generic import TemplateView +#from django.views.generic import TemplateView +from django.shortcuts import render_to_response, render +from django.http import HttpResponseRedirect -class TemplateView(): +from website.forms import ContactForm - def get_context_data(self, **kwargs): - context = super(TemplateView, self).get_context_data(**kwargs) - print self.request -# template_manipulation.send(sender=self.__class__, request=self.request, context=context) - return context \ No newline at end of file +#class TemplateView(TemplateView): +# def get_context_data(self, **kwargs): +# context = super(TemplateView, self).get_context_data(**kwargs) +# context[request] = self.request +# return context + + +def contact(request): + if request.method == 'POST': # If the form has been submitted... + form = ContactForm(request.POST) # A form bound to the POST data + if form.is_valid(): # All validation rules pass + subject = form.cleaned_data['subject'] + message = form.cleaned_data['message'] + sender = form.cleaned_data['sender'] + cc_myself = form.cleaned_data['cc_myself'] + recipients = ['emanuel@intevation.de'] + if cc_myself: + recipients.append(sender) + + from django.core.mail import send_mail + send_mail(subject, message, sender, recipients) + return HttpResponseRedirect('/demo/') # Redirect after POST + else: + form = ContactForm() # An unbound form + + return render(request, 'contact.html', { + 'form': form, + })