#!/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
from Plugins.Extensions.OpenWebif.controllers.i18n import tstrings

##################################################
## 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__ = 1644596122.010939
__CHEETAH_genTimestamp__ = 'Fri Feb 11 16:15:22 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/edittimer.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 edittimer(Template):

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


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

        super(edittimer, 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'''
''')
        dayNamesShort = [VFFSL(SL,"tstrings",True)['mo'], VFFSL(SL,"tstrings",True)['tu'], VFFSL(SL,"tstrings",True)['we'], VFFSL(SL,"tstrings",True)['th'], VFFSL(SL,"tstrings",True)['fr'], VFFSL(SL,"tstrings",True)['sa'], VFFSL(SL,"tstrings",True)['su']]
        write(u'''
<form>
<div class="form-group">
\t<div class="row clearfix">
\t\t<div class="col-sm-6">
\t\t\t<input type="checkbox" name="enabled" id="enabled" value="1">
\t\t\t<label for="enabled">''')
        _v = VFFSL(SL,"tstrings",True)['enabled'] # u"$tstrings['enabled']" on line 10, col 25
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['enabled']")) # from line 10, col 25.
        write(u'''</label>
\t\t</div>
\t</div>
\t<div class="row clearfix">
\t\t<div class="col-sm-6">
\t\t\t<input type="checkbox" name="justplay" id="justplay" value="0">
\t\t\t<label for="justplay">''')
        _v = VFFSL(SL,"tstrings",True)['just_play'] # u"$tstrings['just_play']" on line 16, col 26
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['just_play']")) # from line 16, col 26.
        write(u'''</label>
\t\t</div>
\t\t<div class="col-sm-6">
\t\t\t<input type="checkbox" name="always_zap" id="always_zap" value="0">
\t\t\t<label for="always_zap">''')
        _v = VFFSL(SL,"tstrings",True)['zap_record'] # u"$tstrings['zap_record']" on line 20, col 28
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['zap_record']")) # from line 20, col 28.
        write(u'''</label>
\t\t</div>
''')
        if VFFSL(SL,"pipzap",True): # generated from line 22, col 3
            write(u'''\t\t<div class="col-sm-6">
\t\t\t<input type="checkbox" name="pipzap" id="pipzap" value="0">
\t\t\t<label for="pipzap">''')
            _v = VFFSL(SL,"tstrings",True)['pipifposible'] # u"$tstrings['pipifposible']" on line 25, col 24
            if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['pipifposible']")) # from line 25, col 24.
            write(u'''</label>
\t\t</div>
''')
        else: # generated from line 27, col 3
            write(u'''\t\t<input type="checkbox" name="pipzap" id="pipzap" value="0" style="display:none">
''')
        write(u'''\t</div>
''')
        if VFFSL(SL,"autoadjust",True): # generated from line 31, col 2
            write(u'''\t<div class="row clearfix">
\t\t<div class="col-sm-6">
\t\t\t<input type="checkbox" name="autoadjust" id="autoadjust" value="1">
\t\t\t<label for="autoadjust">''')
            _v = VFFSL(SL,"tstrings",True)['autoadjust'] # u"$tstrings['autoadjust']" on line 35, col 28
            if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['autoadjust']")) # from line 35, col 28.
            write(u'''</label>
\t\t</div>
\t\t<div class="col-sm-6">
\t\t\t<input type="checkbox" name="allow_duplicate" id="allow_duplicate" value="1">
\t\t\t<label for="allow_duplicate">''')
            _v = VFFSL(SL,"tstrings",True)['allow_duplicate'] # u"$tstrings['allow_duplicate']" on line 39, col 33
            if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['allow_duplicate']")) # from line 39, col 33.
            write(u''':</label>
\t\t</div>
\t</div>
''')
        else: # generated from line 42, col 2
            write(u'''\t<input type="checkbox" name="autoadjust" id="autoadjust" value="0" style="display:none">
\t<input type="checkbox" name="allow_duplicate" id="allow_duplicate" value="0" style="display:none">
''')
        write(u'''\t<div class="row clearfix">
\t\t<div class="col-sm-3">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['name'] # u"$tstrings['name']" on line 48, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['name']")) # from line 48, col 11.
        write(u''':</label>
\t\t</div>
\t\t<div class="col-sm-9">
\t\t\t<div class="form-line">
\t\t\t\t<input type="text" name="timername" id="timername" class="form-control" placeholder="''')
        _v = VFFSL(SL,"tstrings",True)['name'] # u"$tstrings['name']" on line 52, col 90
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['name']")) # from line 52, col 90.
        write(u'''">
\t\t\t</div>
\t\t</div>
\t</div>
\t<div class="row clearfix">
\t\t<div class="col-sm-3">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['description'] # u"$tstrings['description']" on line 58, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['description']")) # from line 58, col 11.
        write(u''':</label>
\t\t</div>
\t\t<div class="col-sm-9">
\t\t\t<div class="form-line">
\t\t\t\t<textarea rows="1" class="form-control no-resize auto-growth" name="description" id="description" placeholder="''')
        _v = VFFSL(SL,"tstrings",True)['description'] # u"$tstrings['description']" on line 62, col 116
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['description']")) # from line 62, col 116.
        write(u'''" />
\t\t\t</div>
\t\t</div>
\t</div>
\t<div class="row clearfix"><p>&nbsp;</p></div>
\t<div class="row clearfix">
\t\t<div class="col-sm-3">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['channel'] # u"$tstrings['channel']" on line 69, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['channel']")) # from line 69, col 11.
        write(u''':</label>
\t\t</div>
\t\t<!-- div class="col-sm-3">
\t\t\t<input type="checkbox" name="group1[]" id="cbradio">
\t\t\t<label for="cbradio">(''')
        _v = VFFSL(SL,"tstrings",True)['radio'] # u"$tstrings['radio']" on line 73, col 26
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['radio']")) # from line 73, col 26.
        write(u''')</label>
\t\t</div -->
\t\t<div class="col-sm-9">
\t\t\t<select class="form-control show-tick no-default-select" id="bouquet_select" name="bouquet_select">
\t\t\t\t<option value="0">''')
        _v = VFFSL(SL,"tstrings",True)['nothing'] # u"$tstrings['nothing']" on line 77, col 23
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['nothing']")) # from line 77, col 23.
        write(u'''</option>
\t\t\t</select>
\t\t</div>
\t</div>
\t<div class="row clearfix"><p>&nbsp;</p></div>
\t<div class="row clearfix">
\t\t<div class="col-sm-6">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['start'] # u"$tstrings['start']" on line 84, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['start']")) # from line 84, col 11.
        write(u''':</label><!-- TODO: i10n -->
\t\t\t<input type="text" name="timerbegin" id="timerbegin" class="form-control" placeholder="Please select a date...">
\t\t</div>
\t\t<div class="col-sm-6">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['end'] # u"$tstrings['end']" on line 88, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['end']")) # from line 88, col 11.
        write(u''':</label><!-- TODO: i10n -->
\t\t\t<input type="text" name="timerend" id="timerend" class="form-control" placeholder="Please select a date...">
\t\t</div>
\t</div>
\t<div class="row clearfix">
\t\t<div class="col-sm-12">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['repeated'] # u"$tstrings['repeated']" on line 94, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['repeated']")) # from line 94, col 11.
        write(u''':</label>
\t\t</div>
\t</div>
\t<div class="row clearfix">
\t\t<div class="col-sm-12" style="display: flex; justify-content: space-around;">
''')
        i = 0
        for day in VFFSL(SL,"dayNamesShort",True): # generated from line 100, col 3
            value = 2 ** VFFSL(SL,"i",True)
            write(u'''\t\t\t<span>
\t\t\t\t<input type="checkbox" name="repeated" value="''')
            _v = VFFSL(SL,"value",True) # u'$value' on line 103, col 51
            if _v is not None: write(_filter(_v, rawExpr=u'$value')) # from line 103, col 51.
            write(u'''" id="day''')
            _v = VFFSL(SL,"i",True) # u'$i' on line 103, col 66
            if _v is not None: write(_filter(_v, rawExpr=u'$i')) # from line 103, col 66.
            write(u'''">
\t\t\t\t<label for="day''')
            _v = VFFSL(SL,"i",True) # u'$i' on line 104, col 20
            if _v is not None: write(_filter(_v, rawExpr=u'$i')) # from line 104, col 20.
            write(u'''">''')
            _v = VFFSL(SL,"day",True) # u'$day' on line 104, col 24
            if _v is not None: write(_filter(_v, rawExpr=u'$day')) # from line 104, col 24.
            write(u'''</label>
\t\t\t</span>
''')
            i = VFFSL(SL,"i",True)+1
        write(u'''\t\t</div>
\t</div>
\t<div class="row clearfix">
\t\t<div class="col-sm-3">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['location'] # u"$tstrings['location']" on line 112, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['location']")) # from line 112, col 11.
        write(u''':</label>
\t\t</div>
\t\t<div class="col-sm-9">
\t\t\t<select class="form-control show-tick" id="dirname" name="dirname" >
\t\t\t\t<option value="None">''')
        _v = VFFSL(SL,"tstrings",True)['default'] # u"$tstrings['default']" on line 116, col 26
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['default']")) # from line 116, col 26.
        write(u'''</option>
\t\t\t</select>
\t\t</div>
\t</div>
\t<div class="row clearfix">
\t\t<div class="col-sm-9 m-t-5 m-b-5 pull-right">
\t\t\t<p>* Add a new location in the <strong>Bookmarks</strong> section of <a href="/#settings" target="settings">Settings</a></p><!-- TODO: i10n -->
\t\t</div>
\t</div>
\t<div class="row clearfix">
\t\t<div class="col-sm-3">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['after_event'] # u"$tstrings['after_event']" on line 127, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['after_event']")) # from line 127, col 11.
        write(u''':</label>
\t\t</div>
\t\t<div class="col-sm-9">
\t\t\t<div class="form-group">
\t\t\t<select class="form-control show-tick" id="afterevent" name="afterevent">
\t\t\t<option value="0">''')
        _v = VFFSL(SL,"tstrings",True)['nothing'] # u"$tstrings['nothing']" on line 132, col 22
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['nothing']")) # from line 132, col 22.
        write(u'''</option>
\t\t\t<option value="1">''')
        _v = VFFSL(SL,"tstrings",True)['standby'] # u"$tstrings['standby']" on line 133, col 22
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['standby']")) # from line 133, col 22.
        write(u'''</option>
\t\t\t<option value="2">''')
        _v = VFFSL(SL,"tstrings",True)['shutdown'] # u"$tstrings['shutdown']" on line 134, col 22
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['shutdown']")) # from line 134, col 22.
        write(u'''</option>
\t\t\t<option value="3" selected="">''')
        _v = VFFSL(SL,"tstrings",True)['auto'] # u"$tstrings['auto']" on line 135, col 34
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['auto']")) # from line 135, col 34.
        write(u'''</option>
\t\t\t</select>
\t\t\t</div>
\t\t</div>
\t</div>

\t<span id="has_vpsplugin1">
\t\t<div class="row clearfix">
\t\t\t<div class="col-sm-6">
\t\t\t\t<input type="checkbox" name="vpsplugin_enabled" id="vpsplugin_enabled" value="0">
\t\t\t\t<label for="vpsplugin_enabled">''')
        _v = VFFSL(SL,"tstrings",True)['vps'] # u"$tstrings['vps']" on line 145, col 36
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['vps']")) # from line 145, col 36.
        write(u''':</label>
\t\t\t</div>
\t\t\t<span id="has_vpsplugin2">
\t\t\t\t<div class="col-sm-6">
\t\t\t\t\t<input type="checkbox" name="vpsplugin_safemode" id="vpsplugin_safemode" value="0">
\t\t\t\t\t<label for="vpsplugin_safemode">''')
        _v = VFFSL(SL,"tstrings",True)['safe_mode'] # u"$tstrings['safe_mode']" on line 150, col 38
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['safe_mode']")) # from line 150, col 38.
        write(u''':</label>
\t\t\t\t</div>
\t\t\t</span>
\t\t</div
\t</span>

\t<div class="row clearfix">
\t\t<div class="col-sm-3">
\t\t\t<label>''')
        _v = VFFSL(SL,"tstrings",True)['tags'] # u"$tstrings['tags']" on line 158, col 11
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['tags']")) # from line 158, col 11.
        write(u''':</label>
\t\t</div>
\t\t<div class="col-sm-9">
\t\t\t<span id="tagsnew" style="margin:5px"></span>
\t\t</div>
\t</div>
</div>
</form>

<script>
\tinitTimerEditBegin();

\tjQuery(\'.cbtvr\').click(function() {
\t\tjQuery(\'input[name="\' + this.name + \'"]\').not(this).prop(\'checked\', false);
\t\tinitTimerBQ(jQuery(\'#cbradio\').is(\':checked\'));
\t});

\tjQuery(\'#vpsplugin_enabled\').click(function() {
\t\tcheckVPS();
\t});

\tjQuery(\'#always_zap\').click(function() {
\t\tjQuery(\'#justplay\').prop("disabled", jQuery(\'#always_zap\').is(\':checked\'));
\t});

\tjQuery(\'#timerend\').datetimepicker({
\t\tformat: "dd.mm.yy hh:ii",
\t\tautoclose: true,
\t\ttodayHighlight: true,
\t\ttodayBtn: \'linked\',
\t\tminuteStep: 2,
\t\tlanguage: \'de\',
\t});


\tjQuery(function() {
\t\tautosize(jQuery(\'textarea.auto-growth\'));
\t\tjQuery("#bouquet_select").chosen({disable_search_threshold: 10,no_results_text: "Oops, nothing found!",width: "100%"});

\t\tjQuery(".chosen-container .chosen-drop").addClass(\'ui-widget-content\');
\t\tif (theme == \'eggplant\' || theme == \'vader\') {
\t\t\tjQuery(".chosen-container .chosen-drop").css(\'background-image\',\'none\');
\t\t}
\t});

\tjQuery(\'#editTimerForm\').dialog({
\t\tautoOpen: false,
\t\tmodal: true,
\t\tclose: function() {
\t\t\treturn;
\t\t}
\t});

\tcheckVPS();

\tjQuery.AdminBSB.input.activate();
\tjQuery.AdminBSB.select.activate();
</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_edittimer= 'respond'

## END CLASS DEFINITION

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


# 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=edittimer()).run()


