~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to views/dataset-data-form-add.twig

  • Committer: Dan Garner
  • Date: 2015-08-11 09:29:02 UTC
  • mto: This revision was merged to the branch mainline in revision 453.
  • Revision ID: git-v1:a86fb4369b7395c13367577d23b14c0ab4528c1a
Transitions fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    {% trans "Save" %}, $("#dataSetDataAdd").submit()
21
21
{% endblock %}
22
22
 
23
 
{% block callBack %}dataSetDataEntryOpen{% endblock %}
24
 
 
25
23
{% block formHtml %}
26
24
    <div class="row">
27
25
        <div class="col-md-12">
28
26
            <form id="dataSetDataAdd" class="XiboForm form-horizontal" method="post" action="{{ urlFor("dataSet.data.add", {id: dataSet.dataSetId}) }}">
29
27
                {% for col in dataSet.getColumn() %}
30
 
                    {% if col.dataSetColumnTypeId == 1 or col.dataSetColumnTypeId == 3  %}
 
28
                    {% if col.dataSetColumnTypeId == 1 %}
31
29
                        {% set fieldId = "dataSetColumnId_#{col.dataSetColumnId}" %}
32
30
 
33
31
                        {# Field depending on what data type we have #}
34
32
                        {% if col.dataTypeId == 2 %}
35
33
                            {{ forms.number(fieldId, col.heading) }}
36
34
                        {% elseif col.dataTypeId == 3 %}
37
 
                            {{ forms.dateTime(fieldId, col.heading) }}
38
 
                        {% elseif col.dataTypeId == 5 %}
39
 
                            {% set attributes = [
40
 
                            { name: "data-live-search", value: "true" },
41
 
                            { name: "data-selected-text-format", value: "count > 4" }
42
 
                            ] %}
43
 
                            {{ forms.dropdown(fieldId, "single", col.heading, "", [{mediaId: null, name: ""}]|merge(images), "mediaId", "name", "", "", "", "", "", attributes) }}
44
 
                        {% elseif col.listContent != "" %}
45
 
                            {{ forms.dropdown(fieldId, "single", col.heading, heading, [""]|merge(col.listContentArray())) }}
 
35
                            {{ forms.date(fieldId, col.heading) }}
46
36
                        {% else %}
47
 
                            {{ forms.input(fieldId, col.heading) }}
 
37
                            {{ forms.text(fieldId, col.heading) }}
48
38
                        {% endif %}
49
39
                    {% endif %}
50
40
                {% endfor %}