Commit 7da7b527 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg

Resolve style and code issues

parent bde7bb5d
......@@ -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>
......
This diff was suppressed by a .gitattributes entry.
......@@ -7,70 +7,71 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-28 21:00+0200\n"
"PO-Revision-Date: 2016-08-13 17:56+0100\n"
"Last-Translator: Jim Driessen <jim@driessen.li>\n"
"POT-Creation-Date: 2016-10-19 21:20+0200\n"
"PO-Revision-Date: 2016-10-19 21:21+0200\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:27
#: templates/pizzas/index.html:28
#, python-format
msgid "Order food for %(title)s"
msgstr "Bestel eten voor %(title)s"
#: pizzas/templates/pizzas/index.html:31
#: templates/pizzas/index.html:32
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:36 pizzas/templates/pizzas/orders.html:19
#: templates/pizzas/index.html:37 templates/pizzas/orders.html:14
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:46
#: templates/pizzas/index.html:47
#, python-format
msgid "It will be possible to order from %(start)s."
msgstr "Je kan bestellen vanaf %(start)s."
#: pizzas/templates/pizzas/index.html:51
#: templates/pizzas/index.html:52
#, python-format
msgid "It was possible to order until %(end)s."
msgstr "Je kon bestellen tot %(end)s."
#: pizzas/templates/pizzas/index.html:55
#: templates/pizzas/index.html:56
#, python-format
msgid "It is possible to order until %(end)s."
msgstr "Je kan bestellen tot %(end)s."
#: pizzas/templates/pizzas/index.html:60
#: templates/pizzas/index.html:61
msgid "The order has been paid for."
msgstr "De bestelling is betaald."
#: pizzas/templates/pizzas/index.html:62
#: templates/pizzas/index.html:63
msgid "The order has not yet been paid for."
msgstr "De bestelling is nog niet betaald."
#: pizzas/templates/pizzas/index.html:64
#: templates/pizzas/index.html:65
msgid "Current order"
msgstr "Huidige bestelling"
#: pizzas/templates/pizzas/index.html:69 pizzas/templates/pizzas/index.html:114
#: templates/pizzas/index.html:70 templates/pizzas/index.html:103
msgid "Description"
msgstr "Omschrijving"
#: pizzas/templates/pizzas/index.html:70 pizzas/templates/pizzas/index.html:115
#: pizzas/templates/pizzas/overview.html:26
#: templates/pizzas/index.html:71 templates/pizzas/index.html:104
#: templates/pizzas/overview.html:21
msgid "Price"
msgstr "Prijs"
#: pizzas/templates/pizzas/index.html:71 pizzas/templates/pizzas/index.html:84
#: templates/pizzas/index.html:72 templates/pizzas/index.html:85
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:84
#: templates/pizzas/index.html:85
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:128
#: templates/pizzas/index.html:117
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:18
#: templates/pizzas/orders.html:13
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:29
#: templates/pizzas/orders.html:24
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:49
#: templates/pizzas/orders.html:44
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:18
#: templates/pizzas/overview.html:13
msgid "Back"
msgstr "Terug"
#: pizzas/templates/pizzas/overview.html:27
#: templates/pizzas/overview.html:22
msgid "Amount"
msgstr "Aantal"
#: pizzas/templates/pizzas/overview.html:28
#: templates/pizzas/overview.html:23
msgid "Total"
msgstr "Totaal"
#: pizzas/views.py:72
#: views.py:74
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!"
......@@ -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;
......
......@@ -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 {
......
{% 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>
......
{% 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
{% 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: 1px 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 %}
......
{% 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 %}
{% 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;">
......
......@@ -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,
......
......@@ -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 -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment