Merge lp:~franku/widelands-website/new_legal_notice_page into lp:widelands-website

Proposed by kaputtnik
Status: Merged
Merged at revision: 401
Proposed branch: lp:~franku/widelands-website/new_legal_notice_page
Merge into: lp:widelands-website
Diff against target: 232 lines (+132/-8)
8 files modified
mainpage/forms.py (+6/-1)
mainpage/views.py (+39/-4)
media/css/base.css (+2/-2)
settings.py (+9/-0)
templates/footer.html (+2/-1)
templates/mainpage/legal_notice.html (+56/-0)
templates/mainpage/legal_notice_thanks.html (+16/-0)
urls.py (+2/-0)
To merge this branch: bzr merge lp:~franku/widelands-website/new_legal_notice_page
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+268973@code.launchpad.net

Description of the change

This branch contains changes for an additional legal notice page for the website.

Added two pages:
1. legal notice page with possibility to send an inquiry to some recipients without an account on widelands.org
2. A "thanks for inquiry" page, which is seen if an inquiry has been send

- Link to legal notice page is available over the footer (so it is available on all pages)
- The recipients where the inquiry of the form is send to is defined in settings.py with "INQUIRY_RECIPIENTS =". Currently i have my Email in there, but this should be completed/replaced with an address of a mailing list. Currently you could leave my address and complete it with your email if you want. In future it should only be the email address of a mailing list. This setting could also be in "local_settings.py".
- Changed the colour of errormessages to a more comfortable red.

Because my english is a german english, the text may have to be adjusted :-D

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Can you make the list of email adresse a setting like the list of admins?

Revision history for this message
kaputtnik (franku) wrote :

Do you mean to use a tuple like ('name', 'emailaddress')?

This should be doable.

399. By kaputtnik

recipients as name/adress

Revision history for this message
kaputtnik (franku) wrote :

Now INQUIRY_RECIPIENTS is used to have ('name','email address'). The email part is not checked for validity.

I changed also the code to gather the "message" information.

Revision history for this message
SirVer (sirver) wrote :

looks good. thanks for looking into that. I will try to merge this this week and fill in my remaining contact data.

review: Approve
Revision history for this message
SirVer (sirver) wrote :

took me forever to get around to this, but now it is merged!! thanks for doing this.

I reworded some of the english on the legal notice page and fixed a bug (import of EMAIL_BACKEND) .

Revision history for this message
GunChleoc (gunchleoc) wrote :

Some proofreading - sorry I didn't see this before.

There are no financial goal or interest. => There is no financial goal or interest.

It is customary to use Title Case in English: Project lead => Project Lead

There are several possibilities to get in contact. For questions about the game or the contents of the website please take a look at our Contact page or post in the forums. Use the one of the following methods if you do not want to make an account:

=>

There are several possibilities to get in contact with us. For questions about the game or the contents of the website, please take a look at our Contact page or post in the forums. Use one of the following methods if you do not want to create an account:

Revision history for this message
kaputtnik (franku) wrote :

