SearchKit - Add custom template column type
authorColeman Watts <coleman@civicrm.org>
Thu, 26 Aug 2021 12:52:48 +0000 (08:52 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 31 Aug 2021 19:29:55 +0000 (15:29 -0400)
ext/search_kit/ang/crmSearchAdmin/crmSearchAdminDisplay.component.js
ext/search_kit/ang/crmSearchAdmin/displays/colType/include.html [new file with mode: 0644]
ext/search_kit/ang/crmSearchDisplay/colType/include.html [new file with mode: 0644]

index 7b3d207a28b7cd909c68a8523f188db4f3c595f2..a8e6ebe14f4ea6c4887dbde98c2d34f442333b16 100644 (file)
             links: []
           }
         },
+        include: {
+          label: ts('Custom Code'),
+          icon: 'fa-code',
+          defaults: {
+            path: ''
+          }
+        }
       };
 
       // Drag-n-drop settings for reordering columns
diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/colType/include.html b/ext/search_kit/ang/crmSearchAdmin/displays/colType/include.html
new file mode 100644 (file)
index 0000000..6b7dd04
--- /dev/null
@@ -0,0 +1,9 @@
+<div class="form-inline crm-search-admin-flex-row">
+  <label>
+    {{:: ts('Template File') }}
+  </label>
+  <input class="form-control crm-flex-1" type="text" ng-model="col.path">
+</div>
+<p class="help-block">
+  {{:: ts('Relative path to the custom template, e.g. "~/myModule/myTemplate.html"') }}
+</p>
diff --git a/ext/search_kit/ang/crmSearchDisplay/colType/include.html b/ext/search_kit/ang/crmSearchDisplay/colType/include.html
new file mode 100644 (file)
index 0000000..46ea829
--- /dev/null
@@ -0,0 +1 @@
+<div ng-include="col.path"></div>