Coverage for ivatar/ivataraccount/templates/assign_photo_email.html: 95%
20 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-12 23:12 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-12 23:12 +0000
1{% extends 'base.html' %}
2{% load i18n %}
4{% block title %}{% blocktrans with email.email as email_address %}Choose a photo for {{ email_address }}{% endblocktrans %}{% endblock title %}
6{% block content %}
7<style>
8.nobutton {
9background: none;
10color: inherit;
11border: none;
12padding: 0;
13font: inherit;
14cursor: pointer;
15outline: inherit;
16}
17</style>
18<h1>{% blocktrans with email.email as email_address %}Choose a photo for {{ email_address }}{% endblocktrans %}</h1>
20{% if user.photo_set.count %}
21 <p>{% trans 'Here are the pictures you have uploaded, click on the one you wish to associate with this email address:' %}</p>
22 <div class="row">
23 {% for photo in user.photo_set.all %}
24 <form action="{% url 'assign_photo_email' view.kwargs.email_id %}" method="post" style="float:left;margin-left:20px">{% csrf_token %}
25 <input type="hidden" name="photo_id" value="{{ photo.id }}">
26 <button type="submit" name="photo{{ photo.id }}" class="nobutton">
27 <div class="panel panel-tortin" style="width:132px;margin:0">
28 <div class="panel-heading">
29 <h3 class="panel-title">{% if email.photo.id == photo.id %}<i class="fa fa-check"></i>{% endif %} {% trans 'Image' %} {{ forloop.counter }}</h3>
30 </div>
31 <div class="panel-body" style="height:130px">
32 <center>
33 <img style="max-height:100px;max-width:100px" src="{% url 'raw_image' photo.id %}">
34 </center>
35 </div>
36 </div>
37 </button>
38 </form>
39 {% endfor %}
40{% endif %}
42<div class="row">
43 <form action="{% url 'assign_photo_email' view.kwargs.email_id %}" method="post" style="float:left;margin-left:20px">{% csrf_token %}
44 <button type="submit" name="photoNone" class="nobutton">
45 <div class="panel panel-tortin" style="width:132px;margin:0">
46 <div class="panel-heading">
47 <h3 class="panel-title">{% if email.photo.id == photo.id %}{% if not email.bluesky_handle %}<i class="fa fa-check"></i>{% endif %}{% endif %} {% trans 'No image' %}</h3>
48 </div>
49 <div class="panel-body" style="height:130px">
50 <center>
51 <img style="max-height:100px;max-width:100px" src="/static/img/nobody/100.png">
52 </center>
53 </div>
54 </div>
55 </button>
56 </form>
57 {% if email.bluesky_handle %}
58 <form action="" style="float:left;margin-left:20px">
59 <div class="panel panel-tortin" style="width:132px;margin:0">
60 <div class="panel-heading">
61 <h3 class="panel-title"><i class="fa fa-check"></i> {% trans "Bluesky" %}</h3>
62 </div>
63 <div class="panel-body" style="height:130px">
64 <center>
65 <img style="max-height:100px;max-width:100px" src="{% url "blueskyproxy" email.digest %}?size=100">
66 </center>
67 </div>
68 </div>
69 </form>
70 {% endif %}
71</div>
73<div class="row">
74 <div style="height:8px"></div>
75 <a href="{% url 'upload_photo' %}" class="button">{% blocktrans %}Upload a new one{% endblocktrans %}</a>
76 <a href="{% url 'import_photo' %}" class="button">{% blocktrans %}Import from other services{% endblocktrans %}</a>
77 </div>
79 <div style="height:8px"></div>
80 <form action="{% url 'assign_bluesky_handle_to_email' view.kwargs.email_id %}" method="post" style="float:left;margin-left:20px">{% csrf_token %}
81 <div class="form-group">
82 <label for="id_bluesky_handle">{% trans "Bluesky handle" %}:</label>
83 {% if email.bluesky_handle %}
84 <input type="text" name="bluesky_handle" required value="{{ email.bluesky_handle }}" class="form-control" id="id_bluesky_handle">
85 {% else %}
86 <input type="text" name="bluesky_handle" required value="" placeholder="{% trans 'Bluesky handle' %}" class="form-control" id="id_bluesky_handle">
87 {% endif %}
88 </div>
89 <button type="submit" class="button">{% trans 'Assign Bluesky handle' %}</button>
90 </form>
91 </div>
92</div>
94<div style="height:40px"></div>
95{% endblock content %}