superdesk/superdesk-client-core

View on GitHub
scripts/apps/search/views/save-search.html

Summary

Maintainability
Test Coverage
<div class="float-search-btn" 
     ng-if="!editingSearch && sTab !== 'savedSearches' && innerTab==='parameters'"
     ng-class="{'float-search-btn--shift': searching()}">

    <button class="btn btn--primary btn--expanded search" ng-click="search()" translate>Search</button>
</div>
<div ng-if="searching() || innerTab==='parameters'">
    <div class="save-search " ng-if="searching() && !editingSearch && sTab !== 'savedSearches'">
        <a id="clear_filters" class="save-search__link" ng-click="clear()" translate>Clear filters</a>
        <button id="save_search_init" class="btn btn--primary btn--hollow" ng-click="editItem()" ng-if="!editingSearch"  translate>Save Search</button>
    </div>
    <div class="save-search" ng-if="editingSearch">
        <button class="btn btn--primary btn--expanded btn--hollow search" ng-click="search()" ng-if="innerTab==='parameters'" translate>Search</button>
        <div class="save-search__button-split">
            <button id="saveas_search_init" class="btn btn" ng-click="saveas()" translate ng-if="editingSearch">Save As</button>
            <button id="save_search_init" class="btn btn--primary" ng-click="save(edit)" ng-disabled="!isValid(edit)" ng-if="editingSearch" translate>Save Changes</button>
            <button id="save_search_init" class="btn btn--primary" ng-click="editItem()" ng-if="!editingSearch" translate>Save Changes</button>
        </div>
    </div>
</div>

<div class="save-search-panel" ng-if="edit && activateSearchPane">
    <div class="save-search-panel__title" translate>Save search</div>
    <div class="search-content">
        <form name="viewsForm">
            <div ng-include="'scripts/apps/search/views/save-search-dialog.html'"></div>
        </form>
    </div>
    <div class="pull-right">
        <button class="btn" ng-click="cancel()" translate>Cancel</button>
        <button id="search_save" class="btn btn--primary" ng-click="save(edit)" ng-disabled="!viewsForm.$valid" translate>Ok</button>
    </div>
</div>