<div class="row" ng-if="showStatusLine()">
    <div class="col-md-12">
        <div class="dashboard-status-line">
            <div class="dashboard-status-line-item">
                <div class="dashboard-status-line-item-name"
                     ng-class="isMainPowerConnected() ? 'state-success' : 'state-danger'"
                     translate translate-context="(источник питания)"
                >
                    Питание
                </div>
                <div class="dashboard-status-line-item-state"
                     ng-switch="isMainPowerConnected()">
                    <span ng-switch-when="true" translate translate-context="(источник питания)">подключено</span>
                    <span ng-switch-when="false" translate translate-context="(источник питания)">отключено</span>
                </div>
            </div>
            <div class="dashboard-status-line-item">
                <div class="dashboard-status-line-item-name"
                     ng-class="{
                     'state-danger': getReservePowerState() === 'disconnected',
                     'state-warning': getReservePowerState() === 'connected-discharged',
                     'state-success': getReservePowerState() === 'connected' || getReservePowerState() === 'connected-charged'
                     }"
                     translate translate-context="(аккумуляторная батарея)">
                    АКБ
                </div>
                <div class="dashboard-status-line-item-state"
                     ng-switch="getReservePowerState()">
                    <span ng-switch-when="disconnected"
                          translate translate-context="(аккумуляторная батарея)">
                        отключена
                    </span>
                    <span ng-switch-when="connected"
                          translate translate-context="(аккумуляторная батарея)">
                        подключена
                    </span>
                    <span ng-switch-when="connected-charged"
                          translate translate-context="(аккумуляторная батарея)">
                        подключена и заряжена
                    </span>
                    <span ng-switch-when="connected-discharged"
                          translate translate-context="(аккумуляторная батарея)">
                        подключена и разряжена
                    </span>
                </div>
            </div>
            <div class="dashboard-status-line-item" ng-if="hasTamper">
                <div class="dashboard-status-line-item-name"
                     ng-class="{
                     'state-danger': getTamperState() === 'OPEN',
                     'state-success': getTamperState() === 'CLOSED',
                     'state-unknown': getTamperState() === 'UNKNOWN'
                     }"
                     translate>
                    Тампер
                </div>
                <div class="dashboard-status-line-item-state"
                     ng-switch="getTamperState()">
                    <span ng-switch-when="OPEN" translate translate-context="(состояние тампера)">открыт</span>
                    <span ng-switch-when="CLOSED" translate translate-context="(состояние тампера)">закрыт</span>
                    <span ng-switch-when="UNKNOWN" translate translate-context="(состояние тампера)">неизвестно</span>
                </div>
            </div>
        </div>
    </div>
</div>

<ul class="nav nav-tabs" ng-init="currentTab=initTab()">
    <li ng-show="showWired()" ng-class="{active: currentTab =='wired'}">
        <a href ng-click="currentTab='wired'" ng-switch="getWiredTabName()">
            <span ng-switch-when="zones" translate>Зоны</span>
            <span ng-switch-when="default" translate>Шлейфы</span>
        </a>
    </li>

    <li ng-show="showRielta()" ng-class="{active: currentTab =='rielta'}">
        <a href ng-click="currentTab='rielta'" translate>Беспроводные устройства</a></li>

    <li ng-show="showCwl()" ng-class="{active: currentTab =='cwl'}">
        <a href ng-click="currentTab='cwl'" translate>Беспроводные устройства</a></li>

    <!-- Адресная система доступна только на русском языке -->
    <li ng-show="showRieltaWiredSystem()"
        ng-class="{active: currentTab =='rielta_wired_system'}">
        <a href ng-click="currentTab='rielta_wired_system'">Адресные устройства</a>
    </li>

    <li ng-show="showChannels()" ng-class="{active: currentTab =='channels'}">
        <a href ng-click="currentTab='channels'" translate>Каналы связи</a></li>
</ul>
<ng-switch on="currentTab">
    <div ng-show="showRielta()" ng-switch-when="rielta">
        <ng-include src="'augeas/templates/dashboard/rielta_zones.html'"></ng-include>
    </div>

    <div ng-show="showCwl()" ng-switch-when="cwl">
        <ng-include src="'augeas/templates/dashboard/cwl_zones.html'"></ng-include>
    </div>

    <div ng-show="showWired()" ng-switch-when="wired">
        <ng-include src="'augeas/templates/dashboard/wired_zones.html'"></ng-include>
    </div>

    <div ng-if="showChannels()" ng-switch-when="channels">
        <ng-include src="'augeas/templates/dashboard/channels.html'"></ng-include>
    </div>

    <div ng-if="showRieltaWiredSystem()" ng-switch-when="rielta_wired_system">
        <ng-include src="'augeas/templates/dashboard/rielta_wired_system_zones.html'"></ng-include>
    </div>
</ng-switch>

<div class="well" ng-if="!(showRielta() || showCwl() || showWired() || showChannels() || showRieltaWiredSystem())">
    <p ng-show="hasRielta" translate>
        Нет ни одного включённого шлейфа или беспроводного устройства.
    </p>
    <p ng-show="!hasRielta" translate>
        Нет ни одного включённого шлейфа.
    </p>
    <p ng-show="!showChannels()" translate>
        Отсутствует информация о каналах связи.
    </p>
    <!-- Адресная система доступна только на русском языке -->
    <div ng-if="hasRieltaWired">
        <p ng-show="!showRieltaWiredSystem()">
            Отсутствует информация об адресных устройствах.
        </p>
    </div>
</div>
