superdesk/superdesk-client-core

View on GitHub
scripts/apps/desks/views/settings.html

Summary

Maintainability
Test Coverage
<sd-settings-view>
    <div class="sd-page__main-content" sd-desk-config>
        <div class="sd-page__header sd-page__header--white">
            <h2 class="sd-page__page-heading" translate>Desk management</h2>
        </div>
        <div class="sd-page__header">
            <sd-search-handler ng-model="query.name" data-debounce="200"></sd-search-handler>

            <span class="sd-page__element-grow"></span>
            <button
                class="btn btn--primary"
                ng-click="openDesk('general')"
                data-test-id="add-new-desk"
            >
                <i class="icon-plus-sign icon--white"></i> {{ :: 'Add New' | translate }}
            </button>
        </div>

        <div class="sd-page__content desk-settings">
            <div class="flex-grid box wrap-items small-1 medium-3 large-4 xlarge-6">

                <div class="flex-item card-box" ng-repeat="desk in desks._items | filter:query track by desk._id" data-test-id="desk--{{desk.name}}">
                    <div class="card-box__header">
                        <div class="dropdown" dropdown>
                            <button class="dropdown__toggle" dropdown__toggle data-test-id="desk-actions">
                                <i class="icon-dots-vertical"></i>
                            </button>
                            <ul class="dropdown__menu more-activity-menu pull-right">
                                <li><div class="dropdown__menu-label" translate>Actions</div></li>
                                <li class="dropdown__menu-divider"></li>
                                <li>
                                    <button
                                        ng-click="openDesk('general', desk)"
                                        title="{{:: 'Edit desk'| translate }}"
                                        data-test-id="desk-actions--edit"
                                    >
                                        <i class="icon-pencil"></i>
                                        {{:: 'Edit'| translate}}
                                    </button>
                                </li>
                                <li>
                                    <button
                                        ng-click="openMonitoringSettings(desk)"
                                        title="{{:: 'Monitoring settings'| translate }}"
                                        data-test-id="desk-actions--monitoring-settings"
                                    >
                                        <i class="icon-settings"></i>
                                        {{:: 'Monitoring settings'| translate}}
                                    </button>
                                </li>
                                <li>
                                    <button
                                        ng-click="remove(desk)"
                                        title="{{:: 'Remove desk'| translate }}"
                                        data-test-id="desk-actions--remove"
                                    >
                                        <i class="icon-trash"></i>
                                        {{:: 'Remove'| translate}}
                                    </button>
                                </li>
                            </ul>
                        </div>
                        <div class="card-box__heading">{{ desk.name }}</div>
                    </div>
                    <div class="card-box__content">
                        <ul class="card-box__content-list">
                            <li>
                                <h4>{{ :: 'Stages' | translate }}<span class="label">{{getDeskStages(desk).length}}</span></h4>
                                <span ng-repeat="stage in getDeskStages(desk) track by stage._id" class="card-box__content-list-inline-span">{{labelForStage(stage)}}<span ng-if="$index < getDeskStages(desk).length-1">,&nbsp;</span></span>
                            </li>
                            <li>
                                <h4>{{ :: 'People' | translate }}<span class="label">{{getDeskUsers(desk).length}}</span></h4>
                                <span ng-repeat="user in getDeskUsers(desk) track by user._id" ng-if="$index < numberOfUsers" class="card-box__content-list-inline-span">
                                    {{user.display_name}}<span ng-if="$index < getDeskUsers(desk).length-1">,&nbsp;</span>
                                    <span ng-if="getDeskUsers(desk).length > numberOfUsers && $index === numberOfUsers-1"
                                            ng-click="openDesk('people', desk)"
                                            class="button__view-all">
                                        ... {{ :: 'view all' | translate }}
                                    </span>
                                </span>
                            </li>
                            <li class="card-box__content-list-item--inline">
                                <h4>{{ :: 'Desk Type' | translate }}</h4>
                                <span>{{ desk.desk_type | translate }}</span>
                            </li>
                            <li ng-if="desk.preserve_published_content">
                                <h4>{{ :: 'Published Content' | translate }}</h4>
                                <span>{{ :: 'Not Expired' | translate }}</span>
                            </li>
                            <li class="card-box__content-list-item--inline" ng-if="desk.desk_language">
                                <h4>{{ :: 'Language' | translate }}</h4>
                                <span>{{ desk.desk_language | translate }}</span>
                            </li>
                        </ul>
                    </div>
                </div>

            </div>
        </div>

        <div sd-aggregate-settings
            data-modal-active="agg.modalActive"
            data-desks="agg.desks"
            data-desk-stages="agg.deskStages"
            data-searches="agg.searches"
            data-desk-lookup="agg.deskLookup"
            data-stage-lookup="agg.stageLookup"
            data-search-lookup="agg.searchLookup"
            data-groups="agg.groups"
            data-edit-groups="agg.editGroups"
            data-settings="agg.settings">
        </div>

        <div sd-desk-config-modal
                data-active="modalActive"
                data-desk="desk"
                data-desks="desks"
                data-step="step"
                data-cancel="cancel()"
                data-can-tab-change="canTabChange()">
        </div>


    </div>
</sd-settings-view>