diff --git a/media/attendance_files/attendance_6ad2932c-a06c-4e2a-935b-a5d209a68402.pdf b/media/attendance_files/attendance_6ad2932c-a06c-4e2a-935b-a5d209a68402.pdf new file mode 100644 index 0000000..8653ada Binary files /dev/null and b/media/attendance_files/attendance_6ad2932c-a06c-4e2a-935b-a5d209a68402.pdf differ diff --git a/media/resolution_files/res_con_e0e6bb9d-fe67-49d8-a48e-13b637c1676d.pdf b/media/resolution_files/res_con_e0e6bb9d-fe67-49d8-a48e-13b637c1676d.pdf new file mode 100644 index 0000000..ddb8877 Binary files /dev/null and b/media/resolution_files/res_con_e0e6bb9d-fe67-49d8-a48e-13b637c1676d.pdf differ diff --git a/resulation/__pycache__/views.cpython-311.pyc b/resulation/__pycache__/views.cpython-311.pyc index 27b38af..7ee5f96 100644 Binary files a/resulation/__pycache__/views.cpython-311.pyc and b/resulation/__pycache__/views.cpython-311.pyc differ diff --git a/resulation/views.py b/resulation/views.py index 289ffb9..ce2c95e 100644 --- a/resulation/views.py +++ b/resulation/views.py @@ -332,4 +332,23 @@ def Contract(request): def Viewcontract(request): # Get all records from database pdf_records = resulation.objects.filter(pdftype='Contract').order_by('-m_date') # Latest first - return render(request, 'resulation/viewcontract.html', {'pdf_records': pdf_records}) \ No newline at end of file + return render(request, 'resulation/viewcontract.html', {'pdf_records': pdf_records}) + +from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger +def contracts_list(request): + records = resulation.objects.all() # Replace with your model + paginator = Paginator(records, 10) # Show 10 records per page + + try: + page = int(request.GET.get('page', '1')) + except ValueError: + page = 1 + + try: + pdf_records = paginator.page(page) + except PageNotAnInteger: + pdf_records = paginator.page(1) + except EmptyPage: + pdf_records = paginator.page(paginator.num_pages) + + return {'pdf_records': pdf_records, 'paginator': paginator} \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index 4247ea7..5c40998 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -280,3 +280,29 @@ button[type="submit"]:hover, .submit-btn:hover, .form-table td strong center inp .records-table td a:hover { color: #45a049; } + +.pagination { + margin-top: 20px; + padding: 10px; +} + +.page-links { + display: flex; + justify-content: center; + gap: 10px; + list-style: none; +} + +.prev, .next { + color: #007bff; + text-decoration: none; + cursor: pointer; +} + +.prev:hover, .next:hover { + text-decoration: underline; +} + +.current-page { + font-weight: bold; +} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 4ca6101..c66045d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -17,10 +17,11 @@