233 lines
12 KiB
HTML
233 lines
12 KiB
HTML
{% extends 'dashboard/base.html' %}
|
|
{% load static %}
|
|
{% block title %}{{ title }} - {{ seo_settings.meta_title }}{% endblock title %}
|
|
{% block content %}
|
|
<style>
|
|
.modal-body {
|
|
max-height: calc(100vh - 200px); /* Adjust the value as needed */
|
|
overflow-y: auto;
|
|
}
|
|
.modal {
|
|
overflow: hidden; /* Hide the main modal overflow */
|
|
}
|
|
|
|
.modal-dialog {
|
|
max-height: calc(100vh - 100px); /* Adjust the value to your preference */
|
|
overflow-y: auto; /* Enable vertical scrolling */
|
|
}
|
|
/* Style the modal scrollbar */
|
|
.modal-body::-webkit-scrollbar {
|
|
width: 7px; /* Width of the scrollbar */
|
|
}
|
|
|
|
/* Track */
|
|
.modal-body::-webkit-scrollbar-track {
|
|
background: #333; /* Dark background color of the track */
|
|
}
|
|
|
|
/* Handle */
|
|
.modal-body::-webkit-scrollbar-thumb {
|
|
background: #888; /* Gray color of the scrollbar handle */
|
|
border-radius: 6px; /* Rounded corners on the handle */
|
|
}
|
|
|
|
/* On hover, style the handle */
|
|
.modal-body::-webkit-scrollbar-thumb:hover {
|
|
background: #555; /* Lighter gray color on hover */
|
|
}
|
|
@media (max-width: 576px) {
|
|
.mdbtn {
|
|
width: 100%;
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
</style>
|
|
<div class="page-body">
|
|
<div class="container-fluid">
|
|
<div class="page-title">
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<h3>Primary Menus</h3>
|
|
</div>
|
|
<div class="col-6">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item">
|
|
<a href="{% url 'adminHome' %}">
|
|
<svg class="stroke-icon">
|
|
<use href="{% static 'admin/assets/svg/icon-sprite.svg' %}#stroke-home"></use>
|
|
</svg>
|
|
</a>
|
|
</li>
|
|
<li class="breadcrumb-item">Menus</li>
|
|
<li class="breadcrumb-item active">Primary Menu</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Container-fluid starts-->
|
|
<div class="container-fluid">
|
|
{% if messages %}
|
|
{% for message in messages %}
|
|
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
|
|
{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if form.errors %}
|
|
<div class="alert alert-danger">
|
|
<strong>Error:</strong>
|
|
<ul>
|
|
{% for field, errors in form.errors.items %}
|
|
{% for error in errors %}
|
|
<li>{{ field }}: {{ error }}</li>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
<div class="col-md-12 project-list">
|
|
<div class="card">
|
|
<div class="row">
|
|
<div class="col-md-6 p-0 d-flex">
|
|
<ul class="nav nav-tabs border-tab" id="top-tab" role="tablist">
|
|
<li class="nav-item">
|
|
<a class="nav-link active" id="top-home-tab" data-bs-toggle="tab" href="#top-home" role="tab" aria-controls="top-home" aria-selected="true">
|
|
<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-target">
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
<circle cx="12" cy="12" r="6"></circle>
|
|
<circle cx="12" cy="12" r="2"></circle>
|
|
</svg>
|
|
All Menus
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-md-6 p-0">
|
|
<div class="form-group mb-0 me-0"></div>
|
|
<a class="btn btn-primary mdbtn" href="{% url 'AdminPrimaryMenuCreate' %}">
|
|
<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-plus-square">
|
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
<line x1="12" y1="8" x2="12" y2="16"></line>
|
|
<line x1="8" y1="12" x2="16" y2="12"></line>
|
|
</svg>
|
|
Create New Menu
|
|
</a>
|
|
<a class="btn btn-secondary mdbtn" data-bs-toggle="modal" data-bs-target="#menuModal" href=""> Default Website URLS </a>
|
|
<!-- Bootstrap 4 Modal -->
|
|
<div class="modal fade" id="menuModal" tabindex="-1" role="dialog" aria-labelledby="menuModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="editcontactModalLabel">Website's All Default URLS</h5>
|
|
</div>
|
|
<div class="modal-body">
|
|
<!-- Include your edit form here -->
|
|
<p><strong>Home Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}{% else %}http://{{ request.get_host }}{% endif %}</pre>
|
|
</p>
|
|
<p><strong>About Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}/about-us/{% else %}http://{{ request.get_host }}/about-us/{% endif %}</pre>
|
|
</p>
|
|
<p><strong>Service Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}/services/{% else %}http://{{ request.get_host }}/services/{% endif %}</pre>
|
|
</p>
|
|
<p><strong>Project Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}/projects/{% else %}http://{{ request.get_host }}/projects/{% endif %}</pre>
|
|
</p>
|
|
<p><strong>Pricing Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}/pricing/{% else %}http://{{ request.get_host }}/pricing/{% endif %}</pre>
|
|
</p>
|
|
<p><strong>Blog Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}/blogs/{% else %}http://{{ request.get_host }}/blogs/{% endif %}</pre>
|
|
</p>
|
|
<p><strong>Contact Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}/contact-us/{% else %}http://{{ request.get_host }}/contact-us/{% endif %}</pre>
|
|
</p>
|
|
<p><strong>Terms & Conditions Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}/terms-&-conditions/{% else %}http://{{ request.get_host }}/terms-&-conditions/{% endif %}</pre>
|
|
</p>
|
|
<p><strong>Privacy Policy Page</strong>
|
|
<pre> {% if request.is_secure %}https://{{ request.get_host }}/privacy-policy/{% else %}http://{{ request.get_host }}/privacy-policy/{% endif %}</pre>
|
|
</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-secondary" type="button" data-bs-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<!-- Zero Configuration Starts-->
|
|
<div class="col-sm-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="table-responsive">
|
|
<table class="display" id="basic-1">
|
|
<thead>
|
|
<tr>
|
|
<th>Order</th>
|
|
<th>Name</th>
|
|
<th>Url</th>
|
|
<th>Total Submenu</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for menu in menus %}
|
|
<tr>
|
|
<td>{{ menu.order }}</td>
|
|
<td><a href="{% url 'AdminPrimaryMenuEdit' menu.id %}">{{ menu.name }}</a></td>
|
|
<td>{{ menu.url }}</td>
|
|
<td>{{ menu.submenu_set.count }}</td>
|
|
<td>
|
|
<ul class="action">
|
|
<li class="edit"> <a href="{% url 'AdminPrimaryMenuEdit' menu.id %}"><i class="icon-pencil-alt"></i></a></li>
|
|
<li class="delete"><a href="#" data-slug="{{ menu.id }}"><i class="icon-trash"></i></a></li>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', (event) => {
|
|
var deleteButtons = document.querySelectorAll('.icon-trash');
|
|
|
|
deleteButtons.forEach(function(button) {
|
|
button.addEventListener('click', function (event) {
|
|
event.preventDefault();
|
|
|
|
var url = "{% url 'AdminPrimaryMenuDelete' menu.id %}";
|
|
|
|
Swal.fire({
|
|
title: 'Are you sure?',
|
|
text: "You won't be able to revert this!",
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Yes, delete it!'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
window.location.href = url;
|
|
}
|
|
})
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Zero Configuration Ends-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |