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

41 statements  

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

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

2  

3{% block content %} 

4 <div class="row"> 

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

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

7 <div class="panel-heading">Current members of the X.Org Foundation for the period {{current_membership_period.short_name}} ({{object_list|length}})</div> 

8 <div class="panel-body"> 

9 <table class="table table-striped table-hover table-bordered table-sm sortable" id="suppressed_machine_lst"> 

10 <thead> 

11 <tr> 

12 <th>Full name</th> 

13 <th>Affiliation</th> 

14 <th>Public statement</th> 

15 {% if user.is_superuser %}<th>Action</th>{% endif %} 

16 </tr> 

17 </thead> 

18 <tbody> 

19 {% for member in object_list %} 

20 <tr> 

21 <td>{{member.user_profile.user.get_full_name}}</td> 

22 <td>{{member.user_profile.affiliation|default:"Unknown"}}</td> 

23 <td>{{member.user_profile.public_statement|linebreaks}}</td> 

24 {% if user.is_superuser %}<td> 

25 {% if member.user_profile.user != user and not member.user_profile.user.is_superuser %} 

26 <form action="{% url 'members-user-to-admin' pk=member.user_profile.user.id %}" method="post">{% csrf_token %}<input type="submit" value="Make Admin"></form> 

27 {% elif member.user_profile.user != user and member.user_profile.user.is_superuser %} 

28 <form action="{% url 'members-admin-to-user' pk=member.user_profile.user.id %}" method="post">{% csrf_token %}<input type="submit" value="Make User"></form> 

29 {% else %} 

30 No actions available 

31 {% endif %} 

32 </td> 

33 {% endif %} 

34 </tr> 

35 {% empty %} 

36 <tr><td colspan="{% if user.is_superuser %}4{% else %}3{% endif %}" class="text-center">No members yet. How about <a href="{% url 'membership-application' %}">applying</a>?</td></tr> 

37 {% endfor %} 

38 </tbody> 

39 </table> 

40 </div> 

41 </div> 

42 </div> 

43 </div> 

44{% endblock %}