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

20 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-09-17 23:12 +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<style> 

8.nobutton { 

9background: none; 

10color: inherit; 

11border: none; 

12padding: 0; 

13font: inherit; 

14cursor: pointer; 

15outline: inherit; 

16} 

17</style> 

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

19  

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 openid address:' %}</p> 

22 <div class="row"> 

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

24 <form action="{% url 'assign_photo_openid' view.kwargs.openid_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 openid.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  

41{% endif %} 

42  

43<div class="row"> 

44 <form action="{% url 'assign_photo_openid' view.kwargs.openid_id %}" method="post" style="float:left;margin-left:20px">{% csrf_token %} 

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

46 <div class="panel panel-tortin" style="width:132px;margin:0"> 

47 <div class="panel-heading"> 

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

49 </div> 

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

51 <center> 

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

53 </center> 

54 </div> 

55 </div> 

56 </button> 

57 </form> 

58 {% if openid.bluesky_handle %} 

59 <form action="" style="float:left;margin-left:20px"> 

60 <div class="panel panel-tortin" style="width:132px;margin:0"> 

61 <div class="panel-heading"> 

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

63 </div> 

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

65 <center> 

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

67 </center> 

68 </div> 

69 </div> 

70 </form> 

71 {% endif %} 

72</div> 

73  

74<div class="row"> 

75 <div style="height:8px"></div> 

76 <a href="{% url 'upload_photo' %}" class="button">{% blocktrans %}upload a new one{% endblocktrans %}</a> 

77 <a href="{% url 'import_photo' %}" class="button">{% blocktrans %}Import from other services{% endblocktrans %}</a> 

78 </div> 

79  

80 <div style="height:8px"></div> 

81 <form action="{% url 'assign_bluesky_handle_to_openid' view.kwargs.openid_id %}" method="post" style="float:left;margin-left:20px">{% csrf_token %} 

82 <div class="form-group"> 

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

84 {% if openid.bluesky_handle %} 

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

86 {% else %} 

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

88 {% endif %} 

89 </div> 

90 <button type="submit" class="button">{% trans 'Assign Bluesky handle' %}</button> 

91 </form> 

92 </div> 

93</div> 

94  

95<div style="height:40px"></div> 

96{% endblock content %}