update
This commit is contained in:
parent
6c328953e8
commit
7ff112a5ef
1
.idea/car_inventory.iml
generated
1
.idea/car_inventory.iml
generated
@ -27,6 +27,7 @@
|
|||||||
<orderEntry type="library" name="tesseract.js" level="application" />
|
<orderEntry type="library" name="tesseract.js" level="application" />
|
||||||
<orderEntry type="library" name="line" level="application" />
|
<orderEntry type="library" name="line" level="application" />
|
||||||
<orderEntry type="library" name="@turf/turf" level="application" />
|
<orderEntry type="library" name="@turf/turf" level="application" />
|
||||||
|
<orderEntry type="library" name="apexcharts" level="application" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TemplatesService">
|
<component name="TemplatesService">
|
||||||
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
||||||
|
|||||||
2
.idea/jsLibraryMappings.xml
generated
2
.idea/jsLibraryMappings.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="JavaScriptLibraryMappings">
|
<component name="JavaScriptLibraryMappings">
|
||||||
<file url="file://$PROJECT_DIR$" libraries="{@turf/turf, @zxing, bootstrap-icons, jquery, jquery-3.5.1, line, quagga, sweetalert2, tesseract.js}" />
|
<file url="file://$PROJECT_DIR$" libraries="{@turf/turf, @zxing, apexcharts, bootstrap-icons, jquery, jquery-3.5.1, line, quagga, sweetalert2, tesseract.js}" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Binary file not shown.
Binary file not shown.
@ -151,7 +151,6 @@ def switch_language(request):
|
|||||||
return redirect("/")
|
return redirect("/")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def dealer_signup(request, *args, **kwargs):
|
def dealer_signup(request, *args, **kwargs):
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
data = json.loads(request.body)
|
data = json.loads(request.body)
|
||||||
@ -231,11 +230,11 @@ class OTPView(View, LoginRequiredMixin):
|
|||||||
messages.error(request, _("Invalid OTP. Please try again."))
|
messages.error(request, _("Invalid OTP. Please try again."))
|
||||||
return render(request, self.template_name)
|
return render(request, self.template_name)
|
||||||
|
|
||||||
def verify_otp(self, otp_code, user):
|
# def verify_otp(self, otp_code, user):
|
||||||
device = default_device(user)
|
# device = default_device(user)
|
||||||
if device and device.verify_token(otp_code):
|
# if device and device.verify_token(otp_code):
|
||||||
return True
|
# return True
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -251,6 +250,7 @@ class HomeView(TemplateView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
dealer = get_user_type(self.request)
|
dealer = get_user_type(self.request)
|
||||||
|
|
||||||
total_cars = models.Car.objects.filter(dealer=dealer).count()
|
total_cars = models.Car.objects.filter(dealer=dealer).count()
|
||||||
total_reservations = models.CarReservation.objects.filter(
|
total_reservations = models.CarReservation.objects.filter(
|
||||||
reserved_until__gte=timezone.now()
|
reserved_until__gte=timezone.now()
|
||||||
|
|||||||
5
populate.py
Normal file
5
populate.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from datetime import datetime
|
||||||
|
from zoneinfo import ZoneInfo
|
||||||
|
|
||||||
|
START_DTTM = datetime(year=2022, month=10, day=1, tzinfo=ZoneInfo('Asia/Riyadh'))
|
||||||
|
|
||||||
@ -79,25 +79,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function getCookie(name) {
|
|
||||||
let cookieValue = null;
|
|
||||||
if (document.cookie && document.cookie !== '') {
|
|
||||||
const cookies = document.cookie.split(';');
|
|
||||||
for (let cookie of cookies) {
|
|
||||||
cookie = cookie.trim();
|
|
||||||
if (cookie.substring(0, name.length + 1) === (name + '=')) {
|
|
||||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return cookieValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = "{% url 'account_signup' %}";
|
const url = "{% url 'account_signup' %}";
|
||||||
let submit_btn = document.getElementById('submit_btn');
|
let submit_btn = document.getElementById('submit_btn');
|
||||||
const csrfToken = getCookie('csrftoken');
|
const csrftoken = getCookie('csrftoken');
|
||||||
|
|
||||||
submit_btn.addEventListener('click', async () => {
|
submit_btn.addEventListener('click', async () => {
|
||||||
const allFormData = getAllFormData();
|
const allFormData = getAllFormData();
|
||||||
@ -108,7 +96,7 @@ const url = "{% url 'account_signup' %}";
|
|||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'X-CSRFToken': csrfToken,
|
'X-CSRFToken': csrftoken,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(allFormData),
|
body: JSON.stringify(allFormData),
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<link rel="manifest" href="{% static 'images/favicons/manifest.json' %}">
|
<link rel="manifest" href="{% static 'images/favicons/manifest.json' %}">
|
||||||
<meta name="msapplication-TileImage" content="{% static 'images/logos/logo-d.png' %}">
|
<meta name="msapplication-TileImage" content="{% static 'images/logos/logo-d.png' %}">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
<script src="{% static 'js/apexcharts.js' %}"></script>
|
|
||||||
|
|
||||||
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
|
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
|
||||||
<script src="{% static 'js/config.js' %}"></script>
|
<script src="{% static 'js/config.js' %}"></script>
|
||||||
@ -47,6 +47,8 @@
|
|||||||
<link href="{% static 'css/theme-rtl.min.css' %}" type="text/css" rel="stylesheet" id="style-rtl">
|
<link href="{% static 'css/theme-rtl.min.css' %}" type="text/css" rel="stylesheet" id="style-rtl">
|
||||||
<link href="{% static 'css/user-rtl.min.css' %}" type="text/css" rel="stylesheet" id="user-style-rtl">
|
<link href="{% static 'css/user-rtl.min.css' %}" type="text/css" rel="stylesheet" id="user-style-rtl">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<script src="{% static 'js/main.js' %}"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
|
||||||
integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
|
integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
|
||||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
@ -57,13 +59,43 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<script>
|
||||||
|
{% if messages %}
|
||||||
|
{% for message in messages %}
|
||||||
|
|
||||||
|
const Toast = Swal.mixin({
|
||||||
|
toast: true,
|
||||||
|
position: "top-end",
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 2000,
|
||||||
|
timerProgressBar: false,
|
||||||
|
didOpen: (toast) => {
|
||||||
|
toast.onmouseenter = Swal.stopTimer;
|
||||||
|
toast.onmouseleave = Swal.resumeTimer;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Toast.fire({
|
||||||
|
icon: "{{ message.tags }}",
|
||||||
|
titleText: "{{ message| safe }}"});
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
function notify(tag,msg){
|
||||||
|
Toast.fire({
|
||||||
|
icon: tag,
|
||||||
|
titleText: msg
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<main class="main" id="top">
|
<main class="main" id="top">
|
||||||
{% include 'header.html' %}
|
{% include 'header.html' %}
|
||||||
|
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
||||||
{% block period_navigation %}{% endblock period_navigation %}
|
{% block period_navigation %}
|
||||||
|
|
||||||
|
{% endblock period_navigation %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock content%}
|
{% endblock content%}
|
||||||
@ -97,42 +129,15 @@
|
|||||||
<script src="{% static 'vendors/echarts/echarts.min.js' %}"></script>
|
<script src="{% static 'vendors/echarts/echarts.min.js' %}"></script>
|
||||||
<script src="{% static 'js/crm-analytics.js' %}"></script>
|
<script src="{% static 'js/crm-analytics.js' %}"></script>
|
||||||
<script src="{% static 'js/travel-agency-dashboard.js' %}"></script>
|
<script src="{% static 'js/travel-agency-dashboard.js' %}"></script>
|
||||||
<script src="{% static 'js/main.js' %}"></script>
|
|
||||||
<script src="{% static 'vendors/mapbox-gl/mapbox-gl.js' %}"></script>
|
<script src="{% static 'vendors/mapbox-gl/mapbox-gl.js' %}"></script>
|
||||||
<script src="https://unpkg.com/@turf/turf@6/turf.min.js"></script>
|
<script src="https://unpkg.com/@turf/turf@6/turf.min.js"></script>
|
||||||
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
|
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
|
||||||
<script src="{% static 'vendors/swiper/swiper-bundle.min.js' %}"></script>
|
<script src="{% static 'vendors/swiper/swiper-bundle.min.js' %}"></script>
|
||||||
<script src="{% static 'vendors/flatpickr/flatpickr.min.js' %}"></script>
|
<script src="{% static 'vendors/flatpickr/flatpickr.min.js' %}"></script>
|
||||||
<script src="{% static 'django_ledger/bundle/djetler.bundle.js' %}"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
{% if messages %}
|
|
||||||
{% for message in messages %}
|
|
||||||
|
|
||||||
const Toast = Swal.mixin({
|
|
||||||
toast: true,
|
|
||||||
position: "top-end",
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 2000,
|
|
||||||
timerProgressBar: false,
|
|
||||||
didOpen: (toast) => {
|
|
||||||
toast.onmouseenter = Swal.stopTimer;
|
|
||||||
toast.onmouseleave = Swal.resumeTimer;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Toast.fire({
|
|
||||||
icon: "{{ message.tags }}",
|
|
||||||
titleText: "{{ message| safe }}"});
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
function notify(tag,msg){
|
|
||||||
Toast.fire({
|
|
||||||
icon: tag,
|
|
||||||
titleText: msg
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
{% if entity_slug %}
|
{% if entity_slug %}
|
||||||
let entitySlug = "{{ view.kwargs.entity_slug }}"
|
let entitySlug = "{{ view.kwargs.entity_slug }}"
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<!-- Year Navigation -->
|
<!-- Year Navigation -->
|
||||||
<div class="text-center mb-3">
|
<div class="text-center mb-3">
|
||||||
<p class="mb-1">
|
<p class="mb-1">
|
||||||
<<<<<<< HEAD
|
|
||||||
<span class="fw-bold">Year: </span>
|
<span class="fw-bold">Year: </span>
|
||||||
<a href="{{ previous_year_url }}" class="text-decoration-none me-2">
|
<a href="{{ previous_year_url }}" class="text-decoration-none me-2">
|
||||||
<span class="fas fa-chevron-left"> </span>
|
<span class="fas fa-chevron-left"> </span>
|
||||||
@ -27,12 +27,11 @@
|
|||||||
<span class="fas fa-chevron-right"> </span>
|
<span class="fas fa-chevron-right"> </span>
|
||||||
<span class="fas fa-chevron-right"> </span>
|
<span class="fas fa-chevron-right"> </span>
|
||||||
</a>
|
</a>
|
||||||
=======
|
|
||||||
<span class="fw-bold">{% trans 'Year' %}:</span>
|
<span class="fw-bold">{% trans 'Year' %}:</span>
|
||||||
<a href="{{ previous_year_url }}" class="text-decoration-none me-2"><< {{ previous_year }}</a>
|
<a href="{{ previous_year_url }}" class="text-decoration-none me-2"><< {{ previous_year }}</a>
|
||||||
<a href="{{ current_year_url }}" class="text-decoration-none me-2">{{ year }}</a>
|
<a href="{{ current_year_url }}" class="text-decoration-none me-2">{{ year }}</a>
|
||||||
<a href="{{ next_year_url }}" class="text-decoration-none">{{ next_year }} >></a>
|
<a href="{{ next_year_url }}" class="text-decoration-none">{{ next_year }} >></a>
|
||||||
>>>>>>> a4433631fb8ac35fdea38581ddea53fbba7115e4
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -79,12 +78,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Date Picker -->
|
<!-- Date Picker -->
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
<div class="text-center ">
|
<div class="text-center ">
|
||||||
{% date_picker date_navigation_url %}
|
{% date_picker date_navigation_url %}
|
||||||
</div>
|
</div>
|
||||||
>>>>>>> a4433631fb8ac35fdea38581ddea53fbba7115e4
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -4,7 +4,9 @@
|
|||||||
{% load django_ledger %}
|
{% load django_ledger %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<style id="apexcharts-css">
|
||||||
|
|
||||||
|
</style>
|
||||||
<div class="pb-6">
|
<div class="pb-6">
|
||||||
<div class="row align-items-center justify-content-between g-3 mb-6">
|
<div class="row align-items-center justify-content-between g-3 mb-6">
|
||||||
<div class="col-12 col-md-auto">
|
<div class="col-12 col-md-auto">
|
||||||
@ -136,15 +138,15 @@
|
|||||||
<div class="col-12 col-md-12">
|
<div class="col-12 col-md-12">
|
||||||
<div class="row justify-content-between mb-4">
|
<div class="row justify-content-between mb-4">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h3></h3>
|
<h3 id="dataContainer"></h3>
|
||||||
<div class="col-6 col-md-3">
|
<div class="col-6 col-md-3">
|
||||||
<div class="">
|
<div class="">
|
||||||
<label class="form-label" for="datepicker">{{ _("Start Date")}}</label>
|
<label class="form-label" for="datepicker">{{ _("Start Date")}}</label>
|
||||||
<input id="startDate" class="form-control datetimepicker flatpickr-input" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" type="date" placeholder="dd/mm/yyyy" data-options="{"disableMobile":true,"dateFormat":"Y-m-d"}" readonly="readonly">
|
<input id="startDate" class="form-control datetimepicker flatpickr-input" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" type="date" placeholder="dd/mm/yyyy" data-options="{'disableMobile':true,'dateFormat';:'Y-m-d'}" readonly="readonly">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="form-label" for="datepicker">{{ _("End Date")}}</label>
|
<label class="form-label" for="datepicker">{{ _("End Date")}}</label>
|
||||||
<input id="endDate" class="form-control datetimepicker flatpickr-input" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" type="date" placeholder="dd/mm/yyyy" data-options="{"disableMobile":true,"dateFormat":"Y-m-d"}" readonly="readonly">
|
<input id="endDate" class="form-control datetimepicker flatpickr-input" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" type="date" placeholder="dd/mm/yyyy" data-options="{'disableMobile':true,'dateFormat':'Y-m-d'}" readonly="readonly">
|
||||||
</div>
|
</div>
|
||||||
<button id="apply_filter" class="btn btn-primary mt-3" type="submit">{{ _("Apply") }}</button>
|
<button id="apply_filter" class="btn btn-primary mt-3" type="submit">{{ _("Apply") }}</button>
|
||||||
</div>
|
</div>
|
||||||
@ -253,7 +255,8 @@
|
|||||||
|
|
||||||
async function get_data(){
|
async function get_data(){
|
||||||
const response = await fetch("{% url 'entity-json-net-receivables' request.user.dealer.entity.slug %}");
|
const response = await fetch("{% url 'entity-json-net-receivables' request.user.dealer.entity.slug %}");
|
||||||
data = await response.json();
|
data = await response.json();
|
||||||
|
console.log(data);
|
||||||
const keys = Object.keys(data.results.net_receivable_data);
|
const keys = Object.keys(data.results.net_receivable_data);
|
||||||
const labels = keys;
|
const labels = keys;
|
||||||
const values = keys.map(key => data.results.net_receivable_data[key]);
|
const values = keys.map(key => data.results.net_receivable_data[key]);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block body %}
|
{% block content %}
|
||||||
|
|
||||||
<!-- Account Details Section -->
|
<!-- Account Details Section -->
|
||||||
<div class="row my-3">
|
<div class="row my-3">
|
||||||
|
|||||||
@ -147,9 +147,22 @@
|
|||||||
<div class="card shadow-sm">
|
<div class="card shadow-sm">
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{{plan.name }}</h5>
|
<h5 class="card-title fw-bold">{{plan.name }}</h5>
|
||||||
<p class="card-text">{{ plan.description }}</p>
|
<p class="card-text fs-9">{{ plan.description }}</p>
|
||||||
<p class="h4">{{ plan.price }}</p>
|
{% for plan_pricing in plan.planpricing_set.all %}
|
||||||
|
{% if plan_pricing.visible %}
|
||||||
|
<li class="mb-2">
|
||||||
|
{% if plan_pricing.pricing.url %}<a href="{{ plan_pricing.pricing.url }}" class="info_link pricing text-decoration-none">{% endif %}
|
||||||
|
<span class="plan_pricing_name fw-bold">{{ plan_pricing.pricing.name }}</span>
|
||||||
|
<small class="plan_pricing_period d-block text-muted">({{ plan_pricing.pricing.period }} {% trans "days" %})</small>
|
||||||
|
{% if plan_pricing.pricing.url %}</a>{% endif %}
|
||||||
|
<span class="plan_pricing_price d-block font-weight-bold">{{ plan_pricing.price }} {{ CURRENCY }}</span>
|
||||||
|
{% if plan_pricing.plan == userplan.plan or userplan.is_expired or userplan.plan.is_free %}
|
||||||
|
<a href="{% url 'create_order_plan' pk=plan_pricing.pk %}" class="buy btn btn-sm btn-phoenix-success">{% trans "Buy" %}</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
<a href="{% url 'account_signup' %}" class="btn btn-primary mt-3">{% trans 'Get Started' %}</a>
|
<a href="{% url 'account_signup' %}" class="btn btn-primary mt-3">{% trans 'Get Started' %}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user