SearchKit - Expose default display to the UI
[civicrm-core.git] / ext / search_kit / ang / crmSearchAdmin / searchListing / afforms.html
CommitLineData
5c952e51 1<div class="btn-group">
d102f836
CW
2 <button type="button" ng-click="$ctrl.loadAfforms(); row.openAfformMenu = true;" class="btn btn-xs dropdown-toggle btn-primary-outline" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
3 {{ $ctrl.afforms ? (row.afform_count === 1 ? ts('1 Form') : ts('%1 Forms', {1: row.afform_count})) : ts('Forms...') }}
4 <span class="caret"></span>
5 </button>
6 <ul class="dropdown-menu" ng-if=":: row.openAfformMenu">
5c952e51
CW
7 <li ng-if="::$ctrl.afformAdminEnabled">
8 <a target="_blank" href="{{:: $ctrl.afformPath + '#/create/search/' + row.data.name }}">
9 <i class="fa fa-plus"></i> {{:: ts('Create form for search results table') }}
10 </a>
11 </li>
8fd58f56
CW
12 <li ng-repeat="display_name in row.data.display_name" ng-if="::$ctrl.afformAdminEnabled">
13 <a target="_blank" href="{{:: $ctrl.afformPath + '#/create/search/' + row.data.name + '.' + display_name }}">
14 <i class="fa fa-plus"></i> {{:: ts('Create form for %1', {1: row.data.display_label[$index]}) }}
d102f836
CW
15 </a>
16 </li>
17 <li class="divider" role="separator" ng-if="::$ctrl.afformAdminEnabled"></li>
18 <li ng-if="!row.afform_count" class="disabled">
19 <a href>
20 <i ng-if="!$ctrl.afforms" class="crm-i fa-spinner fa-spin"></i>
8fd58f56 21 <em ng-if="$ctrl.afforms && !$ctrl.afforms[row.data.name]">{{:: ts('None Found') }}</em>
d102f836
CW
22 </a>
23 </li>
8fd58f56 24 <li ng-if="$ctrl.afforms" ng-repeat="afform in $ctrl.afforms[row.data.name]" title="{{:: $ctrl.afformAdminEnabled ? ts('Edit form') : '' }}">
1f3b3d1c
CW
25 <a target="_blank" ng-href="{{:: afform.link }}">
26 <i class="crm-i {{:: $ctrl.afformAdminEnabled ? 'fa-pencil-square-o' : 'fa-list-alt' }}"></i>
d102f836
CW
27 {{:: afform.title }}
28 </a>
29 </li>
30 </ul>
31</div>