modal for refund policy in signup

This commit is contained in:
Faheedkhan 2025-09-04 19:23:57 +03:00
parent 2c0c85c74f
commit 9a3de0db53
6 changed files with 164 additions and 9 deletions

View File

@ -11,9 +11,11 @@ urlpatterns = [
path("", views.WelcomeView, name="welcome"),
path("signup/", views.dealer_signup, name="account_signup"),
path("", views.HomeView, name="home"),
path('refund-policy/',views.refund_policy,name='refund_policy'),
path("<slug:dealer_slug>/", views.HomeView, name="home"),
# Tasks
path("legal/", views.terms_and_privacy, name="terms_and_privacy"),
# path('tasks/<int:task_id>/detail/', views.task_detail, name='task_detail'),
# Dashboards
# path("user/<int:pk>/settings/", views.UserSettingsView.as_view(), name="user_settings"),

View File

@ -359,7 +359,7 @@ def dealer_signup(request):
return JsonResponse({"error": str(e)}, status=400)
return render(
request,
"account/signup-wizard.html",
"account/signup-wizar.html",
)
# class HomeView(LoginRequiredMixin, TemplateView):
@ -11666,3 +11666,9 @@ class ChartOfAccountModelUpdateView(ChartOfAccountModelUpdateViewBase):
permission_required = 'django_ledger.change_chartofaccountmodel'
class CharOfAccountModelActionView(CharOfAccountModelActionViewBase):
permission_required = 'django_ledger.change_chartofaccountmodel'
#for refund policy
def refund_policy(request):
return render(request,'haikal_policy/refund_policy.html')

View File

@ -280,8 +280,28 @@
</div>
</div>
</div>
</div>
<div class="mx-auto mt-4 text-center">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#contentModal" data-url="{% url 'refund_policy' %}">
Our Refund Policy
</button>
</div>
</div>
</section>
<div class="modal fade" id="contentModal" tabindex="-1" aria-labelledby="contentModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="contentModalLabel">Refund Policy</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Loading...</p>
</div>
</div>
</div>
</div>
{% include 'footer.html' %}
<script src="{% static 'js/phoenix.js' %}"></script>
{% endblock content %}
@ -291,6 +311,7 @@
<script type="module"
src="https://cdn.jsdelivr.net/gh/starfederation/datastar@v1.0.0-beta.11/bundles/datastar.js"></script>
<script>
function validatePassword(password, confirmPassword) {
return password === confirmPassword && password.length > 7 && password !== '';
}
@ -383,5 +404,39 @@
notify("error",error);
}
}
//modal for policy
document.addEventListener('DOMContentLoaded', function() {
const contentModal = document.getElementById('contentModal');
if (contentModal) {
contentModal.addEventListener('show.bs.modal', function(event) {
// Get the button that triggered the modal
const button = event.relatedTarget;
// Extract the URL from the button's data-url attribute
const url = button.getAttribute('data-url');
// Select the modal body element
const modalBody = contentModal.querySelector('.modal-body');
// Use the Fetch API to load content
fetch(url)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(html => {
// Insert the HTML content into the modal body
modalBody.innerHTML = html;
})
.catch(error => {
modalBody.innerHTML = `<p class="text-danger">Failed to load content: ${error.message}</p>`;
});
});
}
});
</script>
{% endblock customJS %}

View File

