superdesk/superdesk-client-core

View on GitHub
scripts/apps/dashboard/closed-desk/views/close-desk-widget.html

Summary

Maintainability
Test Coverage
<div class="close-desk-widget-content" ng-controller="RoutingWidgetController as routing">
    <div class="sd-line-input" ng-if="routing.routedFrom.length">
        <label class="sd-line-input__label" translate>Routed from</label>
        <div class="sd-list-item-group">
            <div class="sd-list-item" ng-repeat="desk in routing.routedFrom">
                <div class="sd-list-item">
                    <div class="sd-list-item__border" ng-class="{
                        'sd-list-item__border--locked': !desk.is_closed,
                        'sd-list-item__border--success': desk.is_closed,
                    }"></div>
                    <div class="sd-list-item__column sd-list-item__column--grow">
                        {{ desk.name }}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="space-eater"></div>

    <div class="sd-line-input sd-line-input--is-select">
        <label class="sd-line-input__label" translate>Route incoming content to</label>
        <select class="sd-line-input__select"
            ng-options="d._id as d.name for d in routing.desks"
            ng-model="routing.destination"
            ng-change="routing.updateDestination()"
            ng-disabled="!routing.canManage"
        ></select>
    </div>

    <button class="btn btn--large btn--success btn--expanded"
        ng-if="!routing.desk.is_closed"
        ng-disabled="!routing.destination || !routing.canManage"
        ng-click="routing.toggle()" translate>
        Start routing
    </button>
    <button class="btn btn--large btn--alert btn--expanded"
        ng-if="routing.desk.is_closed"
        ng-disabled="!routing.canManage"
        ng-click="routing.toggle()" translate>
        Stop routing
    </button>
</div>