ajaxDisplay.html.twig 4.87 KB
Newer Older
1
2
3
4
5
6
7
8
9
{% extends '@Potage/layout.html.twig' %}

{% block title %}
    {{ lettre.reference }}
{% endblock %}

{% block searchbar %}
    <nav class="navbar navbar-expand-lg navbar-light bg-light navbar-search">
        <div class="nav-laterale left">
10
11
12
            <a href="{{ path('potage_offre_ajax_display') }}" class="text-secondary">
                <i class="fas fa-long-arrow-alt-up fa-fw" style="transform: rotate(-45deg);"></i> Les offres</a>

13
14
15
16
            <a href="{{ path('potage_lettre_ajax_display') }}" class="text-secondary">
                <i class="fas fa-long-arrow-alt-up fa-fw"></i>Toutes les lettres</a>
        </div>
        <div class="nav-laterale right">
17
18
19
            <a href="{{ path('potage_info_ajax_display') }}" class="text-secondary">
                Les actualités <i class="fas fa-long-arrow-alt-up fa-fw" style="transform: rotate(45deg);"></i></a>

20
21
22
23
24
        </div>
    </nav>
{% endblock %}

{% block headerContent %}
25
    {%  include '@Potage/Lettre/modalForm.html.twig' %}
26
27
28
29
30
31
{% endblock %}

{% block sidebarContent %}
<div class="row">
    <aside class="col-3">
        <div class="card">
32
33
34
            <div class="card-header">
                <h2>Lettre # {{ id }}</h2>
            </div>
35
36
            <ul class="list-group list-group-flush">
                <li class="list-group-item">
37
38
39
                    <dl>
                        <dt>Créée le:</dt>
                        <dd class="field-lettre field0">{{ lettre.createdAt.format('d/m/Y H:i') }}</dd>
40
                        {% if lettre.updatedAt %}
41
42
                            <dt>Dernière modification:</dt>
                            <dd class="field-lettre field1">{{ lettre.updatedAt.format('d/m/Y H:i') }}</dd>
43
                        {% endif %}
44
                    </dl>
45
46
                </li>
                <li class="list-group-item">
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
                    <dl>
                        <dt>Pour:</dt>
                        <dd class="field-lettre field2">Groupe {{ lettre.groupe.nom }}</dd>
                        <dt>Sujet:</dt>
                        <dd class="field-lettre field3">{{ lettre.subject }}</dd>
                        <dt>Période:</dt>
                        <dd>
                            <span class="field-lettre field4">{{ lettre.startedAt.format('d/m/Y') }}</span>
                            <span class="field-lettre field5">{{ lettre.endedAt.format('d/m/Y') }}</span>
                        </dd>
                    </dl>
                </li>
                <li class="list-group-item border-bottom-0">
                    <dl>
                        <dt>Statut:</dt>
                        <dd class="field-lettre field6">{{ lettre.status }}</dd>
                    </dl>
64
65
                </li>
            </ul>
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
            {% if lettre.status in ['draft', 'current'] %}
                <div class="card-footer">
                    <button class="btn btn-dark btn-sm mb-1 mr-1" title="Éditer" data-vivaldi-spatnav-clickable="1"
                            data-toggle="modal" data-target=".form-lettre-modal" data-lettre-id="{{ id }}">
                        <i class="fas fa-pencil-alt fa-fw"></i> Modifier
                    </button>
                </div>
            {% endif %}
        </div>
        <div class="card mt-3">
            <div class="card-header">
                {{ lettre.getInfos|length }}{{ lettre.getInfos|length > 1 ? ' infos' : ' info' }}
            </div>
            {% if lettre.status in ['draft', 'current'] %}
            <div class="card-body">
                <p>Sauvegarder la position</p>
                {{ form(formLettreSorted) }}
            </div>
            {% endif %}
85
86
        </div>
    </aside>
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
{% endblock %}

{% block sectionContent %}
    <section class="col-9">

        <div class="row">
            <div class="col left hd-1">
                <h1>{{ block('title') }}</h1>
            </div>
            <div class="col right hd-1">
                <div style="margin-top: 0.65em;">
                    <a href="javascript: void(0);" class="btn btn-outline-dark mb-2 btn-reload">
                        <i class="fas fa-sync-alt"></i>
                        Rafraîchir la liste
                    </a>
                </div>
            </div>
        </div>

        <div id="maingrid" class="grid lettre-infos {{ lettre.status }}">
            <div id="sortable"></div>
            <div class="clearfix"></div>
        </div>

    </section>
112
113
114
115
116
117
</div>
{% endblock %}

{% block customJS %}
<script type="text/javascript" src="{{ asset('js/functions.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/ajax_functions.js') }}"></script>
118
<script type="text/javascript">
119
120
121
122
123

    let id_lettre = {{ id }};
    let sortForm = document.querySelector('form[name=lettre_sorted]');
    let input = sortForm.querySelector('input#lettre_sorted_sorted');

124
    {% include '@Potage/LettreInfos/ajaxDisplay.js' %}
125
    {% include '@Potage/Lettre/dateSlider.js' %}
126

127
128
129
</script>
{% endblock %}