diff --git a/ftracker/core.py b/ftracker/core.py index 395eed9..2414b97 100644 --- a/ftracker/core.py +++ b/ftracker/core.py @@ -66,7 +66,7 @@ def post_arrival(): db.insert({ 'name': name, 'room': data['room'], - 'arrival': now.isoformat(), + 'arrival': data.get('arrival') or now.isoformat(), 'departure': None }) @@ -104,7 +104,7 @@ def post_departure(): now = datetime.utcnow() db.update( - operations.set('departure', now.isoformat()), + operations.set('departure', data.get('departure') or now.isoformat()), (Entry.name == name) & (Entry.departure == None) ) diff --git a/web/index.html b/web/index.html index 0479ca7..c9705c4 100644 --- a/web/index.html +++ b/web/index.html @@ -42,6 +42,7 @@ input { border: none; padding: 16px; + margin: 4px 0; font-size: 16px; } input[type=text] { @@ -62,6 +63,21 @@ width: 32px; margin-right: 8px; } + .request { + display: block; + position: fixed; + background: #ddd; + top: 16px; + left: 16px; + width: calc(100% - 32px); + box-shadow: 0 1px 4px 0; + } + input[type=datetime-local] { + width: calc(100% - 24px); + padding: 12px; + font-size: 12px; + background: #fff; + } -
+