superdesk/superdesk-client-core

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

Summary

Maintainability
Test Coverage
<sd-settings-view>
    <div class="sd-page__main-content" sd-dictionary-config>
        <div class="sd-page__header sd-page__header--white">
            <h2 class="sd-page__page-heading" translate>Dictionary management</h2>
        </div>
        <div class="sd-page__header">
            <sd-search-handler ng-model="query" data-debounce="200"></sd-search-handler>
    
            <span class="sd-page__element-grow"></span>
            <div class="dropdown dropdown--align-right" dropdown style="margin-right: -20px;" data-sd-tooltip="{{ :: 'Add new' | translate }}" data-flow="left">
    
                <button class="navbtn dropdown sd-create-btn" dropdown__toggle>
                    <i class="icon-plus-large"></i>
                    <span class="circle"></span>
                </button>
                <ul class="dropdown__menu">
                    <li>
                        <div class="dropdown__menu-label">Add new</div>
                    </li>
                    <li class="dropdown__menu-divider"></li>
                    <li>
                        <button id="createDictionary" ng-if="isAdmin()" ng-click="createDictionary()">
                            <i class="icon-plus-sign icon--blue"></i>{{ :: 'Dictionary' | translate }}
                        </button>
                    </li>
                    <li>
                        <button id="createPersonalDictionary" ng-click="createPersonalDictionary()">
                            <i class="icon-plus-sign icon--blue"></i>{{ :: 'Personal Dictionary' | translate }}
                        </button>
                    </li>
                    <li>
                        <button id="createAbbreviations" ng-click="createAbbreviationsDictionary()">
                            <i class="icon-plus-sign icon--blue"></i>{{ :: 'Abbreviations Dictionary' | translate }}
                        </button>
                    </li>
                </ul>
            </div>
    
        </div>
    
        <div class="sd-page__content dictionary-settings" sd-loading="loading">
            <ul class="pills-list">
                <li ng-repeat="dictionary in dictionaries | filter:searchDictionary track by dictionary._id" ng-class="{inactive: dictionary.is_active === 'false'}">
                    <div ng-if="!dictionary.user">
                        <h6>{{ dictionary.name }}</h6>&nbsp;<em><strong>({{ :: dictionary.language_id }})</strong></em>
                    </div>
                    <div ng-if="dictionary.user">
                        <h6 id="{{dictionary.language_id}}">{{ :: 'Personal' | translate }}{{ :: (isAbbreviations(dictionary) ? ' - Abbreviations' : '') | translate }}</h6>&nbsp;
                        <em>
                            <strong>({{ :: dictionary.language_id }})</strong>
                        </em>
                    </div>
                    <div class="actions">
                        <button ng-click="openDictionary(dictionary)" title="{{:: 'Edit dictionary' | translate }}"><i class="icon-pencil"></i></button>
                        <button ng-click="remove(dictionary)" title="{{:: 'Remove dictionary' | translate }}"><i class="icon-trash"></i></button>
                    </div>
                </li>
            </ul>
        </div>
        <div sd-dictionary-config-modal ng-if="dictionary"></div>
    </div>
</sd-settings-view>