Files
goodtimes/templates/manage_wallets/withdrawal_list.html
2024-06-07 20:45:55 +05:30

238 lines
13 KiB
HTML

{% extends 'layout/base_template.html' %}
{% load static %}
{% block stylesheet %}
<!-- include required css cdn link through html here -->
{% include "cdn_through_html/datatable_cdn_css.html" %}
{% include "cdn_through_html/animate_cdn_css.html" %}
{% include "cdn_through_html/modal_cdn_css.html" %}
{% include "cdn_through_html/tabs_cdn_css.html" %}
{% endblock %}
{% block content %}
<div class="row layout-top-spacing">
<div class="col-lg-12">
<div class="row mb-2">
<div class="col">
<h3>Manage Withdrawals</h3>
</div>
<div class="col text-end">
{% comment %} <button class="btn btn-dark mb-2 me-4" onclick="history.back()">
<i class="fa fa-arrow-left"></i>
Back
</button> {% endcomment %}
{% comment %} <a class="btn btn-primary mb-2 me-4" href="">Add Newsletter</a> {% endcomment %}
</div>
</div>
<div class="row layout-spacing">
<div class="col-lg-12">
<div class="statbox widget box box-shadow">
<div class="widget-content widget-content-area">
<div id="contact-us_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
<div class="table-responsive">
<table id="contact-us" class="table style-3 dt-table-hover dataTable no-footer"
role="grid" aria-describedby="style-3_info">
<thead>
<tr role="row">
<th class="text-center" tabindex="0" aria-controls="style-3" rowspan="1"
colspan="1" style="width: 69.2656px;"> Record Id </th>
<th tabindex="1" aria-controls="style-3" rowspan="1" colspan="1"
style="width: 44.2344px;">Principal</th>
<th tabindex="2" aria-controls="style-3" rowspan="1" colspan="1"
style="width: 79.7969px;">Qty</th>
<th tabindex="3" aria-controls="style-3" rowspan="1" colspan="1"
style="width: 77.3281px;">Amount</th>
<th tabindex="3" aria-controls="style-3" rowspan="1" colspan="1"
style="width: 77.3281px;">G-Token</th>
<th tabindex="3" aria-controls="style-3" rowspan="1" colspan="1"
style="width: 77.3281px;">Status</th>
<th tabindex="4" aria-controls="style-3" rowspan="1" colspan="1"
style="width: 143.516px;">Sold At</th>
<!-- <th tabindex="5" aria-controls="style-3" rowspan="1" colspan="1"
style="width: 98.875px;">Reply / Update</th> -->
<th tabindex="7" aria-controls="style-3" rowspan="1" colspan="1"
style="width: 51.625px;">Action</th>
</tr>
</thead>
<tbody>
{% for withdrawal_obj in withdrawal_objs%}
<tr role="row">
<td class="text-center"> {{withdrawal_obj.id}} </td>
<td>{{withdrawal_obj.principal}}</td>
<td>{{withdrawal_obj.coins}}</td>
<td>{{withdrawal_obj.amount}}</td>
<td style="word-wrap: break-word; white-space: pre-wrap; max-width: 100%; overflow-wrap: break-word;">{{withdrawal_obj.token}}</td>
<td>{{withdrawal_obj.status}}</td>
<td>{{withdrawal_obj.created_on}}</td>
<!-- <td class="text-center">
<button type="button" class="btn btn-info mb-2 me-4"
data-bs-toggle="modal" data-bs-target="#tabsModalMessageReply"
onclick="MessageModal('{{withdrawal_obj.notes}}','{{withdrawal_obj.reply}}')">
View
</button>
</td> -->
<td class="text-center">
<button type="button" class="btn btn-success mb-2 me-4"
data-bs-toggle="modal" data-bs-target="#replyFormModal"
onclick="ReplyModal('{{withdrawal_obj.id}}','{{withdrawal_obj.status}}')">
Status
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Message/ reply modal -->
<div class="modal fade" id="tabsModalMessageReply" tabindex="-1" role="dialog" aria-labelledby="tabsModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="tabsModalLabel">Message / Reply</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
</button>
</div>
<div class="modal-body">
<div class="simple-pill">
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="pills-message-tab" data-bs-toggle="pill"
data-bs-target="#pills-message" type="button" role="tab" aria-controls="pills-message"
aria-selected="true">Message</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="pills-reply-tab" data-bs-toggle="pill"
data-bs-target="#pills-reply" type="button" role="tab" aria-controls="pills-reply"
aria-selected="false">Reply</button>
</li>
</ul>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-message" role="tabpanel"
aria-labelledby="pills-message-tab" tabindex="0">
<div class="card">
<div class="card-body">
<p class="mt-3" id="messageData"></p>
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-reply" role="tabpanel" aria-labelledby="pills-reply-tab"
tabindex="0">
<div class="card">
<div class="card-body">
<p class="mt-3" id="replyData"></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-light-dark" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- reply column modal-->
<div class="modal fade inputForm-modal" id="replyFormModal" tabindex="-1" role="dialog"
aria-labelledby="inputFormModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header" id="inputFormModalLabel">
<h5 class="modal-title">Reply</b></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-hidden="true"></button>
</div>
<form class="mt-0" method="POST" action="{% url 'manage_wallets:update_status' %}">
{% csrf_token %}
<div class="modal-body">
<input type="hidden" name="id" value="" id="contactUs">
<div class="col-12">
<label for="status">Status</label>
<select id="status" name="status" class="form-control">
<option value="submitted">Submitted</option>
<option value="review">Review</option>
<option value="processing">Under Process</option>
<option value="transferred">Transferred</option>
<option value="dispute">Dispute</option>
<option value="denied">Denied</option>
</select>
</div>
<div class="col-12">
<label for="message" class="form-label">Message</label>
<textarea id="message" class="form-control" name="message" rows="4" cols="50"></textarea>
</div>
<button type="submit" class="btn btn-primary mt-2 mb-2 btn-no-effect"
data-bs-dismiss="modal">Send</button>
</div>
</form>
</div>
</div>
</div>
{% endblock content %}
{% block javascript %}
<!-- include required js cdn link through html here -->
{% include "cdn_through_html/datatable_cdn_js.html" %}
<script>
contact_us = $('#contact-us').DataTable({
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
"<'table-responsive'tr>" +
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
"oLanguage": {
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
"sInfo": "Showing page _PAGE_ of _PAGES_",
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
"sSearchPlaceholder": "Search...",
"sLengthMenu": "Results : _MENU_",
},
"order": [[ 0, "desc" ]],
"stripeClasses": [],
"lengthMenu": [5, 10, 20, 50],
"pageLength": 10
});
// message modal show and set data
function MessageModal(message, reply) {
console.log("trigger")
// Set the data in the modal content
$("#messageData").text(message);
$("#replyData").text(reply);
// Show the modal
$('#tabsModalMessageReply').modal('show');
}
// reply modal show and set data
function ReplyModal(contact_us_id, status) {
console.log("trigger")
// Set the data in the modal content
$("#contactUs").val(contact_us_id);
$("#status").val(status);
// Show the modal
$('#replyFormModal').modal('show');
}
</script>
{% endblock %}