Pārlūkot izejas kodu

product drawing, customer template

tum 8 mēneši atpakaļ
vecāks
revīzija
ed3e51f102

+ 53 - 0
app/report/templates/report/productdrawing_form.html

@@ -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 %}

+ 1 - 1
app/report/views.py

@@ -1100,7 +1100,7 @@ class ProductDrawingCRUDView(ConfigurableCRUDView):
1100 1100
     model = ProductDrawing
1101 1101
     list_template_name = 'legacy/datacrud_list.html'
1102 1102
     detail_template_name = 'legacy/datacrud_detail.html'
1103
-    form_template_name = 'legacy/datacrud_form.html'
1103
+    form_template_name = 'report/productdrawing_form.html'
1104 1104
     confirm_delete_template_name = 'legacy/datacrud_confirm_delete.html'
1105 1105
     filterset_class = ProductDrawingFilter
1106 1106