-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathproducts_detail.html
424 lines (331 loc) · 11.2 KB
/
products_detail.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
{% extends "layouts/base.html" %}
{% load static %}
{% block title %} Dashboard {% endblock %}
<!-- Specific Page CSS goes HERE -->
{% block stylesheets %}{% endblock stylesheets %}
{% block content %}
{% load mptt_tags %}
<div class="col-md-12">
<div class="card card-plain" align="right" dir="rtl">
<div class="card-header">
<h4 class="card-title" dir="rtl" align="center"> محصول {{ product.name }} </h4>
<p> کد: <small> ({{ product.synch_to.code }}) </small> </p>
<p> موجودی: {{ product.synch_to.inventory.normalize }} {{ product.synch_to.unit }} </p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card card-user">
<div class="card-body">
<p class="card-text">
<div class="author">
<div class="block block-one"></div>
<div class="block block-two"></div>
<div class="block block-three"></div>
<div class="block block-four"></div>
<img width="20%" src="{{ product.synch_to.image.url }}">
</div>
</p>
<div align="right" dir="rtl" class="card-description">
<p class="category"> {{ product.synch_to.description|linebreaks }} </p>
</div>
</div>
</div>
</div>
</div>
<div class="row" dir="rtl" align="right">
<div class="col-md-7">
<div class="card card-user">
<div class="card-header">
<h4 class="card-title"> BOM محصول </h4>
</div>
<div class="card-body">
{% for Bom_product in bom %}
<section id='eg1' class="ladder tree">
<ul>
<li>
<a href=".">
{{ Bom_product.material }}
ضریب مصرف: {{ Bom_product.inventory.normalize }}
<img width="30px" src="{{ Bom_product.material.image.url }}" alt="Profile Photo">
<hr>
</a>
<ul>
{% recursetree material_bom %}
{% if node.relatedProduct.name == Bom_product.material.name %}
<li>
<a href=".">
{{ node.name.name }}
ضریب مصرف: {{ node.quantity.normalize }}
<img width="30px" src="{{ node.name.image.url }}" alt="Profile Photo">
<hr>
</a>
<ul>{% if not node.is_leaf_node %}<li>{{ children }}</li>{% endif %}</ul>
</li>
{% endif %}
{% endrecursetree %}
</ul>
</li>
</ul>
</section>
{% endfor %}
</div>
</div>
</div>
<div class="col-md-5">
<div class="card card-user">
<div class="card-header">
<h4 class="card-title"> اقلام مصرفی </h4>
</div>
<div class="card-body">
<table class="table tablesorter " id="">
<thead class=" text-primary">
<tr>
<th>
نام
</th>
<th>
کد
</th>
<th>
ضریب مصرف
</th>
<th class="text-center">
تصویر
</th>
</tr>
</thead>
<tbody>
{% for Bom_product in bom_masrafi %}
<tr>
<td><a href="{{ Bom_product.material.get_absolute_url }}"> {{ Bom_product.material.name }} </a></td>
<td> {{ Bom_product.material.code }} </td>
<td> {{ Bom_product.inventory.normalize }}</td>
<td class="text-center">
<div class="photo">
<img src="{{ Bom_product.material.image.url }}" alt="Profile Photo">
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card card-user">
<div class="card-header">
<h4 class="card-title" dir="rtl" align="center"> درخت محصول </h4> <hr>
</div>
<div class="card-body">
<div id="tree"> <div>
</div>
</div>
</div>
</div>
<div class="row" dir="rtl" align="right">
<div class="col-md-12">
<div class="card card-user">
<div class="card-header">
<h4 class="card-title"> ایستگاه های درگیر </h4>
</div>
<div class="card-body">
<table class="table tablesorter " id="">
<thead class=" text-primary">
<tr>
<th>
نام
</th>
<th>
وضعیت
</th>
<th>
مسئول
</th>
<th>
توضیحات
</th>
<th>
موجودی
</th>
<th class="text-center">
قطعه خروجی
</th>
</tr>
</thead>
<tbody>
{% for Tree in tree %}
<tr>
<td><a href="{{ Tree.station.get_absolute_url }}"> {{ Tree.station.name }} </a></td>
<td> {{ Tree.station.position }} </td>
<td> {{ Tree.station.manager }} </td>
<td> {{ Tree.station.description|slice:":60" }}... </td>
<td> {{ Tree.station.inventory.normalize }} </td>
<td class="text-center"> {{ Tree.station.output_material }} </td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row" dir="rtl" align="right">
<div class="col-md-12">
<div class="card card-user">
<div class="card-header">
<h4 class="card-title"> سفارشات </h4>
</div>
<div class="card-body">
<table class="table tablesorter " id="">
<thead class=" text-primary">
<tr>
<th>
نام
</th>
<th>
کد
</th>
<th>
تیراژ
</th>
<th class="text-center">
تایید شده
</th>
<th class="text-center">
تکمیل شده
</th>
<th class="text-center">
تصویر
</th>
</tr>
</thead>
<tbody>
{% for Order in order %}
<tr>
<td><a href="{{ Order.get_absolute_url }}"> {{ Order.product.name }} </a></td>
<td> {{ Order.code }} </td>
<td> {{ Order.circulation.normalize }} </td>
<td class="text-center">
{% if Order.confirmed %}
<i style="color:green;" class="tim-icons icon-check-2"></i>
{% else %}
<i style="color:red;" class="tim-icons icon-simple-remove"></i>
{% endif %}
</td>
<td class="text-center">
{% if Order.completed %}
<i style="color:green;" class="tim-icons icon-check-2"></i>
{% else %}
<i style="color:red;" class="tim-icons icon-simple-remove"></i>
{% endif %}
</td>
<td class="text-center">
<div class="photo">
<img src="{{ Order.product.synch_to.image.url }}" alt="Profile Photo">
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row" dir="rtl" align="center">
<div class="col-md-4">
<div class="card card-user">
</div>
</div>
<div class="col-md-4">
<div class="card card-user">
<br>
<h4> فایل ضمیمه محصول </h4>
<br>
<a href="{{ product.file.url }}" download><button class="btn btn-outline-warning mr-3">Download</button></a>
<br>
</div>
</div>
<div class="col-md-4">
<div class="card card-user">
</div>
</div>
</div>
<p dir="rtl" align="right"> تگ : {{ product.tag }} </p>
<br> <br><br> <br><br> <br> <hr>
{% endblock content %}
<!-- Specific Page JS goes HERE -->
{% block javascripts %}
<script>
$("#eg1 li ul").slideToggle(); // hide all nested lists
$("#eg1 li ul").prev("a").click(function(){ // add fn to list items that have a nested list
$(this).next("ul").slideToggle(100); // show/hide the nested list
return false; // prevent scrolling
});
window.onload = function () {
OrgChart.templates.ana.plus = '<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle>'
+ '<text text-anchor="middle" style="font-size: 18px;cursor:pointer;" fill="#757575" x="15" y="22">{collapsed-children-count}</text>';
var chart = new OrgChart(document.getElementById("tree"), {
template: "ana",
enableDragDrop: true,
assistantSeparation: 170,
align: OrgChart.ORIENTATION,
toolbar: {
fullScreen: true,
zoom: true,
fit: true,
expandAll: true
},
tags: {
"نیرو خانگی": {
template: "polina"
},
"انبار": {
template: "rony"
},
"حمل و نقل": {
template: "belinda"
},
"ایستگاه": {
template: "ana"
},
"برون سپاری": {
template: "ula"
}
},
nodeBinding: {
field_0: "نام",
field_1: "موجودی",
field_2: "ورودی",
field_3: "خروجی",
field_4: "مسئول",
img_0: "img"
},
});
chart.load([
{% for Tree in tree %}
{
id: "{{ Tree.station }}",
pid: "{{ Tree.parent_station }}",
نام: "{{ Tree.station }}",
موجودی: "{{ Tree.station.inventory.normalize }}",
ورودی: "{% for input_material in Tree.station.input_material.all %} {{ input_material.name }} , {% endfor %}",
مسئول: "{{ Tree.station.manager }}" ,
خروجی:" {{ Tree.station.output_material }} " ,
img: "{{ Tree.station.output_material.image.url }}",
tags: ["{{ Tree.station.position }}"]
},
{% endfor %}
]);
};
$(document).ready(function() {
// Javascript method's body can be found in assets/js/demos.js
demo.initDashboardPageCharts();
});
</script>
{% endblock javascripts %}