Compare commits

1 Commits

Author SHA1 Message Date
hugo
20db73836c Style fixes and gitignore 2023-10-03 21:56:20 +02:00
5 changed files with 25 additions and 19 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
__pycacahe__/*

View File

@@ -7,4 +7,3 @@ Web app for tracking current ticket numbers
- keep all ticket numbers and timestamps in SQL table "tickets"
- display last ticket number
- don't allow tickets that are out of probable ticket number range
- if last submited ticket is timestamped more then 90 minutes ago, try to predict the next number

View File

@@ -1,7 +1,6 @@
from flask import render_template, request, redirect
from freeriders import app, db
from freeriders.models import Ticket
from datetime import datetime
import time
@app.route('/sms', methods=['GET'])
@@ -9,10 +8,7 @@ def sms():
if request.method == 'GET':
try:
lastticket = Ticket.query.order_by(Ticket.timestamp.desc()).first()
date = datetime.now()
datenow = f'{"{:02d}".format(date.day)}.{"{:02d}".format(date.month)}.{date.year}'
timenow = f'{"{:02d}".format(date.hour)}:{"{:02d}".format(date.minute)}:{date.second}'
return render_template('sms.html', ticket = lastticket, date = datenow, time = timenow)
return render_template('sms.html', ticket = lastticket)
except:
return 'Error retriving last ticket'
else:

View File

@@ -1,9 +1,9 @@
:root {
--border-radus: 1rem;
--background: #EEE;
--header-background: #DDD;
--background: #F9F9F9;
--header-background: #EEE;
--header-height: 3rem;
--input-bar-height: 2rem;
--input-bar-height: 3rem;
}
body{
@@ -14,14 +14,13 @@ body{
}
main {
max-width: 400px;
display: flex;
flex-direction: column;
align-self: flex-start;
gap: 1rem;
margin: 0 auto;
padding: 1rem 0.5rem;
height: calc(100vh - 5rem);
padding: 2rem 0.5rem;
height: calc(100vh - var(--header-height) - var(--input-bar-height));
overflow-y: scroll;
box-sizing: border-box;
}
@@ -30,22 +29,25 @@ header {
background-color: var(--header-background);
display: flex;
flex-direction: row;
padding: 1rem;
align-items: center;
padding: 0 1rem;
gap: 1rem;
font-weight: bold;
width: 100vw;
height: var(header-height);
height: var(--header-height);
box-sizing: border-box;
}
footer {
width: 100vw;
height: var(input-bar-height);
background-color: #FDD;
height: var(--input-bar-height);
background-color: var(--background);
display: flex;
flex-direction: row;
align-items: center;
padding: 0 1rem;
box-sizing: border-box;
gap: 1rem;
}
.request {
@@ -67,4 +69,12 @@ footer {
.date {
align-self: center;
margin-top: 0.5rem;
}
.textbox{
background-color: var(--header-background);
width: 80%;
height: 1rem;
padding: 0.2rem;
border-radius: 2rem;
}

View File

@@ -20,8 +20,8 @@
U Beogradu, za broj telefona ste kupili
VREMENSKU KARTU OD 90 MINUTA U ZONI A po
ceni od 50 din + osnovna cena poruke,
koja vazi do {{ date }}, {{ time }}.
Karta broj: {{ ticket }}.
koja vazi do 03.10.2023, 09:42:54.
Karta broj: 0000343232.
Placanjem operateru izmirujete dugovanja
za ovu kartu prema JKP Naplata prevozne
usluge Beograd. Sacuvajte ovu poruku.
@@ -59,4 +59,4 @@
<div>x</div>
</footer>
</body>
</html>
</html>