Add a set of templates for the interface

This commit is contained in:
Jan Losinski 2019-01-07 09:03:41 +01:00
parent bc270c9ee9
commit ef72567832
7 changed files with 239 additions and 0 deletions

View File

@ -0,0 +1,50 @@
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="{{ static('css/custom.css') }}" rel="stylesheet">
<title>Punky appointment reservation!</title>
</head>
<body>
<main role="main" class="container">
<h1 class="text-center"><a href="/">Punkow</a></h1>
{% block body %}{% endblock %}
</main>
<footer class="footer">
<div class="container">
<span class="text-muted">
<strong><a href="/">Punkow</a></strong>
| Simple queue based appointment booking.
| <a href="/terms">terms</a>
| <a href="https://github.com/janLo/punkow" target="_blank">code</a>
</span>
</div>
</footer>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
</body>
</html>

View File

@ -0,0 +1,9 @@
{% extends 'detail.html' %}
{% block action %}
<div class="col align-self-center">
<form method="post" action="{{ del_url }}">
<button type="submit" class="btn btn-danger btn-block ">Really cancel?</button>
</form>
</div>
{% endblock %}

View File

@ -0,0 +1,46 @@
{% extends 'base.html' %}
{% import 'macros.html' as forms %}
{% macro row(desc, value) %}
<tr>
<th>
{{ desc }}
</th>
<td>
{{ value|urlize(30, target="_blank", nofollow="true") }}
</td>
</tr>
{% endmacro %}
{% block body %}
{{ forms.messages(errors=errors, messages=messages) }}
{% if data is not none %}
<div class="card">
<div class="card-header">Details of booking request <strong>{{ data.key }}</strong></div>
<div class="card-body">
<div class="row">
<table class="table">
{{ row("URL:", data.target) }}
{{ row("Status:", data.state) }}
{{ row("Created:", data.created.strftime('%Y-%m-%d %H:%M')) }}
</table>
</div>
<div class="row">
{% block action %}
{% if data.resolved is none %}
<a class="btn btn-outline-danger col align-self-center" href="{{ del_url }}" role="button">Cancel
request</a>
{% else %}
<div class="alert alert-warning col" role="alert">
<strong>{{ data.resolved.strftime('%Y-%m-%d %H:%M') }}:</strong> This entry is not
active anymore. All personal data is deleted!
</div>
{% endif %}
{% endblock %}
</div>
</div>
</div>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,34 @@
{% extends 'base.html' %}
{% import 'macros.html' as forms %}
{% block body %}
{{ forms.messages(errors=errors, messages=messages) }}
<div class="card">
<div class="card-header">New booking requst</div>
<div class="card-body">
<form method="post" action="/create">
<div class="row">
{{ forms.input('url', "Start URL", description='The start url for your booking', data=data, errors=errors) }}
</div>
<div class="row">
{{ forms.input('name', "Name", description='The name the booking is for (Your name)', data=data, errors=errors) }}
</div>
<div class="row">
{{ forms.input('email', "E-Mail", type='email', description='Your email address (to get the booking confirmation)', data=data, errors=errors) }}
</div>
<div class="row">
{{ forms.check_input('terms_accepted', "Accept terms", type='checkbox', value='accepted', description='Confirm that you have read and accepted the terms!', data=data, errors=errors) }}
</div>
<div class="row">
<div class="col-lg">
<button type="submit" class="btn btn-primary">Create</button>
</div>
</div>
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,37 @@
{% extends 'base.html' %}
{% block body %}
<p class="lead">
Book appointments in the berlin authorities more easy!
</p>
<div class="alert alert-danger">
<strong>Notice:</strong> This is a private toy project!
No support provided and no commercial use allowed. Please read the <a href="/terms">terms</a>!
</div>
<p>Appointment booking in the Berlin authorities can be really frustrating.
Appointments go available at different tims and sind often booked out shortly after.
For a successful booking you have to click yourself constantly for months through their service.
This is almost impossible for working people.</p>
<p>This service tries to help with this problem.
You select a service where you want to book the appointment for and a location where you want to book it and retrieve the booking-email-address.
This you enter this together with your name and your email address in this service.
From this point on it will check in regular intervals if there is a free appointment and if so, books it on your behalf.</p>
<p>The maximum time to try is 30 days.
After this period your request gets cancelled if there is still no appointment available.</p>
<p>The necessary URL can be found at the websites of the "Terminbuchungssystem" at service.berlin.de.
Select your service at: <a href="https://service.berlin.de/dienstleistungen/" target="_blank">https://service.berlin.de/dienstleistungen/</a>
and copy the "link address" of the "Termin buchen" link for the location you want zo go.</p>
<div class="alert alert-warning">
<strong>Notice:</strong> The requests will be processed in the order they came in.
It will not give you any benefit to register multiple requests for the same service.
</div>
<p>
<a href="/create" class="btn btn-outline-primary col align-self-center" role="button">Register your request now!</a>
</p>
{% endblock %}

