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

19 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-03-28 00:10 +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  

22{% url 'upload_photo' as upload_url %} 

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

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

30<div class="row"> 

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

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

65  

66{% endif %} 

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

68{% endblock content %}