#!/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 prewikka.templates.ClassicLayout import ClassicLayout
from prewikka.views.sensor import node_cmp
from prewikka.views.sensor import analyzer_cmp
from prewikka.views.sensor import getDominantStatus

##################################################
## 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__ = 1313541190.848393
__CHEETAH_genTimestamp__ = 'Tue Aug 16 18:33:10 2011'
__CHEETAH_src__ = 'prewikka/templates/SensorListing.tmpl'
__CHEETAH_srcLastModified__ = 'Fri Jul  3 08:59:48 2009'
__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 SensorListing(ClassicLayout):

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


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

        super(SensorListing, 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 layout_start_hook(self, **KWS):



        ## CHEETAH: generated from #def layout_start_hook at line 6, col 1.
        trans = KWS.get("trans")
        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'''<script type="text/javascript">
<!--
$(document).ready(function() {

 $(".fieldset_toggle").click(function(){
    var $d1 = $(this).parent().parent().next("div");
    var $d2 = $(this).parent().parent().next("div").next("div");

    if ( $d1.is(\':visible\') ) {
       $d1.hide(\'normal\');
       $d2.show(\'normal\');
    } else {
       $d2.hide(\'normal\');
       $d1.show(\'normal\');
    }

    return false;
  });

  $(".fieldset_toggle2").click(function(){
        $(this).prev().find(".fieldset_toggle").click();
        return false;
  });

  $("td.offline, td.online, td.missing, td.unknown").click(function(){
        var $ctype = $(this).attr(\'class\');
        var $div = $(this).parents("table").next("div");
        var $all_tr = $("table tbody tr", $div);

        $all_tr.filter(".tr_" + $ctype).show();
        $all_tr.not(".tr_" + $ctype).hide();
        $div.show(\'normal\');

        return false;
  });

  $("td.show_all").click(function(){
        var $div = $(this).parents("table").next("div");
        var $all_tr = $("table tbody tr", $div);

        if ( $div.is(\':visible\') && ! $all_tr.is(\':hidden\') ) {
                $div.hide(\'normal\');
        } else {
                $all_tr.show();
                $div.show(\'normal\');
        }

        return false;
  });
});

//--></script>

''')
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def main_content(self, **KWS):



        ## CHEETAH: generated from #block main_content at line 62, col 1.
        trans = KWS.get("trans")
        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
        
        _orig_filter_19664820 = _filter
        filterName = u'CleanOutput'
        if self._CHEETAH__filters.has_key("CleanOutput"):
            _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
        else:
            _filter = self._CHEETAH__currentFilter = \
			self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
        write(u'''
''')
        if len(VFFSL(SL,"locations",True)) > 0: # generated from line 65, col 1
            write(u''' <form action="?" method="post">
 <input type="hidden" name="view" value="sensor_messages_delete" />
''')
        write(u'''
<div id="fieldset_page">

''')
        listing = VFN(VFFSL(SL,"locations",True),"keys",False)()
        _v = VFN(VFFSL(SL,"listing",True),"sort",False)() # u'$listing.sort()' on line 73, col 1
        if _v is not None: write(_filter(_v, rawExpr=u'$listing.sort()')) # from line 73, col 1.
        write(u'''

''')
        for entry in VFFSL(SL,"listing",True): # generated from line 75, col 1
            write(u''' <fieldset class="fieldset_heading">
''')
            dominant = VFFSL(SL,"getDominantStatus",False)(VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)])
            dclass = "heartbeat_analyze_sensor_status_" + VFFSL(SL,"dominant",True)
            write(u'''
''')
            if VFFSL(SL,"dominant",True) != "online": # generated from line 80, col 3
                display = "block"
                display_tmp = "none"
            else: # generated from line 83, col 3
                display = "none"
                display_tmp = "block"
            write(u'''
  <legend>
   <b>
    <a href="#" class="fieldset_toggle"; return false;">''')
            _v = VFFSL(SL,"entry",True) # u'$entry' on line 90, col 57
            if _v is not None: write(_filter(_v, rawExpr=u'$entry')) # from line 90, col 57.
            write(u'''</a>
   </b>
  </legend>

   <div style="display: ''')
            _v = VFFSL(SL,"display_tmp",True) # u'$display_tmp' on line 94, col 25
            if _v is not None: write(_filter(_v, rawExpr=u'$display_tmp')) # from line 94, col 25.
            write(u'''" class="''')
            _v = VFFSL(SL,"dclass",True) # u'$dclass' on line 94, col 46
            if _v is not None: write(_filter(_v, rawExpr=u'$dclass')) # from line 94, col 46.
            write(u''' fieldset_toggle2">
    <table style="border: 1px solid black;">
     <tr class="nodash" style="cursor: pointer;">
      <td style="background-color: white; width:150px;">
''')
            nlen = VFFSL(SL,"len",False)(VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["nodes"])
            alen = VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["total"]
            write(u'''       ''')
            if False:
                ngettext("%d Node", "%d Nodes", VFFSL(SL,"nlen",True))
            _v = VFFSL(SL,"unicode",False)(VFFSL(SL,"ngettext",False)("%d Node", "%d Nodes", VFFSL(SL,"nlen",True)) % VFFSL(SL,"nlen",True)) # u'$unicode($ngettext("%d Node", "%d Nodes", $nlen) % $nlen)' on line 100, col 8
            if _v is not None: write(_filter(_v, rawExpr=u'$unicode($ngettext("%d Node", "%d Nodes", $nlen) % $nlen)')) # from line 100, col 8.
            write(u''', ''')
            if False:
                ngettext("%d Analyzer", "%d Analyzers", VFFSL(SL,"alen",True))
            _v = VFFSL(SL,"unicode",False)(VFFSL(SL,"ngettext",False)("%d Analyzer", "%d Analyzers", VFFSL(SL,"alen",True)) % VFFSL(SL,"alen",True)) # u'$unicode($ngettext("%d Analyzer", "%d Analyzers", $alen) % $alen)' on line 100, col 67
            if _v is not None: write(_filter(_v, rawExpr=u'$unicode($ngettext("%d Analyzer", "%d Analyzers", $alen) % $alen)')) # from line 100, col 67.
            write(u'''
      </td>
       ''')
            if False:
                ngettext("%d Online", "%d Online", VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["online"])
            if False:
                ngettext("%d Offline", "%d Offline", VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["offline"])
            if False:
                ngettext("%d Unknown", "%d Unknown", VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["unknown"])
            if False:
                ngettext("%d Missing", "%d Missing", VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["missing"])
            for i in ( ("online",  VFFSL(SL,"ngettext",False)("%d Online", "%d Online", VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["online"])),
                    ("offline", VFFSL(SL,"ngettext",False)("%d Offline", "%d Offline", VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["offline"])),
                    ("unknown", VFFSL(SL,"ngettext",False)("%d Unknown", "%d Unknown", VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["unknown"])),
                    ("missing", VFFSL(SL,"ngettext",False)("%d Missing", "%d Missing", VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["missing"]))): # generated from line 102, col 8
                if VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)][VFFSL(SL,"i",True)[0]] > 0: # generated from line 106, col 9
                    write(u'''      <td class="heartbeat_analyze_sensor_status_''')
                    _v = VFFSL(SL,"i",True)[0] # u'$i[0]' on line 107, col 50
                    if _v is not None: write(_filter(_v, rawExpr=u'$i[0]')) # from line 107, col 50.
                    write(u'''">''')
                    _v = VFFSL(SL,"unicode",False)(VFFSL(SL,"i",True)[1] % VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)][VFFSL(SL,"i",True)[0]]) # u'$unicode($i[1] % $locations[$entry][$i[0]])' on line 107, col 57
                    if _v is not None: write(_filter(_v, rawExpr=u'$unicode($i[1] % $locations[$entry][$i[0]])')) # from line 107, col 57.
                    write(u'''</td>
''')
            write(u'''     </tr>
    </table>
   </div>

   <div style="display: ''')
            _v = VFFSL(SL,"display",True) # u'$display' on line 114, col 25
            if _v is not None: write(_filter(_v, rawExpr=u'$display')) # from line 114, col 25.
            write(u'''">
''')
            nlisting = VFN(VFFSL(SL,"locations",True)[VFFSL(SL,"entry",True)]["nodes"],"values",False)()
            write(u'''   ''')
            _v = VFN(VFFSL(SL,"nlisting",True),"sort",False)(node_cmp) # u'$nlisting.sort(node_cmp)' on line 116, col 4
            if _v is not None: write(_filter(_v, rawExpr=u'$nlisting.sort(node_cmp)')) # from line 116, col 4.
            write(u'''

''')
            for node in VFFSL(SL,"nlisting",True): # generated from line 118, col 4
                cnt = 0
                row_classes = ("table_row_even", "table_row_odd")
                row_class = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2]
                dominant = VFFSL(SL,"getDominantStatus",False)(VFFSL(SL,"node",True))
                dclass = "heartbeat_analyze_sensor_status_" + dominant
                write(u'''
''')
                if VFFSL(SL,"dominant",True) != "online": # generated from line 125, col 5
                    display = "block"
                else: # generated from line 127, col 5
                    display = "none"
                write(u'''
    <table style="width:100%; border: 1px solid black;">
     <thead style="width: 100%;">
      <tr class="''')
                _v = VFFSL(SL,"dclass",True) # u'$dclass' on line 133, col 18
                if _v is not None: write(_filter(_v, rawExpr=u'$dclass')) # from line 133, col 18.
                write(u'''">
        <th>''')
                _v = VFFSL(SL,"node.node_name",True) # u'$node.node_name' on line 134, col 13
                if _v is not None: write(_filter(_v, rawExpr=u'$node.node_name')) # from line 134, col 13.
                write(u'''</th>
        <th>
''')
                for addr in VFFSL(SL,"node.node_addresses",True): # generated from line 136, col 10
                    write(u'''          <a class="popup_menu_toggle" href="#">''')
                    _v = VFFSL(SL,"addr.value",True) # u'$addr.value' on line 137, col 49
                    if _v is not None: write(_filter(_v, rawExpr=u'$addr.value')) # from line 137, col 49.
                    write(u'''</a>
          <span class="popup_menu">
           - <a href="''')
                    _v = VFFSL(SL,"addr.inline_filter",True) # u'$addr.inline_filter' on line 139, col 23
                    if _v is not None: write(_filter(_v, rawExpr=u'$addr.inline_filter')) # from line 139, col 23.
                    write(u'''">''')
                    if False:
                        _("Filter on address")
                    _v = VFFSL(SL,"_",False)("Filter on address") # u'$_("Filter on address")' on line 139, col 44
                    if _v is not None: write(_filter(_v, rawExpr=u'$_("Filter on address")')) # from line 139, col 44.
                    write(u'''</a><br />
           - <a target="''')
                    _v = VFFSL(SL,"prewikka.external_link_target",True) # u'$prewikka.external_link_target' on line 140, col 25
                    if _v is not None: write(_filter(_v, rawExpr=u'$prewikka.external_link_target')) # from line 140, col 25.
                    write(u'''" href="https://www.prelude-ids.com/host_details.php?host=''')
                    _v = VFFSL(SL,"addr.value",True) # u'$addr.value' on line 140, col 113
                    if _v is not None: write(_filter(_v, rawExpr=u'$addr.value')) # from line 140, col 113.
                    write(u'''">''')
                    if False:
                        _("Address information")
                    _v = VFFSL(SL,"_",False)("Address information") # u'$_("Address information")' on line 140, col 126
                    if _v is not None: write(_filter(_v, rawExpr=u'$_("Address information")')) # from line 140, col 126.
                    write(u'''</a><br />

''')
                    for name, link in VFFSL(SL,"addr.host_commands",True): # generated from line 142, col 12
                        write(u'''           - <a href="''')
                        _v = VFFSL(SL,"link",True) # u'$link' on line 143, col 23
                        if _v is not None: write(_filter(_v, rawExpr=u'$link')) # from line 143, col 23.
                        write(u'''">''')
                        _v = VFFSL(SL,"name",True) # u'$name' on line 143, col 30
                        if _v is not None: write(_filter(_v, rawExpr=u'$name')) # from line 143, col 30.
                        write(u'''</a><br />
''')
                    write(u'''          </span>
          <br/>
''')
                write(u'''        </th>
        <th>''')
                _v = VFFSL(SL,"node.ostype",True) # u'$node.ostype' on line 149, col 13
                if _v is not None: write(_filter(_v, rawExpr=u'$node.ostype')) # from line 149, col 13.
                write(u'''</th>
        <th>''')
                _v = VFFSL(SL,"node.osversion",True) # u'$node.osversion' on line 150, col 13
                if _v is not None: write(_filter(_v, rawExpr=u'$node.osversion')) # from line 150, col 13.
                write(u'''</th>
        <th>

         <table align="right" style="border: 1px solid black; width: 200px; text-align: center;">
          <tr class="nodash">
           <td class="show_all" style="cursor: pointer; background-color: white; width: 60px; text-align: center;">
            ''')
                if False:
                    _("Total:")
                _v = VFFSL(SL,"_",False)("Total:") # u'$_("Total:")' on line 156, col 13
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Total:")')) # from line 156, col 13.
                write(u''' <a href="#">''')
                _v = VFFSL(SL,"node",True)["total"] # u'$node["total"]' on line 156, col 38
                if _v is not None: write(_filter(_v, rawExpr=u'$node["total"]')) # from line 156, col 38.
                write(u'''</a>
           </td>
''')
                for i in ("online", "offline", "unknown", "missing"): # generated from line 158, col 12
                    if VFFSL(SL,"node",True)[VFFSL(SL,"i",True)] > 0: # generated from line 159, col 13
                        write(u'''           <td class="''')
                        _v = VFFSL(SL,"i",True) # u'$i' on line 160, col 23
                        if _v is not None: write(_filter(_v, rawExpr=u'$i')) # from line 160, col 23.
                        write(u''' heartbeat_analyze_sensor_status_''')
                        _v = VFFSL(SL,"i",True) # u'$i' on line 160, col 58
                        if _v is not None: write(_filter(_v, rawExpr=u'$i')) # from line 160, col 58.
                        write(u'''" style="cursor: pointer;">
            <a href="#">''')
                        _v = VFFSL(SL,"node",True)[VFFSL(SL,"i",True)] # u'$node[$i]' on line 161, col 25
                        if _v is not None: write(_filter(_v, rawExpr=u'$node[$i]')) # from line 161, col 25.
                        write(u'''</a>
           </td>
''')
                write(u'''          </tr>
         </table>

        </th>
      </tr>
     </thead>
    </table>

    <div style="display: ''')
                _v = VFFSL(SL,"display",True) # u'$display' on line 173, col 26
                if _v is not None: write(_filter(_v, rawExpr=u'$display')) # from line 173, col 26.
                write(u'''">
    <table style="width: 100%; border: 1px solid black;">
     <thead>
      <tr class="tr_header ''')
                _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # u'$row_classes[$cnt%2]' on line 176, col 28
                if _v is not None: write(_filter(_v, rawExpr=u'$row_classes[$cnt%2]')) # from line 176, col 28.
                write(u'''">
       <th>''')
                if False:
                    _("Delete")
                _v = VFFSL(SL,"_",False)("Delete") # u'$_("Delete")' on line 177, col 12
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Delete")')) # from line 177, col 12.
                write(u'''</th>
       <th>''')
                if False:
                    _("Name")
                _v = VFFSL(SL,"_",False)("Name") # u'$_("Name")' on line 178, col 12
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Name")')) # from line 178, col 12.
                write(u'''</th>
       <th>''')
                if False:
                    _("Model")
                _v = VFFSL(SL,"_",False)("Model") # u'$_("Model")' on line 179, col 12
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Model")')) # from line 179, col 12.
                write(u'''</th>
       <th>''')
                if False:
                    _("Version")
                _v = VFFSL(SL,"_",False)("Version") # u'$_("Version")' on line 180, col 12
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Version")')) # from line 180, col 12.
                write(u'''</th>
       <th>''')
                if False:
                    _("Class")
                _v = VFFSL(SL,"_",False)("Class") # u'$_("Class")' on line 181, col 12
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Class")')) # from line 181, col 12.
                write(u'''</th>
       <th>''')
                if False:
                    _("Last heartbeat")
                _v = VFFSL(SL,"_",False)("Last heartbeat") # u'$_("Last heartbeat")' on line 182, col 12
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Last heartbeat")')) # from line 182, col 12.
                write(u'''</th>
       <th style="text-align: center;">''')
                if False:
                    _("Status")
                _v = VFFSL(SL,"_",False)("Status") # u'$_("Status")' on line 183, col 40
                if _v is not None: write(_filter(_v, rawExpr=u'$_("Status")')) # from line 183, col 40.
                write(u'''</th>
      </tr>
     </thead>
''')
                alisting = VFFSL(SL,"node.analyzers",True)
                write(u'''     ''')
                _v = VFN(VFFSL(SL,"node.analyzers",True),"sort",False)(analyzer_cmp) # u'$node.analyzers.sort(analyzer_cmp)' on line 187, col 6
                if _v is not None: write(_filter(_v, rawExpr=u'$node.analyzers.sort(analyzer_cmp)')) # from line 187, col 6.
                write(u'''
     <tbody>
''')
                for analyzer in VFFSL(SL,"node.analyzers",True): # generated from line 189, col 6
                    cnt += 1
                    write(u'''      <tr class="tr_''')
                    _v = VFFSL(SL,"analyzer",True)['status'] # u"$analyzer['status']" on line 191, col 21
                    if _v is not None: write(_filter(_v, rawExpr=u"$analyzer['status']")) # from line 191, col 21.
                    write(u''' ''')
                    _v = VFFSL(SL,"row_classes",True)[VFFSL(SL,"cnt",True)%2] # u'$row_classes[$cnt%2]' on line 191, col 41
                    if _v is not None: write(_filter(_v, rawExpr=u'$row_classes[$cnt%2]')) # from line 191, col 41.
                    write(u'''">
       <td style="padding-top: 0px; padding-bottom: 0px;"><input class="checkbox" type="checkbox" name="analyzerid" value="''')
                    _v = VFFSL(SL,"analyzer",True)["analyzerid"] # u'$analyzer["analyzerid"]' on line 192, col 124
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer["analyzerid"]')) # from line 192, col 124.
                    write(u'''" /></td>

       <td>
        <a class="popup_menu_toggle" href="#">''')
                    _v = VFFSL(SL,"analyzer.name",True) # u'$analyzer.name' on line 195, col 47
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.name')) # from line 195, col 47.
                    write(u'''</a>
        <span class="popup_menu">
         - <a href="''')
                    _v = VFFSL(SL,"analyzer.alert_listing",True) # u'$analyzer.alert_listing' on line 197, col 21
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.alert_listing')) # from line 197, col 21.
                    write(u'''">''')
                    if False:
                        _("Alert listing")
                    _v = VFFSL(SL,"_",False)("Alert listing") # u'$_("Alert listing")' on line 197, col 46
                    if _v is not None: write(_filter(_v, rawExpr=u'$_("Alert listing")')) # from line 197, col 46.
                    write(u'''</a><br />
         - <a href="''')
                    _v = VFFSL(SL,"analyzer.heartbeat_listing",True) # u'$analyzer.heartbeat_listing' on line 198, col 21
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.heartbeat_listing')) # from line 198, col 21.
                    write(u'''">''')
                    if False:
                        _("Heartbeat listing")
                    _v = VFFSL(SL,"_",False)("Heartbeat listing") # u'$_("Heartbeat listing")' on line 198, col 50
                    if _v is not None: write(_filter(_v, rawExpr=u'$_("Heartbeat listing")')) # from line 198, col 50.
                    write(u'''</a><br />
         - <a href="''')
                    _v = VFFSL(SL,"analyzer.heartbeat_analyze",True) # u'$analyzer.heartbeat_analyze' on line 199, col 21
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.heartbeat_analyze')) # from line 199, col 21.
                    write(u'''">''')
                    if False:
                        _("Heartbeat analysis")
                    _v = VFFSL(SL,"_",False)("Heartbeat analysis") # u'$_("Heartbeat analysis")' on line 199, col 50
                    if _v is not None: write(_filter(_v, rawExpr=u'$_("Heartbeat analysis")')) # from line 199, col 50.
                    write(u'''</a><br />
        </span>
       </td>
       <td>''')
                    _v = VFFSL(SL,"analyzer",True)["model"] # u'$analyzer["model"]' on line 202, col 12
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer["model"]')) # from line 202, col 12.
                    write(u'''</td>
       <td>''')
                    _v = VFFSL(SL,"analyzer",True)["version"] # u'$analyzer["version"]' on line 203, col 12
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer["version"]')) # from line 203, col 12.
                    write(u'''</td>
       <td>''')
                    _v = VFFSL(SL,"analyzer",True)["class"] # u'$analyzer["class"]' on line 204, col 12
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer["class"]')) # from line 204, col 12.
                    write(u'''</td>
       <td>''')
                    _v = VFFSL(SL,"analyzer",True)["last_heartbeat_time"] # u'$analyzer["last_heartbeat_time"]' on line 205, col 12
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer["last_heartbeat_time"]')) # from line 205, col 12.
                    write(u'''</td>
       <td style="text-align: center;" class="heartbeat_analyze_sensor_status_''')
                    _v = VFFSL(SL,"analyzer",True)["status"] # u'$analyzer["status"]' on line 206, col 79
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer["status"]')) # from line 206, col 79.
                    write(u'''">''')
                    _v = VFFSL(SL,"analyzer",True)["status_meaning"] # u'$analyzer["status_meaning"]' on line 206, col 100
                    if _v is not None: write(_filter(_v, rawExpr=u'$analyzer["status_meaning"]')) # from line 206, col 100.
                    write(u'''</td>
      </tr>
''')
                write(u'''     </tbody>
    </table>
    </div>

    <br />
''')
            write(u'''  </div>
 </fieldset>

<br />
''')
        write(u'''
''')
        if len(VFFSL(SL,"locations",True)) > 0: # generated from line 221, col 1
            write(u'''  <div style="text-align: right; vertical-align: bottom;">
    <input class="checkbox" type="checkbox" name="alerts" /><b>''')
            if False:
                _("Alerts")
            _v = VFFSL(SL,"_",False)("Alerts") # u'$_("Alerts")' on line 223, col 64
            if _v is not None: write(_filter(_v, rawExpr=u'$_("Alerts")')) # from line 223, col 64.
            write(u'''</b>
    <input class="checkbox" type="checkbox" name="heartbeats" /><b>''')
            if False:
                _("Heartbeats")
            _v = VFFSL(SL,"_",False)("Heartbeats") # u'$_("Heartbeats")' on line 224, col 68
            if _v is not None: write(_filter(_v, rawExpr=u'$_("Heartbeats")')) # from line 224, col 68.
            write(u'''</b>
    &nbsp;<input type="submit" value="''')
            if False:
                _("Delete")
            _v = VFFSL(SL,"_",False)("Delete") # u'$_("Delete")' on line 225, col 39
            if _v is not None: write(_filter(_v, rawExpr=u'$_("Delete")')) # from line 225, col 39.
            write(u'''" />
  </div>
''')
        write(u'''
</div>
</form>

''')
        _filter = self._CHEETAH__currentFilter = _orig_filter_19664820
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def writeBody(self, **KWS):



        ## CHEETAH: main method generated for this template
        trans = KWS.get("trans")
        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'''

''')
        self.main_content(trans=trans)
        
        ########################################
        ## 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_SensorListing= 'writeBody'

## END CLASS DEFINITION

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


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


