SearchKit - Standardize labels with Title Case and no colon
[civicrm-core.git] / ext / search_kit / ang / crmSearchAdmin / searchList.html
CommitLineData
475029f6
CW
1<div id="bootstrap-theme" class="crm-search">
2 <h1 crm-page-title>{{:: ts('Saved Searches') }}</h1>
3 <div class="form-inline">
ccaaa678 4 <label for="search-list-filter">{{:: ts('Filter') }}</label>
2ef64700 5 <input class="form-control" type="search" id="search-list-filter" ng-model="$ctrl.searchFilter" placeholder="&#xf002">
475029f6
CW
6 <a class="btn btn-primary pull-right" href="#/create/Contact/">
7 <i class="crm-i fa-plus"></i>
8 {{:: ts('New Search') }}
9 </a>
10 </div>
11 <table>
12 <thead>
13 <tr>
14 <th>{{:: ts('ID') }}</th>
44402a2e 15 <th>{{:: ts('Label') }}</th>
475029f6
CW
16 <th>{{:: ts('For') }}</th>
17 <th>{{:: ts('Displays') }}</th>
18 <th>{{:: ts('Smart Group') }}</th>
2ef64700 19 <th ng-if="$ctrl.afformEnabled">{{:: ts('Forms') }}</th>
c2dabeac
CW
20 <th>{{:: ts('Created') }}</th>
21 <th>{{:: ts('Last Modified') }}</th>
475029f6
CW
22 <th></th>
23 </tr>
24 </thead>
25 <tbody>
2ef64700 26 <tr ng-repeat="search in $ctrl.savedSearches | filter:$ctrl.searchFilter">
c2dabeac
CW
27 <td>{{:: search.id }}</td>
28 <td>{{:: search.label }}</td>
29 <td>{{:: $ctrl.entityTitles[search.api_entity] }}</td>
475029f6 30 <td>
7620b30a 31 <div class="btn-group">
102c400b 32 <button type="button" disabled ng-if="!search.display_name" class="btn btn-xs dropdown-toggle btn-primary-outline">
7620b30a
CW
33 {{:: ts('0 Displays') }}
34 </button>
102c400b 35 <button type="button" ng-if="search.display_name" class="btn btn-xs dropdown-toggle btn-primary-outline" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
7620b30a
CW
36 {{:: search.display_name.length === 1 ? ts('1 Display') : ts('%1 Displays', {1: search.display_name.length}) }} <span class="caret"></span>
37 </button>
38 <ul class="dropdown-menu" ng-if=":: search.display_name.length">
39 <li ng-repeat="display_name in search.display_name">
2ef64700
CW
40 <a href="{{:: $ctrl.searchPath + '#/display/' + search.name + '/' + display_name }}" target="_blank">
41 <i class="fa {{:: search.display_icon[$index] }}"></i>
42 {{:: search.display_label[$index] }}
43 </a>
7620b30a
CW
44 </li>
45 </ul>
46 </div>
47 </td>
c2dabeac 48 <td>{{:: search.groups.join(', ') }}</td>
5e5cf74b 49 <td ng-if="::$ctrl.afformEnabled">
2ef64700
CW
50 <div class="btn-group">
51 <button type="button" ng-click="$ctrl.loadAfforms()" ng-if="search.display_name" class="btn btn-xs dropdown-toggle btn-primary-outline" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
5e5cf74b
CW
52 {{ $ctrl.afforms ? ($ctrl.afforms[search.name] && $ctrl.afforms[search.name].length === 1 ? ts('1 Form') : ts('%1 Forms', {1: $ctrl.afforms[search.name] ? $ctrl.afforms[search.name].length : 0})) : ts('Forms...') }}
53 <span class="caret"></span>
2ef64700
CW
54 </button>
55 <ul class="dropdown-menu">
56 <li ng-repeat="display_name in search.display_name" ng-if="::$ctrl.afformAdminEnabled">
e78dd8bd 57 <a href="{{:: $ctrl.afformPath + '#/create/search/' + search.name + '.' + display_name }}">
2ef64700
CW
58 <i class="fa fa-plus"></i> {{:: ts('Create form for %1', {1: search.display_label[$index]}) }}
59 </a>
60 </li>
61 <li class="divider" role="separator" ng-if="::$ctrl.afformAdminEnabled"></li>
62 <li ng-if="!$ctrl.afforms || !$ctrl.afforms[search.name]" class="disabled">
63 <a href>
64 <i ng-if="!$ctrl.afforms" class="crm-i fa-spinner fa-spin"></i>
65 <em ng-if="$ctrl.afforms && !$ctrl.afforms[search.name]">{{:: ts('None Found') }}</em>
66 </a>
67 </li>
e78dd8bd
CW
68 <li ng-if="$ctrl.afforms" ng-repeat="afform in $ctrl.afforms[search.name]" title="{{:: ts('Edit form') }}">
69 <a href="{{:: $ctrl.afformPath + '#/edit/' + afform.name }}">
70 <i class="crm-i fa-pencil-square-o"></i>
2ef64700
CW
71 {{:: afform.title }}
72 </a>
73 </li>
74 </ul>
75 </div>
76 </td>
c2dabeac
CW
77 <td>{{:: ts('%1 by %2', {1: formatDate(search.created_date), 2: search['created.display_name']}) }}</td>
78 <td>{{:: ts('%1 by %2', {1: formatDate(search.created_date), 2: search['modified.display_name']}) }}</td>
7620b30a 79 <td class="text-right">
b40e49df
CW
80 <a class="btn btn-xs btn-default" href="#/edit/{{:: search.id }}">{{:: ts('Edit') }}</a>
81 <a class="btn btn-xs btn-default" href="#/create/{{:: search.api_entity + '?params=' + $ctrl.encode(search.api_params) }}">{{:: ts('Clone') }}</a>
7620b30a 82 <a href class="btn btn-xs btn-danger" crm-confirm="{type: 'delete', obj: search}" on-yes="$ctrl.deleteSearch(search)">{{:: ts('Delete') }}</a>
475029f6
CW
83 </td>
84 </tr>
85 <tr ng-if="$ctrl.savedSearches.length === 0">
86 <td colspan="9">
87 <p class="messages status no-popup text-center">
88 {{:: ts('No saved searches.')}}
475029f6
CW
89 </p>
90 </td>
91 </tr>
92 </tbody>
93 </table>
94</div>