Shall i add the corrections to the current merge proposal?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mainpage/forms.py'
2--- mainpage/forms.py 2010-01-02 22:28:51 +0000
3+++ mainpage/forms.py 2015-08-27 16:47:39 +0000
4@@ -4,9 +4,14 @@
5 from registration.forms import RegistrationForm
6 from wlrecaptcha.forms import RecaptchaForm, \
7 RecaptchaFieldPlaceholder, RecaptchaWidget
8+from django import forms
9
10 class RegistrationWithCaptchaForm(RegistrationForm,RecaptchaForm):
11 captcha = RecaptchaFieldPlaceholder(widget=RecaptchaWidget(theme="white"),
12 label="Are you human?")
13
14-
15+class ContactForm(forms.Form):
16+ surname = forms.CharField(max_length=80)
17+ forename = forms.CharField(max_length=80)
18+ email = forms.EmailField()
19+ inquiry = forms.CharField(widget=forms.Textarea)
20
21=== modified file 'mainpage/views.py'
22--- mainpage/views.py 2015-07-29 16:43:51 +0000
23+++ mainpage/views.py 2015-08-27 16:47:39 +0000
24@@ -1,8 +1,13 @@
25 from django.shortcuts import render_to_response
26 from django.template import RequestContext
27-from settings import WIDELANDS_SVN_DIR
28+from settings import WIDELANDS_SVN_DIR, EMAIL_BACKEND, INQUIRY_RECIPIENTS
29 from templatetags.wl_markdown import do_wl_markdown
30 from operator import itemgetter
31+from django.core.mail import send_mail
32+from mainpage.forms import ContactForm
33+from django.shortcuts import render
34+from django.http import HttpResponseRedirect
35+from django.core.urlresolvers import reverse
36 import sys
37 import json
38 import os
39@@ -13,11 +18,41 @@
40 return render_to_response('mainpage.html',
41 context_instance=RequestContext(request))
42
43+def legal_notice(request):
44+ """The legal notice page to fullfill law."""
45+
46+ if request.method == 'POST':
47+ form = ContactForm(request.POST)
48+ if form.is_valid():
49+ name = form.cleaned_data['forename'] + ' ' + form.cleaned_data['surname']
50+ subject = 'An inquiry over the webpage'
51+ message = '\n'.join(['From: ' + name,
52+ 'EMail: ' + form.cleaned_data['email'],
53+ 'Inquiry:',
54+ form.cleaned_data['inquiry']])
55+ sender = 'legal_note@widelands.org'
56+
57+ ## get email addresses which are in a tuple of ('name','email'),
58+ recipients = []
59+ for recipient in INQUIRY_RECIPIENTS:
60+ recipients.append(recipient[1])
61+
62+ send_mail(subject, message, sender,
63+ recipients, fail_silently=False)
64+ return HttpResponseRedirect('/legal_notice_thanks/') # Redirect after POST
65
66+ else:
67+ form = ContactForm() # An unbound form
68+
69+ return render(request, 'mainpage/legal_notice.html', {
70+ 'form': form,
71+ })
72+
73+def legal_notice_thanks(request):
74+ return render(request, 'mainpage/legal_notice_thanks.html')
75+
76+
77 from forms import RegistrationWithCaptchaForm
78-from django.http import HttpResponseRedirect
79-from django.core.urlresolvers import reverse
80-
81 from registration.backends.default import DefaultBackend
82
83
84
85=== modified file 'media/css/base.css'
86--- media/css/base.css 2015-01-08 21:40:25 +0000
87+++ media/css/base.css 2015-08-27 16:47:39 +0000
88@@ -194,7 +194,7 @@
89 }
90
91 .errormessage {
92- color: #ff0000;
93+ color: #ff6b3c;
94 }
95
96 .errormessage ul {
97@@ -227,7 +227,7 @@
98 div#footer {
99 background-color: #695536;
100 background-image: url("../img/wood.png");
101- padding: 15px;
102+ padding: 10px;
103 margin-top: 20px;
104 text-align: center;
105 box-shadow: 4px 4px 4px 0px rgba(0, 0, 0, 0.7);
106
107=== modified file 'settings.py'
108--- settings.py 2015-01-08 21:40:25 +0000
109+++ settings.py 2015-08-27 16:47:39 +0000
110@@ -264,6 +264,15 @@
111
112 USE_GOOGLE_ANALYTICS=False
113
114+##############################################
115+## Recipient(s) who get an email if someone ##
116+## uses the on legal notice page ##
117+## Use allways the form ('name', 'Email') ##
118+##############################################
119+INQUIRY_RECIPIENTS = (
120+ ('franku','somal@arcor.de'),
121+ )
122+
123 try:
124 from local_settings import *
125 except ImportError:
126
127=== modified file 'templates/footer.html'
128--- templates/footer.html 2015-02-24 20:24:59 +0000
129+++ templates/footer.html 2015-08-27 16:47:39 +0000
130@@ -7,5 +7,6 @@
131 {% endcomment %}
132
133 <div id="footer">
134- Copyright &copy; 2009 - 2015 By the Widelands Development Team
135+ Copyright &copy; 2009 - 2015 By the Widelands Development Team</br>
136+ <a class="small" href="{% url legal_notice %}">Legal notice (contact)</a>
137 </div>
138
139=== added file 'templates/mainpage/legal_notice.html'
140--- templates/mainpage/legal_notice.html 1970-01-01 00:00:00 +0000
141+++ templates/mainpage/legal_notice.html 2015-08-27 16:47:39 +0000
142@@ -0,0 +1,56 @@
143+{% extends "base.html" %}
144+{% load wl_markdown %}
145+
146+{% block title %}Legal notice {{ block.super }}{% endblock %}
147+
148+{% block content %}
149+
150+<h1>Legal notice</h1>
151+
152+<div class="blogEntry">
153+ <p>The webpage <a href="https://wl.widelands.org">widelands.org</a> is a private page to exchange knowledge and experience about the game widelands. There is no financial goal or interest.</p>
154+
155+ <h2>Project leader</h2>
156+ <ul>
157+ <li>Holger Rapp</li>
158+ </ul>
159+
160+ <h2>Contact</h2>
161+ <p>There are several possibilities to get in contact. For questions about the game or the contents of the website please take a look at our <a href=/wiki/ContactPage>Contact page</a>. Because most methods described over there needs an account, the following methods for contacting could be used without an account:</p>
162+
163+ <ul>
164+ <li>E-Mail to project leader: sirver(at)gmx.de</li>
165+ <li>Contact form (all fields has to be filled out)!
166+
167+ <form action="/legal_notice/" method="post">{% csrf_token %}
168+ {% if form.errors %}
169+ <p class="errormessage" style="text-align: left;">Please fill out all fields!</p>
170+ {% endif %}
171+ <table>
172+ <tr>
173+ <td><label for="id_forename">Your first name: </label></td>
174+ <td><input id="id_forename" type="text" name="forename" maxlength="80" required></td>
175+ </tr>
176+ <tr>
177+ <td><label for="id_surname">Your last name: </label></td>
178+ <td><input id="id_surname" type="text" name="surname" maxlength="80" required></td>
179+ </tr>
180+ <tr>
181+ <td><label for="id_email">Your Email:</label></td>
182+ <td><input type="text" name="email" id="id_email" required></td>
183+ </tr>
184+ <tr>
185+ <td><label for="id_inquiry">Your Inquiry: </label></td>
186+ <td><textarea id="id_inquiry" rows="10" cols="40" name="inquiry" required></textarea></td>
187+ </tr>
188+ <tr>
189+ <td></td>
190+ <td><input type="submit" value="Submit"></td>
191+ </tr>
192+ </table>
193+ </form>
194+ </li>
195+ </ul>
196+</div>
197+{% endblock %}
198+
199
200=== added file 'templates/mainpage/legal_notice_thanks.html'
201--- templates/mainpage/legal_notice_thanks.html 1970-01-01 00:00:00 +0000
202+++ templates/mainpage/legal_notice_thanks.html 2015-08-27 16:47:39 +0000
203@@ -0,0 +1,16 @@
204+{% extends "base.html" %}
205+{% load wl_markdown %}
206+
207+{% block title %}Impressum (Legal note) {{ block.super }}{% endblock %}
208+
209+{% block content %}
210+
211+<h1>Legal notice</h1>
212+
213+<div class="blogEntry">
214+ <h2>Thanks</h2>
215+
216+ <p>Thanks for your inquiry. An Email has been send to several recipients. We will answer as quickly as possible.</p>
217+ </div>
218+{% endblock %}
219+
220
221=== modified file 'urls.py'
222--- urls.py 2012-05-17 19:28:39 +0000
223+++ urls.py 2015-08-27 16:47:39 +0000
224@@ -42,6 +42,8 @@
225 url(r'^$', mainpage, name="mainpage"),
226 url(r'^changelog/$', "mainpage.views.changelog", name="changelog"),
227 url(r'^developers/$', "mainpage.views.developers", name="developers"),
228+ url(r'^legal_notice/$', "mainpage.views.legal_notice", name="legal_notice"),
229+ url(r'^legal_notice_thanks/$', "mainpage.views.legal_notice_thanks", name="legal_notice_thanks"),
230 url(r'^help/(?P<path>.*)', redirect_to, { "url": "/encyclopedia/%(path)s", "permanent": True }), # to not break old links
231 url(r'^encyclopedia/', include("wlhelp.urls")),
232 url(r'^webchat/', include("wlwebchat.urls")),

Subscribers

People subscribed via source and target branches