|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+{% extends "base.html" %}
|
|
|
2
|
+{% load legacy_filters %}
|
|
|
3
|
+{% load tailwind_filters %}
|
|
|
4
|
+
|
|
|
5
|
+{% block title %}
|
|
|
6
|
+ {% if view.title %}
|
|
|
7
|
+ {{ view.title }}
|
|
|
8
|
+ {% else %}
|
|
|
9
|
+ {{ view|class_name }}
|
|
|
10
|
+ {% endif %}
|
|
|
11
|
+{% endblock %}
|
|
|
12
|
+
|
|
|
13
|
+{% block content %}
|
|
|
14
|
+<div class="container mx-auto px-4 py-6">
|
|
|
15
|
+ <h1 class="text-2xl font-bold mb-6">
|
|
|
16
|
+ {% if view.title %}
|
|
|
17
|
+ {{ view.title }}
|
|
|
18
|
+ {% elif view|class_name == "CreateViewClass" %}
|
|
|
19
|
+ Create {{ model_verbose_name }}
|
|
|
20
|
+ {% else %}
|
|
|
21
|
+ Update {{ model_verbose_name }}
|
|
|
22
|
+ {% endif %}
|
|
|
23
|
+ </h1>
|
|
|
24
|
+
|
|
|
25
|
+ <!-- Render the Form -->
|
|
|
26
|
+ <form method="post" enctype="multipart/form-data" >
|
|
|
27
|
+ {% csrf_token %}
|
|
|
28
|
+ <div>
|
|
|
29
|
+
|
|
|
30
|
+ {{ form.code_no |as_crispy_field }}
|
|
|
31
|
+ {{ form.code_no_mks |as_crispy_field }}
|
|
|
32
|
+ {{ form.lot_no |as_crispy_field }}
|
|
|
33
|
+ {% if form.instance.drawing %}
|
|
|
34
|
+ <p>
|
|
|
35
|
+ <a href="{{ form.instance.drawing.url }}" target="_blank">
|
|
|
36
|
+ <img src="{{ form.instance.drawing.url }}" width='500px'>
|
|
|
37
|
+ </a>
|
|
|
38
|
+ </p>
|
|
|
39
|
+ {% endif %}
|
|
|
40
|
+ {{ form.drawing | as_crispy_field }}
|
|
|
41
|
+ {{ form.description | as_crispy_field }}
|
|
|
42
|
+ </div>
|
|
|
43
|
+ <div class='mt-4'>
|
|
|
44
|
+ <button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
|
|
|
45
|
+ Save
|
|
|
46
|
+ </button>
|
|
|
47
|
+ <a href="{% url list_url_name %}" class="bg-gray-300 text-gray-800 px-4 py-2 rounded hover:bg-gray-400">
|
|
|
48
|
+ Cancel
|
|
|
49
|
+ </a>
|
|
|
50
|
+ </div>
|
|
|
51
|
+ </form>
|
|
|
52
|
+</div>
|
|
|
53
|
+{% endblock %}
|