Coverage for ivatar/ivataraccount/templates/assign_photo_openid.html: 89%

9 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2025-10-13 23:07 +0000

1{% extends 'base.html' %} 

2{% load i18n %} 

3  

4{% block title %}{% blocktrans with openid.openid as openid_address %}Choose a photo for {{ openid_address }}{% endblocktrans %}{% endblock title %} 

5  

6{% block content %} 

7<h1>{% blocktrans with openid.openid as openid_address %}Choose a photo for {{ openid_address }}{% endblocktrans %}</h1> 

8  

9{% if user.photo_set.count %} 

10 <p>{% trans 'Here are the pictures you have uploaded, click on the one you wish to associate with this openid address:' %}</p> 

11 <div class="photo-grid"> 

12 {% for photo in user.photo_set.all %} 

13 <form action="{% url 'assign_photo_openid' view.kwargs.openid_id %}" method="post" class="photo-card">{% csrf_token %} 

14 <input type="hidden" name="photo_id" value="{{ photo.id }}"> 

15 <button type="submit" name="photo{{ photo.id }}" class="nobutton"> 

16 <div class="panel panel-tortin"> 

17 <div class="panel-heading"> 

18 <h3 class="panel-title">{% if openid.photo.id == photo.id %}<i class="fa-solid fa-check"></i>{% endif %} {% trans 'Image' %} {{ forloop.counter }}</h3> 

19 </div> 

20 <div class="panel-body" style="height:130px"> 

21 <center> 

22 <img style="max-height:100px;max-width:100px" src="{% url 'raw_image' photo.id %}"> 

23 </center> 

24 </div> 

25 </div> 

26 </button> 

27 </form> 

28 {% endfor %} 

29 </div> 

30{% endif %} 

31  

32<div class="photo-grid"> 

33 <form action="{% url 'assign_photo_openid' view.kwargs.openid_id %}" method="post" class="photo-card">{% csrf_token %} 

34 <button type="submit" name="photoNone" class="nobutton"> 

35 <div class="panel panel-tortin"> 

36 <div class="panel-heading"> 

37 <h3 class="panel-title">{% if not openid.photo and not openid.bluesky_handle %}<i class="fa-solid fa-check"></i>{% endif %} {% trans 'No image' %}</h3> 

38 </div> 

39 <div class="panel-body" style="height:130px"> 

40 <center> 

41 <img style="max-height:100px;max-width:100px" src="/static/img/nobody/100.png"> 

42 </center> 

43 </div> 

44 </div> 

45 </button> 

46 </form> 

47 {% if openid.bluesky_handle %} 

48 <form action="" class="photo-card"> 

49 <div class="panel panel-tortin"> 

50 <div class="panel-heading"> 

51 <h3 class="panel-title"><i class="fa-solid fa-check"></i> {% trans "Bluesky" %}</h3> 

52 </div> 

53 <div class="panel-body" style="height:130px"> 

54 <center> 

55 <img style="max-height:100px;max-width:100px" src="{% url "blueskyproxy" openid.digest %}?size=100"> 

56 </center> 

57 </div> 

58 </div> 

59 </form> 

60 {% endif %} 

61</div> 

62  

63<div class="action-buttons"> 

64 <a href="{% url 'upload_photo' %}" class="btn btn-primary">{% blocktrans %}upload a new one{% endblocktrans %}</a> 

65 <a href="{% url 'import_photo' %}" class="btn btn-secondary">{% blocktrans %}Import from other services{% endblocktrans %}</a> 

66</div> 

67  

68<div style="margin-top: 2rem;"> 

69 <form action="{% url 'assign_bluesky_handle_to_openid' view.kwargs.openid_id %}" method="post">{% csrf_token %} 

70 <div class="form-group"> 

71 <label for="id_bluesky_handle">{% trans "Bluesky handle" %}:</label> 

72 {% if openid.bluesky_handle %} 

73 <input type="text" name="bluesky_handle" required value="{{ openid.bluesky_handle }}" class="form-control" id="id_bluesky_handle"> 

74 {% else %} 

75 <input type="text" name="bluesky_handle" required value="" placeholder="{% trans 'Bluesky handle' %}" class="form-control" id="id_bluesky_handle"> 

76 {% endif %} 

77 </div> 

78 <button type="submit" class="btn btn-primary">{% trans 'Assign Bluesky handle' %}</button> 

79 </form> 

80</div> 

81{% endblock content %}