-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: aakashshankar <[email protected]>
- Loading branch information
Showing
11 changed files
with
277 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{% extends 'base.html' %} | ||
{% block title %}Admin Only Page{% endblock %} | ||
|
||
{% block content %} | ||
<div class="pt-12"> | ||
<div class="container mx-auto mt-32 mb-10 p-10 bg-white shadow-lg rounded-lg"> | ||
<h1 class="text-2xl font-bold text-center mb-6">Pending Approval Listings</h1> | ||
|
||
{% if pending_services %} | ||
<div class="overflow-x-auto"> | ||
<table class="min-w-full bg-white border border-gray-200 rounded-lg"> | ||
<thead> | ||
<tr class="w-full bg-gray-200 text-left text-gray-600 uppercase text-sm leading-normal"> | ||
<th class="py-3 px-6">Service Name</th> | ||
<th class="py-3 px-6">Description</th> | ||
<th class="py-3 px-6">Status</th> | ||
<th class="py-3 px-6 text-center">Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody id="service-table-body" class="text-gray-700 text-sm font-light"> | ||
{% for service in pending_services %} | ||
<tr id="service-row-{{ service.id }}" class="border-b border-gray-200 hover:bg-gray-100"> | ||
<td class="py-3 px-6 font-medium">{{ service.name }}</td> | ||
<td class="py-3 px-6">{{ service.description }}</td> | ||
<td class="py-3 px-6">{{ service.service_status }}</td> | ||
<td class="py-3 px-6 text-center"> | ||
<form action="{% url 'admin_update_listing' service.id %}" method="post" style="display:inline;"> | ||
{% csrf_token %} | ||
<button type="submit" name="status" value="approve" | ||
class="bg-green-500 hover:bg-green-700 text-white font-bold py-1 px-3 rounded mx-1"> | ||
Approve | ||
</button> | ||
<button type="submit" name="status" value="reject" | ||
class="bg-red-500 hover:bg-red-700 text-white font-bold py-1 px-3 rounded mx-1"> | ||
Reject | ||
</button> | ||
</form> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
{% else %} | ||
<p class="text-center text-gray-500">No pending listings at the moment.</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from enum import Enum | ||
|
||
|
||
class ServiceStatus(Enum): | ||
PENDING_APPROVAL = "PENDING_APPROVAL" | ||
APPROVED = "APPROVED" | ||
REJECTED = "REJECTED" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.