From 4dd3652b44df45b27de1cc79110e03e94cd00666 Mon Sep 17 00:00:00 2001 From: Horilla Date: Tue, 30 Jan 2024 19:12:13 +0530 Subject: [PATCH] [UPDT] EMPLOYEE: Employee document count --- .../templates/documents/document_nav.html | 1 + .../document_request_create_form.html | 108 ++++++++---------- employee/templates/documents/requests.html | 91 +++++++-------- employee/templates/tabs/htmx/view_file.html | 5 +- employee/views.py | 4 +- 5 files changed, 99 insertions(+), 110 deletions(-) diff --git a/employee/templates/documents/document_nav.html b/employee/templates/documents/document_nav.html index 71c31559c..d1b932523 100644 --- a/employee/templates/documents/document_nav.html +++ b/employee/templates/documents/document_nav.html @@ -79,6 +79,7 @@ >{% trans "Job Position" %} {{f.form.employee_id__employee_work_info__job_position_id}} +
diff --git a/employee/templates/documents/document_request_create_form.html b/employee/templates/documents/document_request_create_form.html index 921b77a21..250f4d868 100644 --- a/employee/templates/documents/document_request_create_form.html +++ b/employee/templates/documents/document_request_create_form.html @@ -1,64 +1,54 @@ {% load i18n %}
-
-
-
- - {{form.title}} -
-
-
-
- - {{form.employee_id}} -
-
-
-
-
-
- - {{form.format}} -
-
-
-
- - {{form.max_size}} -
-
-
-
-
-
- - {{form.description}} -
-
-
+
+
+
+ + {{form.title}} +
+
+
+
+ + {{form.employee_id}} +
+
+
+
+
+
+ + {{form.format}} +
+
+
+
+ + {{form.max_size}} +
+
+
+
+
+
+ + {{form.description}} +
+
+
-
- -
+
+ +
diff --git a/employee/templates/documents/requests.html b/employee/templates/documents/requests.html index 487ebc7e4..c1533f003 100644 --- a/employee/templates/documents/requests.html +++ b/employee/templates/documents/requests.html @@ -32,7 +32,7 @@ role="dialog" aria-labelledby="uploadFileModal" aria-hidden="true" -> + >
+ >
- - - {{document_list.list|length}} - - {{document_list.grouper}} + {{document_list.grouper}} +
+ {{document_list.list.0.upload_documents_count}} / {{document_list.list|length}} +
@@ -151,45 +148,45 @@ >
{% if document.document %} - - {% if document.status == "approved" %} - - - {% elif document.status == 'rejected' %} - - - + {% if document.status == "approved" %} + + + {% elif document.status == 'rejected' %} + + + + {% else %} + + + + {% endif %} {% else %} - - - - {% endif %} - {% else %} - - - + + + {% endif %}
diff --git a/employee/templates/tabs/htmx/view_file.html b/employee/templates/tabs/htmx/view_file.html index a6cc69481..81dd9f0c1 100644 --- a/employee/templates/tabs/htmx/view_file.html +++ b/employee/templates/tabs/htmx/view_file.html @@ -14,7 +14,7 @@ {% if document.document %} {% if perms.horilla_document.change_documentrequest %} {% if document.status == "approved" %} - + {% else %} @@ -29,7 +29,7 @@ {% endif %} {% if document.status == "rejected" %} - + {% else %} @@ -50,6 +50,7 @@ href="data:{{ content_type }};base64,{{ file_content|base64_encode }}" class="oh-btn oh-btn--info w-100" download="{{document.title}}" + title="{% trans 'Download' %}" > {% endif %} diff --git a/employee/views.py b/employee/views.py index 1a99a543b..d9f0e2204 100755 --- a/employee/views.py +++ b/employee/views.py @@ -510,7 +510,7 @@ def document_request_view(request): f = DocumentRequestFilter() document_requests = DocumentRequest.objects.all() documents = Document.objects.filter(document_request_id__isnull=False).order_by( - "document_request_id" + "-document_request_id" ) documents = filtersubordinates( request=request, @@ -535,7 +535,7 @@ def document_filter_view(request): previous_data = request.GET.urlencode() documents = DocumentRequestFilter(request.GET).qs documents = documents.exclude(document_request_id__isnull=True).order_by( - "document_request_id" + "-document_request_id" ) data_dict = parse_qs(previous_data) get_key_instances(Document, data_dict)