Skip to content

Commit

Permalink
userlist use qualification badges
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrindt committed Aug 29, 2023
1 parent 5563dcb commit b6b9ab4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
40 changes: 23 additions & 17 deletions ephios/core/templates/core/userprofile_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,37 @@ <h1>
{% for userprofile in userprofile_list %}
<li class="list-group-item">
<div class="row mb-0">
<div class="col-8 col-lg-3">
<h5 class="mb-0">
<div class="col-12 col-lg-5">
<h5 class="mb-0 d-inline">
{{ userprofile.get_full_name }}
</h5>
<span class="float-end">
{% if userprofile.is_minor %}
<span class="badge bg-warning">{% translate "Minor" %}</span>
{% endif %}
{% if not userprofile.is_active %}
<span class="badge bg-danger">{% translate "Inactive" %}</span>
{% elif userprofile.is_staff %}
<span class="badge bg-info">{% translate "Admin" %}</span>
{% endif %}
</span>
<br/>
<a class="link-dark link-underline-opacity-0 link-opacity-50 link-underline-opacity-50-hover link-opacity-100-hover"
href="mailto:{{ userprofile.email }}">{{ userprofile.email }}</a>
</div>
<div class="col-4 col-lg-3 d-flex justify-content-end align-items-start pt-1 gap-1">
{% if userprofile.is_minor %}
<span class="badge bg-warning">{% translate "Minor" %}</span>
{% endif %}
{% if not userprofile.is_active %}
<span class="badge bg-danger">{% translate "Inactive" %}</span>
{% elif userprofile.is_staff %}
<span class="badge bg-info">{% translate "Admin" %}</span>
{% endif %}
</div>
<div class="col-8 col-lg">
<div class="text-body-secondary">
<span class="fa fa-users"></span>
{{ userprofile.groups.all|join:", " }}
<div class="text-">
{% if userprofile.groups.all %}
<span class="fas fa-users"></span>
{{ userprofile.groups.all|join:", " }}
{% else %}
<span class="fas fa-users-slash" title="{% translate "no groups" %}"></span>
{% endif %}
</div>
<div class="text-body-secondary">
<span class="fa fa-certificate"></span>
{{ userprofile.qualification_grants.all|grants_to_essential_abbreviations|join:", " }}
{% for abbreviation in userprofile.qualification_grants.all|grants_to_essential_abbreviations %}
<span class='badge bg-secondary text-dark'>{{ abbreviation }}</span>
{% endfor %}
</div>
</div>
<div class="col-4 col-lg-auto d-flex align-items-center justify-content-end">
Expand Down
2 changes: 1 addition & 1 deletion ephios/core/views/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def get_queryset(self):
if self.filter_form.is_valid():
qs = self.filter_form.filter_events(qs)
else:
# saveguard for not loading too many events
# safeguard for not loading too many events
qs = qs.filter(end_time__gte=timezone.now()).order_by("start_time", "end_time")
return qs

Expand Down

0 comments on commit b6b9ab4

Please sign in to comment.