From bec16f8dcb2890fe5b22b7fbb00b3e283baf6ab2 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 8 Sep 2023 01:52:04 +0100 Subject: [PATCH] Improvements --- main.py | 6 +++++- templates/message.jinja | 2 -- templates/show_message.html | 19 ++++++++++++++++--- templates/start_form.html | 25 +++++++++++++++++++------ 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index e10ede5..3e2e2f2 100755 --- a/main.py +++ b/main.py @@ -48,7 +48,11 @@ def show_message() -> str: wiki_part2=wiki_part2, ) - return flask.render_template("show_message.html", msg=msg) + subject = f"Request to use your photo of {name} on Wikipedia" + + lines = msg.split("\n\n") + + return flask.render_template("show_message.html", subject=subject, lines=lines) if __name__ == "__main__": diff --git a/templates/message.jinja b/templates/message.jinja index a60e2e5..9469cfa 100644 --- a/templates/message.jinja +++ b/templates/message.jinja @@ -1,7 +1,5 @@ {# vim:ft=jinja #} -Request to use your photo of {{ name }} on Wikipedia - Hi, I wanted to get in touch regarding your photo of {{ name }}, which I came across on Flickr: diff --git a/templates/show_message.html b/templates/show_message.html index a6e49d1..503950a 100644 --- a/templates/show_message.html +++ b/templates/show_message.html @@ -1,11 +1,24 @@ - - + + + + Flickr Mail + -
{{ msg }}
+
+
Subject: {{ subject }} +
+

message

+ {% for p in lines %} +

{{ p }}

+ {% endfor %} +
+
+ + diff --git a/templates/start_form.html b/templates/start_form.html index a4ac8d4..67e0862 100644 --- a/templates/start_form.html +++ b/templates/start_form.html @@ -1,19 +1,32 @@ - URL Input Form + + + + Flickr Mail + +
+

Enter URLs

- -

+
+ + +
- -

+
+ + +
+ +
+
+ -