#!/usr/bin/env python




##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
    import builtins as builtin
except ImportError:
    import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import *
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
import six
from six.moves.urllib.parse import quote
from Plugins.Extensions.OpenWebif.controllers.i18n import tstrings
from json import dumps
from time import localtime, strftime, mktime
from Plugins.Extensions.OpenWebif.controllers.views.responsive.ajax.renderevtblock import renderEvtBlock

##################################################
## MODULE CONSTANTS
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.4.4'
__CHEETAH_versionTuple__ = (2, 4, 4, 'development', 0)
__CHEETAH_genTime__ = 1644596121.655676
__CHEETAH_genTimestamp__ = 'Fri Feb 11 16:15:21 2022'
__CHEETAH_src__ = '/home/nonsolosat/openpli-dreambox-oe-core/build/tmp/work/dm520-oe-linux/enigma2-plugin-extensions-openwebif/gitAUTOINC+81b15e17ab-r0/git/plugin/controllers/views/responsive/ajax/multiepg.tmpl'
__CHEETAH_srcLastModified__ = 'Fri Feb 11 15:59:45 2022'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'

if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
    raise AssertionError(
      'This template was compiled with Cheetah version'
      ' %s. Templates compiled before version %s must be recompiled.'%(
         __CHEETAH_version__, RequiredCheetahVersion))

##################################################
## CLASSES

