f55fc71a8f56a04103757748d26249ea5bb0487d
[civicrm-core.git] / ext / afform / admin / ang / afGuiEditor / afGuiEntity.html
1 <div class="af-gui-columns crm-flex-box" ng-if="!$ctrl.entity.loading">
2 <fieldset class="af-gui-entity-values">
3 <legend>{{:: ts('Values:') }}</legend>
4 <div class="form-inline" ng-if="getMeta().fields[fieldName]" ng-repeat="(fieldName, value) in $ctrl.entity.data">
5 <label>{{ getMeta().fields[fieldName].label }}:</label><br />
6 <input class="form-control" af-gui-field-value="getField($ctrl.entity.type, fieldName)" ng-model="$ctrl.entity.data[fieldName]" />
7 <a href ng-click="removeValue($ctrl.entity, fieldName)">
8 <i class="crm-i fa-times"></i>
9 </a>
10 </div>
11 <hr />
12 <div class="form-inline">
13 <input class="form-control" ng-model="controls.addValue" crm-ui-select="{data: valuesFields}" placeholder="Add value" />
14 </div>
15 </fieldset>
16
17 <fieldset class="af-gui-entity-palette">
18 <legend class="form-inline">
19 {{:: ts('Add:') }}
20 <input ng-model="controls.fieldSearch" class="form-control" type="search" placeholder="&#xf002" title="{{:: ts('Search fields') }}" />
21 </legend>
22 <div class="af-gui-entity-palette-select-list">
23 <div ng-if="blockList.length">
24 <label>{{:: ts('Blocks') }}</label>
25 <div ui-sortable="{update: buildPaletteLists, items: '&gt; div:not(.disabled)', connectWith: '[data-entity=' + $ctrl.entity.name + '] &gt; [ui-sortable]', placeholder: 'af-gui-dropzone'}" ui-sortable-update="$ctrl.editor.onDrop" ng-model="blockList">
26 <div ng-repeat="block in blockList" ng-class="{disabled: blockInUse(block)}">
27 {{ blockTitles[$index] }}
28 </div>
29 </div>
30 </div>
31 <div ng-if="elementList.length">
32 <label>{{:: ts('Elements') }}</label>
33 <div ui-sortable="{update: buildPaletteLists, items: '&gt; div:not(.disabled)', connectWith: '[ui-sortable]', placeholder: 'af-gui-dropzone'}" ui-sortable-update="$ctrl.editor.onDrop" ng-model="elementList">
34 <div ng-repeat="element in elementList" >
35 {{ elementTitles[$index] }}
36 </div>
37 </div>
38 </div>
39 <div ng-repeat="fieldGroup in fieldList">
40 <div ng-if="fieldGroup.fields.length">
41 <label>{{ fieldGroup.label }}</label>
42 <div ui-sortable="{update: buildPaletteLists, items: '&gt; div:not(.disabled)', connectWith: '[data-entity=' + fieldGroup.entityName + '] &gt; [ui-sortable]', placeholder: 'af-gui-dropzone'}" ui-sortable-update="$ctrl.editor.onDrop" ng-model="fieldGroup.fields">
43 <div ng-repeat="field in fieldGroup.fields" ng-class="{disabled: fieldInUse(field.name)}">
44 {{ getField(fieldGroup.entityType, field.name).label }}
45 </div>
46 </div>
47 </div>
48 </div>
49 </div>
50 </fieldset>
51 </div>
52
53 <a href ng-click="$ctrl.editor.removeEntity($ctrl.entity.name)" class="btn btn-sm btn-danger-outline af-gui-remove-entity" title="{{ ts('Remove %1', {1: getMeta().label}) }}">
54 <i class="crm-i fa-trash"></i>
55 </a>
56
57 <fieldset ng-if="!$ctrl.entity.loading">
58 <legend>{{:: ts('Options') }}</legend>
59 <div ng-include="'~/afGuiEditor/entityConfig/' + $ctrl.entity.type + '.html'"></div>
60 </fieldset>