diff --git a/apps/member/views.py b/apps/member/views.py index e03c5ff5..381314b2 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -130,10 +130,15 @@ class UserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): history_list = \ Transaction.objects.all().filter(Q(source=user.note) | Q(destination=user.note)).order_by("-id")\ .filter(PermissionBackend.filter_queryset(self.request.user, Transaction, "view")) - context['history_list'] = HistoryTable(history_list) + history_table = HistoryTable(history_list, prefix='transaction-') + history_table.paginate(per_page=20, page=self.request.GET.get("transaction-page", 1)) + context['history_list'] = history_table + club_list = Membership.objects.filter(user=user, date_end__gte=datetime.today())\ .filter(PermissionBackend.filter_queryset(self.request.user, Membership, "view")) - context['club_list'] = MembershipTable(data=club_list) + membership_table = MembershipTable(data=club_list, prefix='membership-') + membership_table.paginate(per_page=10, page=self.request.GET.get("membership-page", 1)) + context['club_list'] = membership_table return context @@ -310,13 +315,17 @@ class ClubDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): club_transactions = Transaction.objects.all().filter(Q(source=club.note) | Q(destination=club.note))\ .filter(PermissionBackend.filter_queryset(self.request.user, Transaction, "view")).order_by('-id') - context['history_list'] = HistoryTable(club_transactions) + history_table = HistoryTable(club_transactions, prefix="history-") + history_table.paginate(per_page=20, page=self.request.GET.get('history-page', 1)) + context['history_list'] = history_table club_member = Membership.objects.filter( club=club, date_end__gte=datetime.today(), ).filter(PermissionBackend.filter_queryset(self.request.user, Membership, "view")) - context['member_list'] = MembershipTable(data=club_member) + membership_table = MembershipTable(data=club_member, prefix="membership-") + membership_table.paginate(per_page=20, page=self.request.GET.get('membership-page', 1)) + context['member_list'] = membership_table # Check if the user has the right to create a membership, to display the button. empty_membership = Membership( diff --git a/templates/member/club_detail.html b/templates/member/club_detail.html index 3ad29901..fedd43fa 100644 --- a/templates/member/club_detail.html +++ b/templates/member/club_detail.html @@ -10,9 +10,11 @@ {% block extrajavascript %} {% endblock %} diff --git a/templates/member/club_info.html b/templates/member/club_info.html index de0192b4..93c76d59 100644 --- a/templates/member/club_info.html +++ b/templates/member/club_info.html @@ -55,7 +55,7 @@ {% trans "Edit" %} {% endif %} {% url 'member:club_detail' club.pk as club_detail_url %} - {%if request.get_full_path != club_detail_url %} + {%if request.path_info != club_detail_url %} {% trans 'View Profile' %} {% endif %} diff --git a/templates/member/club_tables.html b/templates/member/club_tables.html index fbded9c3..32be9bd4 100644 --- a/templates/member/club_tables.html +++ b/templates/member/club_tables.html @@ -1,31 +1,23 @@ {% load render_table from django_tables2 %} {% load i18n %} -