View File

@ -0,0 +1,34 @@
{% macro input(id, label, type='text', description='', placeholder='', data={}, errors={}) %}
<div class="form-group col-lg{% if id in errors %} is-invalid{% endif %}">
<label for="{{ id }}">{{ label }}</label>
<input name="{{ id }}" type="{{ type }}"
class="form-control form-control-sm{% if id in errors %} is-invalid{% endif %}" id="{{ id }}"
aria-describedby="{{ id }}Help" placeholder="{{ placeholder }}" value="{{ data[id]|default("") }}">
<small id="{{ id }}Help" class="form-text text-muted">{{ description }}</small>
</div>
{% endmacro %}
{% macro check_input(id, label, type='checkbox', value='true', description='', placeholder='', data={}, errors={}) %}
<div class="form-group col-lg{% if id in errors %} is-invalid{% endif %}">
<label for="{{ id }}">{{ label }}</label>
<div class="form-check form-check-inline col-lg">
<input name="{{ id }}" type="{{ type }}"
class="form-check col-1{% if id in errors %} is-invalid{% endif %}" id="{{ id }}"
aria-describedby="{{ id }}Help" placeholder="{{ placeholder }}" value="{{ value }}">
<small id="{{ id }}Help" class="form-text text-muted">{{ description }}</small>
</div>
</div>
{% endmacro %}
{% macro messages(errors, messages=[]) %}
{% for msg in errors.values() %}
<div class="alert alert-danger" role="alert">
{{ msg }}
</div>
{% endfor %}
{% for msg in messages %}
<div class="alert alert-primary" role="alert">
{{ msg }}
</div>
{% endfor %}
{% endmacro %}

View File

@ -0,0 +1,29 @@
{% extends 'base.html' %}
{% block body %}
<h2>Terms & conditions</h2>
<p>This is no commercial service.
Therefore I do not provide any guarantees about the availability and quality of this service.</p>
<p>Only private use for people ith genie needs for appointments in the administration of th city of berlin is
allowed.
It is not allowed to use this service for any commercial purposes.</p>
<p>The terms and conditions of the appointmentbooking system of the administration of the city of Berlin apply.
If you use this service you confirm that these are known to you and we can accept them at the time of the
registration on your behalf.
The full text can be found at:
<a href="https://service.berlin.de/terminvereinbarung/nutzungsbedingungen/" target="_blank">https://service.berlin.de/terminvereinbarung/nutzungsbedingungen/</a>
</p>
<p>To use the service you have to enter personal data.
These contain your email address and your name.
This data is only used to fill in the registration form for appointments.
It is deleted as soon as the request is processed or cancelled.</p>
<p>You agree the the data will be submitted to appointment booking portal.
The portals privacy policy can be found at:
<a href="https://service.berlin.de/terminvereinbarung/datenschutzerklaerung.705213.php">https://service.berlin.de/terminvereinbarung/datenschutzerklaerung.705213.php</a>
</p>
{% endblock %}