{% load staticfiles %}
<html>
<head>
    <title>{{ filter }} alerts panel</title>
</head>
<script src="https://yandex.st/jquery/2.0.3/jquery.min.js" type="text/javascript"></script>

<script type='text/javascript'>
    $(document).ready(function(){
        console.log('ready');
        var conf = [];
        var conf1 = [];
        {% for line in data %}
            conf1 = []; {% for alert in line %}
                conf1.push({
                    'alertname': '{{ alert.alertname }}',
                    'lightname': '{{ alert.lightname }}',
                    'metagroup': '{{ alert.metagroup }}'});
            {% endfor %} conf.push(conf1);
        {% endfor %}
        document.getElementById('lights-frame').onload = function(){
        document.getElementById('lights-frame').contentWindow.postMessage(
                {
                    fullscreen: false,
                    lightsConfig: {
                        lights : conf
                    }
                },
                '*');
        };
    });
</script>
<body>
<iframe id="lights-frame" src="//yasm.yandex-team.ru/iframe-panel?beta=1&mini&night=0" width="100%" height="100%">panel</iframe>
</body>
</html>
