Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

grid-pattern-edit.html.twig 1.64 KB
Newer Older
1
2
{% import _self as macros %}

Arnaud Bey's avatar
Arnaud Bey committed
3
<span onclick="gridPatternHandler.list();" class="btn btn-sm btn-outline-secondary">
arnaudbey's avatar
add app  
arnaudbey committed
4
5
6
    <i class="fa fa-chevron-left" aria-hidden="true"></i>
    {{"back_to_patterns_list" | trans}}
</span>
Arnaud Bey's avatar
Arnaud Bey committed
7
<span id="pattern-save-btn" onclick="{{ pattern.id ? "gridPatternHandler.save()" : "gridPatternHandler.create()"}}" class="btn btn-sm btn-primary">
Arnaud Bey's avatar
Arnaud Bey committed
8
    <i class="far fa-save" aria-hidden="true"></i>
arnaudbey's avatar
add app  
arnaudbey committed
9
10
11
    {{ "save" | trans }}
</span>
{% if pattern.id %}
Arnaud Bey's avatar
fix UI  
Arnaud Bey committed
12
<span onclick="gridPatternHandler.delete({{ pattern.id }})" class="btn btn-sm btn-danger float-right">
Arnaud Bey's avatar
Arnaud Bey committed
13
    <i class="far fa-save" aria-hidden="true"></i>
arnaudbey's avatar
add app  
arnaudbey committed
14
15
16
17
18
19
20
21
22
23
    {{ "delete" | trans }}
</span>
{% endif %}

<hr/>

<form id="gridpattern" method="POST">
    {{ form_row(form.name) }}
    {{ form_row(form.description) }}
    {{ form_label(form.strings) }}
Arnaud Bey's avatar
Arnaud Bey committed
24
    <span class="btn btn-outline-secondary btn-sm" onclick="gridPatternHandler.addString()" >
arnaudbey's avatar
add app  
arnaudbey committed
25
26
27
        <i class="fa fa-plus" aria-hidden="true"></i>
        {{ 'add_string' | trans }}
    </span>
28
    <ul class="list-group row" id="strings" data-prototype="{{ macros.strings_prototype(form.strings.vars.prototype)|e }}">
arnaudbey's avatar
add app  
arnaudbey committed
29
    {% for string in form.strings %}
30
	   {{ macros.strings_prototype(string) }}
arnaudbey's avatar
add app  
arnaudbey committed
31
32
33
34
35
36
37
38
39
    {% endfor %}
    </ul>
    <input type="hidden" id="pattern-id" name="pattern-id" value="{{ pattern.id }}"/>
    {{ form_widget(form._token) }}
</form>

{% macro strings_prototype(string) %}
<li class="col-md-6 list-group-item string">
    {{ form_widget(string.value) }}
Arnaud Bey's avatar
Arnaud Bey committed
40
    <span onclick="gridPatternHandler.removeString(this);" class="btn btn-danger btn-sm">
arnaudbey's avatar
add app  
arnaudbey committed
41
42
43
44
        <i class="fa fa-times" aria-hidden="true"></i>
    </span>
</li>
{% endmacro %}