-<div ng-if="!$ctrl.groupExists">
- <div class="alert alert-warning">
- {{:: ts('Smart group "%1" will be deleted.', {1: $ctrl.savedSearch.groups[0].title}) }}
- </div>
+<div class="alert alert-warning" ng-show="!smartGroupColumns.length">
+ {{:: ts('Unable to create smart group because this search does not include any contacts.') }}
+</div>
+
+<div class="form-inline">
+ <label for="crm-search-admin-group-title">{{ ts('Group Title:') }} <span class="crm-marker">*</span></label>
+ <input id="crm-search-admin-group-title" class="form-control" placeholder="{{:: ts('Untitled') }}" ng-model="$ctrl.savedSearch.groups[0].title" ng-disabled="!smartGroupColumns.length" ng-required="smartGroupColumns.length">
+ <label for="api-save-search-select-column">{{:: ts('Contact Column:') }}</label>
+ <input id="api-save-search-select-column" ng-model="$ctrl.savedSearch.api_params.select[0]" class="form-control huge" crm-ui-select="{data: smartGroupColumns}"/>
</div>
-<div ng-if="$ctrl.groupExists">
- <div class="alert alert-warning" ng-show="!smartGroupColumns.length">
- {{:: ts('Unable to create smart group because this search does not include any contacts.') }}
+<fieldset ng-show="smartGroupColumns.length">
+ <label>{{:: ts('Description:') }}</label>
+ <textarea class="form-control" ng-model="$ctrl.savedSearch.groups[0].description"></textarea>
+ <div class="form-inline">
+ <label>{{:: ts('Group Type:') }} </label>
+ <div class="checkbox" ng-repeat="option in groupOptions.group_type track by option.id">
+ <label>
+ <input type="checkbox" checklist-model="$ctrl.savedSearch.groups[0].group_type" checklist-value="option.id">
+ {{ option.label }}
+ </label>
+ </div>
</div>
- <input class="form-control" placeholder="{{:: ts('Group Title') }}" ng-model="$ctrl.savedSearch.groups[0].title" ng-disabled="!smartGroupColumns.length">
- <hr />
<div class="form-inline">
- <label for="api-save-search-select-column">{{:: ts('Contact Column:') }} <span class="crm-marker">*</span></label>
- <input id="api-save-search-select-column" ng-model="$ctrl.savedSearch.api_params.select[0]" class="form-control" crm-ui-select="{data: smartGroupColumns}"/>
+ <label>{{:: ts('Visibility:') }}</label>
+ <select class="form-control" ng-model="$ctrl.savedSearch.groups[0].visibility" ng-options="item.id as item.label for item in groupOptions.visibility track by item.id" crm-ui-select></select>
</div>
- <fieldset ng-show="smartGroupColumns.length">
- <label>{{:: ts('Description:') }}</label>
- <textarea class="form-control" ng-model="$ctrl.savedSearch.groups[0].description"></textarea>
- <div class="form-inline">
- <label>{{:: ts('Group Type:') }} </label>
- <div class="checkbox" ng-repeat="option in groupOptions.group_type track by option.id">
- <label>
- <input type="checkbox" checklist-model="$ctrl.savedSearch.groups[0].group_type" checklist-value="option.id">
- {{ option.label }}
- </label>
- </div>
- </div>
- <div class="form-inline">
- <label>{{:: ts('Visibility:') }}</label>
- <select class="form-control" ng-model="$ctrl.savedSearch.groups[0].visibility" ng-options="item.id as item.label for item in groupOptions.visibility track by item.id" crm-ui-select></select>
- </div>
- </fieldset>
-</div>
+</fieldset>