~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to views/notification-page.twig

  • Committer: Dan Garner
  • Date: 2016-02-15 17:54:45 UTC
  • mto: (454.4.130)
  • mto: This revision was merged to the branch mainline in revision 484.
  • Revision ID: git-v1:dd226a6f84464ff28758a249e1fd52ca4a35d911
Correction to Layout Duration ToolTip
xibosignage/xibo#721

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{#
2
 
/*
3
 
 * Spring Signage Ltd - http://www.springsignage.com
4
 
 * Copyright (C) 2015 Spring Signage Ltd
5
 
 * (${FILE_NAME})
6
 
 */
7
 
 
8
 
#}
9
 
{% extends "authed.twig" %}
10
 
{% import "inline.twig" as inline %}
11
 
 
12
 
{% block actionMenu %}
13
 
    <ul class="nav nav-pills pull-right">
14
 
        <li class="btn btn-success btn-xs"><a class="XiboFormButton btns" href="{{ urlFor("notification.add.form") }}"><i class="fa fa-plus-circle" aria-hidden="true"></i> {% trans "Add Notification" %}</a></li>
15
 
    </ul>
16
 
{% endblock %}
17
 
 
18
 
 
19
 
{% block pageContent %}
20
 
    <div class="widget">
21
 
        <div class="widget-title">{% trans "Notification Centre" %}</div>
22
 
        <div class="widget-body">
23
 
            <div class="XiboGrid" id="{{ random() }}">
24
 
                <div class="XiboFilter">
25
 
                    <div class="FilterDiv" id="Filter">
26
 
                        <form class="form-inline">
27
 
 
28
 
                        </form>
29
 
                    </div>
30
 
                </div>
31
 
                <div class="XiboData">
32
 
                    <table id="notifications" class="table table-striped">
33
 
                        <thead>
34
 
                            <tr>
35
 
                                <th>{% trans "Subject" %}</th>
36
 
                                <th>{% trans "Date" %}</th>
37
 
                                <th>{% trans "Email?" %}</th>
38
 
                                <th>{% trans "Interrupt?" %}</th>
39
 
                                <th></th>
40
 
                            </tr>
41
 
                        </thead>
42
 
                        <tbody>
43
 
 
44
 
                        </tbody>
45
 
                    </table>
46
 
                </div>
47
 
            </div>
48
 
        </div>
49
 
    </div>
50
 
{% endblock %}
51
 
 
52
 
{% block javaScript %}
53
 
    <script type="text/javascript">
54
 
        var table = $("#notifications").DataTable({ "language": dataTablesLanguage,
55
 
            serverSide: true, stateSave: true, stateDuration: 0,
56
 
            stateLoadCallback: function (settings, callback) {
57
 
                var data;
58
 
                $.ajax({
59
 
                    type: "GET",
60
 
                    async: false,
61
 
                    url: "{{ urlFor("user.pref") }}?preference=notificationGrid",
62
 
                    dataType: 'json',
63
 
                    success: function (json) {
64
 
                        if (json.success)
65
 
                            data = JSON.parse(json.data.value);
66
 
                    }
67
 
                });
68
 
                return data;
69
 
            },
70
 
            stateSaveCallback: function (settings, data) {
71
 
                $.ajax({
72
 
                    type: "POST",
73
 
                    url: "{{ urlFor("user.pref") }}",
74
 
                    data: {
75
 
                        preference: [{
76
 
                            option: "notificationGrid",
77
 
                            value: JSON.stringify(data)
78
 
                        }]
79
 
                    }
80
 
                });
81
 
            },
82
 
            filter: false,
83
 
            searchDelay: 3000,
84
 
            "order": [[ 1, "desc"]],
85
 
            ajax: {
86
 
                "url": "{{ urlFor("notification.search") }}",
87
 
                "data": function(d) {
88
 
                    $.extend(d, $("#notifications").closest(".XiboGrid").find(".FilterDiv form").serializeObject());
89
 
                }
90
 
            },
91
 
            "columns": [
92
 
                { "data": "subject" },
93
 
                {
94
 
                    "data": "releaseDt",
95
 
                    "render": dataTableDateFromUnix
96
 
                },
97
 
                {
98
 
                    "data": "isEmail",
99
 
                    "render": dataTableTickCrossColumn
100
 
                },
101
 
                {
102
 
                    "data": "isInterrupt",
103
 
                    "render": dataTableTickCrossColumn
104
 
                },
105
 
                {
106
 
                    "orderable": false,
107
 
                    "data": dataTableButtonsColumn
108
 
                }
109
 
            ]
110
 
        });
111
 
 
112
 
        table.on('draw', dataTableDraw);
113
 
        table.on('processing.dt', dataTableProcessing);
114
 
 
115
 
        function notificationFormOpen(dialog) {
116
 
            $('select[name="displayGroupIds[]"]', dialog).selectpicker();
117
 
            $('select[name="userGroupIds[]"]', dialog).selectpicker();
118
 
 
119
 
            // Conjure up a text editor
120
 
            CKEDITOR.replace("body", CKEDITOR_DEFAULT_CONFIG);
121
 
 
122
 
            // Make sure when we close the dialog we also destroy the editor
123
 
            dialog.on("hide.bs.modal", function(event) {
124
 
                if (event.target.className == "bootbox modal in" && CKEDITOR.instances["body"] != undefined) {
125
 
                    CKEDITOR.instances["body"].destroy();
126
 
                }
127
 
            });
128
 
        }
129
 
    </script>
130
 
{% endblock %}
 
 
b'\\ No newline at end of file'