class multiepg(Template):

    ##################################################
    ## CHEETAH GENERATED METHODS


    def __init__(self, *args, **KWs):

        super(multiepg, self).__init__(*args, **KWs)
        if not self._CHEETAH__instanceInitialized:
            cheetahKWArgs = {}
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
            for k,v in KWs.items():
                if k in allowedKWs: cheetahKWArgs[k] = v
            self._initCheetahInstance(**cheetahKWArgs)
        

    def respond(self, trans=None):



        ## CHEETAH: main method generated for this template
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write(u'''
<!-- TODO: move styles to css file -->
<style>
\ttable { font-size: 13px; }
\ttr { vertical-align: top }
\t.float { float:left }
\t.service { font-weight: bold; font-size: 12px; padding-right: 4px; white-space: nowrap; overflow: hidden; }
\t.service img { width:50px; height:30px; float:none; margin-right:10px; border: 0; }
\t.serviceheader { padding: 10px; width: 190px; text-align: center; background-color: #bababa; box-shadow: inset -20px 40px 60px #fff; }
\t.theme--city-lights .serviceheader { background-color: #313443; box-shadow: inset -20px 40px 60px #282c37; }
\t.event { cursor: pointer; width: 190px; overflow:hidden; }
\t.bq { font-size: 12px; padding: 2px 4px; line-height: 18px; cursor: pointer; white-space: nowrap; display: inline-block; margin: 1px 1px 0px 0px;}
\t.plusclick { font-size: 14px; }
\t.navtab-active { cursor: pointer; margin-right:8px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; background-color: transparent !important; bottom: 2px;}
\t.navtab-inactive { cursor: pointer; margin-right:8px; border:None; background-color: transparent !important;  }
\t.timer { font-weight: bold; font-size: 10px; color:red; }
\t#eventdescription { width: 375px; height: auto; position: fixed; top: 205px; left: 350px; z-index: 100; display: none; overflow: auto; }
\t#navepg { margin-bottom: 1px; }
''')
        if VFFSL(SL,"mode",True) != 2: # generated from line 25, col 1
            write(u'''\t#tbl1 tbody { width: 100%; height: 100%; overflow-y: auto; display: block; overflow-x: hidden;}
\t#tbl2 tbody { width: 100%; height: 100%; overflow-y: hidden; display: block; overflow-x: hidden;}
\t#fulltbl { width: 100%; height: 100%; overflow-y: hidden; display: block; overflow-x: auto;}
''')
        write(u'''\t.notablemargin { margin: 0px;}
\t.ui-widget-content.nobg , .ui-widget-header.nobg{ background-image: none; } 
\t.wrapper { overflow-x: auto; width: 100%; -ms-overflow-style: -ms-autohiding-scrollbar;}
\ttd.border { width: 190px; }

\t.epg__event { display: flex; flex-wrap: wrap; padding: 0 0.2em 1em; }
\t.epg__time--start { flex: 0 1 2.8em }
\t.epg__title { font-weight: bold; margin-bottom: 0.2ex; flex: 1 0 0; display: block; }
\t.epg__desc { cursor: pointer; width: 190px; overflow:hidden; max-height: 3.75em; overflow: hidden; line-height: 1.25em; font-size: 12px; text-align: justify; padding-right: 1em; }
\t@supports (-webkit-line-clamp: 4) { .epg__desc { max-height: none; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; } }
\timg[src*="default_picon"] { filter: grayscale(1) opacity(0.5); }

\t#fulltbl .table-striped>tbody>tr:hover,
\t#fulltbl .table-striped>tbody>tr:nth-of-type(odd):hover,
\t#fulltbl .theme--city-lights .table-striped>tbody>tr:hover,
\t#fulltbl .theme--city-lights .table-striped>tbody>tr:nth-of-type(odd):hover { 
\t/* background-color: initial; */
\t}
\t.epg__event:hover {
\t\tfilter: brightness(1.2);
\t}
\t.epg__event:hover .epg__title {
\t\t\ttext-decoration: underline;
\t}
\t.epg__event.event--has-timer {
    position: relative;
    overflow: visible;
\t}
\t.epg__event.event--has-timer::after {
\tcontent: \'\';
    display: block;
    border-radius: 0;
    top: -25%;
    right: 0;
    bottom: -10%;
    left: -10px;
    position: absolute;
    border-width: 0 0 0 3px;
\tborder-style: solid;
  \t}
\t.epg__timer-status .material-icons {
\t\tfont-size: 1.2em;
    margin-right: 0.6ex;
    /* margin-bottom: 0.2ex; */
    vertical-align: text-top;
    /* line-height: 1.2; */
    float: left;
\t}
\t.epg__row {
    border: solid;
    border-width: 1px 0px 0px 0px;
    height: 60px !important;
    margin: 0;
    box-shadow: 5px 0px 2px -3px rgba(0, 0, 0, 0.2);
\t}
\t.epg__channel {
    width: 125px !important;
    margin-left: 15px;
    padding-right: 18px;
\t}
\t.epg__channel label {
    font-size: 11px;
    line-height: 1;
\t}
</style>

<div id="navepg">
<ul class="nav nav-tabs tab--skinned" style="margin-top: -10px;">
''')
        for slot in list(range(0,7)): # generated from line 98, col 1
            write(u'''\t<li><div class="plusclick navtab-''')
            if VFFSL(SL,"slot",True)==VFFSL(SL,"day",True) : # generated from line 99, col 35
                _v =  'active' 
                if _v is not None: write(_filter(_v))
            else:
                _v =  'inactive' 
                if _v is not None: write(_filter(_v))
            write(u'''" data-day="''')
            _v = VFFSL(SL,"slot",True) # u'$(slot)' on line 99, col 94
            if _v is not None: write(_filter(_v, rawExpr=u'$(slot)')) # from line 99, col 94.
            write(u'''">''')
            _v = VFFSL(SL,"tstrings",True)[("day_" + (time.strftime("%w", time.localtime(time.time()+86400*slot))))] # u'$tstrings[("day_" + (time.strftime("%w", time.localtime(time.time()+86400*slot))))]' on line 99, col 103
            if _v is not None: write(_filter(_v, rawExpr=u'$tstrings[("day_" + (time.strftime("%w", time.localtime(time.time()+86400*slot))))]')) # from line 99, col 103.
            write(u'''</div></li>
''')
        if VFFSL(SL,"mode",True) == 2: # generated from line 101, col 1
            write(u'''<li><div class="plusclick lbl">&nbsp;''')
            _v = VFFSL(SL,"tstrings",True)['prime_times'] # u"$tstrings['prime_times']" on line 102, col 38
            if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['prime_times']")) # from line 102, col 38.
            write(u''':&nbsp;</div></li>
<li><div id="pt0" class="plusclick navtab-inactive" data-day="201">06:00</div></li>
<li><div id="pt1" class="plusclick navtab-inactive" data-day="202">12:00</div></li>
<li><div id="pt2" class="plusclick navtab-inactive" data-day="203">20:00</div></li>
''')
            if VFFSL(SL,"day",True) == 0: # generated from line 106, col 1
                write(u'''\t\t<li><div id="pt3" class="plusclick navtab-inactive">&nbsp;</div>
<li><div id="pt4" class="plusclick navtab-active" data-day="200">''')
                _v = VFFSL(SL,"tstrings",True)['now'] # u"$tstrings['now']" on line 108, col 66
                if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['now']")) # from line 108, col 66.
                write(u'''</div></li>
''')
            write(u'''
''')
        else: # generated from line 111, col 1
            write(u'''<li><div class="plusclick lbl">&nbsp;''')
            _v = VFFSL(SL,"tstrings",True)['cw'] # u"$tstrings['cw']" on line 112, col 38
            if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['cw']")) # from line 112, col 38.
            write(u''':&nbsp;</div></li>
''')
            for wk in list(range(0,3)): # generated from line 113, col 1
                w = VFFSL(SL,"wk",True) + 1000
                write(u'''\t<li><div class="plusclick navtab-''')
                if VFFSL(SL,"wk",True)==VFFSL(SL,"week",True) : # generated from line 115, col 35
                    _v =  'active' 
                    if _v is not None: write(_filter(_v))
                else:
                    _v =  'inactive' 
                    if _v is not None: write(_filter(_v))
                write(u'''" data-day="''')
                _v = VFFSL(SL,"w",True) # u'$(w)' on line 115, col 93
                if _v is not None: write(_filter(_v, rawExpr=u'$(w)')) # from line 115, col 93.
                write(u'''">''')
                _v = VFN(VFFSL(SL,"time",True),"strftime",False)("%V",time.localtime(time.time()+604800*wk)) # u'$time.strftime("%V",time.localtime(time.time()+604800*wk))' on line 115, col 99
                if _v is not None: write(_filter(_v, rawExpr=u'$time.strftime("%V",time.localtime(time.time()+604800*wk))')) # from line 115, col 99.
                write(u'''</div></li>
''')
        write(u'''<li><div class=" lbl">&nbsp;''')
        _v = VFFSL(SL,"tstrings",True)['display_mode'] # u"$tstrings['display_mode']" on line 118, col 29
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['display_mode']")) # from line 118, col 29.
        write(u''':&nbsp;</div></li>
<li><div class="plusclick navtab-''')
        if VFFSL(SL,"mode",True)==1 : # generated from line 119, col 34
            _v =  'active' 
            if _v is not None: write(_filter(_v))
        else:
            _v =  'inactive' 
            if _v is not None: write(_filter(_v))
        write(u'''" data-day="101">''')
        _v = VFFSL(SL,"tstrings",True)['tv_guide'] # u"$tstrings['tv_guide']" on line 119, col 95
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['tv_guide']")) # from line 119, col 95.
        write(u'''</div></li>
<li><div class="plusclick navtab-''')
        if VFFSL(SL,"mode",True)==2 : # generated from line 120, col 34
            _v =  'active' 
            if _v is not None: write(_filter(_v))
        else:
            _v =  'inactive' 
            if _v is not None: write(_filter(_v))
        write(u'''" data-day="102">''')
        _v = VFFSL(SL,"tstrings",True)['timeline'] # u"$tstrings['timeline']" on line 120, col 95
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['timeline']")) # from line 120, col 95.
        write(u'''</div></li>
</ul>

<div id="compressmepg" onclick="CompressMEPG();"><i id="compressmepgi" class="fa fa-compress link" aria-hidden="true"></i></div>
<div id="refreshmepg2" onclick="RefreshMEPG();"><i id="refreshmepgi" class="fa fa-refresh link" aria-hidden="true"></i></div>
\t<br clear="all">

<ul class="nav nav-tabs tab--skinned" style="margin-top: -10px;">
''')
        for bq in VFFSL(SL,"bouquets",True): # generated from line 128, col 1
            write(u'''\t<li><div class="bq navtab-''')
            if VFFSL(SL,"bq",True)[0]==VFFSL(SL,"bref",True) : # generated from line 129, col 28
                _v =  'active' 
                if _v is not None: write(_filter(_v))
            else:
                _v =  'inactive' 
                if _v is not None: write(_filter(_v))
            write(u'''" data-ref="''')
            _v = VFFSL(SL,"quote",False)(VFFSL(SL,"bq",True)[0]) # u'$quote($bq[0])' on line 129, col 89
            if _v is not None: write(_filter(_v, rawExpr=u'$quote($bq[0])')) # from line 129, col 89.
            write(u'''">''')
            _v = VFFSL(SL,"bq",True)[1] # u'$bq[1]' on line 129, col 105
            if _v is not None: write(_filter(_v, rawExpr=u'$bq[1]')) # from line 129, col 105.
            write(u'''</div></li>
''')
        write(u'''</ul>
<br clear="all">
</div>

''')
        if VFFSL(SL,"mode",True) == 2: # generated from line 135, col 1
            write(u'''<style>
\t.picon { display: inline-block; margin:0; max-width: 100px;}
\t.picon > img { max-height: 30px;}
\t.timetable { border:none; height: 0px;}
\t.timetable > div { display:table; margin:0px 0px 0px -110px; padding:0;}
\t.timetable-now { position: relative;top: 0;left: 0px;z-index: 1;width: 2px;background-color: #0fb8fb;float:left;}
\t#tbl1 tbody { width: 100%; height: 100%; overflow-y: auto; display: block; overflow-x: hidden;}
\t.eventlist { display: inline-block; list-style-type: none; margin: 0px; padding: 0px 0px; width: calc(100% - 105px); }
\t.event { display: block; position: relative; vertical-align: top; clear: left; border: none; }
\t.event a,.event > span { padding: 0px; height:58px; width:100%; display: block; white-space: normal; overflow: hidden; }
\t.event a:link:hover { text-decoration: none; }
\t.ename { display: block; width: 100%; padding-left:5px; padding-top:10px; float: left; font-weight: 200; line-height: 1,4; font-size: 14px; }
\t.etime,.etimer  { display: inline-block; padding-left: 5px; font-weight: 200; line-height: 1,4; font-size: 12px; }
\t.event { display: inline-block; border:solid; border-width: 0px 0px 0px 1px; padding: 0px 0px 0px 0px!important; margin:0px 0px 0px -3px!important;}
\t.event .ename,.event .etime,.event .etimer { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
\t.channel-listing { list-style-type: none;}
\t.curevent { background: #e9e9e9; }
\t.etimesmall, .etime, .ename {
\t\tcolor: #000000;
\t\ttext-decoration: none;
\t}
\t.etimesmall, .etime {
\t\tfont-size: 10px;
\t}
\t.theme--city-lights .event a {
\t\tcolor: inherit;
\t}
\t.theme--city-lights .event a:hover {
\t\tcolor: inherit;
\t}
\t.theme--city-lights .curevent {
\t\tcolor: #f1f1f1;
\t\tbackground: #313443;
\t}
\t.theme--city-lights .ename,
\t.theme--city-lights .etimesmall, 
\t.theme--city-lights .etime { 
\t\tcolor: inherit;
\t}
</style>

''')
            now = VFFSL(SL,"mktime",False)(VFFSL(SL,"localtime",False)())
            write(u'''
''')
            if VFFSL(SL,"day",True) == 0: # generated from line 179, col 1
                first = VFFSL(SL,"now",True) - 3600
            else: # generated from line 181, col 1
                first = VFFSL(SL,"now",True) + (VFFSL(SL,"day",True) * 3600 * 24)
            write(u'''
''')
            s = VFFSL(SL,"strftime",False)("%S",VFFSL(SL,"localtime",False)(VFFSL(SL,"first",True)))
            m = VFFSL(SL,"strftime",False)("%M",VFFSL(SL,"localtime",False)(VFFSL(SL,"first",True)))
            offset = VFFSL(SL,"int",False)(VFFSL(SL,"m",True)) * 60
            offset = VFFSL(SL,"offset",True) + VFFSL(SL,"int",False)(VFFSL(SL,"s",True))
            write(u'''
''')
            if VFFSL(SL,"day",True) > 0: # generated from line 190, col 1
                h = VFFSL(SL,"strftime",False)("%H",VFFSL(SL,"localtime",False)(VFFSL(SL,"first",True)))
                offset = VFFSL(SL,"offset",True) + VFFSL(SL,"int",False)(VFFSL(SL,"h",True)) * 60 * 60
                offset = VFFSL(SL,"offset",True) + 3600
            write(u'''
''')
            first = VFFSL(SL,"first",True) - VFFSL(SL,"offset",True)
            write(u'''
''')
        write(u'''
''')
        if VFFSL(SL,"mode",True) == 1: # generated from line 200, col 1
            renderEventBlock = VFFSL(SL,"renderEvtBlock",False)()
            write(u'''<div id="fulltbl" class="responsive-table">
\t<table border="0" cellpadding="0" cellspacing="0" width="100%" id="tbl2">
\t\t<tbody id="tbl2body">
\t\t\t<tr style="background-color:#bababa;">
''')
            for sname, eventlist in six.iteritems(VFFSL(SL,"events",True)): # generated from line 206, col 1
                evl = VFFSL(SL,"eventlist",True)[0]
                ref = ""
                if VFFSL(SL,"evl",True): # generated from line 209, col 1
                    ev = VFFSL(SL,"evl",True)[0]
                    ref = "data-ref='" + VFFSL(SL,"ev.ref",True) + "'"
                write(u'''\t\t\t\t<td class="serviceheader">
\t\t\t\t\t<div class="service event" ''')
                _v = VFFSL(SL,"ref",True) # u'$ref' on line 214, col 33
                if _v is not None: write(_filter(_v, rawExpr=u'$ref')) # from line 214, col 33.
                write(u'''><img src="''')
                _v = VFFSL(SL,"picons",True)[VFFSL(SL,"sname",True)] # u'$(picons[$sname])' on line 214, col 48
                if _v is not None: write(_filter(_v, rawExpr=u'$(picons[$sname])')) # from line 214, col 48.
                write(u'''" loading="lazy">''')
                _v = VFFSL(SL,"sname",True) # u'$sname' on line 214, col 82
                if _v is not None: write(_filter(_v, rawExpr=u'$sname')) # from line 214, col 82.
                write(u'''</div>
\t\t\t\t</td>
''')
            write(u'''\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t\t<table border="0" cellpadding="0" cellspacing="0" width="100%" id="tbl1" class="table table-striped">
\t\t\t\t\t\t<tbody id="tbl1body">
''')
            even = 0
            for slot in list(range(0,12)): # generated from line 222, col 1
                write(u'''\t\t\t\t\t\t\t<tr>
''')
                for sname, eventlist in six.iteritems(VFFSL(SL,"events",True)): # generated from line 224, col 2
                    write(u'''\t\t\t\t\t\t\t\t<td class="border" style="white-space:normal;">
''')
                    for event in VFFSL(SL,"eventlist",True)[VFFSL(SL,"slot",True)]: # generated from line 226, col 3
                        write(u'''\t\t\t''')
                        _v = VFN(VFFSL(SL,"renderEventBlock",True),"render",False)(VFFSL(SL,"event",True)) # u'$renderEventBlock.render($event)' on line 227, col 4
                        if _v is not None: write(_filter(_v, rawExpr=u'$renderEventBlock.render($event)')) # from line 227, col 4.
                        write(u'''
''')
                    if len(VFFSL(SL,"eventlist",True)[VFFSL(SL,"slot",True)]) == 0: # generated from line 229, col 3
                        write(u'''\t\t\t\t\t\t\t\t\t<article class="epg__event event"></article>
''')
                    write(u'''\t\t\t\t\t\t\t\t</td>
''')
                write(u'''\t\t\t\t\t\t\t</tr>
''')
            write(u'''\t\t\t\t\t\t</tbody>
\t\t\t\t\t</table>
\t\t\t</tr>
\t\t</tbody>
\t<table>
</div>

''')
        else: # generated from line 243, col 1
            write(u'''<div id="fulltbl" class="responsive-table" style="overflow-y:auto;overflow-x:hidden">
\t<table>
\t\t<tbody>
\t\t\t<tr>
\t\t\t\t<td>
\t\t\t\t\t<table>
\t\t\t\t\t\t<tbody>
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t<td>
''')
            for sname, eventlist in six.iteritems(VFFSL(SL,"events",True)): # generated from line 253, col 1
                write(u'''\t\t\t\t\t\t\t\t\t<div class="row epg__row">
\t\t\t\t\t\t\t\t\t\t<div class="epg__channel pull-left">
\t\t\t\t\t\t\t\t\t\t\t<h2 class="picon"><img src="''')
                _v = VFFSL(SL,"picons",True)[VFFSL(SL,"sname",True)] # u'$(picons[$sname])' on line 256, col 40
                if _v is not None: write(_filter(_v, rawExpr=u'$(picons[$sname])')) # from line 256, col 40.
                write(u'''" title="''')
                _v = VFFSL(SL,"sname",True) # u'$sname' on line 256, col 66
                if _v is not None: write(_filter(_v, rawExpr=u'$sname')) # from line 256, col 66.
                write(u'''" loading="lazy"></h2>
\t\t\t\t\t\t\t\t\t\t\t</br><label>''')
                _v = VFFSL(SL,"sname",True) # u'$sname' on line 257, col 24
                if _v is not None: write(_filter(_v, rawExpr=u'$sname')) # from line 257, col 24.
                write(u'''</label>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t</div>
''')
            write(u'''\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t<tbody>
\t\t\t\t\t</table>
\t\t\t\t</td>
\t\t\t\t<td>
\t\t\t\t\t<table class="table-striped">
\t\t\t\t\t\t<tbody>
\t\t\t\t\t\t\t<tr style="background-color: initial;">
\t\t\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t\t\t<div style="overflow:auto" id="tblinner">
\t\t\t\t\t\t\t\t\t\t<div class="timetable">
\t\t\t\t\t\t\t\t\t\t\t<div>
\t\t\t\t\t\t\t\t\t\t\t\t<div class="timetable-now"></div>
\t\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t</div>
''')
            for sname, eventlist in six.iteritems(VFFSL(SL,"events",True)): # generated from line 277, col 1
                write(u'''\t\t\t\t\t\t\t\t\t\t<div class="row" style="width:30000px;border:solid;border-width:1px 0px 0px 0px;height:60px !important;">
\t\t\t\t\t\t\t\t\t\t\t<ol class="eventlist">
''')
                c = 0
                ref = ''
                for event in VFFSL(SL,"eventlist",True)[0]: # generated from line 282, col 2
                    pad = 0
                    if VFFSL(SL,"c",True) == 0: # generated from line 284, col 3
                        ref = quote(event['ref'], safe=' ~@#$&()*!+=:;,.?/\'')
                        pad = 58 + (VFFSL(SL,"event.begin_timestamp",True) - VFFSL(SL,"first",True)) / 6
                        write(u'''\t\t\t\t\t\t\t\t\t\t\t\t<li class="event" style="width:''')
                        _v = VFFSL(SL,"pad",True) # u'${pad}' on line 287, col 44
                        if _v is not None: write(_filter(_v, rawExpr=u'${pad}')) # from line 287, col 44.
                        write(u'''px;border:none;">
\t\t\t\t\t\t\t\t\t\t\t\t</li>
''')
                    end = VFFSL(SL,"event.begin_timestamp",True) + VFFSL(SL,"event.duration",True)
                    iscurr = ""
                    if VFFSL(SL,"event.begin_timestamp",True) < VFFSL(SL,"now",True) and VFFSL(SL,"end",True) > VFFSL(SL,"now",True): # generated from line 292, col 3
                        iscurr = " curevent"
                    write(u'''\t\t\t\t\t\t\t\t\t\t\t\t<li class="event" data-ref="''')
                    _v = VFFSL(SL,"ref",True) # u'$ref' on line 295, col 41
                    if _v is not None: write(_filter(_v, rawExpr=u'$ref')) # from line 295, col 41.
                    write(u'''" data-id="''')
                    _v = VFFSL(SL,"event.id",True) # u'${event.id}' on line 295, col 56
                    if _v is not None: write(_filter(_v, rawExpr=u'${event.id}')) # from line 295, col 56.
                    write(u'''" data-toggle="modal" data-target="#EventModal" onclick="loadeventepg(\'''')
                    _v = VFFSL(SL,"event.id",True) # u'${event.id}' on line 295, col 138
                    if _v is not None: write(_filter(_v, rawExpr=u'${event.id}')) # from line 295, col 138.
                    write(u"""', '""")
                    _v = VFFSL(SL,"ref",True) # u'$ref' on line 295, col 153
                    if _v is not None: write(_filter(_v, rawExpr=u'$ref')) # from line 295, col 153.
                    write(u'''\');return false;" style="width:''')
                    _v = VFFSL(SL,"event.duration",True)/6 # u'${event.duration/6}' on line 295, col 188
                    if _v is not None: write(_filter(_v, rawExpr=u'${event.duration/6}')) # from line 295, col 188.
                    write(u'''px;padding:10px;">
\t\t\t\t\t\t\t\t\t\t\t\t\t<a href="javascript:void(0);" class="ui-widget-content ''')
                    _v = VFFSL(SL,"iscurr",True) # u'${iscurr}' on line 296, col 69
                    if _v is not None: write(_filter(_v, rawExpr=u'${iscurr}')) # from line 296, col 69.
                    write(u'''" title="''')
                    _v = VFFSL(SL,"event",True)['title'] # u"$event['title']" on line 296, col 87
                    if _v is not None: write(_filter(_v, rawExpr=u"$event['title']")) # from line 296, col 87.
                    write(u'''">
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="ename">''')
                    _v = VFFSL(SL,"event",True)['title'] # u"$event['title']" on line 297, col 35
                    if _v is not None: write(_filter(_v, rawExpr=u"$event['title']")) # from line 297, col 35.
                    write(u'''<span class="etimesmall"> (''')
                    _v = VFFSL(SL,"strftime",False)("%d.%m", VFFSL(SL,"localtime",False)(VFFSL(SL,"event",True)['begin_timestamp'])) # u'$strftime("%d.%m", $localtime($event[\'begin_timestamp\']))' on line 297, col 77
                    if _v is not None: write(_filter(_v, rawExpr=u'$strftime("%d.%m", $localtime($event[\'begin_timestamp\']))')) # from line 297, col 77.
                    write(u''')</span></span>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="etime">''')
                    _v = VFFSL(SL,"strftime",False)("%H:%M", VFFSL(SL,"localtime",False)(VFFSL(SL,"event",True)['begin_timestamp'])) # u'$strftime("%H:%M", $localtime($event[\'begin_timestamp\']))' on line 298, col 35
                    if _v is not None: write(_filter(_v, rawExpr=u'$strftime("%H:%M", $localtime($event[\'begin_timestamp\']))')) # from line 298, col 35.
                    write(u''' - ''')
                    _v = VFFSL(SL,"strftime",False)("%H:%M", VFFSL(SL,"localtime",False)(VFFSL(SL,"event",True)['begin_timestamp'] + VFFSL(SL,"event",True)['duration'])) # u'$strftime("%H:%M", $localtime($event[\'begin_timestamp\'] + $event[\'duration\']))' on line 298, col 95
                    if _v is not None: write(_filter(_v, rawExpr=u'$strftime("%H:%M", $localtime($event[\'begin_timestamp\'] + $event[\'duration\']))')) # from line 298, col 95.
                    write(u'''</span>
''')
                    if VFFSL(SL,"event",True)['timerStatus'] != '': # generated from line 299, col 4
                        write(u'''\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="etimer ''')
                        _v = VFFSL(SL,"event",True)['timerStatus'] # u"$event['timerStatus']" on line 300, col 35
                        if _v is not None: write(_filter(_v, rawExpr=u"$event['timerStatus']")) # from line 300, col 35.
                        write(u'''">''')
                        _v = VFFSL(SL,"tstrings",True)['timer'] # u"$tstrings['timer']" on line 300, col 58
                        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['timer']")) # from line 300, col 58.
                        write(u'''</span>
''')
                    write(u'''\t\t\t\t\t\t\t\t\t\t\t\t\t</a>
\t\t\t\t\t\t\t\t\t\t\t\t</li>
''')
                    c = VFFSL(SL,"c",True) + 1
                write(u'''\t\t\t\t\t\t\t\t\t\t\t</ol>
\t\t\t\t\t\t\t\t\t\t</div>
''')
            write(u'''\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t</tbody>
\t\t\t\t\t</table>
\t\t\t\t\t
\t\t\t\t</td>
\t\t\t<tr>
\t\t</tbody>
\t<table><!-- fixing this will cause timeline to shift event title/time out of vertical alignment, just like the IE5 days! -->
</div>
</div>

</div>
''')
        write(u'''<div id="eventdescription"></div>

<script>
// $mode == ''')
        _v = VFFSL(SL,"mode",True) # u'$mode' on line 327, col 14
        if _v is not None: write(_filter(_v, rawExpr=u'$mode')) # from line 327, col 14.
        write(u'''
''')
        if '$mode' == 2: # generated from line 328, col 1
            write(u"""var multiepg_first = '""")
            _v = VFFSL(SL,"first",True) # u'$first' on line 329, col 23
            if _v is not None: write(_filter(_v, rawExpr=u'$first')) # from line 329, col 23.
            write(u"""';
var multiepg_now = '""")
            _v = VFFSL(SL,"now",True) # u'$now' on line 330, col 21
            if _v is not None: write(_filter(_v, rawExpr=u'$now')) # from line 330, col 21.
            write(u"""';
""")
        else: # generated from line 331, col 1
            write(u"""var multiepg_first = '';
var multiepg_now = '';
""")
        write(u"""
var multiepg_mode = '""")
        _v = VFFSL(SL,"mode",True) # u'$mode' on line 336, col 22
        if _v is not None: write(_filter(_v, rawExpr=u'$mode')) # from line 336, col 22.
        write(u"""';
var multiepg_day = '""")
        _v = VFFSL(SL,"day",True) # u'$day' on line 337, col 21
        if _v is not None: write(_filter(_v, rawExpr=u'$day')) # from line 337, col 21.
        write(u"""';
var multiepg_week = '""")
        _v = VFFSL(SL,"week",True) # u'$week' on line 338, col 22
        if _v is not None: write(_filter(_v, rawExpr=u'$week')) # from line 338, col 22.
        write(u"""';
var multiepg_epgmode = '""")
        _v = VFFSL(SL,"epgmode",True) # u'$epgmode' on line 339, col 25
        if _v is not None: write(_filter(_v, rawExpr=u'$epgmode')) # from line 339, col 25.
        write(u"""';
var multiepg_bref = '""")
        _v = VFFSL(SL,"quote",False)(VFFSL(SL,"bref",True)) # u'${quote($bref)}' on line 340, col 22
        if _v is not None: write(_filter(_v, rawExpr=u'${quote($bref)}')) # from line 340, col 22.
        write(u"""';
var picons = """)
        _v = VFFSL(SL,"dumps",False)(VFFSL(SL,"picons",True)) # u'$dumps($picons)' on line 341, col 14
        if _v is not None: write(_filter(_v, rawExpr=u'$dumps($picons)')) # from line 341, col 14.
        write(u''';
</script>
<script src="/modern/js/vti-responsive-multiepg.min.js"></script>
''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        
    ##################################################
    ## CHEETAH GENERATED ATTRIBUTES


    _CHEETAH__instanceInitialized = False

    _CHEETAH_version = __CHEETAH_version__

    _CHEETAH_versionTuple = __CHEETAH_versionTuple__

    _CHEETAH_genTime = __CHEETAH_genTime__

    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__

    _CHEETAH_src = __CHEETAH_src__

    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__

    _mainCheetahMethod_for_multiepg= 'respond'

## END CLASS DEFINITION

if not hasattr(multiepg, '_initCheetahAttributes'):
    templateAPIClass = getattr(multiepg, '_CHEETAH_templateClass', Template)
    templateAPIClass._addCheetahPlumbingCodeToClass(multiepg)


# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/

##################################################
## if run from command line:
if __name__ == '__main__':
    from Cheetah.TemplateCmdLineIface import CmdLineIface
    CmdLineIface(templateObj=multiepg()).run()


