From 7bc83e9441fc6ac8d00c75a7974ef796eb5f315d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 31 Mar 2014 21:34:44 -0400 Subject: [PATCH] Make admin_fields_edit be Angular-powered. Roll includes/hoplite to 38d8c893ebfb727e6f70ee86a155431e8d9fd571. --- admin/fields.php | 5 +++-- admin/templates/admin_fields_edit.tpl | 31 +++++++++++++++------------ includes/hoplite | 2 +- static/admin.js | 12 ++--------- 4 files changed, 23 insertions(+), 27 deletions(-) diff --git a/admin/fields.php b/admin/fields.php index a23a626..39c60da 100644 --- a/admin/fields.php +++ b/admin/fields.php @@ -31,7 +31,7 @@ class FieldsAction extends http\ActionController implements TemplatePreCaching { public function TemplateSet() { - return array('admin_fields_list', 'admin_fields_edit'); + return ['admin_fields_list', 'admin_fields_edit']; } public function ActionList(http\Request $request, http\Response $response) @@ -58,7 +58,8 @@ class FieldsAction extends http\ActionController implements TemplatePreCaching if ($request->http_method != 'POST') $this->controller()->StopWithCode(http\ResponseCode::METHOD_NOT_ALLOWED); - $this->controller()->StopWithRedirect($this->controller()->MakeURL('/fields/list')); + var_dump($request); + //$this->controller()->StopWithRedirect($this->controller()->MakeURL('/fields/list')); } protected function _GetActionMethod(http\Request $request) diff --git a/admin/templates/admin_fields_edit.tpl b/admin/templates/admin_fields_edit.tpl index ff3e1aa..c46a724 100644 --- a/admin/templates/admin_fields_edit.tpl +++ b/admin/templates/admin_fields_edit.tpl @@ -1,5 +1,16 @@ {%#import 'admin_header'%} + +
@@ -7,39 +18,31 @@
- - diff --git a/includes/hoplite b/includes/hoplite index dc08cff..38d8c89 160000 --- a/includes/hoplite +++ b/includes/hoplite @@ -1 +1 @@ -Subproject commit dc08cff4b89d90466ebc2b3f2a8dc38b611558ab +Subproject commit 38d8c893ebfb727e6f70ee86a155431e8d9fd571 diff --git a/static/admin.js b/static/admin.js index 2029413..a5d45ab 100644 --- a/static/admin.js +++ b/static/admin.js @@ -15,15 +15,7 @@ angular.module('bugdar.admin.settings', []) }]); angular.module('bugdar.admin.fields', []) - .directive('fieldType', ['$templateCache', function($templateCache) { - return { - restrict: 'A', - replace: true, - template: $templateCache.get('-/admin/fields/field-type-option.tpl'), - scope: { - fieldType: '@' - } - }; - }]) .controller('FieldEditor', ['$scope', function($scope) { + $scope.field = ModelData; + $scope.fieldTypes = FieldTypes; }]); -- 2.22.5