2023-09-08 03:46:04 +01:00
|
|
|
{% 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="wikipedia" class="form-label">Wikipedia URL:</label>
|
|
|
|
<input type="text" class="form-control" id="wikipedia" name="wikipedia" value="{{ wikipedia_url }}" required>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<input type="submit" value="Submit">
|
|
|
|
</form>
|
|
|
|
|
|
|
|
{% if name %}
|
|
|
|
|
2023-09-08 03:46:04 +01:00
|
|
|
<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>
|
2023-09-08 03:46:04 +01:00
|
|
|
|
2023-09-08 19:03:07 +01:00
|
|
|
<form action="{{ url_for(request.endpoint) }}">
|
2023-09-08 03:46:04 +01:00
|
|
|
<input type="hidden" name="wikipedia" value="{{ wikipedia_url }}"></input>
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="flickr" class="form-label">Flickr URL:</label>
|
2023-09-08 19:03:07 +01:00
|
|
|
<input type="text" class="form-control" id="flickr" name="flickr" value="{{ flickr_url }}" required>
|
2023-09-08 03:46:04 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<input type="submit" value="Submit">
|
|
|
|
</form>
|
|
|
|
|
2023-09-08 12:11:42 +01:00
|
|
|
{% endif %}
|
2023-09-08 03:46:04 +01:00
|
|
|
|
2023-09-08 19:03:07 +01:00
|
|
|
{% 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 12:52:11 +01:00
|
|
|
<div>Source code and bug reports: <a href="https://git.4angle.com/edward/flickr-mail">https://git.4angle.com/edward/flickr-mail</div>
|
|
|
|
|
2023-09-08 03:46:04 +01:00
|
|
|
</div>
|
2023-09-08 12:11:42 +01:00
|
|
|
</div>
|
2023-09-08 03:46:04 +01:00
|
|
|
{% endblock %}
|
2023-09-08 19:03:07 +01:00
|
|
|
|
|
|
|
{% block scripts %}
|
2023-09-09 15:05:38 +01:00
|
|
|
{% if subject and lines %}
|
2023-09-08 19:03:07 +01:00
|
|
|
<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 %}
|
2023-09-08 19:03:07 +01:00
|
|
|
{% endblock %}
|