mirror of
https://github.com/ae-utbm/sith.git
synced 2025-03-10 07:17:11 +00:00
remove ClubStatView
This commit is contained in:
parent
6a17e4480e
commit
87559a384a
@ -1,49 +0,0 @@
|
|||||||
{% extends "core/base.jinja" %}
|
|
||||||
|
|
||||||
{% block title %}
|
|
||||||
{% trans %}Club stats{% endtrans %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
{% if club_list %}
|
|
||||||
<h3>{% trans %}Club stats{% endtrans %}</h3>
|
|
||||||
<form action="" method="GET">
|
|
||||||
{% csrf_token %}
|
|
||||||
<p>
|
|
||||||
<select name="branch">
|
|
||||||
{% for b in settings.SITH_PROFILE_DEPARTMENTS %}
|
|
||||||
<option value="{{ b[0] }}">{{ b[0] }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</p>
|
|
||||||
<p><input type="submit" value="{% trans %}Show{% endtrans %}" /></p>
|
|
||||||
</form>
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td>Club</td>
|
|
||||||
<td>Member number</td>
|
|
||||||
<td>Old member number</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for c in club_list.order_by('id') %}
|
|
||||||
{% set members = c.members.all() %}
|
|
||||||
{% if request.GET['branch'] %}
|
|
||||||
{% set members = members.filter(user__department=request.GET['branch']) %}
|
|
||||||
{% endif %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ c.get_display_name() }}</td>
|
|
||||||
<td>{{ members.filter(end_date=None, role__gt=settings.SITH_MAXIMUM_FREE_ROLE).count() }}</td>
|
|
||||||
<td>{{ members.exclude(end_date=None, role__gt=settings.SITH_MAXIMUM_FREE_ROLE).count() }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{% else %}
|
|
||||||
{% trans %}There is no club in this website.{% endtrans %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -37,7 +37,6 @@ from club.views import (
|
|||||||
ClubRevView,
|
ClubRevView,
|
||||||
ClubSellingCSVView,
|
ClubSellingCSVView,
|
||||||
ClubSellingView,
|
ClubSellingView,
|
||||||
ClubStatView,
|
|
||||||
ClubToolsView,
|
ClubToolsView,
|
||||||
ClubView,
|
ClubView,
|
||||||
MailingAutoGenerationView,
|
MailingAutoGenerationView,
|
||||||
@ -54,7 +53,6 @@ from club.views import (
|
|||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", ClubListView.as_view(), name="club_list"),
|
path("", ClubListView.as_view(), name="club_list"),
|
||||||
path("new/", ClubCreateView.as_view(), name="club_new"),
|
path("new/", ClubCreateView.as_view(), name="club_new"),
|
||||||
path("stats/", ClubStatView.as_view(), name="club_stats"),
|
|
||||||
path("<int:club_id>/", ClubView.as_view(), name="club_view"),
|
path("<int:club_id>/", ClubView.as_view(), name="club_view"),
|
||||||
path(
|
path(
|
||||||
"<int:club_id>/rev/<int:rev_id>/", ClubRevView.as_view(), name="club_view_rev"
|
"<int:club_id>/rev/<int:rev_id>/", ClubRevView.as_view(), name="club_view_rev"
|
||||||
|
@ -522,15 +522,6 @@ class MembershipDeleteView(PermissionRequiredMixin, DeleteView):
|
|||||||
return reverse_lazy("core:user_clubs", kwargs={"user_id": self.object.user.id})
|
return reverse_lazy("core:user_clubs", kwargs={"user_id": self.object.user.id})
|
||||||
|
|
||||||
|
|
||||||
class ClubStatView(TemplateView):
|
|
||||||
template_name = "club/stats.jinja"
|
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
|
||||||
kwargs = super().get_context_data(**kwargs)
|
|
||||||
kwargs["club_list"] = Club.objects.all()
|
|
||||||
return kwargs
|
|
||||||
|
|
||||||
|
|
||||||
class ClubMailingView(ClubTabsMixin, CanEditMixin, DetailFormView):
|
class ClubMailingView(ClubTabsMixin, CanEditMixin, DetailFormView):
|
||||||
"""A list of mailing for a given club."""
|
"""A list of mailing for a given club."""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user