From 8fd88f18056bbb7cd96cfbb0083611f129731987 Mon Sep 17 00:00:00 2001 From: tebarius Date: Sun, 5 Nov 2023 22:28:37 +0100 Subject: [PATCH] css,mail,tel,url,calendar fertig --- .idea/runConfigurations/Dockerfile_Raspi.xml | 20 ++++ .idea/workspace.xml | 74 ++++++------ Dockerfile | 4 +- Dockerfile-RasPi | 4 +- Flask-QR.zip | Bin 1466 -> 0 bytes app/Flask-QR.py | 115 ++++++++++++++++++- app/static/style.css | 28 +++++ app/templates/base.html | 14 +++ app/templates/cal.html | 30 +++++ app/templates/index.html | 35 +++--- app/templates/mail.html | 24 ++++ app/templates/qr.html | 21 ++-- app/templates/tel.html | 12 ++ app/templates/text.html | 12 ++ app/templates/url.html | 15 +++ app/templates/wifi.html | 23 ++++ 16 files changed, 350 insertions(+), 81 deletions(-) create mode 100644 .idea/runConfigurations/Dockerfile_Raspi.xml delete mode 100644 Flask-QR.zip create mode 100644 app/static/style.css create mode 100644 app/templates/base.html create mode 100644 app/templates/cal.html create mode 100644 app/templates/mail.html create mode 100644 app/templates/tel.html create mode 100644 app/templates/text.html create mode 100644 app/templates/url.html create mode 100644 app/templates/wifi.html diff --git a/.idea/runConfigurations/Dockerfile_Raspi.xml b/.idea/runConfigurations/Dockerfile_Raspi.xml new file mode 100644 index 0000000..0e8fa78 --- /dev/null +++ b/.idea/runConfigurations/Dockerfile_Raspi.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4620587..7e2bba4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,18 +4,23 @@ + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f41cb70..c712de4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM python:slim LABEL authors="tebarius" -LABEL version="1.0" -LABEL description="Simple QR-Code-Generator-Server" +LABEL version="1.1" +LABEL description="QR-Code-Generator-Server with Flask-App" WORKDIR /app COPY ./app /app/ diff --git a/Dockerfile-RasPi b/Dockerfile-RasPi index e3b7d86..f1c64a9 100644 --- a/Dockerfile-RasPi +++ b/Dockerfile-RasPi @@ -1,8 +1,8 @@ FROM python:slim LABEL authors="tebarius" -LABEL version="1.0" -LABEL description="Simple QR-Code-Generator-Server" +LABEL version="1.1" +LABEL description="QR-Code-Generator-Server with Flask-App" WORKDIR /app COPY ./app /app/ diff --git a/Flask-QR.zip b/Flask-QR.zip deleted file mode 100644 index 963a75d24b285fc7b34e486d2ab68198a403604b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1466 zcmWIWW@Zs#U|`^2=2<_GpzVF* z9_N{sOW2R49O&lYoww&Tx5?U-XG|u?1+DD)^)1XyP;mFc>AzO*iz+k!Y7y}Fl~eCS zu9uU~8{T<(lh5f%IZv;(qDr-++YT%4lS|nHmrKV;+$fW^DJ|Qf^Zf1S)6qEw=cBsh zZbcT@xju5WXW$e*Y4GbxwC)BfM|)g)W`^68YSUu|a7 zbYHApdg@Z<3cnMp-gsvGe-?Z2X=2-pml2s_OfdQMu z#J~Uwa)i3fyp+@my^NCFoZ6t1euoVN_9}nmZ=SegX{PqUg{6lUhI~1uq;lk9=kk@I z`UktOe0#m|@)9kM4gATK_l%6q_EuFy?WwiVPkcO8M_)gqOJQan*P)3e<|it81jN4{ z^45uu+uZtahV3G^(|b0Wycgn}`@JAaa-V;pDdY3+LfnrEpBt;WE=~_v{4L{oz{aZE z5yB?tvy^-19yC=tR-J5l>x_|J)9iyU#IDY9c|3pLYR^v@|2KNrF4=X9B}RI6!__#6 z*a`mDUUw($Kbi6(dJ~tbOIgxfj_k#?&yFyr8@zp0oz6FBqEJgyorhqz^p)=>?@hd- zZaRj%Fsu0Rd)s%l1v3vVZhmll#ue@&bF~FG{1)Z?S*9@g<&Tia)bpyVAMCxjcbRMZ zyeZxbXJ@Q^DDcLY!|UAZTpyW$%YQolPkrmO^oZr$P(IWD#}-veW!Uh{es*~C^S|xC zm=HlfwJkop&&ak>8W{9Uz@QgI3Hrh!aJWwmwDkvu``w8@_`{VqE)AR*5v1?W-$I;GB%L*k!UPxr}EnRg_ z`qSRao=?{<=UFFUc*QnzNy`+o+UW}`sRblpXa;2l~ten^B7MapO&F_ zwWoe=lF>nO>CWAY;^Wf-l2{r)5N*mnOa@$@oO1-v!}LRGI;E= zEGtC*L&X9UxnJS|-i%E4-~@}Uj8K6leFZ3uRAO*3Km-{XBp6;8HK~g6+yX`cDnJ;H zEib_g7XWH91?olQ7-X~WdhYEJ#%ngV{0B2z0cdtCirI+Vh-}MQCBn8~CN*SRZU7S> g!UxcVhirw4g0Q;~R*$f + # DESCRIPTION: + # LOCATION: + # DTSTART:20231114T090000 + # DTEND:20231123T110000 + # END:VEVENT + sdt = request.args.get('sdate').replace('-', '') + if request.args.get('edate') == "": + edt = sdt + else: + edt = request.args.get('edate').replace('-', '') + if request.args.get('stime') != "": + sdt += f"T{request.args.get('stime').replace(':', '')}00" + if request.args.get('etime') != "": + edt += f"T{request.args.get('etime').replace(':', '')}00" + data = (f"BEGIN:VEVENT\nSUMMARY:{request.args.get('title')}\n" + f"DESCRIPTION: {request.args.get('description')}\n" + f"LOCATION:{request.args.get('location')}\n" + f"DTSTART:{sdt}\nDTEND:{edt}\n" + f"END:VEVENT") + + elif request.args.get('type') == "mail": + more = False + data = f"mailto:{request.args.get('mail')}" + if request.args.get('cc') != "": + data += f"?cc={request.args.get('cc')}" + more = True + if request.args.get('bcc') != "": + if more: + data += "&" + else: + data += "?" + more = True + data += f"bcc={request.args.get('bcc')}" + if request.args.get('subject') != "": + if more: + data += "&" + else: + data += "?" + more = True + data += f"subject={request.args.get('subject')}" + if request.args.get('body') != "": + if more: + data += "&" + else: + data += "?" + data += f"body={request.args.get('body')}" + + else: + data = "Sorry kein Inhalt!!!" return render_template('qr.html', data=data) if __name__ == "__main__": - app.run(host='0.0.0.0', port=80) + app.run(host='0.0.0.0', port=80, debug=True) diff --git a/app/static/style.css b/app/static/style.css new file mode 100644 index 0000000..2447cc2 --- /dev/null +++ b/app/static/style.css @@ -0,0 +1,28 @@ + H1 { + text-align: center; + background-color: #eee; + border-radius: 60px; + filter: drop-shadow(10px 10px 20px blue); + font-size: 70px; + } + p { + text-align: center; + font-size: 50px; + } + div { + text-align: center; + font-size: 50px; + } + form { + text-align: center; + font-size: 50px; + } + input { font-size: 30px; + } + button { + border: solid gainsboro; + font-size: 30px; + margin: 15px; + border-radius: 50px; + filter: drop-shadow(10px 10px 10px blue); + } diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..7c4b9be --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,14 @@ + + + + QR-Code-Generator + + + + + +

