combo.html.twig 1.24 KB
Newer Older
1
2
{% import _self as my_macros %}

arnaudbey's avatar
add app    
arnaudbey committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<div class="panel panel-default">
    <div class="panel-heading">
        &nbsp;
        <span class="pull-right">
            <span class="btn btn-default btn-xs" onclick="combo.add()" >
                <i class="fa fa-plus" aria-hidden="true"></i>
                {{ 'add_combo' | trans }}
            </span>
            <button type="button" class="btn btn-default  btn-xs" data-toggle="modal" data-target="#helper-combos">
                <i class="fa fa-eye" aria-hidden="true"></i>
                {{ 'see_combos' | trans }}
            </button>
        </span>
    </div>

18
    <ul class="list-group" id="combos" data-prototype="{{ my_macros.combos_prototype(form.combos.vars.prototype)|e }}">
arnaudbey's avatar
add app    
arnaudbey committed
19
    {% for combo in form.combos %}
20
	      {{ my_macros.combos_prototype(combo) }}
arnaudbey's avatar
add app    
arnaudbey committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
    {% endfor %}
    </ul>
</div>

{% macro combos_prototype(combo) %}
<li class="list-group-item combo">
    {{ form_label(combo.number) }} : {{ form_widget(combo.number) }} - {{ form_label(combo.lenght) }} : {{ form_widget(combo.lenght) }}
    <span class="pull-right">
        <span onclick="objectives.remove(this);" class="btn btn-danger">
            <i class="fa fa-times" aria-hidden="true"></i>
        </span>
    </span>
</li>
{% endmacro %}