0byt3m1n1
Path:
/
home
/
mgatv524
/
www
/
shimoda
/
views
/
[
Home
]
File: stats-proofofplay-page.twig
{# /* * Spring Signage Ltd - http://www.springsignage.com * Copyright (C) 2017 Spring Signage Ltd * (stats-proofofplay-page.twig) */ #} {% extends "authed.twig" %} {% import "inline.twig" as inline %} {% block actionMenu %} <ul class="nav nav-pills pull-right"> <li class="btn btn-primary btn-xs"><a class="XiboFormButton btns" title="{% trans "Export raw data to CSV" %}" href="{{ urlFor("stats.export.form") }}"> <i class="fa fa-cloud-download" aria-hidden="true"></i> {% trans "Export" %}</a></li> <li class="btn btn-warning btn-xs"><a class="btns" id="refreshGrid" title="{% trans "Refresh" %}" href="#"><i class="fa fa-refresh" aria-hidden="true"></i></a></li> </ul> {% endblock %} {% block pageContent %} {% set displayFilterOptions = [{displayId: null, display: ""}]|merge(displays) %} <div class="widget"> <div class="widget-title">{% trans "Proof of Play" %}</div> <div class="widget-body"> <div class="XiboGrid" id="{{ random() }}" data-grid-name="statsView"> <div class="XiboFilter well"> <div class="FilterDiv" id="Filter"> <form class="form-inline"> {% set title %}{% trans "From Date" %}{% endset %} {{ inline.date("statsFromDt", title, defaults.fromDateOneDay, "", "", "", "") }} {% set title %}{% trans "To Date" %}{% endset %} {{ inline.date("statsToDt", title, defaults.toDate, "", "", "", "") }} {% set title %}{% trans "Display" %}{% endset %} {{ inline.dropdown("displayId", "single", title, "", displayFilterOptions, "displayId", "display") }} {% set title %}{% trans "Layout" %}{% endset %} {% set layoutFilterOptions = [{layoutId: null, layout: ""}]|merge(layouts) %} {{ inline.dropdown("layoutId[]", "dropdownmulti", title, "", layoutFilterOptions, "layoutId", "layout", "", "selectPicker", "", "m", "", [{name: "data-live-search", value:"true"}, {name: "data-selected-text-format", value: "count > 3"}]) }} {% set title %}{% trans "Media" %}{% endset %} {% set mediaFilterOptions = [{mediaId: null, name: ""}]|merge(media) %} {{ inline.dropdown("mediaId[]", "dropdownmulti", title, "", mediaFilterOptions, "mediaId", "name", "", "selectPicker", "", "m", "", [{name: "data-live-search", value:"true"}, {name: "data-selected-text-format", value: "count > 3"}]) }} </form> </div> </div> <div class="XiboData"> <table id="stats" class="table table-striped"> <thead> <tr> <th>{% trans "Type" %}</th> <th>{% trans "Display" %}</th> <th>{% trans "Layout ID" %}</th> <th>{% trans "Layout" %}</th> <th>{% trans "Widget ID" %}</th> <th>{% trans "Media" %}</th> <th>{% trans "Number of Plays" %}</th> <th>{% trans "Total Duration" %}</th> <th>{% trans "Total Duration (s)" %}</th> <th>{% trans "First Shown" %}</th> <th>{% trans "Last Shown" %}</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> </div> {% endblock %} {% block javaScript %} <script type="text/javascript"> $(document).ready(function() { var table = $("#stats").DataTable({ "language": dataTablesLanguage, serverSide: true, stateSave: true, stateDuration: 0, stateLoadCallback: function (settings, callback) { var data; $.ajax({ type: "GET", async: false, url: "{{ urlFor("user.pref") }}?preference=proofOfPlayGrid", dataType: 'json', success: function (json) { if (json.success) data = JSON.parse(json.data.value); } }); return data; }, stateSaveCallback: function (settings, data) { $.ajax({ type: "POST", url: "{{ urlFor("user.pref") }}", data: { preference: [{ option: "proofOfPlayGrid", value: JSON.stringify(data) }] } }); }, filter: false, searchDelay: 3000, "order": [[1, "asc"]], ajax: { "url": "{{ urlFor("stats.search") }}", "data": function (d) { $.extend(d, $("#stats").closest(".XiboGrid").find(".FilterDiv form").serializeObject()); } }, "columns": [ {"data": "type"}, {"data": "display"}, {"data": "layoutId"}, {"data": "layout"}, {"data": "widgetId"}, {"data": "media"}, {"data": "numberPlays"}, { "data": "duration", "render": function (data, type, row, meta) { if (type != "display") return ""; return moment().startOf("day").seconds(data).format("H:mm:ss") } }, {"data": "duration"}, {"data": "minStart"}, {"data": "maxEnd"} ] }); table.on('draw', dataTableDraw); table.on('processing.dt', dataTableProcessing); $("#refreshGrid").click(function () { table.ajax.reload(); }); }); function statsExportFormSubmit() { $("#statisticsExportForm").submit(); XiboDialogClose(); } </script> {% endblock %}