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 @@ ...@@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Warpzone - {{ page_title }}</title> <title>{% block title %}{% endblock %} - Warpzone</title>
<style> <style>
.table-scrollable{ .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" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Login" %}{% endblock %}
{% block content %} {% block content %}
<form class="form-signin" style="max-width: 330px; margin: 0 auto; padding: 40px"> <form class="form-signin" style="max-width: 330px; margin: 0 auto; padding: 40px">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{% block content %} {% block content %}
<p class="lead">{% trans "Profile Settings" %}</p><p></p> <p class="lead">{% block title %}{% trans "Profile Settings" %}{% endblock %}</p><p></p>
<div> <div>
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Registration" %}{% endblock %}
{% block content %} {% block content %}
{% if success %} {% if success %}
<div class="alert alert-success"> <div class="alert alert-success">
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
{% trans "The Email adress is invalid." %} {% trans "The Email adress is invalid." %}
{% elif error == "fill_all_fields" %} {% elif error == "fill_all_fields" %}
{% trans "Please fill all fields." %} {% trans "Please fill all fields." %}
{% elif error == "invalid_username" %}
{% trans "Username can only contain alphanumeric characters and the underscore." %}
{% endif %} {% endif %}
</strong> </strong>
</div> </div>
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Reset Password" %}{% endblock %}
{% block content %} {% block content %}
{% if token_error %} {% if token_error %}
<h2 class="form-signin-heading">{% trans "The Token is invalid" %}</h2> <h2 class="form-signin-heading">{% trans "The Token is invalid" %}</h2>
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Reset Password" %}{% endblock %}
{% block content %} {% block content %}
{% if request.POST %} {% if request.POST %}
<h2 class="form-signin-heading">{% trans "If your information were right, you've got an Email" %}</h2> <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.core.exceptions import ValidationError
from django import forms from django import forms
from django.shortcuts import render from django.shortcuts import render
...@@ -11,7 +12,6 @@ def register(request): ...@@ -11,7 +12,6 @@ def register(request):
pages['error'] = False pages['error'] = False
if request.method == "POST": if request.method == "POST":
print(request.POST)
username = request.POST['username'] username = request.POST['username']
password = request.POST['password'] password = request.POST['password']
password2 = request.POST['password2'] password2 = request.POST['password2']
...@@ -24,6 +24,8 @@ def register(request): ...@@ -24,6 +24,8 @@ def register(request):
if username == "" or email == "" or password == "" or password2 == "": if username == "" or email == "" or password == "" or password2 == "":
pages['error'] = "fill_all_fields" pages['error'] = "fill_all_fields"
elif not re.search(r'^\w+$', username):
pages['error'] = "invalid_username"
elif password != password2: elif password != password2:
pages['error'] = "passwords_did_not_match" pages['error'] = "passwords_did_not_match"
elif not pages["error"]: elif not pages["error"]:
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{% load i18n %} {% load i18n %}
{% load humanize %} {% load humanize %}
{% load bootstrap %} {% load bootstrap %}
{% block title %}{% trans "Pizza Sheet" %}{% endblock %}
{% block content %} {% block content %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
<div class="panel panel-default"> <div class="panel panel-default">
...@@ -22,11 +22,20 @@ ...@@ -22,11 +22,20 @@
{% endif %} {% endif %}
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<thead> <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> </thead>
<tbody> <tbody>
{% for sheet in food_sheets %} {% 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 %} {% endfor %}
</tbody> </tbody>
</table> </table>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
{% load i18n %} {% load i18n %}
{% load bootstrap %} {% load bootstrap %}
{% load humanize %} {% load humanize %}
{% block title %}{% trans "Pizza Sheet" %}{% endblock %}
{% block content %} {% block content %}
<div class="panel panel-default"> <div class="panel panel-default">
......
...@@ -24,7 +24,7 @@ def index(request): ...@@ -24,7 +24,7 @@ def index(request):
form.save() form.save()
else: else:
pages['error'] = form.errors 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['pizza_services'] = FoodService.objects.all()
pages['create_food_sheet'] = FoodSheetForm() pages['create_food_sheet'] = FoodSheetForm()
return HttpResponse(render(request, 'warpfood/main.html', pages)) return HttpResponse(render(request, 'warpfood/main.html', pages))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}
<h2>{% trans "About" %}</h2> <h2>{% block title %}{% trans "About" %}{% endblock %}</h2>
<p class="lead">Welcome to Warpzone Internal</p> <p class="lead">Welcome to Warpzone Internal</p>
<p class="text-justify"> <p class="text-justify">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{% load i18n %} {% load i18n %}
{% block content %} {% block content %}
<h2>{% trans "News" %}</h2> <h2>{% block title %}{% trans "News" %}{% endblock %}</h2>
{% for news in news_list %} {% for news in news_list %}
<div class="panel panel-primary"> <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