forked from kiloutyg/docauposte2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
incidents_modification.html.twig
executable file
·109 lines (93 loc) · 4.27 KB
/
incidents_modification.html.twig
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
{% extends 'base.html.twig' %}
{% block title %}
{{incident.name}}
|
{{ parent() }}
{% endblock %}
{% block body %}
{% set lastZone = null %}
{% set lastProductLine = null %}
{% set lastCategory = null %}
{% set lastButton = null %}
<script>
{% if zone is defined and zone is not null %}
zoneIdFromServer = parseInt('{{ zone.getId() }}');{% endif %}{% if productLine is defined and productLine is not null %}productLineIdFromServer = parseInt('{{ productLine.getId() }}');{% endif %}{% if category is defined and category is not null %}categoryIdFromServer = parseInt('{{ category.getId() }}');{% endif %}{% if button is defined and button is not null %}buttonIdFromServer = parseInt('{{ button.getId() }}');{% endif %}
</script>
<div class="card border-0 shadow rounded-3 my-5 bg-secondary">
<div class="card-body ">
<div class="row d-flex align-items-center gy-lg-0 gy-5">
<p class="text-white m-0">
<h3 style="color:white">
Modification du fichier
<strong>{{incident.name}}</strong>
:
</h3>
Type d'incident:
{{ incident.incidentCategory.name|split('.')|first|upper }}
</p>
<iframe src="{{ path('app_modify_incident_download_file', { 'id': incident.id }) }}" width="69%" height="950" target="_blank"></iframe>
{{ form_start(form, {'attr': {'class': 'form-floating justify-content-center', 'id': 'modifyIncidentForm','method' : 'POST', 'enctype': 'multipart/form-data'}, 'action': path('app_incident_modify_file', {'incidentId': incident.id})}) }}
<div class="fallback">
<div class="mb-3">
{{ form_label(form.file, 'Choisissez un nouveau ficher:', {'label_attr': {'class': 'form-label', 'style': 'color:white'}}) }}
{{ form_widget(form.file, {'attr': {'class': 'form-control', 'id': 'file', 'accept' : '.pdf'}}) }}
</div>
<div class="mb-3">
{{ form_label(form.name, 'Nouveau nom du fichier:', {'label_attr': {'class': 'form-label', 'style': 'color:white'}}) }}
{{ form_widget(form.name, {'attr': {'class': 'form-control', 'id': 'name', 'placeholder': 'Entrer un nouveau nom de fichier (optionnel)'}}) }}
</div>
<div
style="color:white">
{# Display the current button hierarchy #}
{% if lastZone != incident.productLine.zone %}
{% set lastZone = incident.productLine.zone %}
Zone:
{{ lastZone.name|split('.')|first|upper }}
>
{% endif %}
{% if lastProductLine != incident.productLine %}
{% set lastProductLine = incident.productLine %}
Produit:
{{ lastProductLine.name|split('.')|first|upper}}
{% endif %}
</div>
<div class="row">
<div class="col-md-2 col-sm-2 mt-2 mb-2">
<label for="incident_zone" style="color:white">Zone:</label>
</div>
<div class="col-md-10 col-sm-10 mt-2 mb-2">
<select name="incident_zone" id="incident_zone" class="form-select" required>
<option value="" selected disabled hidden>Choisir une Zone</option>
</select>
</div>
<div class="col-md-2 col-sm-2 mt-2 mb-2">
<label for="incident_productline" style="color:white">Ligne :</label>
</div>
<div class="col-md-10 col-sm-10 mt-2 mb-2">
{{ form_widget(form.productline,{'attr': {'class': 'form-select', 'name': 'incident_productline', 'id': 'incident_productline', 'required': true}}) }}
</div>
<div class="col-md-2 col-sm-2 mt-2 mb-2">
<label for="incidents_incidentCategory" style="color:white">Type d'incident:</label>
</div>
<div class="col-md-10 col-sm-10 mt-2 mb-2">
{{ form_widget(form.incidentCategory,{'attr': {'class': 'form-select', 'name': 'incident_incidentCategory', 'id': 'incident_incidentCategory'}}) }}
</div>
</div>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-5">
<button type="submit" class="btn btn-primary mb-5 submit-incident-modification">Modifier</button>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ encore_entry_script_tags('incident-cascading-dropdowns') }}
<script>
window.onload = function () {
let selectElement = document.getElementById('incident_productline');
selectElement.innerHTML = '<option value="" selected disabled hidden>Choisir un produit</option>';
}
</script>
{% endblock %}