~xibo-maintainers/xibo/tempel

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
{#
/*
 * Spring Signage Ltd - http://www.springsignage.com
 * Copyright (C) 2015 Spring Signage Ltd
 * (${FILE_NAME})
 */
#}

{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}

{% block formTitle %}
    {% trans "Add Layout" %}
{% endblock %}

{% block formButtons %}
    {% trans "Help" %}, XiboHelpRender("{{ help }}")
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, $("#layoutAddForm").submit()
{% endblock %}

{% block callBack %}layoutAddFormOpen{% endblock %}

{% block formFieldActions %}
    [{
    "field": "layoutId",
    "trigger": "change",
    "value": 0,
    "operation": "equals",
    "actions": {
        ".resolution-group": { "display": "block" }
    }
    },{
    "field": "layoutId",
    "trigger": "change",
    "value": 0,
    "operation": "not",
    "actions": {
        ".resolution-group": { "display": "none" }
    }
    }]
{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <ul class="nav nav-tabs" role="tablist">
                <li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
                <li><a href="#description" role="tab" data-toggle="tab"><span>{% trans "Description" %}</span></a></li>
            </ul>
            <form id="layoutAddForm" class="form-horizontal" method="post" action="{{ urlFor("layout.add") }}" data-redirect="{{ urlFor("layout.designer") }}">
                <div class="tab-content">
                    <div class="tab-pane active" id="general">
                        {% set title %}{% trans "Name" %}{% endset %}
                        {% set helpText %}{% trans "The Name of the Layout - (1 - 50 characters)" %}{% endset %}
                        {{ forms.input("name", title, "", helpText) }}

                        {% set title %}{% trans "Tags" %}{% endset %}
                        {% set helpText %}{% trans "Tags for this layout - used when searching for it. Comma delimited. (1 - 250 characters)" %}{% endset %}
                        {{ forms.input("tags", title, "", helpText) }}

                        {% set title %}{% trans "Template" %}{% endset %}
                        {% set helpText %}{% trans "Optionally choose a template you have saved before." %}{% endset %}
                        {% set layouts = [{layoutId: null, layout: ""}]|merge(layouts) %}
                        {{ forms.dropdown("layoutId", "single", title, "", layouts, "layoutId", "layout", helpText) }}

                        {% set title %}{% trans "Resolution" %}{% endset %}
                        {% set helpText %}{% trans "Choose the resolution this Layout should be designed for." %}{% endset %}
                        {{ forms.dropdown("resolutionId", "single", title, "", resolutions, "resolutionId", "resolution", helpText, "resolution-group") }}
                    </div>
                    <div class="tab-pane" id="description">
                        {% set title %}{% trans "Description" %}{% endset %}
                        {% set helpText %}{% trans "An optional description of the Layout. (1 - 250 characters)" %}{% endset %}
                        {{ forms.textarea("description", title, "", helpText) }}
                    </div>
                </div>
            </form>
        </div>
    </div>
{% endblock %}