aboutsummaryrefslogtreecommitdiffhomepage
path: root/main/app/sprinkles/admin/templates/forms/group.html.twig
blob: fade5abb9f9a619f984d01161130a2dac90d62d2 (plain) (blame)
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
<form class="js-form" method="{{ form.method | default('POST') }}" action="{{ site.uri.public }}/{{ form.action }}">
    {% include "forms/csrf.html.twig" %}
    <div class="js-form-alerts">
    </div>
    <div class="row">
        {% block group_form %}
            {% if 'name' not in form.fields.hidden %}
                <div class="col-sm-12">
                    <div class="form-group">
                        <label>{{ translate("GROUP.NAME") }}</label>
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-edit fa-fw"></i></span>
                            <input type="text" class="form-control" name="name" autocomplete="off"
                                   value="{{ group.name }}" placeholder="{{ translate("GROUP.NAME_EXPLAIN") }}"
                                   {% if 'name' in form.fields.disabled %}disabled{% endif %}>
                        </div>
                    </div>
                </div>
            {% endif %}
            {% if 'slug' not in form.fields.hidden %}
                <div class="col-sm-12">
                    <div class="form-group">
                        <label>{{ translate("SLUG") }}</label>
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-tag fa-fw"></i></span>
                            <input type="text" class="form-control" name="slug" autocomplete="off"
                                   value="{{ group.slug }}" placeholder="{{ translate("SLUG") }}"
                                   {% if 'slug' in form.fields.disabled %}disabled{% endif %} readonly>
                            {% if 'slug' not in form.fields.disabled %}
                                <span class="input-group-btn" data-toggle="buttons">
                                <label class="btn btn-primary">
                                    <input type="checkbox" id="form-group-slug-override"
                                           autocomplete="off"> {{ translate("OVERRIDE") }}
                                </label>
                            </span>
                            {% endif %}
                        </div>
                    </div>
                </div>
            {% endif %}
            {% if 'icon' not in fields.hidden %}
                <div class="col-sm-12">
                    <div class="form-group">
                        <label>{{ translate("GROUP.ICON") }}</label>
                        <div class="input-group">
                            <span class="input-group-addon icon-preview"><i class="{{ group.icon }} fa-fw"></i></span>
                            <input type="text" class="form-control" name="icon" autocomplete="off"
                                   value="{{ group.icon }}" placeholder="{{ translate("GROUP.ICON_EXPLAIN") }}"
                                   {% if 'icon' in form.fields.disabled %}disabled{% endif %}>
                        </div>
                    </div>
                </div>
            {% endif %}
            {% if 'description' not in fields.hidden %}
                <div class="col-sm-12">
                    <div class="form-group">
                        <label for="input_description">{{ translate("DESCRIPTION") }}</label>
                        <textarea id="input_description" class="form-control" type="text" name="description"
                                  {% if 'description' in form.fields.disabled %}disabled{% endif %}
                                  rows=6>{{ group.description }}</textarea>
                    </div>
                </div>
            {% endif %}
        {% endblock %}
    </div>
    <br>
    <div class="row">
        <div class="col-xs-6 col-sm-4">
            <button type="submit" class="btn btn-block btn-lg btn-success">{{ form.submit_text }}</button>
        </div>
        <div class="col-xs-4 col-sm-3 pull-right">
            <button type="button" class="btn btn-block btn-lg btn-link"
                    data-dismiss="modal">{{ translate("CANCEL") }}</button>
        </div>
    </div>
</form>
<!-- Include validation rules -->
<script>
    {% include "pages/partials/page.js.twig" %}
</script>