extends layout
block head
    link(href="css/timers.css", rel="stylesheet")
    script(src="/socket.io/socket.io.js")
    script(src="/js/ui.js")
    script(src="/js/util.js")
    script(src="js/timers.js")
    script(src="js/groups.js")
    
block content
    include includes/headline
    .container#flashcontainer
        include includes/flash
    .wrapper
        .row(id='groupwrapper')
            if (typeof groups !== 'undefined')
                each group in groups
                    include includes/group
        .row
            a.btn.btn-success(onClick="newGroup(this)")
                i.fa.fa-folder-o.fa-lg
                |&nbsp;Add Group

        a(id="statusSpinner")
            i.fa.fa-refresh.fa-xs
        
        if (typeof timers !== 'undefined')
          each timer in timers
              if(timer.active)
                  script. toggleSwitch('#{timer._id}');

        script. updateNeeded()