superdesk/superdesk-client-core

View on GitHub
scripts/apps/ingest/views/dashboard/ingest-dashboard-widget.html

Summary

Maintainability
Test Coverage
<div class="header">
    <div class="title">{{item.name}}</div>
    <div class="sub-title"><span translate>Source Type:</span> <span class="text">{{item.source}}</span></div>
    <div class="sub-title"><span translate>Update Cycle:</span> <span class="text">{{item.update_schedule | scheduleFilter}}</span></div>
</div>

<div ng-show="item.show_status" class="status" ng-class="{closed: item.is_closed, opened: !item.is_closed}">
    <div ng-show="item.is_closed">
        <div><span class="uppercase" translate>Closed</span><span>by {{item.last_closed.display_name || 'System' | translate}}</span></div>
        <div class="time" ng-show="item.last_closed && item.last_closed.closed_at">
            <span translate>on</span> {{item.last_closed.closed_at | dateTimeString}}
        </div>
        <div ng-show="item.last_closed && item.last_closed.message">
            {{item.last_closed.message}}
        </div>
    </div>
    <div ng-show="!item.is_closed">
        <div><span class="uppercase" translate>Opened</span><span>by {{item.last_opened.display_name  || 'System' | translate}}</span></div>
        <div class="time" ng-show="item.last_opened && item.last_opened.opened_at">
            <span translate>since</span> {{item.last_opened.opened_at | dateTimeString | translate}}
        </div>
    </div>
</div>
<div ng-show="item.show_ingest_count" class="ingested-count">
    <div class="count">{{ingested_count}}</div>
    <div class="text">items in last 24 hours.</div>
</div>
<div ng-show="item.show_time" class="update-time">
    <div ng-show="item.show_time">
        <div class="text" translate>Last Time Updated</div>
        <div class="time">{{item.last_updated | reldate}}</div>
    </div>
    <div ng-show="item.last_item_arrived">
        <div class="text" translate>Last Item Arrived</div>
        <div class="time">{{item.last_item_arrived | reldate}}</div>
    </div>
    <div ng-show="isIdle()" class="error">
        <em translate>Channel has gone strangely quiet.</em>
    </div>
</div>
<div sd-toggle-box data-title="{{ 'Log Messages' | translate }}" ng-if="item.show_log_messages">
    <ul>
        <li ng-repeat="message in log_messages track by message._id">
            <div>{{message._created | reldate}}</div>
            <div ng-class="{true:'error'}[message.name == 'error']"><b>{{ message.user_name || 'System' }} </b><span sd-activity-message data-activity="message"></span></div>
            <div ng-if="!$last" class="divider"></div>
        </li>
    </ul>
</div>

<div class="dropdown dropdown--bigger card-list__controls" dropdown>
    <button class="dropdown__toggle" dropdown__toggle><i class="icon--white icon-dots-vertical"></i></button>
        <ul class="dropdown__menu">
            <li>
            <div class="dropdown__menu-label">
                {{ :: 'Show' | translate }}
                <button class="dropdown__menu-close"><i class="icon-close-small"></i></button>
            </div>
            </li>
            <li class="dropdown__menu-divider"></li>
            <li class="dropdown__menu-item--no-link">
                <div>
                    <span class="pull-right" sd-switch ng-model="item.show_status" ng-click="setUserPreferences()"></span>
                    <label translate>Status</label>
                </div>
            </li>
            <li class="dropdown__menu-divider"></li>
            <li class="dropdown__menu-item--no-link">
                <div>
                    <span class="pull-right" sd-switch ng-model="item.show_ingest_count" ng-click="setUserPreferences()"></span>
                    <label translate>Number of items</label>
                    <span class="dropdown__menu-info" translate>in the last 24 hours.</span>
                </div>
            </li>
            <li class="dropdown__menu-divider"></li>
            <li class="dropdown__menu-item--no-link">
                <div>
                    <span class="pull-right" sd-switch ng-model="item.show_time" ng-click="setUserPreferences()"></span>
                    <label translate>Time</label>
                    <span class="dropdown__menu-info" translate>last update and last item arrived.</span>
                </div>
            </li>
            <li class="dropdown__menu-divider"></li>
            <li class="dropdown__menu-item--no-link">
                <div>
                    <span class="pull-right" sd-switch ng-model="item.show_log_messages" ng-click="setUserPreferences()"></span>
                    <label translate>Log Messages</label>
                    <ul>
                        <li>
                            <div>
                                <label>
                                    <input type="radio" name="{{item._id}}_messages" value="all" ng-model="item.log_messages" ng-change="filterLogMessages()">
                                    <span translate>Show all messages</span>
                                </label>
                            </div>
                        </li>
                        <li>
                            <div>
                                <label>
                                    <input type="radio" name="{{item._id}}_messages" value="error" ng-model="item.log_messages" ng-change="filterLogMessages()">
                                    <span translate>Show error messages</span>
                                </label>
                            </div>
                        </li>
                    </ul>
                </div>
            </li>
            <li class="dropdown__menu-divider"></li>
            <li class="dropdown__menu-item" ng-if="showIngest"><a class="uppercase" ng-href="#/settings/ingest?_id={{item._id}}"><i class="icon-pencil"></i><span translate>Edit Ingest Source</span></a></li>
        </ul>
</div>