diff options
-rw-r--r-- | workshop_app/templates/workshop_app/my_workshops.html | 36 | ||||
-rw-r--r-- | workshop_app/views.py | 27 |
2 files changed, 7 insertions, 56 deletions
diff --git a/workshop_app/templates/workshop_app/my_workshops.html b/workshop_app/templates/workshop_app/my_workshops.html index 846c11b..b4e0985 100644 --- a/workshop_app/templates/workshop_app/my_workshops.html +++ b/workshop_app/templates/workshop_app/my_workshops.html @@ -119,7 +119,7 @@ {% block content %} -{% if workshop_occurences %} +{% if workshops %} <h3 align="center" style="color:#2952a2;">The status of your workshops </h3> <br> @@ -144,7 +144,7 @@ </tr> </thead> {% csrf_token %} - {% for workshop in workshop_occurences %} + {% for workshop in workshops %} <tbody> <tr> {% if workshop.status == 'Pending' and workshop.requested_workshop_instructor %} @@ -186,7 +186,7 @@ </tr> </thead> {% csrf_token %} - {% for workshop in workshop_occurences %} + {% for workshop in workshops %} <tbody> <tr> {% if workshop.status == 'ACCEPTED' and workshop.requested_workshop_title %} @@ -271,7 +271,7 @@ </tr> </thead> {% csrf_token %} - {% for workshop in workshop_occurences %} + {% for workshop in workshops %} <tbody> <tr> {% if workshop.status == 'Pending' and workshop.condition_one %} @@ -314,7 +314,7 @@ </tr> </thead> {% csrf_token %} - {% for workshop in workshop_occurences %} + {% for workshop in workshops %} <tbody> <tr> {% if workshop.status == 'DELETED' or workshop.status == 'REJECTED' %} @@ -335,32 +335,6 @@ </table> </div> -<!-- Page Navigation --> - <div class="container"> - <div class="Page-Nav" align="center"> - <nav aria-label="Page navigation"> - <ul class="pagination pagination-sm"> - <li class="page-item"> - {% if workshop_occurences.has_previous %} - <a class="page-link" tabindex="-1" - href="?page={{ workshop_occurences.previous_page_number }}">Previous</a> - {% endif %} - </li> - <li class="page-item"> - <span class="current"> - Page {{ workshop_occurences.number }} of {{ workshop_occurences.paginator.num_pages }} - </span> - </li> - <li class="page-item"> - {% if workshop_occurences.has_next %} - <a class="page-link" href="?page={{ workshop_occurences.next_page_number }}">Next - </a> - {% endif %} - </li> - </ul> - </nav> - </div> - </div> {% else %} {% if request.user.profile.position == 'instructor' %} diff --git a/workshop_app/views.py b/workshop_app/views.py index 961445a..bdb5580 100644 --- a/workshop_app/views.py +++ b/workshop_app/views.py @@ -676,20 +676,8 @@ def my_workshops(request): for p in proposed_workshop_pending: workshops.append(p) - - #Show upto 12 Workshops per page - paginator = Paginator(workshops, 12) - page = request.GET.get('page') - try: - workshop_occurences = paginator.page(page) - except PageNotAnInteger: - #If page is not an integer, deliver first page. - workshop_occurences = paginator.page(1) - except EmptyPage: - #If page is out of range(e.g 999999), deliver last page. - workshop_occurences = paginator.page(paginator.num_pages) return render(request, 'workshop_app/my_workshops.html', - { "workshop_occurences" :workshop_occurences, + { "workshops" :workshops, "today": today}) else: @@ -706,19 +694,8 @@ def my_workshops(request): for p in proposed_workshop: workshops.append(p) - #Show upto 12 Workshops per page - paginator = Paginator(workshops, 12) - page = request.GET.get('page') - try: - workshop_occurences = paginator.page(page) - except PageNotAnInteger: - #If page is not an integer, deliver first page. - workshop_occurences = paginator.page(1) - except EmptyPage: - #If page is out of range(e.g 999999), deliver last page. - workshop_occurences = paginator.page(paginator.num_pages) return render(request, 'workshop_app/my_workshops.html', - {"workshop_occurences": workshop_occurences}) + {"workshops": workshops}) else: return redirect('/login/') |