extends ../../layouts/main
block content

  -
    var onlineChannels = channels.filter((channel) => channel.lastUpdate && (channel.lastUpdate.status === 'live'))
    var offlineChannels = channels.filter((channel) => !channel.lastUpdate || (channel.lastUpdate.status !== 'live'))

  .uk-margin
    h1 Manage Your Venue Channels
    a(href="/admin/venue/channel/create").uk-button.dtp-button-primary.uk-border-rounded Add Channel

  .uk-margin
    if Array.isArray(offlineChannels) && (channels.length > 0)
      uk.uk-list.uk-list-divider
        each channel of offlineChannels
          li
            +renderVenueChannelListItem(channel, { baseUrl: '/admin/venue/channel' })
    else
      div There are no channels integrated with #{site.name}.