Coverage for ivatar/ivataraccount/templates/assign_photo_email.html: 100%

20 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2024-12-26 00:11 +0000

1{% extends 'base.html' %} 

2{% load i18n %} 

3  

4{% block title %}{% blocktrans with email.email as email_address %}Choose a photo for {{ email_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 email.email as email_address %}Choose a photo for {{ email_address }}{% endblocktrans %}</h1> 

19  

20{% if not user.photo_set.count %} 

21  

22{% url 'upload_photo' as upload_url %} 

23<h4>{% blocktrans %}You need to <a href="{{ upload_url }}">upload some photos</a> first!{% endblocktrans %}</h4> 

24  

25<p><a href="{% url 'profile' %}" class="button">{% trans 'Back to your profile' %}</a></p> 

26  

27{% else %} 

28  

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

30<div class="row"> 

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

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

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

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

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

36 <div class="panel-heading"> 

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

38</div> 

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

40 <center> 

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

42 </center> 

43</div> 

44</div> 

45</button> 

46 </form> 

47{% endfor %} 

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

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

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

51 <div class="panel-heading"> 

52 <h3 class="panel-title">{% if email.photo.id == photo.id %}<i class="fa fa-check"></i>{% endif %} {% trans 'No image' %}</h3> 

53</div> 

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

55 <center> 

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

57 </center> 

58</div> 

59</div> 

60</button> 

61 </form> 

62</div> 

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

64 <a href="{% url 'upload_photo' %}" class="button">{% blocktrans %}Upload a new one{% endblocktrans %}</a>&nbsp;&nbsp; 

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

66{% endif %} 

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

68{% endblock content %}