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

20 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-05-12 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 not 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 openid.photo.id == photo.id %}<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</div> 

59  

60<div class="row"> 

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

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

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

64 </div> 

65  

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

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

68 <div class="form-group"> 

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

70 {% if openid.bluesky_handle %} 

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

72 {% else %} 

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

74 {% endif %} 

75 </div> 

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

77 </form> 

78 </div> 

79</div> 

80  

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

82{% endblock content %}