This commit is contained in:
ariska committed 2024-11-19 13:00:24 +07:00
commit 45e3c1f698
3462 files changed
+617437

No files matched your search

@@ -0,0 +1,105 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="{{ settings.favicon.url }}" type="image/x-icon">
<link rel="shortcut icon" href="{{ settings.favicon.url }}" type="image/x-icon">
<title>{% block title %}{{ title }} - {{ seo_settings.meta_title }}{% endblock title %}</title>
<!-- Google font-->
<link href="https://fonts.googleapis.com/css?family=Rubik:400,400i,500,500i,700,700i&amp;display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900&amp;display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/font-awesome.css' %}">
<!-- ico-font-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/icofont.css' %}">
<!-- Themify icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/themify.css' %}">
<!-- Flag icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/flag-icon.css' %}">
<!-- Feather icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/feather-icon.css' %}">
<!-- Plugins css start-->
<!-- Plugins css Ends-->
<!-- Bootstrap css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/bootstrap.css' %}">
<!-- App css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/style.css' %}">
<link id="color" rel="stylesheet" href="{% static 'admin/assets/css/color-1.css' %}" media="screen">
<!-- Responsive css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/responsive.css' %}">
</head>
<body>
<!-- loader starts-->
<div class="loader-wrapper">
<div class="loader-index"><span></span></div>
<svg>
<defs></defs>
<filter id="goo">
<fegaussianblur in="SourceGraphic" stddeviation="11" result="blur"></fegaussianblur>
<fecolormatrix in="blur" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9" result="goo"> </fecolormatrix>
</filter>
</svg>
</div>
<!-- loader ends-->
<!-- tap on top starts-->
<div class="tap-top"><i data-feather="chevrons-up"></i></div>
<!-- tap on tap ends-->
<!-- page-wrapper Start-->
<div class="page-wrapper">
<div class="container-fluid p-0">
<div class="row">
<div class="col-12">
<div class="login-card">
<div>
<div><a class="logo" href="">
<img class="img-fluid for-light" src="{{ settings.logo_light.url }}" width="200" alt="looginpage">
<img class="img-fluid for-dark" src="{{ settings.logo_light.url }}" width="200" alt="looginpage"></a></div>
<div class="login-main">
<form class="theme-form" method='post'>
{% csrf_token %}
<h4 class="text-light">Reset Your Password</h4>
{% 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 %}
<div class="mb-2">
<label class="col-form-label text-light">Username<span class="text-danger">*</span></label>
<div class="form-input position-relative">
<input class="form-control" type="text" name="username" required placeholder="eg. rakib">
</div>
</div>
<div class="form-group mb-0">
<button class="btn btn-primary btn-block w-100" type="submit">Next</button>
</div>
<p class="mt-4 mb-0 text-center">Already have an password?<a class="ms-2" href="{% url "logIn" %}">Log In</a></p>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- latest jquery-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Bootstrap js-->
<script src="{% static 'admin/assets/js/bootstrap/bootstrap.bundle.min.js' %}"></script>
<!-- feather icon js-->
<script src="{% static 'admin/assets/js/icons/feather-icon/feather.min.js' %}"></script>
<script src="{% static 'admin/assets/js/icons/feather-icon/feather-icon.js' %}"></script>
<!-- scrollbar js-->
<!-- Sidebar jquery-->
<script src="{% static 'admin/assets/js/config.js' %}"></script>
<!-- Plugins JS start-->
<!-- Plugins JS Ends-->
<!-- Theme js-->
<script src="{% static 'admin/assets/js/script.js' %}"></script>
<!-- Plugin used-->
</body>
</html>
+147
View File
@@ -0,0 +1,147 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="{{ settings.favicon.url }}" type="image/x-icon">
<link rel="shortcut icon" href="{{ settings.favicon.url }}" type="image/x-icon">
<title>{% block title %}{{ title }} - {{ seo_settings.meta_title }}{% endblock title %}</title>
<!-- Google font-->
<link href="https://fonts.googleapis.com/css?family=Rubik:400,400i,500,500i,700,700i&amp;display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900&amp;display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/font-awesome.css' %}">
<!-- ico-font-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/icofont.css' %}">
<!-- Themify icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/themify.css' %}">
<!-- Flag icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/flag-icon.css' %}">
<!-- Feather icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/feather-icon.css' %}">
<!-- Plugins css start-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/sweetalert2.css' %}">
<!-- Plugins css Ends-->
<!-- Bootstrap css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/bootstrap.css' %}">
<!-- App css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/style.css' %}">
<link id="color" rel="stylesheet" href="{% static 'admin/assets/css/color-1.css' %}" media="screen">
<!-- Responsive css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/responsive.css' %}">
</head>
<body>
<!-- login page start-->
<div class="container-fluid">
<div class="row">
<div class="col-12 p-0">
<div class="login-card">
<div>
<div><a class="logo text-start" href="">
<img class="img-fluid for-light" src="{{ settings.logo_light.url }}" width="200" alt="looginpage">
<img class="img-fluid for-dark" src="{{ settings.logo_light.url }}" width="200" alt="looginpage"></a></div>
<div class="login-main">
<form class="theme-form" method="post">
{% csrf_token %}
<h4 class="text-light">Login in to account</h4>
<p class="text-light">Enter your username & password to login</p>
{% 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="form-group">
<label class="col-form-label text-light">Username<span class="text-danger">*</span></label>
<input class="form-control" type="text" required="" name="username" placeholder="eg. rakib">
</div>
<div class="form-group">
<label class="col-form-label text-light">Password<span class="text-danger">*</span></label>
<div class="form-input position-relative">
<input class="form-control" type="password" name="login[password]" required="" placeholder="*********">
<div class="show-hide"><span class="show"> </span></div>
</div>
</div>
<div class="form-group mb-0">
<div class="checkbox p-0">
<input id="checkbox1" type="checkbox">
<label class="text-muted" for="checkbox1">Remember password</label>
</div>
<a class="link" href="{% url "initiate_password_reset" %}">Forgot password?</a>
<div class="text-end mt-3">
<button class="btn btn-primary btn-block w-100" type="submit">Sign in</button>
</div>
</div>
<!-- Buttons for Admin and Editor -->
{% if demo_mode %}
<div class="text-center mt-4">
<button class="btn btn-primary" type="button" onclick="fillAdminCredentials()">Admin</button>
<button class="btn btn-primary" type="button" onclick="fillEditorCredentials()">Editor</button>
</div>
{% endif %}
</form>
{% if demo_mode %}
<script>
// JavaScript functions to fill in username and password fields for Admin and Editor
function fillAdminCredentials() {
document.querySelector('input[name="username"]').value = "admin";
document.querySelector('input[name="login[password]"]').value = "123456";
}
function fillEditorCredentials() {
document.querySelector('input[name="username"]').value = "editor";
document.querySelector('input[name="login[password]"]').value = "123456";
}
</script>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<!-- latest jquery-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Bootstrap js-->
<script src="{% static 'admin/assets/js/bootstrap/bootstrap.bundle.min.js' %}"></script>
<!-- feather icon js-->
<script src="{% static 'admin/assets/js/icons/feather-icon/feather.min.js' %}"></script>
<script src="{% static 'admin/assets/js/icons/feather-icon/feather-icon.js' %}"></script>
<!-- scrollbar js-->
<!-- Sidebar jquery-->
<script src="{% static 'admin/assets/js/config.js' %}"></script>
<!-- Plugins JS start-->
<script src="{% static 'admin/assets/js/sweet-alert/sweetalert.min.js' %}"></script>
<!-- Plugins JS Ends-->
<!-- Theme js-->
<script src="{% static 'admin/assets/js/script.js' %}"></script>
<!-- Plugin used-->
<script>
$(document).on('click', '#error', function(e) {
if($('.email').val() == '' || $('.pwd').val() == ''){
swal(
"Error!", "Sorry, looks like some data are not filled, please try again !", "error"
)
}
});
</script>
</div>
</body>
</html>
+160
View File
@@ -0,0 +1,160 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="{{ settings.favicon.url }}" type="image/x-icon">
<link rel="shortcut icon" href="{{ settings.favicon.url }}" type="image/x-icon">
<title>{% block title %}{{ title }} - {{ seo_settings.meta_title }}{% endblock title %}</title>
<!-- Google font-->
<link href="https://fonts.googleapis.com/css?family=Rubik:400,400i,500,500i,700,700i&amp;display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900&amp;display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/font-awesome.css' %}">
<!-- ico-font-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/icofont.css' %}">
<!-- Themify icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/themify.css' %}">
<!-- Flag icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/flag-icon.css' %}">
<!-- Feather icon-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/feather-icon.css' %}">
<!-- Plugins css start-->
<!-- Plugins css Ends-->
<!-- Bootstrap css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/vendors/bootstrap.css' %}">
<!-- App css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/style.css' %}">
<link id="color" rel="stylesheet" href="{% static 'admin/assets/css/color-1.css' %}" media="screen">
<!-- Responsive css-->
<link rel="stylesheet" type="text/css" href="{% static 'admin/assets/css/responsive.css' %}">
<style>
.input-group-append .btn {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: 0;
}
/* Ensure the input field and button align vertically */
.input-group {
position: relative;
}
.input-group-append {
position: absolute;
right: 0;
top: 0;
bottom: 0;
display: flex;
align-items: center;
padding: 0.375rem 0.75rem;
}
.sh{
z-index: 999;
cursor: pointer;
}
</style>
</head>
<body>
<!-- loader starts-->
<div class="loader-wrapper">
<div class="loader-index"><span></span></div>
<svg>
<defs></defs>
<filter id="goo">
<fegaussianblur in="SourceGraphic" stddeviation="11" result="blur"></fegaussianblur>
<fecolormatrix in="blur" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9" result="goo"> </fecolormatrix>
</filter>
</svg>
</div>
<!-- loader ends-->
<!-- tap on top starts-->
<div class="tap-top"><i data-feather="chevrons-up"></i></div>
<!-- tap on tap ends-->
<!-- page-wrapper Start-->
<div class="page-wrapper">
<div class="container-fluid p-0">
<div class="row">
<div class="col-12">
<div class="login-card">
<div>
<div><a class="logo" href="">
<img class="img-fluid for-light" src="{{ settings.logo_light.url }}" width="200" alt="looginpage">
<img class="img-fluid for-dark" src="{{ settings.logo_light.url }}" width="200" alt="looginpage"></a></div>
<div class="login-main">
<form class="theme-form" method='post'>
{% csrf_token %}
<h4>Set New Password</h4>
{% 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 %}
<div class="">
<label class="col-form-label">New Password<span class="text-danger">*</span></label>
<div class="input-group">
<input class="form-control" type="password" id="new_password1" name="new_password1" required="" placeholder="*********">
<div class="input-group-append">
<span class="text-dark sh" id="toggle_password1" onclick="togglePassword('new_password1', 'toggle_password1')">Show</span>
</div>
</div>
</div>
<div class="mb-3">
<label class="col-form-label">Retype Password<span class="text-danger">*</span></label>
<div class="input-group">
<input class="form-control" type="password" id="new_password2" name="new_password2" required="" placeholder="*********">
<div class="input-group-append">
<span class="text-dark sh" id="toggle_password2" onclick="togglePassword('new_password2', 'toggle_password2')">Show</span>
</div>
</div>
</div>
<div class="form-group mb-0">
<button class="btn btn-primary btn-block w-100" type="submit">Done </button>
</div>
<p class="mt-4 mb-0">Already have a password?<a class="ms-2" href="{% url "logIn" %}">Log In</a></p>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- page-wrapper Ends-->
<!-- latest jquery-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Bootstrap js-->
<script src="{% static 'admin/assets/js/bootstrap/bootstrap.bundle.min.js' %}"></script>
<!-- feather icon js-->
<script src="{% static 'admin/assets/js/icons/feather-icon/feather.min.js' %}"></script>
<script src="{% static 'admin/assets/js/icons/feather-icon/feather-icon.js' %}"></script>
<!-- scrollbar js-->
<!-- Sidebar jquery-->
<script src="{% static 'admin/assets/js/config.js' %}"></script>
<!-- Plugins JS start-->
<!-- Plugins JS Ends-->
<!-- Theme js-->
<script src="{% static 'admin/assets/js/script.js' %}"></script>
<!-- Plugin used-->
<!-- Code injected by live-server -->
<script>
function togglePassword(inputId, toggleButtonId) {
const passwordInput = document.getElementById(inputId);
const toggleButton = document.getElementById(toggleButtonId);
if (passwordInput.type === 'password') {
passwordInput.type = 'text';
toggleButton.innerHTML = 'Hide';
} else {
passwordInput.type = 'password';
toggleButton.innerHTML = 'Show';
}
}
</script>
</body>
</html>
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Password Reset</title>
<style>
/* Add your CSS styles here */
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #ffffff;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.header {
background-color: #7366ff;
color: #fff;
padding: 20px 0;
text-align: center;
}
.header h1 {
margin: 0;
}
.content {
padding: 20px;
text-align: center;
}
.button {
display: inline-block;
padding: 12px 24px;
background-color: #7366ff;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-weight: bold;
}
.button:hover {
background-color: #6052f3;
}
.note {
font-size: 14px;
color: #888;
margin-top: 20px;
}
.ii a[href] {
color: white !important;
}
a {
color: white !important;
}
a:visited {
color: white !important;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Password Reset</h1>
</div>
<div class="content">
<p>Hello {{ user.username }},</p>
<p>You've requested to reset your password.</p>
<a class="button" href="{{ reset_link }}" target="_blank">Reset Password</a>
<p class="note">If you didn't make this request, you can safely ignore this email.</p>
</div>
</div>
</body>
</html>
+165
View File
@@ -0,0 +1,165 @@
{% extends 'dashboard/base.html' %}
{% load static %}
{% load customtag %}
{% block title %}{{ title }} - {{ seo_settings.meta_title }}{% endblock title %}
{% block content %}
<style>
/* Media query for mobile devices */
@media (max-width: 768px) {
#cke_id_description {
width: 309px !important;
}
}
/* Media query for desktop devices */
@media (min-width: 769px) {
#cke_id_description {
width: 980px !important;
position: relative;
}
}
/* CSS to style the password input container */
.password-input {
position: relative;
}
/* CSS to position the "Show" and "Hide" text on the right side */
.toggle-password {
position: absolute;
top: 74px;
right: 38px;
transform: translateY(-50%);
cursor: pointer;
}
</style>
<div class="page-body">
<div class="container-fluid">
<div class="page-title">
<div class="row">
<div class="col-6">
<h3>{{ title }}</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">Users</li>
<li class="breadcrumb-item active">Create User</li>
</ol>
</div>
</div>
</div>
</div>
<!-- Container-fluid starts-->
<div class="container-fluid">
<div class="row project-cards">
<div class="col-md-12 project-list">
</div>
<div class="container">
<form method="POST" enctype="multipart/form-data">
{% csrf_token %}
{{form.media}}
{% 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="row mb-3">
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.name.id_for_label }}" class="form-label">Name <span class="text-danger">*</span></label>
{{ form.name|add_class:'form-control' }}
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.email.id_for_label }}" class="form-label">Email <span class="text-danger">*</span></label>
{{ form.email|add_class:'form-control' }}
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.username.id_for_label }}" class="form-label">Username <span class="text-danger">*</span></label>
{{ form.username|add_class:'form-control' }}
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.role.id_for_label }}" class="form-label">Role <span class="text-danger">*</span></label>
{{ form.role|add_class:'form-select' }}
</div>
</div>
</div>
</div>
<div class="row mb-1">
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.password1.id_for_label }}" class="form-label">Password <span class="text-danger">*</span></label>
<input type="password" id="{{ form.password1.id_for_label }}" class="form-control" name="password1" />
<span class="toggle-password" onclick="togglePasswordVisibility('{{ form.password1.id_for_label }}')"><i class="fa fa-eye"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.password2.id_for_label }}" class="form-label">Confirm Password <span class="text-danger">*</span></label>
<input type="password" id="{{ form.password2.id_for_label }}" class="form-control" name="password2" />
<span class="toggle-password" onclick="togglePasswordVisibility('{{ form.password2.id_for_label }}')"><i class="fa fa-eye"></i></span>
</div>
</div>
</div>
</div>
<script>
// JavaScript to toggle password visibility
function togglePasswordVisibility(inputId) {
var input = document.getElementById(inputId);
var toggle = document.querySelector('[id="' + inputId + '"] + .toggle-password');
if (input.type === 'password') {
input.type = 'text';
toggle.innerHTML = '<i class="fa fa-eye-slash"></i>';
} else {
input.type = 'password';
toggle.innerHTML = '<i class="fa fa-eye"></i>';
}
}
</script>
<!-- Add more form fields as needed -->
<button class="btn btn-primary mb-5" type="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
<!-- Container-fluid Ends-->
{% endblock %}
+218
View File
@@ -0,0 +1,218 @@
{% extends 'dashboard/base.html' %}
{% load static %}
{% load customtag %}
{% block title %}{{ title }} - {{ seo_settings.meta_title }}{% endblock title %}
{% block content %}
<style>
/* Media query for mobile devices */
@media (max-width: 768px) {
#cke_id_description {
width: 309px !important;
}
}
/* Media query for desktop devices */
@media (min-width: 769px) {
#cke_id_description {
width: 980px !important;
position: relative;
}
}
</style>
<div class="page-body">
<div class="container-fluid">
<div class="page-title">
<div class="row">
<div class="col-6">
<h3>{{ title }}</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">Users</li>
<li class="breadcrumb-item active">Edit Profile</li>
</ol>
</div>
</div>
</div>
</div>
<!-- Container-fluid starts-->
<div class="container-fluid">
<div class="row project-cards">
<div class="col-md-12 project-list">
</div>
<div class="container">
<form method="POST" enctype="multipart/form-data">
{% csrf_token %}
{{form.media}}
{% 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="row mb-3">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<label for="{{ form.profile_picture.id_for_label }}" class="form-label">Profile Picture <span class="text-danger">*</span></label>
{% if profile.profile_picture %}
<br>
<img class="currentImg" style="border-radius:10px; width:100px;" src="{{ profile.profile_picture.url }}" alt="Current Image">
<br>
{% endif %}
{{ form.profile_picture }}
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.name.id_for_label }}" class="form-label">Name <span class="text-danger">*</span></label>
{{ form.name }}
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.email.id_for_label }}" class="form-label">Email <span class="text-danger">*</span></label>
{{ form.email}}
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.phone.id_for_label }}" class="form-label">Phone <span class="text-danger">*</span></label>
{{ form.phone}}
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.role.id_for_label }}" class="form-label">Role <span class="text-danger">*</span></label>
{{ form.role|add_class:'form-select' }}
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.slug.id_for_label }}" class="form-label">Profile Slug <span class="text-danger">*</span></label>
{{ form.slug }}
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.address.id_for_label }}" class="form-label">Address <span class="text-danger">*</span></label>
{{ form.address }}
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.city.id_for_label }}" class="form-label">City <span class="text-danger">*</span></label>
{{ form.city }}
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.state.id_for_label }}" class="form-label">State <span class="text-danger">*</span></label>
{{ form.state }}
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.zipcode.id_for_label }}" class="form-label">Zipcode <span class="text-danger">*</span></label>
{{ form.zipcode }}
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.country.id_for_label }}" class="form-label">Country <span class="text-danger">*</span></label>
{{ form.country }}
</div>
</div>
</div>
</div>
<div class="row mb-1">
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.facebook.id_for_label }}" class="form-label">Facebook <span class="text-danger">*</span></label>
{{ form.facebook }}
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.instagram.id_for_label }}" class="form-label">Instagram <span class="text-danger">*</span></label>
{{ form.instagram }}
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<label for="{{ form.linkedin.id_for_label }}" class="form-label">Linkedin <span class="text-danger">*</span></label>
{{ form.linkedin }}
</div>
</div>
</div>
</div>
<!-- Add more form fields as needed -->
<button class="btn btn-primary mb-5" type="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
<!-- Container-fluid Ends-->
{% endblock %}
+162
View File
@@ -0,0 +1,162 @@
{% extends 'dashboard/base.html' %}
{% load static %}
{% load customtag %}
{% block title %}{{ title }} - {{ seo_settings.meta_title }}{% endblock title %}
{% block content %}
<style>
/* Media query for mobile devices */
@media (max-width: 768px) {
#cke_id_description {
width: 309px !important;
}
}
/* Media query for desktop devices */
@media (min-width: 769px) {
#cke_id_description {
width: 980px !important;
position: relative;
}
}
.password-input {
position: relative;
}
/* CSS to position the "Show" and "Hide" text inside the field */
.toggle-password {
position: absolute;
top: 50%;
right: 10px; /* Adjust this value to control the right-side position */
transform: translateY(-50%);
cursor: pointer;
padding: 2px 5px;
}
</style>
<div class="page-body">
<div class="container-fluid">
<div class="page-title">
<div class="row">
<div class="col-6">
<h3>{{ title }} of {{profile.name}}</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">User</li>
<li class="breadcrumb-item">{{ profile.user }}</li>
<li class="breadcrumb-item active">Change Password</li>
</ol>
</div>
</div>
</div>
</div>
<!-- Container-fluid starts-->
<div class="container-fluid">
<div class="row project-cards">
<div class="col-md-12 project-list">
</div>
<div class="container">
<form method="POST" action="" enctype="multipart/form-data">
{% csrf_token %}
{% 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">
<ul>
{% for field in form %}
{% if field.errors %}
<li>{{ field.label }}: {{ field.errors }}</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
<div class="row mb-2">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<label for="" class="form-label">Username ( Read Only )</label>
<input type="text" value={{ profile.user }} id="" readonly class="form-control" name="username" />
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<label for="{{ form.old_password.id_for_label }}" class="form-label">Old Password <span class="text-danger">*</span></label>
<div class="password-input">
<input type="password" id="{{ form.old_password.id_for_label }}" class="form-control" name="old_password" />
<span class="toggle-password" onclick="togglePasswordVisibility('{{ form.old_password.id_for_label }}')"><i class="fa fa-eye"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-1">
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.new_password1.id_for_label }}" class="form-label">New Password <span class="text-danger">*</span></label>
<div class="password-input">
<input type="password" id="{{ form.new_password1.id_for_label }}" class="form-control" name="new_password1" />
<span class="toggle-password" onclick="togglePasswordVisibility('{{ form.new_password1.id_for_label }}')"><i class="fa fa-eye"></i></span>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-body">
<label for="{{ form.new_password2.id_for_label }}" class="form-label">Confirm Password <span class="text-danger">*</span></label>
<div class="password-input">
<input type="password" id="{{ form.new_password2.id_for_label }}" class="form-control" name="new_password2" />
<span class="toggle-password" onclick="togglePasswordVisibility('{{ form.new_password2.id_for_label }}')"><i class="fa fa-eye"></i></span>
</div>
</div>
</div>
</div>
</div>
<!-- Add more form fields as needed -->
<button class="btn btn-primary mb-5" type="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
<script>
// JavaScript to toggle password visibility
function togglePasswordVisibility(inputId) {
var input = document.getElementById(inputId);
var toggle = document.querySelector('[id="' + inputId + '"] + .toggle-password');
if (input.type === 'password') {
input.type = 'text';
toggle.innerHTML = '<i class="fa fa-eye-slash"></i>';
} else {
input.type = 'password';
toggle.innerHTML = '<i class="fa fa-eye"></i>';
}
}
</script>
<!-- Container-fluid Ends-->
{% endblock %}
+127
View File
@@ -0,0 +1,127 @@
{% extends 'dashboard/base.html' %}
{% load static %}
{% block title %}{{ title }} - {{ seo_settings.meta_title }}{% endblock title %}
{% block content %}
<style>
i.fa.fa-key {
color: darkgoldenrod;
}
</style>
<div class="page-body">
<div class="container-fluid">
<div class="page-title">
<div class="row">
<div class="col-6">
<h3>Users</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">Users</li>
<li class="breadcrumb-item active">User List</li>
</ol>
</div>
</div>
</div>
</div>
<!-- Container-fluid starts-->
<div class="container-fluid">
<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 Users</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" href="{% url 'createUser' %}"> <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 User</a>
</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>#</th>
<th>Image</th>
<th>Name</th>
<th>Role</th>
<th>Email</th>
<th>Phone</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ forloop.counter }}</td>
<td><img src="{{ user.getUserImage }}" style="border-radius:10px;" width="50" alt="userProfilePicture"></td>
<td><a href="{% url 'editUserProfile' user.id %}">{{ user.name }}</a></td>
<td>{{ user.user.role }}</td>
{% if user.email %}
<td>{{ user.email }}</td>
{% else %}
<td>Not added</td>
{% endif %}
{% if user.phone %}
<td>{{ user.phone }}</td>
{% else %}
<td>Not added</td>
{% endif %}
<td>
<ul class="action">
<li class="edit"> <a href="{% url 'editUserProfile' user.id %}"><i class="icon-pencil-alt"></i></a></li>
<li class="password"> <a href="{% url 'changePassword' user.id %}"><i class="fa fa-key"></i></a></li>
<li class="delete"><a href="#" data-slug="{{ user.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 'deleteUser' user.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 %}