62 lines
2.5 KiB
HTML
62 lines
2.5 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<title>Enquiry List</title>
|
||
|
|
{% load static %}
|
||
|
|
|
||
|
|
<link rel="stylesheet" href="{% static 'cmc.css' %}">
|
||
|
|
<script src="https://unpkg.com/htmx.org@1.6.1"></script>
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
{% include 'partials/nav.html' %}
|
||
|
|
|
||
|
|
<section class="section">
|
||
|
|
|
||
|
|
<h1 class="title">Add Enquiry</h1>
|
||
|
|
|
||
|
|
|
||
|
|
<form method="post" hx-post="{% url 'add_enquiry' %}" hx-target="body">
|
||
|
|
{% csrf_token %}
|
||
|
|
{{ form.as_p }}
|
||
|
|
|
||
|
|
<div class="field">
|
||
|
|
<label class="label" for="customer-search">Search for customer</label>
|
||
|
|
<div class="control">
|
||
|
|
<input type="text" id="customer-search" name="customer" hx-get="{% url 'customer_autocomplete' %}" hx-trigger="keyup changed delay:500ms" hx-target="#customer-select" autocomplete="off">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="field">
|
||
|
|
<label class="label" for="customer-select">Customer</label>
|
||
|
|
<div class="select">
|
||
|
|
<select name="customer_id" id="customer-select" hx-get="{% url 'load_contacts' %}" hx-trigger="change" hx-target="#contact-select">
|
||
|
|
{% for customer in customers %}
|
||
|
|
<option value="{{ customer.id }}">{{ customer.name }}</option>
|
||
|
|
{% endfor %}
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="field">
|
||
|
|
<label class="label" for="contact-select">Contact</label>
|
||
|
|
<div class="select">
|
||
|
|
<select name="contact_id" id="contact-select" hx-get="{% url 'load_contacts' %}" hx-trigger="change" hx-target="#contact-select">
|
||
|
|
{% for customer in customers %}
|
||
|
|
<option value="{{ contact.id }}">{{ contact.first_name }} {{ contact.last_name }}</option>
|
||
|
|
{% endfor %}
|
||
|
|
</select>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="field is-grouped">
|
||
|
|
<div class="control">
|
||
|
|
<button class="button is-link" type="submit">Submit</button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</section>
|
||
|
|
</body>
|
||
|
|
</html>
|