You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
5.1 KiB
HTML

{% 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">
Add Ticket for {{customer.user.first_name}} {{customer.user.last_name}}
</h1>
<form class="w-full flex flex-col gap-5 justify-center items-center mt-5" method="POST" action="{% url 'addticket' customer.id %}" enctype="multipart/form-data">
{% csrf_token %}
<div class="w-full">
<label class="text-gray-500">Ticket Title:</label>
<input required 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">
<label class="text-gray-500">What is this regarding?</label>
<select name="regarding" class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1"
id="regardingSelectTag">
<option value="General/Account/Billing">General/Account/Billing</option>
<option value="Product">Product</option>
<option value="Project">Project</option>
</select>
</div>
<!-- Projects Select Tag -->
<div class="w-full hidden" id="projectsSelectTag">
<label class="text-gray-500">Choose one of {{customer.user.first_name}}'s projects:</label>
<select name="project" class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1">
{% if not customer_projects %}
<option value="" selected disabled>Select Project</option>
{% else %}
{% for customer_project in customer_projects %}
<option value="{{customer_project.id}}">{{customer_project.name}}</option>
{% endfor %}
{% endif %}
</select>
</div>
<!-- Products Select Tag -->
<div class="w-full hidden" id="productsSelectTag">
<label class="text-gray-500">Choose one of {{customer.user.first_name}}'s products/subscriptions:</label>
<select name="product" class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1" >
{% if not customer_products %}
<option value="" selected disabled>Select Product</option>
{% else %}
{% for customer_product in customer_products %}
<option value="{{customer_product.item.id}}">{{customer_product.item.title}}</option>
{% endfor %}
{% endif %}
</select>
</div>
<div class="w-full">
<label class="text-gray-500">Department:</label>
<select name="department" class="w-full h-[50px] py-1 px-3 border border-gray-300 outline-none rounded-md mt-1" >
<option value="" selected disabled>Select Department</option>
{% for department in departments %}
<option value="{{department.id}}">{{department.name}}</option>
{% endfor %}
</select>
</div>
<div class="w-full">
<label class="text-gray-500">Description:</label>
<textarea required name="description"
class="w-full py-1 px-3 border border-gray-300 outline-none rounded-md mt-1 resize-none"
rows="8"></textarea>
</div>
<div class="w-full">
<label class="text-gray-500">Attach Files:</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="files" type="file" class="file-input" hidden multiple />
<span class="file-name text-gray-500 text-base focus:outline-none outline-none">Upload
Document(s)</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-3">
<button type="submit"
class="w-fit py-1 px-5 bg-osiblue rounded-md outline-none text-white border border-osiblue text-xl cursor-pointer hover:bg-white hover:text-osiblue duration-300">Save</button>
</div>
</form>
</div>
</div>
<!-------------- JS SCRIPTS --------------->
<script type="text/javascript" src='{% static "js/upload-input-tag.js" %}'></script>
<script type="text/javascript" src='{% static "js/add-ticket.js" %}'></script>
{% endblock %}