QRCode-Generator

+ {% block inhalt %} + {% endblock %} + + diff --git a/app/templates/cal.html b/app/templates/cal.html new file mode 100644 index 0000000..0ac21d2 --- /dev/null +++ b/app/templates/cal.html @@ -0,0 +1,30 @@ +{% extends "base.html" %} + +{% block inhalt %} +
+
+ + + +
+ +
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +{% endblock %} diff --git a/app/templates/index.html b/app/templates/index.html index 6211232..65d5f3c 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,23 +1,14 @@ - - - - QR-Code-Generator - - -

QRCode-Generator

-

+{% extends "base.html" %} -

-
-
- -

- - -
- - - - - - +{% block inhalt %} +

+ Welche Art von QR-Code soll generiert werden?
+

+ + + + + + + +{% endblock %} diff --git a/app/templates/mail.html b/app/templates/mail.html new file mode 100644 index 0000000..9167cea --- /dev/null +++ b/app/templates/mail.html @@ -0,0 +1,24 @@ +{% extends "base.html" %} + +{% block inhalt %} +
+
+ + + +
+
+ +
+ +
+ +
+ +
+
+ + +
+ +{% endblock %} diff --git a/app/templates/qr.html b/app/templates/qr.html index 09784b9..0d808e6 100644 --- a/app/templates/qr.html +++ b/app/templates/qr.html @@ -1,20 +1,15 @@ - - - - QR-Code-Generator - - -

QRCode-Generator

-

- folgender Text wurde im QR-Code codiert:
+{% extends "base.html" %} + +{% block inhalt %} +

+ folgendes wurde im QR-Code codiert:
{{ data }}

- QR-Code für {{ data }} + QR-Code für {{ data }}

-

+

Noch einmal bitte!

+{% endblock %} - - diff --git a/app/templates/tel.html b/app/templates/tel.html new file mode 100644 index 0000000..41e3737 --- /dev/null +++ b/app/templates/tel.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block inhalt %} +
+
+ + +

+ + +
+{% endblock %} diff --git a/app/templates/text.html b/app/templates/text.html new file mode 100644 index 0000000..e4db86d --- /dev/null +++ b/app/templates/text.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block inhalt %} +
+
+ + +

+ + +
+{% endblock %} diff --git a/app/templates/url.html b/app/templates/url.html new file mode 100644 index 0000000..5e44cc9 --- /dev/null +++ b/app/templates/url.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block inhalt %} +
+
+ + + +
+
+ + +
+ +{% endblock %} diff --git a/app/templates/wifi.html b/app/templates/wifi.html new file mode 100644 index 0000000..06e84af --- /dev/null +++ b/app/templates/wifi.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} + +{% block inhalt %} +
+
+ + + +
+ + + + + + + + +
+ + +
+ +{% endblock %}