Coverage for gui/templates/gui/index.html: 100%

81 statements  

« prev     ^ index     » next       coverage.py v7.2.1, created at 2023-03-14 06:24 +0000

1{% extends 'gui/base.html' %} 

2{% load humanize %} 

3  

4{% block content %} 

5 <div class="row"> 

6 <div class="col-md-12"> 

7 <div class="panel panel-default" > 

8 <div class="panel-heading">Our role</div> 

9 <div class="panel-body"> 

10 <p>The X.Org project provides an open source implementation of the X Window System. The development work is being done in conjunction with the freedesktop.org community.</p> 

11  

12 <p>The X.Org Foundation is the educational non-profit corporation whose Board serves this effort, and whose Members lead this work.</p> 

13 </div> 

14 </div> 

15 </div> 

16 </div> 

17 <div class="row"> 

18 <div class="col-md-4"> 

19 <div class="panel panel-default" > 

20 <div class="panel-heading">Useful Links</div> 

21 <div class="panel-body"> 

22 <ul> 

23 {% for link in links %} 

24 <li><a href="{{link.url}}" {% if link.description %}title="{{link.description}}"{% endif %}>{{link.short_name}}</a></li> 

25 {% endfor %} 

26 </ul> 

27 </div> 

28 </div> 

29 </div> 

30 {% if user.is_authenticated %} 

31 {% if user.profile.membership is not None %} 

32 {% with membership=user.profile.membership %} 

33 <div class="col-md-4"> 

34 <div class="panel panel-default {% if membership.is_pending %}panel-warning{% elif membership.is_rejected %}panel-danger{% elif membership.is_approved %}panel-success{% endif %}"> 

35 <div class="panel-heading">Application for the period: {{current_membership_period.short_name}}</div> 

36 <div class="panel-body text-center"> 

37 {% if membership.is_pending %} 

38 <p>Thanks for applying, your application is being processed!</p> 

39 {% elif membership.is_rejected %} 

40 <p>Your application has been rejected. Reason:</p> 

41 {{membership.rejection_reason|linebreaks}} 

42 {% elif membership.is_approved %} 

43 <p>Your application has been approved, thanks for being a member!</p> 

44 {% endif %} 

45 </div> 

46 </div> 

47 </div> 

48 {% endwith %} 

49 {% else %} 

50 <div class="col-md-4"> 

51 <div class="panel panel-default panel-warning" > 

52 <div class="panel-heading">{% if user.profile.last_membership %}Re-new membership{% else %}Apply for membership{% endif %}: {{current_membership_period.short_name}}</div> 

53 <div class="panel-body text-center"> 

54 <p>{{current_membership_period.description}}</p> 

55 <a class="btn btn-primary" href="{% url 'membership-application' %}" role="button">Apply</a> 

56 </div> 

57 </div> 

58 </div> 

59 {% endif %} 

60 {% else %} 

61 <div class="col-md-4"> 

62 <div class="panel panel-default panel-danger" > 

63 <div class="panel-heading">Log-in or Sign-up</div> 

64 <div class="panel-body text-center"> 

65 Please <a href="{% url 'account_login' %}">log-in</a> or <a href="{% url 'account_signup' %}">sign-up</a> to access more information. 

66 </div> 

67 </div> 

68 </div> 

69 {% endif %} 

70 {% if user.is_authenticated and user.profile.membership is not None and user.profile.active_ballots|length > 0 %} 

71 <div class="col-md-4"> 

72 <div class="panel panel-warning" > 

73 <div class="panel-heading">Active ballots ({{user.profile.active_ballots|length}})</div> 

74 <div class="panel-body"> 

75 <ul> 

76 {% for ballot, has_voted in user.profile.active_ballots %} 

77 <li><a {% if not has_voted %}href="{% url 'ballot-vote' ballot.id %}"{% endif %} title="{{ballot.description|default:''}}">{{ballot.short_name}}</a>{% if has_voted %} (voted){% endif %}: Closing {{ballot.closing_on|naturaltime}}{% if user.is_superuser %} (<a href= "{% url 'ballot-admin' ballot.id %}">admin</a>){% endif %}</li> 

78 {% endfor %} 

79 </ul> 

80 </div> 

81 </div> 

82 </div> 

83 {% endif %} 

84 </div> 

85{% endblock %}