@ -63,11 +63,17 @@ body {
{% for notification in notifications %}
<div class="list-item d-flex align-items-start py-4 border-bottom position-relative">
{% if not notification.is_read %}
<span class="unread-dot bg-primary"></span>
{% endif %}
<div class="me-4 mt-1">
<div class="me-4 mt-1">
<i class="fas fa-info-circle fa-2x text-primary"></i>
</div>
{% else %}
<div class="me-4 mt-1">
<i class="fas fa-info-circle fa-2x text-secondary"></i>
</div>
</div>
{% endif %}
<div class="flex-grow-1">
<h5 class="mb-1 text-dark fw-normal">
{{ notification.message|safe }}
@ -96,11 +102,11 @@ body {
</div>
<div class="col-lg-4 d-none d-lg-block">
<div class="card bg-light border-0 rounded-4 p-4 sticky-top">
<div class="card bg-light border-0 rounded-4 p-4 sticky-top mt-3">
<h4 class="fw-bold mb-3 text-dark">{% trans "Status" %}</h4>
<ul class="list-unstyled mb-0">
<li class="d-flex align-items-center mb-2">
<i class="fas fa-circle-check text-success me-2"></i>
<i class="fas fa-circle-check text-secondary me-2"></i>
<span>{% trans "Read:" %}<span class="fw-bold ms-1">{{read_count}}</span></span>
</li>
<li class="d-flex align-items-center">

View File

@ -0,0 +1,86 @@
{% load i18n %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% trans "Haikal Refund Policy" %}</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css">
</head>
<body>
<div class="policy-container m-4">
<div class="policy-header">
<h1>{% trans "Haikal Refund Policy" %}</h1>
<p class="lead">
{% trans "This policy for Haikal DMS by Tenhal outlines refund conditions." %}
</p>
</div>
<section id="initial-guarantee" class="policy-section">
<h2>{% trans "1. 14-Day Guarantee" %}</h2>
<p>
{% trans "Get a full refund of your <strong>initial subscription fee</strong> within <strong>14 days</strong> of purchase if you're not satisfied. This is for new customers only and excludes non-refundable fees." %}
</p>
</section>
<section id="eligibility" class="policy-section">
<h2>{% trans "2. Refund Eligibility" %}</h2>
<p>{% trans "Refunds are given for:" %}</p>
<ul>
<li>
<strong>{% trans "Service Failure:" %}</strong> {% trans "If the service consistently fails and our support team can't fix it." %}
</li>
<li>
<strong>{% trans "Billing Errors:" %}</strong> {% trans "For incorrect or duplicate charges." %}
</li>
</ul>
</section>
<section id="non-refundable" class="policy-section">
<h2>{% trans "3. Non-Refundable Situations" %}</h2>
<p>{% trans "We don't offer refunds for:" %}</p>
<ul>
<li>
<strong>{% trans "Change of Mind:" %}</strong> {% trans "If you simply decide not to use the service." %}
</li>
<li>
<strong>{% trans "Recurring Payments:" %}</strong> {% trans "Payments after the initial 14-day period." %}
</li>
<li>
<strong>{% trans "Partial Use:" %}</strong> {% trans "We don't provide prorated refunds for partial months or years." %}
</li>
<li>
<strong>{% trans "One-Time Fees:" %}</strong> {% trans "Setup and professional services fees are non-refundable." %}
</li>
</ul>
</section>
<section id="how-to-request" class="policy-section">
<h2>{% trans "4. How to Request" %}</h2>
<p>
{% trans "Email our Billing and Support team at" %} <a href="mailto:haikal@support.sa">haikal@support.sa</a> {% trans "with your company name, account ID, invoice number, and a detailed reason for the refund." %}
</p>
</section>
<section id="processing" class="policy-section">
<h2>{% trans "5. Processing" %}</h2>
<p>
{% trans "Approved refunds are processed in <strong>10-14 business days</strong> to your original payment method." %}
</p>
</section>
<section id="data-termination" class="policy-section">
<h2>{% trans "6. Account Termination" %}</h2>
<p>
{% trans "Once a refund is issued, your access is revoked. You are responsible for exporting your data before termination." %}
</p>
</section>
</div>
</body>
</html>

View File

@ -3,7 +3,7 @@
{% load static %}
{% load crispy_forms_tags %}
{% block title %}
{% trans "Transactions" %}
{% trans "Jorunal Entry Transactions" %}
{% endblock %}
{% block content %}
<div class="row justify-content-center">