From: Coleman Watts Date: Sat, 9 Feb 2019 04:59:02 +0000 (-0500) Subject: Skelital gui list page X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9fdcd44395f0180a690750d4dd84d80e033a8f15;p=civicrm-core.git Skelital gui list page --- diff --git a/ext/afform/gui/CRM/AfformGui/Page/Gui.php b/ext/afform/gui/CRM/AfformGui/Page/Gui.php index 545aaf73de..8a10ab9ac0 100644 --- a/ext/afform/gui/CRM/AfformGui/Page/Gui.php +++ b/ext/afform/gui/CRM/AfformGui/Page/Gui.php @@ -8,7 +8,7 @@ class CRM_AfformGui_Page_Gui extends CRM_Core_Page { $loader->setModules(['afformGui']); $loader->setPageName('civicrm/admin/afform'); $loader->useApp([ - 'defaultRoute' => '/build', + 'defaultRoute' => '/list', ]); $loader->load(); CRM_Utils_System::setTitle('CiviCRM'); diff --git a/ext/afform/gui/ang/afformGui/afformBuilder.html b/ext/afform/gui/ang/afformGui/afformBuilder.html index 27e9ba42a8..8647a08e91 100644 --- a/ext/afform/gui/ang/afformGui/afformBuilder.html +++ b/ext/afform/gui/ang/afformGui/afformBuilder.html @@ -1,4 +1,4 @@
- Hello! +
diff --git a/ext/afform/gui/ang/afformGui/afformBuilder.js b/ext/afform/gui/ang/afformGui/afformBuilder.js index cd440558ea..aeea181c06 100644 --- a/ext/afform/gui/ang/afformGui/afformBuilder.js +++ b/ext/afform/gui/ang/afformGui/afformBuilder.js @@ -1,9 +1,17 @@ (function(angular, $, _) { angular.module('afformGui').config(function($routeProvider) { - $routeProvider.when('/build', { + $routeProvider.when('/build/:afformName?', { controller: 'afformBuilder', - templateUrl: '~/afformGui/afformBuilder.html' + templateUrl: '~/afformGui/afformBuilder.html', + resolve: { + afform: function(crmApi4, $route) { + var name = $route.current.params.afformName; + if (name) { + return crmApi4('Afform', 'get', {where: [['name', '=', name]]}); + } + } + } }); }); @@ -11,11 +19,11 @@ // $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('afformBuilder', function($scope, crmApi4, crmStatus, crmUiHelp) { + angular.module('afformGui').controller('afformBuilder', function($scope, $routeParams, crmApi4, crmStatus, crmUiHelp, afform) { // 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/afformBuilder'}); - + $scope.afform = afform; });