Commit | Line | Data |
---|---|---|
25523059 CW |
1 | <legend>{{ data.label || ts('%1 group', {1: $ctrl.conjunctions[data.op]}) }}</legend> |
2 | <div class="btn-group btn-group-xs" ng-if="data.groupParent"> | |
3 | <button class="btn btn-danger-outline" ng-click="$ctrl.removeGroup()" title="{{:: ts('Remove group') }}"> | |
4 | <i class="crm-i fa-trash" aria-hidden="true"></i> | |
5 | </button> | |
6 | </div> | |
7 | <div class="api4-clause-group-sortable" ng-model="data.clauses" ui-sortable="$ctrl.sortOptions"> | |
8 | <div class="api4-input form-inline clearfix" ng-repeat="(index, clause) in data.clauses" ng-class="{hiddenElement: index < (data.skip || 0)}"> | |
9 | <div ng-if="index >= (data.skip || 0)"> | |
10 | <div class="api4-clause-badge" title="{{:: ts('Drag to reposition') }}"> | |
11 | <span class="badge badge-info"> | |
12 | <span ng-if="index === (data.skip || 0) && !data.groupParent">{{ data.label }}</span> | |
13 | <span ng-if="index > (data.skip || 0) || data.groupParent">{{ $ctrl.conjunctions[data.op] }}</span> | |
14 | <i class="crm-i fa-arrows" aria-hidden="true"></i> | |
15 | </span> | |
16 | </div> | |
17 | <div ng-if="!$ctrl.conjunctions[clause[0]]" class="api4-input-group"> | |
18 | <input class="form-control" ng-model="clause[0]" crm-ui-select="{data: data.fields, allowClear: true, placeholder: 'Field'}" /> | |
7156e4b0 | 19 | <select class="form-control api4-operator" ng-model="clause[1]" ng-options="o.key as o.value for o in $ctrl.operators" ></select> |
25523059 CW |
20 | <input class="form-control" ng-model="clause[2]" crm-search-value="{field: clause[0], op: clause[1], format: data.format}" /> |
21 | </div> | |
22 | <fieldset class="clearfix" ng-if="$ctrl.conjunctions[clause[0]]" crm-search-clause="{format: data.format, clauses: clause[1], op: clause[0], fields: data.fields, groupParent: data.clauses, groupIndex: index}"> | |
23 | </fieldset> | |
24 | </div> | |
25 | </div> | |
26 | </div> | |
27 | <div class="api4-input form-inline"> | |
28 | <div class="api4-clause-badge"> | |
29 | <div class="btn-group btn-group-xs" title="{{ data.groupParent ? ts('Add a subgroup of clauses') : ts('Add a group of clauses') }}"> | |
30 | <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
31 | {{ $ctrl.conjunctions[data.op] }} <span class="caret"></span> | |
32 | </button> | |
33 | <ul class="dropdown-menu api4-add-where-group-menu"> | |
34 | <li ng-repeat="(con, label) in $ctrl.conjunctions" ng-show="data.op !== con"> | |
35 | <a href ng-click="$ctrl.addGroup(con)">{{ label }}</a> | |
36 | </li> | |
37 | </ul> | |
38 | </div> | |
39 | </div> | |
40 | <input class="form-control" ng-model="$ctrl.newClause" ng-change="$ctrl.addClause()" crm-ui-select="{data: data.fields, placeholder: ts('Select field')}" /> | |
41 | </div> |