Search ext: Improve wording of update & delete actions
authorColeman Watts <coleman@civicrm.org>
Fri, 16 Oct 2020 18:39:37 +0000 (14:39 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 29 Oct 2020 23:48:28 +0000 (19:48 -0400)
ext/search/ang/searchActions/crmSearchActionDelete.ctrl.js
ext/search/ang/searchActions/crmSearchActionDelete.html
ext/search/ang/searchActions/crmSearchActionUpdate.ctrl.js
ext/search/ang/searchActions/crmSearchActionUpdate.html

index f81d915acf4ab153f875ad8ae1c390bfd768f0cf..4f0cf17a655a2a100be7c13bbb2268c921b2f7da 100644 (file)
@@ -7,6 +7,7 @@
       ctrl = $scope.$ctrl = this;
 
     this.entity = searchMeta.getEntity(model.entity);
+    this.entityTitle = model.ids.length === 1 ? this.entity.title : this.entity.titlePlural;
 
     this.cancel = function() {
       dialogService.cancel('crmSearchAction');
index a8c95de8a207b9ed3d441c532e552589f52d7f69..855f3570d4f8ea4bfc98fec3d0a1cae3082be18c 100644 (file)
@@ -1,10 +1,10 @@
 <div id="bootstrap-theme">
   <div ng-controller="crmSearchActionDelete">
-    <p>{{:: ts('Are you sure you want to delete %1 %2?', {1: model.ids.length, 2: $ctrl.entity.title}) }}</p>
+    <p><strong>{{:: ts('Are you sure you want to delete %1 %2?', {1: model.ids.length, 2: $ctrl.entityTitle}) }}</strong></p>
     <hr />
     <div class="buttons pull-right">
       <button type="button" ng-click="$ctrl.cancel()" class="btn btn-danger">{{:: ts('Cancel') }}</button>
-      <button ng-click="$ctrl.delete()" class="btn btn-primary">{{:: ts('Delete %1 %2', {1: model.ids.length, 2: $ctrl.entity.title}) }}</button>
+      <button ng-click="$ctrl.delete()" class="btn btn-primary">{{:: ts('Delete %1', {1: $ctrl.entityTitle}) }}</button>
     </div>
   </div>
 </div>
index b44acb29a939d619986b14c2674040890b01613f..18bd6fd08235c091918b25588d72d3f736cc98d9 100644 (file)
@@ -7,6 +7,7 @@
       ctrl = $scope.$ctrl = this;
 
     this.entity = searchMeta.getEntity(model.entity);
+    this.entityTitle = model.ids.length === 1 ? this.entity.title : this.entity.titlePlural;
     this.values = [];
     this.add = null;
 
index 52787c6abe370da931e1eab50e68b720e96409a6..a1af56da3c714f876bb74442a10bd9bb0c788f22 100644 (file)
@@ -1,5 +1,6 @@
 <div id="bootstrap-theme">
   <div ng-controller="crmSearchActionUpdate">
+    <p><strong>{{:: ts('Update the %1 selected %2 with the following values:', {1: model.ids.length, 2: $ctrl.entityTitle}) }}</strong></p>
     <div class="form-inline" ng-repeat="clause in $ctrl.values" >
       <input class="form-control" ng-change="$ctrl.updateField($index)" ng-model="clause[0]" crm-ui-select="{data: $ctrl.availableFields, allowClear: true, placeholder: 'Field'}" />
       <input class="form-control" ng-model="clause[1]" crm-search-value="{field: clause[0]}" />
@@ -10,7 +11,7 @@
     <hr />
     <div class="buttons pull-right">
       <button type="button" ng-click="$ctrl.cancel()" class="btn btn-danger">{{:: ts('Cancel') }}</button>
-      <button ng-click="$ctrl.save()" class="btn btn-primary" ng-disabled="!$ctrl.values.length">{{:: ts('Update %1 %2', {1: model.ids.length, 2: (model.ids.length === 1 ? $ctrl.entity.title : $ctrl.entity.title_plural)}) }}</button>
+      <button ng-click="$ctrl.save()" class="btn btn-primary" ng-disabled="!$ctrl.values.length">{{:: ts('Update %1', {1: $ctrl.entityTitle}) }}</button>
     </div>
   </div>
 </div>