Skip to content
Snippets Groups Projects
Commit 9669e154 authored by Christian Dresen's avatar Christian Dresen
Browse files

Further Changes

parent 2e9b1f43
No related branches found
No related tags found
No related merge requests found
Showing
with 27 additions and 24 deletions
......@@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Warpzone - {{ page_title }}</title>
<title>{% block title %}{% endblock %} - Warpzone</title>
<style>
.table-scrollable{
......
{% extends "base.html" %}
{% load i18n %}
{% block content %}
<h2>{{ body_text }}</h2>
<p class="lead">{% trans "Welcome to Warpzone internal" %}</p>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
{% endblock %}
\ No newline at end of file
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Login" %}{% endblock %}
{% block content %}
<form class="form-signin" style="max-width: 330px; margin: 0 auto; padding: 40px">
......
......@@ -4,7 +4,7 @@
{% block content %}
<p class="lead">{% trans "Profile Settings" %}</p><p></p>
<p class="lead">{% block title %}{% trans "Profile Settings" %}{% endblock %}</p><p></p>
<div>
......
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Registration" %}{% endblock %}
{% block content %}
{% if success %}
<div class="alert alert-success">
......@@ -26,6 +26,8 @@
{% trans "The Email adress is invalid." %}
{% elif error == "fill_all_fields" %}
{% trans "Please fill all fields." %}
{% elif error == "invalid_username" %}
{% trans "Username can only contain alphanumeric characters and the underscore." %}
{% endif %}
</strong>
</div>
......
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Reset Password" %}{% endblock %}
{% block content %}
{% if token_error %}
<h2 class="form-signin-heading">{% trans "The Token is invalid" %}</h2>
......
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Reset Password" %}{% endblock %}
{% block content %}
{% if request.POST %}
<h2 class="form-signin-heading">{% trans "If your information were right, you've got an Email" %}</h2>
......
import re
from django.core.exceptions import ValidationError
from django import forms
from django.shortcuts import render
......@@ -11,7 +12,6 @@ def register(request):
pages['error'] = False
if request.method == "POST":
print(request.POST)
username = request.POST['username']
password = request.POST['password']
password2 = request.POST['password2']
......@@ -24,6 +24,8 @@ def register(request):
if username == "" or email == "" or password == "" or password2 == "":
pages['error'] = "fill_all_fields"
elif not re.search(r'^\w+$', username):
pages['error'] = "invalid_username"
elif password != password2:
pages['error'] = "passwords_did_not_match"
elif not pages["error"]:
......
......@@ -3,7 +3,7 @@
{% load i18n %}
{% load humanize %}
{% load bootstrap %}
{% block title %}{% trans "Pizza Sheet" %}{% endblock %}
{% block content %}
{% if user.is_authenticated %}
<div class="panel panel-default">
......@@ -22,11 +22,20 @@
{% endif %}
<table class="table table-striped table-hover">
<thead>
<tr><th>{% trans "Estimated Order Time" %}</th><th>{% trans "Pizza Service" %}</th></tr>
<tr><th>{% trans "Estimated Order Time" %}</th><th>{% trans "Pizza Service" %}</th><th>{% trans "Status" %}</th></tr>
</thead>
<tbody>
{% for sheet in food_sheets %}
<tr data-link="/pizza/view/{{ sheet.id }}/"><td>{{ sheet.estimated_order_time | naturaltime }}</td><td>{{ sheet.food_service }}</td></tr>
<tr data-link="/pizza/view/{{ sheet.id }}/">
<td>{{ sheet.estimated_order_time | naturaltime }}</td>
<td>{{ sheet.food_service }}</td>
<td>
{% if sheet.closed %}
<span class="btn btn-xs btn-danger">Closed</span>
{% else %}
<span class="btn btn-xs btn-success">Open</span>
{% endif %}
</td>
{% endfor %}
</tbody>
</table>
......
......@@ -3,6 +3,7 @@
{% load i18n %}
{% load bootstrap %}
{% load humanize %}
{% block title %}{% trans "Pizza Sheet" %}{% endblock %}
{% block content %}
<div class="panel panel-default">
......
......@@ -24,7 +24,7 @@ def index(request):
form.save()
else:
pages['error'] = form.errors
pages['food_sheets'] = FoodSheet.objects.all()
pages['food_sheets'] = FoodSheet.objects.order_by("-id")
pages['pizza_services'] = FoodService.objects.all()
pages['create_food_sheet'] = FoodSheetForm()
return HttpResponse(render(request, 'warpfood/main.html', pages))
......
......@@ -2,7 +2,7 @@
{% load i18n %}
{% block content %}
<h2>{% trans "About" %}</h2>
<h2>{% block title %}{% trans "About" %}{% endblock %}</h2>
<p class="lead">Welcome to Warpzone Internal</p>
<p class="text-justify">
......
......@@ -3,7 +3,7 @@
{% load i18n %}
{% block content %}
<h2>{% trans "News" %}</h2>
<h2>{% block title %}{% trans "News" %}{% endblock %}</h2>
{% for news in news_list %}
<div class="panel panel-primary">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment