New changes.
parent
a2655fa504
commit
e9db6dcad2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,7 @@
|
||||
from django.urls import path
|
||||
from billing.edit import views
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path('edit_payment_modal', views.edit_payment_modal, name='edit_payment_modal'),
|
||||
]
|
@ -0,0 +1,13 @@
|
||||
from django.shortcuts import render, get_object_or_404
|
||||
from osinacore.models import *
|
||||
from billing.models import *
|
||||
from osinacore.decorators import *
|
||||
|
||||
@staff_login_required
|
||||
def edit_payment_modal(request):
|
||||
|
||||
context = {
|
||||
|
||||
}
|
||||
|
||||
return render(request, 'edit_templates/edit-payment-modal.html', context)
|
@ -0,0 +1,34 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Comment</h1>
|
||||
|
||||
<div class="w-full flex justify-center items-center">
|
||||
<textarea name="comment" type="text" placeholder="Write Your Comment..."
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-4 resize-none"
|
||||
rows="5" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,62 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Payment</h1>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Amount:</label>
|
||||
<input name="title" type="decimal"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1" placeholder="Amount" required>
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Date Paid:</label>
|
||||
<input name="title" type="date"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Date Due:</label>
|
||||
<input name="title" type="date"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Payment Method:</label>
|
||||
<select name="" id="" class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
<option value="" selected disabled>Payment Method</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Comment:</label>
|
||||
<textarea name="comment" type="text" placeholder="Write Your Comment..."
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none resize-none"
|
||||
rows="4"></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,62 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Edit Payment</h1>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Amount:</label>
|
||||
<input name="title" type="decimal"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1" placeholder="Amount" required>
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Date Paid:</label>
|
||||
<input name="title" type="date"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Date Due:</label>
|
||||
<input name="title" type="date"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Payment Method:</label>
|
||||
<select name="" id="" class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
<option value="" selected disabled>Payment Method</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Comment:</label>
|
||||
<textarea name="comment" type="text" placeholder="Write Your Comment..."
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none resize-none"
|
||||
rows="4"></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,60 @@
|
||||
{% load static %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Osina</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="POST" action="{% url 'addtagmodal' %}">
|
||||
{% csrf_token %}
|
||||
<h1 class="text-secondosiblue text-2xl font-semibold text-center">Add Payment Method</h1>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Payment Method:</label>
|
||||
<input name="title" type="text"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Description:</label>
|
||||
<textarea name="" type="text" placeholder="Description"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-1 resize-none"
|
||||
rows="4" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<label class="text-gray-500">Payment Logo:</label>
|
||||
<div class="inbox-box border border-gray-300 w-full rounded-md px-3 mt-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<input name="logo" required type="file" class="file-input" accept="image/*" hidden />
|
||||
<span class="file-name text-gray-500 text-base focus:outline-none outline-none">Upload
|
||||
Logo</span>
|
||||
<label
|
||||
class="file-label bg-transparent text-gray-500 border border-white h-14 cursor-pointer flex items-center">
|
||||
<i class="fa fa-upload" style="font-size: 25px;"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-4">
|
||||
<button type="submit"
|
||||
class="w-fit bg-osiblue border border-osiblue rounded-md text-white text-xl px-5 py-1 hover:bg-white hover:text-osiblue duration-300">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-------------- JS SCRIPTS --------------->
|
||||
<script type="text/javascript" src='{% static "js/upload-input-tag.js" %}'></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,30 @@
|
||||
{%load static%}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="post" action="" target="_parent">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="h-[140px] flex flex-col justify-center items-center">
|
||||
<h1 class="text-secondosiblue text-xl font-semibold text-center">Are you sure you want to delete this Payment Method?</h1>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-5 gap-5">
|
||||
<button
|
||||
class="w-fit bg-red-500 border border-red-500 rounded-md text-white text-base px-5 py-1 hover:bg-white hover:text-red-500 duration-300">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,30 @@
|
||||
{%load static%}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body class="font-poppinsLight">
|
||||
<form id="hiddenContent" method="post" action="" target="_parent">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="h-[140px] flex flex-col justify-center items-center">
|
||||
<h1 class="text-secondosiblue text-xl font-semibold text-center">Are you sure you want to delete this Payment?</h1>
|
||||
|
||||
<div class="w-full flex justify-center items-center mt-5 gap-5">
|
||||
<button
|
||||
class="w-fit bg-red-500 border border-red-500 rounded-md text-white text-base px-5 py-1 hover:bg-white hover:text-red-500 duration-300">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,65 @@
|
||||
{% extends "add-edit-main.html" %}
|
||||
{%load static%}
|
||||
{% block content %}
|
||||
|
||||
<div class="w-full px-5 s:px-9 mb-5">
|
||||
<div class="w-full h-full shadow-md rounded-md py-5 px-3 bg-white">
|
||||
<h1 class="text-3xl text-secondosiblue text-center font-semibold">
|
||||
Edit Payment Method
|
||||
</h1>
|
||||
|
||||
<form id="hiddenContent" method="POST" action="">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="w-full flex flex-col gap-5 justify-center items-center">
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Payment Method:</label>
|
||||
<input name="title" type="text" value="shdhd"
|
||||
class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Description:</label>
|
||||
<textarea name="" type="text" placeholder="Description"
|
||||
class="w-full p-3 border border-gray-300 rounded-md bg-transparent outline-none mt-1 resize-none"
|
||||
rows="4" required>dfsdfds dd</textarea>
|
||||
</div>
|
||||
|
||||
<div class="w-full">
|
||||
<label class="text-gray-500">Payment Logo:</label>
|
||||
<div class="inbox-box border border-gray-300 w-full rounded-md px-3 mt-1">
|
||||
<div class="flex items-center justify-between">
|
||||
<input name="logo" required type="file" class="file-input" accept="image/*" hidden />
|
||||
<span class="file-name text-gray-500 text-base focus:outline-none outline-none">Upload
|
||||
Logo</span>
|
||||
<label
|
||||
class="file-label bg-transparent text-gray-500 border border-white h-14 cursor-pointer flex items-center">
|
||||
<i class="fa fa-upload" style="font-size: 25px;"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- POPUP MODAL -->
|
||||
<div class="w-full h-full bg-black bg-opacity-40 z-20 fixed justify-center items-center hidden inset-0" id="popUpModal">
|
||||
<div class="w-[95%] md:w-fit h-fit bg-white rounded-md p-9 relative">
|
||||
<button class="absolute top-3 right-5 text-slate-800 text-xl cursor-pointer outline-none border-none"
|
||||
id="closeModalButton">
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
<iframe id="popupModalFrame" frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>
|
||||
|
||||
<!-------------- JS SCRIPTS --------------->
|
||||
<script type="text/javascript" src='{% static "js/upload-input-tag.js" %}'></script>
|
||||
|
||||
{% endblock content %}
|
@ -0,0 +1,101 @@
|
||||
{% extends "main.html" %}
|
||||
{%load static%}
|
||||
{% block content %}
|
||||
|
||||
|
||||
<div class="w-full xxlg1:w-[75%]">
|
||||
<div class="w-full h-fit bg-white rounded-md shadow-md p-5">
|
||||
<h1 class="text-secondosiblue text-[25px]">Payment Methods</h1>
|
||||
|
||||
<!-- FILTERING -->
|
||||
<div
|
||||
class="w-full py-4 px-3 bg-gray-200 rounded-md shadow-md mt-4 flex flex-col s:flex-row gap-3 justify-between items-center">
|
||||
<div class="w-full s:w-fit flex justify-start items-center gap-5">
|
||||
<div class="relative h-fit w-full s:w-fit flex items-center">
|
||||
<input type="text" placeholder="Enter Payment"
|
||||
class="py-2 px-3 border border-gray-300 rounded-md outline-none w-full s:w-[300px] h-[40px] relative">
|
||||
<button
|
||||
class="text-gray-500 text-xl outline-none border-none cursor-pointer absolute right-2 bg-white">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full s:w-fit">
|
||||
<button
|
||||
class="w-full s:w-fit text-base px-3 py-2 bg-osiblue text-white outline-none border border-osiblue rounded-md cursor-pointer hover:bg-white hover:text-osiblue duration-300 addPaymentMethodButton"
|
||||
data-modal-url="{% url 'add_payment_method_modal' %}">Add
|
||||
Payment Method</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto border border-gray-300 rounded-md mt-5" id="customersContainer">
|
||||
<table class="min-w-full divide-y">
|
||||
<!-- TABLE HEADER -->
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col"
|
||||
class="px-6 py-3 text-sm font-medium text-gray-500 uppercase border-r border-gray-300 whitespace-nowrap">
|
||||
Payment Method
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3 text-sm font-medium text-gray-500 uppercase whitespace-nowrap border-r border-gray-300">
|
||||
Description
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3 text-sm font-medium text-gray-500 uppercase whitespace-nowrap">
|
||||
Actions
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- TABLE BODY -->
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
<tr>
|
||||
<td class="px-6 py-4 text-center text-sm border-r border-gray-300">
|
||||
<div class="w-full flex justify-center items-center gap-2 text-gray-500 text-sm">
|
||||
<img src="{% static 'images/icons/whishlogo.png' %}" class="w-[30px] rounded-md">
|
||||
<p>Whish</p>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 text-center text-sm border-r border-gray-300">
|
||||
<p class="text-secondosiblue">Helo this is a description</p>
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 text-center text-sm">
|
||||
<div class="flex justify-center items-center gap-3">
|
||||
<a href="{% url 'editpaymentmethod' %}">
|
||||
<div class="cursor-pointer">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[18px] text-fifthosiblue hover:scale-110 duration-500 transition-transform">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" />
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
<div data-modal-url="{% url 'deletepaymentmethodmodal' %}" class="deletePaymentMethodButton">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-[18px] text-red-500 hover:scale-110 duration-500 transition-transform">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- POPUP MODAL -->
|
||||
<div class="w-full h-full bg-black bg-opacity-40 z-20 fixed justify-center items-center hidden inset-0" id="popUpModal">
|
||||
<div class="w-[95%] md:w-fit h-fit bg-white rounded-md p-9 relative">
|
||||
<button class="absolute top-3 right-5 text-slate-800 text-xl cursor-pointer outline-none border-none"
|
||||
id="closeModalButton">
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
<iframe id="popupModalFrame" frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src='{% static "js/pop-modals.js" %}'></script>
|
||||
|
||||
|
||||
{% endblock content %}
|
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,32 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const addButtons = document.querySelectorAll('.addServiceButton');
|
||||
|
||||
addButtons.forEach(function (button) {
|
||||
button.addEventListener('click', function () {
|
||||
const serviceId = button.getAttribute('data-service-id');
|
||||
const serviceTitle = button.getAttribute('data-service-title');
|
||||
|
||||
const selectTag = document.getElementById('servicesSelectTag');
|
||||
const option = document.createElement('option');
|
||||
option.value = serviceId;
|
||||
option.text = serviceTitle;
|
||||
|
||||
if (button.classList.contains('added')) {
|
||||
button.classList.remove('added');
|
||||
button.classList.remove('bg-red-500');
|
||||
button.classList.add('bg-osiblue');
|
||||
button.querySelector('p').textContent = "Add";
|
||||
const optionToRemove = selectTag.querySelector(`option[value="${serviceId}"]`);
|
||||
if (optionToRemove) {
|
||||
selectTag.removeChild(optionToRemove);
|
||||
}
|
||||
} else {
|
||||
button.classList.add('added');
|
||||
button.classList.add('bg-red-500');
|
||||
button.querySelector('p').textContent = "Remove";
|
||||
selectTag.appendChild(option);
|
||||
option.selected = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue