From e00e4e87e431a6390fb27f4824f519c71564a540 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 10 Feb 2019 20:04:36 -0500 Subject: [PATCH] WIP afformList angular page --- ext/afform/gui/ang/afformGui/afformList.html | 4 +++ ext/afform/gui/ang/afformGui/afformList.js | 27 +++++++++++++++++++ .../templates/CRM/AfformGui/afformList.hlp | 1 + 3 files changed, 32 insertions(+) create mode 100644 ext/afform/gui/ang/afformGui/afformList.html create mode 100644 ext/afform/gui/ang/afformGui/afformList.js create mode 100644 ext/afform/gui/templates/CRM/AfformGui/afformList.hlp diff --git a/ext/afform/gui/ang/afformGui/afformList.html b/ext/afform/gui/ang/afformGui/afformList.html new file mode 100644 index 0000000000..165d91bc02 --- /dev/null +++ b/ext/afform/gui/ang/afformGui/afformList.html @@ -0,0 +1,4 @@ +
+
+ +
diff --git a/ext/afform/gui/ang/afformGui/afformList.js b/ext/afform/gui/ang/afformGui/afformList.js new file mode 100644 index 0000000000..14d78c214c --- /dev/null +++ b/ext/afform/gui/ang/afformGui/afformList.js @@ -0,0 +1,27 @@ +(function(angular, $, _) { + + angular.module('afformGui').config(function($routeProvider) { + $routeProvider.when('/list', { + controller: 'afformList', + templateUrl: '~/afformGui/afformList.html', + resolve: { + afforms: function(crmApi4) { + return crmApi4('Afform', 'get'); + } + } + }); + }); + + // The controller uses *injection*. This default injects a few things: + // $scope -- This is the set of variables shared between JS and HTML. + // crmApi, crmStatus, crmUiHelp -- These are services provided by civicrm-core. + // myContact -- The current contact, defined above in config(). + angular.module('afformGui').controller('afformList', function($scope, crmApi4, crmStatus, crmUiHelp, afforms) { + // The ts() and hs() functions help load strings for this module. + var ts = $scope.ts = CRM.ts('afformGui'); + var hs = $scope.hs = crmUiHelp({file: 'CRM/AfformGui/afformList'}); + $scope.afforms = afforms; + + }); + +})(angular, CRM.$, CRM._); diff --git a/ext/afform/gui/templates/CRM/AfformGui/afformList.hlp b/ext/afform/gui/templates/CRM/AfformGui/afformList.hlp new file mode 100644 index 0000000000..55a904ca6d --- /dev/null +++ b/ext/afform/gui/templates/CRM/AfformGui/afformList.hlp @@ -0,0 +1 @@ +{* help for Angular afformGui *} -- 2.25.1