flickr-mail/templates/combined.html

75 lines
2.2 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% block title %}Flickr mail{% endblock %}
{% block content %}
<div class="container">
2023-09-08 12:11:42 +01:00
<div class="row">
2023-09-09 15:05:29 +01:00
<h1>Flickr mail</h1>
2023-09-08 12:11:42 +01:00
<form action="{{ url_for(request.endpoint) }}">
<div class="mb-3">
<label for="enwp" class="form-label">Wikipedia article URL or title:</label>
<input type="text" class="form-control" id="enwp" name="enwp" value="{{ enwp }}" required>
2023-09-08 12:11:42 +01:00
</div>
<input type="submit" value="Submit">
</form>
{% if name %}
<p>Wikipedia article: {{ name }}</p>
2023-09-29 12:40:30 +01:00
<p><a href="https://flickr.com/search/?view_all=1&safe_search=3&text={{ '"' + name + '"' | urlencode }}" target="_blank">Search flickr</a></p>
<form action="{{ url_for(request.endpoint) }}">
<input type="hidden" name="enwp" value="{{ enwp }}"></input>
<div class="mb-3">
<label for="flickr" class="form-label">Flickr URL:</label>
<input type="text" class="form-control" id="flickr" name="flickr" value="{{ flickr_url }}" required>
</div>
<input type="submit" value="Submit">
</form>
2023-09-08 12:11:42 +01:00
{% endif %}
{% if flickr_url %}
<p><a href="https://www.flickr.com/mail/write/?to={{nsid}}">send message</a>
<div><strong>Subject:</strong> {{ subject }} <button class="btn btn-primary" id="copy-subject">copy</button>
<div>
<h3>message
<button class="btn btn-primary" id="copy-message">copy</button>
</h3>
{% for p in lines %}
<p>{{ p }}</p>
{% endfor %}
</div>
{% endif %}
2023-09-29 13:12:02 +01:00
<div class="mt-3">Written by <a href="/">Edward Betts</a>. Source code and bug reports: <a href="https://git.4angle.com/edward/flickr-mail">https://git.4angle.com/edward/flickr-mail</div>
2023-09-29 12:52:11 +01:00
</div>
2023-09-08 12:11:42 +01:00
</div>
{% endblock %}
{% block scripts %}
2023-09-09 15:05:38 +01:00
{% if subject and lines %}
<script>
var copy_subject = document.getElementById("copy-subject");
var copy_message = document.getElementById("copy-message");
var subject = {{ subject | tojson }};
var message = {{ "\n\n".join(lines) | tojson }};
copy_subject.addEventListener("click", function(e) {
navigator.clipboard.writeText(subject);
});
copy_message.addEventListener("click", function(e) {
navigator.clipboard.writeText(message);
});
</script>
2023-09-09 15:05:38 +01:00
{% endif %}
{% endblock %}