Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
7da7b527
Commit
7da7b527
authored
Oct 19, 2016
by
Sébastiaan Versteeg
Browse files
Resolve style and code issues
parent
bde7bb5d
Changes
12
Hide whitespace changes
Inline
Side-by-side
website/events/templates/events/event.html
View file @
7da7b527
...
...
@@ -146,18 +146,18 @@
</td>
</tr>
{#
{% if event.pizzaevent %}
#}
{#
<tr>
#}
{#
<th>
#}
{#
Pizza
#}
{#
</th>
#}
{#
<td>
#}
{#
<a
href=
"{
{
url "
pizzas:index
"
}
}"
class=
"btn btn-style1"
>
#}
{#
{% trans "Order" %}
#}
{#
</a>
#}
{#
</td>
#}
{#
</tr>
#}
{#
{% endif %}
#}
{% if event.pizzaevent %}
<tr>
<th>
Pizza
</th>
<td>
<a
href=
"{
%
url "
pizzas:index
"
%
}"
class=
"btn btn-style1"
>
{% trans "Order" %}
</a>
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
...
...
website/pizzas/locale/nl/LC_MESSAGES/django.mo
View file @
7da7b527
No preview for this file type
website/pizzas/locale/nl/LC_MESSAGES/django.po
View file @
7da7b527
...
...
@@ -7,70 +7,71 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-
09-28
21:
0
0+0200\n"
"PO-Revision-Date: 2016-
08-13 17:56
+0
1
00\n"
"Last-Translator:
Jim Driessen <jim@driessen.li
>\n"
"POT-Creation-Date: 2016-
10-19
21:
2
0+0200\n"
"PO-Revision-Date: 2016-
10-19 21:21
+0
2
00\n"
"Last-Translator:
Sébastiaan Versteeg <se_bastiaan@outlook.com
>\n"
"Language-Team: \n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.
6
.10\n"
"X-Generator: Poedit 1.
8
.10\n"
#:
pizzas/
admin.py:15
#: admin.py:15
#, python-brace-format
msgid "<strong><a href=\"{link}\">Orders</a></strong>"
msgstr "<strong><a href=\"{link}\">Bestellingen</a></strong>"
#:
pizzas/
models.py:12
#: models.py:12
msgid "Order from"
msgstr "Bestel vanaf"
#:
pizzas/
models.py:13
#: models.py:13
msgid "Order until"
msgstr "Bestel tot"
#:
pizzas/
models.py:42
pizzas/
models.py:43
#: models.py:42 models.py:43
msgid "This event cannot overlap with "
msgstr "Dit evenement kan niet overlappen met "
#:
pizzas/
models.py:72
#: models.py:72
msgid "Use this for non-members"
msgstr "Vul dit in voor niet-leden"
#:
pizzas/
models.py:84
pizzas/
models.py:85
#: models.py:84 models.py:85
msgid "Either specify a member or a name"
msgstr "Specificeer een lid of vul een naam in"
#: pizzas/templates/pizzas/add_order.html:5
#: pizzas/templates/pizzas/index.html:5 pizzas/templates/pizzas/orders.html:5
#: pizzas/templates/pizzas/overview.html:5
#: templates/pizzas/add_order.html:4
msgid "Add order"
msgstr "Nieuwe bestelling toevoegen"
#: templates/pizzas/add_order.html:4 templates/pizzas/index.html:4
#: templates/pizzas/orders.html:5 templates/pizzas/overview.html:4
msgid "Pizzas"
msgstr "Pizza's"
#:
pizzas/
templates/pizzas/add_order.html:
19
#: templates/pizzas/add_order.html:
7
#, python-format
msgid "Add order for %(title)s"
msgstr "Bestelling toevoegen voor %(title)s"
#: pizzas/templates/pizzas/add_order.html:24
#: pizzas/templates/pizzas/index.html:68 pizzas/templates/pizzas/index.html:113
#: pizzas/templates/pizzas/orders.html:27
#: templates/pizzas/add_order.html:12 templates/pizzas/index.html:69
#: templates/pizzas/index.html:102 templates/pizzas/orders.html:22
msgid "Name"
msgstr "Naam"
#: pizzas/templates/pizzas/add_order.html:33
#: pizzas/templates/pizzas/orders.html:28
#: pizzas/templates/pizzas/overview.html:25
#: templates/pizzas/add_order.html:21 templates/pizzas/orders.html:23
#: templates/pizzas/overview.html:20
msgid "Product"
msgstr "Product"
#:
pizzas/
templates/pizzas/add_order.html:
39
#: templates/pizzas/add_order.html:
27
msgid "Add"
msgstr "Toevoegen"
#:
pizzas/
templates/pizzas/add_order.html:
45
#: templates/pizzas/add_order.html:
33
#, python-format
msgid ""
"A more generic version of this form is<br>also available in the <a href="
...
...
@@ -79,148 +80,151 @@ msgstr ""
"Een meer generieke versie van dit formulier<br>is ook beschikbaar in de <a "
"href=\"%(url_pizzas_order_add)s\">back-end</a>."
#:
pizzas/
templates/pizzas/index.html:2
7
#: templates/pizzas/index.html:2
8
#, python-format
msgid "Order food for %(title)s"
msgstr "Bestel eten voor %(title)s"
#:
pizzas/
templates/pizzas/index.html:3
1
#: templates/pizzas/index.html:3
2
msgid "There is no current event for which you can order food"
msgstr "Er is nu geen evenement waar je eten voor kunt bestellen"
#:
pizzas/
templates/pizzas/index.html:3
6 pizzas/
templates/pizzas/orders.html:1
9
#: templates/pizzas/index.html:3
7
templates/pizzas/orders.html:1
4
msgid "All events"
msgstr "Alle evenementen"
#:
pizzas/
templates/pizzas/index.html:
39
#: templates/pizzas/index.html:
40
msgid "All orders"
msgstr "Alle bestellingen"
#:
pizzas/
templates/pizzas/index.html:4
6
#: templates/pizzas/index.html:4
7
#, python-format
msgid "It will be possible to order from %(start)s."
msgstr "Je kan bestellen vanaf %(start)s."
#:
pizzas/
templates/pizzas/index.html:5
1
#: templates/pizzas/index.html:5
2
#, python-format
msgid "It was possible to order until %(end)s."
msgstr "Je kon bestellen tot %(end)s."
#:
pizzas/
templates/pizzas/index.html:5
5
#: templates/pizzas/index.html:5
6
#, python-format
msgid "It is possible to order until %(end)s."
msgstr "Je kan bestellen tot %(end)s."
#:
pizzas/
templates/pizzas/index.html:6
0
#: templates/pizzas/index.html:6
1
msgid "The order has been paid for."
msgstr "De bestelling is betaald."
#:
pizzas/
templates/pizzas/index.html:6
2
#: templates/pizzas/index.html:6
3
msgid "The order has not yet been paid for."
msgstr "De bestelling is nog niet betaald."
#:
pizzas/
templates/pizzas/index.html:6
4
#: templates/pizzas/index.html:6
5
msgid "Current order"
msgstr "Huidige bestelling"
#:
pizzas/
templates/pizzas/index.html:
69 pizzas/
templates/pizzas/index.html:1
14
#: templates/pizzas/index.html:
70
templates/pizzas/index.html:1
03
msgid "Description"
msgstr "Omschrijving"
#:
pizzas/
templates/pizzas/index.html:7
0 pizzas/
templates/pizzas/index.html:1
15
#:
pizzas/
templates/pizzas/overview.html:2
6
#: templates/pizzas/index.html:7
1
templates/pizzas/index.html:1
04
#: templates/pizzas/overview.html:2
1
msgid "Price"
msgstr "Prijs"
#:
pizzas/
templates/pizzas/index.html:7
1 pizzas/
templates/pizzas/index.html:8
4
#: templates/pizzas/index.html:7
2
templates/pizzas/index.html:8
5
msgid "Cancel"
msgstr "Annuleren"
#:
pizzas/
templates/pizzas/index.html:
79
#: templates/pizzas/index.html:
80
msgid "You can no longer cancel."
msgstr "Je kunt niet meer annuleren."
#:
pizzas/
templates/pizzas/index.html:8
4
#: templates/pizzas/index.html:8
5
msgid "Are you sure you want to cancel your order?"
msgstr "Weet je zeker dat je de bestelling wilt annuleren?"
#:
pizzas/
templates/pizzas/index.html:
104
#: templates/pizzas/index.html:
93
msgid "Changing your order"
msgstr "Bestelling bewerken"
#:
pizzas/
templates/pizzas/index.html:
107
#: templates/pizzas/index.html:
96
msgid "You did not place an order."
msgstr "Je hebt geen bestelling geplaatst."
#: pizzas/templates/pizzas/index.html:117
#: pizzas/templates/pizzas/index.html:128
#: templates/pizzas/index.html:106 templates/pizzas/index.html:117
msgid "Modify"
msgstr "Bewerken"
#: pizzas/templates/pizzas/index.html:117
#: pizzas/templates/pizzas/index.html:128
#: templates/pizzas/index.html:106 templates/pizzas/index.html:117
msgid "Order"
msgstr "Bestellen"
#:
pizzas/
templates/pizzas/index.html:1
28
#: templates/pizzas/index.html:1
17
msgid "Are you sure you want to modify your order?"
msgstr "Weet je zeker dat je de bestelling aan wilt passen?"
#: pizzas/templates/pizzas/orders.html:14
#: pizzas/templates/pizzas/overview.html:14
#: templates/pizzas/orders.html:9 templates/pizzas/overview.html:9
#, python-format
msgid "Orders for %(title)s"
msgstr "Bestellingen voor %(title)s"
#:
pizzas/
templates/pizzas/orders.html:1
8
#: templates/pizzas/orders.html:1
3
msgid "Add a new order"
msgstr "Nieuwe bestelling toevoegen"
#:
pizzas/
templates/pizzas/orders.html:
20
#: templates/pizzas/orders.html:
15
msgid "Overview"
msgstr "Overzicht"
#:
pizzas/
templates/pizzas/orders.html:2
9
#: templates/pizzas/orders.html:2
4
msgid "Paid"
msgstr "Betaald"
#: pizzas/templates/pizzas/orders.html:43
#: pizzas/templates/pizzas/orders.html:76
#: pizzas/templates/pizzas/overview.html:76
#: templates/pizzas/orders.html:38 templates/pizzas/overview.html:71
msgid "Yes"
msgstr "Ja"
#: pizzas/templates/pizzas/orders.html:43
#: pizzas/templates/pizzas/orders.html:76
#: pizzas/templates/pizzas/overview.html:76
#: templates/pizzas/orders.html:38 templates/pizzas/overview.html:71
msgid "No"
msgstr "Nee"
#:
pizzas/
templates/pizzas/orders.html:4
9
#: templates/pizzas/orders.html:4
4
msgid "Are you sure you want to delete this order?"
msgstr "Weet je zeker dat je de bestelling wilt verwijderen?"
#: pizzas/templates/pizzas/orders.html:57
#: pizzas/templates/pizzas/overview.html:49
#: templates/pizzas/orders.html:52 templates/pizzas/overview.html:44
msgid "Nobody ordered yet"
msgstr "Nog geen bestellingen"
#:
pizzas/
templates/pizzas/overview.html:1
8
#: templates/pizzas/overview.html:1
3
msgid "Back"
msgstr "Terug"
#:
pizzas/
templates/pizzas/overview.html:2
7
#: templates/pizzas/overview.html:2
2
msgid "Amount"
msgstr "Aantal"
#:
pizzas/
templates/pizzas/overview.html:2
8
#: templates/pizzas/overview.html:2
3
msgid "Total"
msgstr "Totaal"
#:
pizzas/
views.py:7
2
#: views.py:7
4
msgid "You must supply an order pk."
msgstr "Je moet een bestelling pk meegeven."
#: pizzas/views.py:76
msgid "Order not found!"
msgstr "Bestelling niet gevonden!"
#: views.py:78 views.py:92 views.py:108
msgid "Your order could not be found."
msgstr "Je bestelling kont niet worden gevonden."
#: views.py:106
msgid "Your order has been cancelled."
msgstr "Je bestelling is geannuleerd."
#: views.py:120
msgid "Your order was successful."
msgstr "Je bestelling is succesvol."
#~ msgid "Order not found!"
#~ msgstr "Bestelling niet gevonden!"
website/pizzas/static/pizzas/css/style.css
View file @
7da7b527
...
...
@@ -5,6 +5,11 @@
#button-container
{
clear
:
both
;
overflow
:
auto
;
margin-bottom
:
15px
;
}
#button-container
a
:first-child
{
margin-right
:
0
;
}
#button-container
a
{
...
...
@@ -19,6 +24,15 @@
background-color
:
#E05C50
;
}
.product-name
{
font-weight
:
bolder
;
font-size
:
40px
;
}
.form-group
{
margin-bottom
:
15px
;
}
@media
(
max-width
:
767px
)
{
#main
.main-content
{
padding-right
:
16px
!important
;
...
...
website/pizzas/static/pizzas/js/orders.js
View file @
7da7b527
...
...
@@ -12,7 +12,7 @@ $(function() {
if
(
data
.
success
===
1
)
{
button
.
addClass
(
'
btn-style
'
+
(
4
-
data
.
paid
));
button
.
removeClass
(
'
btn-style
'
+
(
3
+
data
.
paid
));
button
.
val
(
data
.
paid
?
trans
.
yes
:
trans
.
no
);
button
.
val
(
data
.
paid
?
gettext
(
'
Yes
'
)
:
gettext
(
'
No
'
)
);
button
.
blur
();
}
else
{
...
...
website/pizzas/templates/pizzas/add_order.html
View file @
7da7b527
{% extends "base.html" %}
{% extends "pizzas/base.html" %}
{% load i18n staticfiles %}
{% block page_title %}{% trans "Pizzas" %}{% endblock %}
{% block css_head %}
{{ block.super }}
<link
href=
"{% static "
pizzas
/
css
/
style.css
"
%}"
rel=
"stylesheet"
type=
"text/css"
>
{% endblock %}
{% block title %}{% trans "Add order" %} — {{ event.title }} — {% trans "Pizzas"|capfirst %} — {{ block.super }}{% endblock %}
{% block body %}
<style>
.form-group
{
margin-bottom
:
15px
;
}
</style>
<h3>
{% blocktrans with title=event.title %}Add order for {{ title }}{% endblocktrans %}
</h3>
<h1>
{% blocktrans with title=event.title %}Add order for {{ title }}{% endblocktrans %}
</h1>
<form
class=
"form-horizontal"
method=
"post"
action=
"{% url 'pizzas:add-order' event.pk %}"
>
{% csrf_token %}
<div
class=
"
form
-group {% if form.name.errors %}has-error{% endif %}"
>
<div
class=
"
control
-group {% if form.name.errors %}has-error{% endif %}"
>
<label
for=
"{{ form.name.auto_id }}"
class=
"control-label"
>
{% trans 'Name' %}
</label>
<div
class=
"controls"
>
{{ form.name }}
...
...
@@ -29,14 +17,14 @@
{% endfor %}
</div>
</div>
<div
class=
"
form
-group {% if form.product.errors %}has-error{% endif %}"
>
<div
class=
"
control
-group {% if form.product.errors %}has-error{% endif %}"
>
<label
for=
"{{ form.product.auto_id }}"
class=
"control-label"
>
{% trans 'Product' %}
</label>
<div
class=
"controls"
>
{{ form.product }}
</div>
</div>
<div
class=
"
form
-group"
>
<input
type=
"submit"
class=
"btn btn-style1"
value=
"{% trans 'Add' %}"
>
<div
class=
"
control
-group"
>
<input
type=
"submit"
class=
"btn btn-style1
pull-right login
"
value=
"{% trans 'Add' %}"
>
</div>
</form>
...
...
website/pizzas/templates/pizzas/base.html
0 → 100644
View file @
7da7b527
{% extends 'base.html' %}
{% load staticfiles compress %}
{% block css_head %}
{{ block.super }}
{% compress css %}
<link
href=
"{% static "
pizzas
/
css
/
style.css
"
%}"
rel=
"stylesheet"
type=
"text/css"
>
{% endcompress %}
{% endblock %}
\ No newline at end of file
website/pizzas/templates/pizzas/index.html
View file @
7da7b527
{% extends "base.html" %}
{% extends "pizzas/base.html" %}
{% load i18n staticfiles %}
{% block
page_
title
%
}{% trans "Pizzas"
%
}{% endblock %}
{% block
title %}{{ event.
title }
} —
{% trans "Pizzas"
|capfirst %} — {{ block.super }
}{% endblock %}
{% block css_head %}
{{ block.super }}
<link
href=
"{% static "
pizzas
/
css
/
style.css
"
%}"
rel=
"stylesheet"
type=
"text/css"
>
{% block header_image_container %}
{% if event.just_ended %}
<div
class=
"header-image container {{ order.paid|yesno:'paid,unpaid' }}"
>
</div>
{% else %}
{{ block.super }}
{% endif %}
{% endblock %}
{% block body %}
{% if event %}
{% if event.just_ended and order %}
<center>
<span
style=
"font-weight: bolder; font-size: 40px
"
>
<
div
class=
"text-
center
"
>
<span
class=
"product-name
"
>
{{ order.product.name }}
</span>
<br>
...
...
@@ -21,7 +24,7 @@
<span
style=
"font-size: 24px;"
>
{{ member.get_full_name }}
</span>
</
center
>
</
div
>
{% endif %}
<h1>
{% blocktrans with title=event.title %}Order food for {{ title }}{% endblocktrans %}
...
...
@@ -33,10 +36,10 @@
{% endif %}
<div
id=
"button-container"
>
{% if perms.pizzas.change_pizzaevent %}
<a
href=
"{% url 'admin:pizzas_pizzaevent_changelist' %}"
class=
"btn btn-
primary
pull-right"
>
{% trans "All events" %}
</a>
<a
href=
"{% url 'admin:pizzas_pizzaevent_changelist' %}"
class=
"btn btn-
style1
pull-right"
>
{% trans "All events" %}
</a>
{% endif %}
{% if perms.pizzas.change_order and event %}
<a
href=
"{% url 'pizzas:orders' event.pk %}"
class=
"btn btn-
primary
pull-right"
>
{% trans "All orders" %}
</a>
<a
href=
"{% url 'pizzas:orders' event.pk %}"
class=
"btn btn-
style1
pull-right"
>
{% trans "All orders" %}
</a>
{% endif %}
<br><br>
</div>
...
...
@@ -88,19 +91,7 @@
</tr>
</table>
</div>
{% if event.just_ended %}
<style>
.header-image
{
background-color
:
{{
order
.
paid
|
yesno
:
'#DFF0D8,#E05C50'
}
}
!
important
;
background-image
:
none
!
important
;
border-top
:
1
px
solid
{
{
order.paid|
yesno
:
'#8FCC74,#EED3D7'
}
}
!
important
;
}
#main
{
border-top
:
1px
solid
{{
order
.
paid
|
yesno
:
'8FCC74,EED3D7'
}
}
!
important
;
}
</style>
{% else %}
{% if not event.just_ended %}
<h4>
{% trans "Changing your order" %}
</h4>
{% endif %}
{% elif event.just_ended %}
...
...
website/pizzas/templates/pizzas/orders.html
View file @
7da7b527
{% extends "base.html" %}
{% extends "
pizzas/
base.html" %}
{% load i18n staticfiles %}
{% block page_title %}{% trans "Pizzas" %}{% endblock %}
{% block css_head %}
{{ block.super }}
<link
href=
"{% static "
pizzas
/
css
/
style.css
"
%}"
rel=
"stylesheet"
type=
"text/css"
>
{% endblock %}
{% block title %}{{ event.title }} — {% trans "Pizzas"|capfirst %} — {{ block.super }}{% endblock %}
{% block body %}
<h1>
...
...
@@ -15,9 +10,9 @@
</h1>
<div
id=
"button-container"
>
<a
href=
"{% url 'pizzas:add-order' event.pk %}"
class=
"btn btn-
primary
pull-right"
>
{% trans "Add a new order" %}
</a>
<a
href=
"{% url 'admin:pizzas_pizzaevent_changelist' %}"
class=
"btn btn-
primary
pull-right"
>
{% trans "All events" %}
</a>
<a
href=
"{% url 'pizzas:overview' event.pk %}"
class=
"btn btn-
primary
pull-right"
>
{% trans "Overview" %}
</a>
<a
href=
"{% url 'pizzas:add-order' event.pk %}"
class=
"btn btn-
style1
pull-right"
>
{% trans "Add a new order" %}
</a>
<a
href=
"{% url 'admin:pizzas_pizzaevent_changelist' %}"
class=
"btn btn-
style1
pull-right"
>
{% trans "All events" %}
</a>
<a
href=
"{% url 'pizzas:overview' event.pk %}"
class=
"btn btn-
style1
pull-right"
>
{% trans "Overview" %}
</a>
<br><br>
</div>
<div
style=
"overflow-x: auto;"
>
...
...
@@ -73,6 +68,5 @@
<script
type=
"text/javascript"
>
var
csrf_token
=
'
{{ csrf_token }}
'
;
var
paid_url
=
"
{% url 'pizzas:toggle-orderpayment' %}
"
;
var
trans
=
{
'
yes
'
:
'
{% trans
'
Yes
'
%}
'
,
'
no
'
:
'
{% trans
'
No
'
%}
'
};
</script>
{% endblock %}
website/pizzas/templates/pizzas/overview.html
View file @
7da7b527
{% extends "base.html" %}
{% extends "pizzas/base.html" %}
{% load i18n staticfiles %}
{% block
page_
title
%
}{% trans "Pizzas"
%
}{% endblock %}
{% block
title %}{{ event.
title }
} —
{% trans "Pizzas"
|capfirst %} — {{ block.super }
}{% endblock %}
{% block css_head %}
{{ block.super }}
<link
href=
"{% static "
pizzas
/
css
/
style.css
"
%}"
rel=
"stylesheet"
type=
"text/css"
>
{% endblock %}
{% block body %}
<h1>
...
...
@@ -15,7 +10,7 @@
</h1>
<div
id=
"button-container"
>
<a
href=
"{% url 'pizzas:orders' event.pk %}"
class=
"btn btn-
primary
pull-right"
>
{% trans "Back" %}
</a>
<a
href=
"{% url 'pizzas:orders' event.pk %}"
class=
"btn btn-
style1
pull-right"
>
{% trans "Back" %}
</a>
<br><br>
</div>
<div
style=
"overflow-x: auto;"
>
...
...
website/pizzas/views.py
View file @
7da7b527
...
...
@@ -2,6 +2,7 @@ from django.shortcuts import render, get_object_or_404
from
django.views.decorators.http
import
require_http_methods
from
django.http
import
HttpResponseRedirect
,
JsonResponse
from
django.core.urlresolvers
import
reverse
from
django.contrib
import
messages
from
django.contrib.auth.decorators
import
permission_required
from
django.http
import
Http404
from
django.utils.translation
import
ugettext_lazy
as
_
...
...
@@ -74,7 +75,7 @@ def toggle_orderpayment(request):
try
:
order
=
get_object_or_404
(
Order
,
pk
=
int
(
request
.
POST
[
'order'
]))
except
Http404
:
return
JsonResponse
({
'error'
:
_
(
"
Order
not found
!
"
)})
return
JsonResponse
({
'error'
:
_
(
"
Your order could
not
be
found
.
"
)})
order
.
paid
=
not
order
.
paid
order
.
save
()
return
JsonResponse
({
'success'
:
1
,
'paid'
:
int
(
order
.
paid
)})
...
...
@@ -88,7 +89,7 @@ def delete_order(request):
order
=
get_object_or_404
(
Order
,
pk
=
int
(
request
.
POST
[
'order'
]))
order
.
delete
()
except
Http404
:
pass
# TODO use contrib.messages for some information here
messages
.
error
(
request
,
_
(
"Your order could not be found."
))
event
=
PizzaEvent
.
current
()
if
event
:
return
HttpResponseRedirect
(
reverse
(
'pizzas:orders'
,
args
=
[
event
.
pk
]))
...
...
@@ -102,9 +103,9 @@ def cancel_order(request):
order
=
get_object_or_404
(
Order
,
pk
=
int
(
request
.
POST
[
'order'
]))
if
order
.
member
==
request
.
user
.
member
:
order
.
delete
()
messages
.
success
(
request
,
_
(
"Your order has been cancelled."
))
except
Http404
:
pass
# TODO use contrib.messages for some information here
# TODO use contrib.messages for some information here
messages
.
error
(
request
,
_
(
"Your order could not be found."
))
return
HttpResponseRedirect
(
reverse
(
'pizzas:index'
))
...
...
@@ -116,7 +117,7 @@ def add_order(request, event_pk):
order
=
form
.
save
(
commit
=
False
)
order
.
pizza_event
=
event
order
.
save
()
# TODO use contrib.messages for some information here
messages
.
success
(
request
,
_
(
"Your order was successful."
))
return
HttpResponseRedirect
(
reverse
(
'pizzas:orders'
,
args
=
[
event
.
pk
]))
context
=
{
'event'
:
event
,
...
...
website/thaliawebsite/templates/base.html
View file @
7da7b527
...
...
@@ -125,11 +125,13 @@
<div
id=
"header-panel"
class=
"wrapper header-parallax"
>
{# todo header image #}
{% block header_image_container %}
<div
class=
"header-image container"
style=
"background-image: url('{% block header_image %}{% static "
images
/
header_default.jpg
"
%}{%
endblock
header_image
%}')"
>
</div>
</div>
{% endblock header_image_container %}
</div>
<!-- /#header panel -->
<!-- content -->
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment