Improvements

This commit is contained in:
Edward Betts 2023-09-08 01:52:04 +01:00
parent 084c886933
commit bec16f8dcb
4 changed files with 40 additions and 12 deletions

View file

@ -48,7 +48,11 @@ def show_message() -> str:
wiki_part2=wiki_part2, 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__": if __name__ == "__main__":

View file

@ -1,7 +1,5 @@
{# vim:ft=jinja {# vim:ft=jinja
#} #}
Request to use your photo of {{ name }} on Wikipedia
Hi, Hi,
I wanted to get in touch regarding your photo of {{ name }}, which I came across on Flickr: I wanted to get in touch regarding your photo of {{ name }}, which I came across on Flickr:

View file

@ -1,11 +1,24 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title></title> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Flickr Mail</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
</head> </head>
<body> <body>
<pre>{{ msg }}</pre> <div class="container my-3">
<div><strong>Subject:</strong> {{ subject }}
<div>
<h3>message</h3>
{% for p in lines %}
<p>{{ p }}</p>
{% endfor %}
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" crossorigin="anonymous"></script>
</body> </body>
</html> </html>

View file

@ -1,19 +1,32 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>URL Input Form</title> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Flickr Mail</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
</head> </head>
<body> <body>
<div class="container">
<div class="row">
<h1>Enter URLs</h1> <h1>Enter URLs</h1>
<form action="{{ url_for("show_message") }}"> <form action="{{ url_for("show_message") }}">
<label for="flickr_url">Flickr URL:</label> <div class="mb-3">
<input type="text" id="flickr" name="flickr" required><br><br> <label for="flickr" class="form-label">Flickr URL:</label>
<input type="text" class="form-control" id="flickr" name="flickr" required>
</div>
<label for="wikipedia_url">Wikipedia URL:</label> <div class="mb-3">
<input type="text" id="wikipedia" name="wikipedia" required><br><br> <label for="wikipedia" class="form-label">Wikipedia URL:</label>
<input type="text" class="form-control" id="wikipedia" name="wikipedia" required>
</div>
<input type="submit" value="Submit"> <input type="submit" value="Submit">
</form> </form>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" crossorigin="anonymous"></script>
</body> </body>
</html> </html>