expands html for cachegroup form

Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ef61adb0
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ef61adb0
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ef61adb0

Branch: refs/heads/psql
Commit: ef61adb064739922409f0c19806a7195108e7dd1
Parents: 6c92034
Author: Jeremy Mitchell <mitchell...@gmail.com>
Authored: Thu Oct 13 12:15:27 2016 -0600
Committer: Jeremy Mitchell <mitchell...@gmail.com>
Committed: Thu Oct 13 12:15:27 2016 -0600

----------------------------------------------------------------------
 .../form/cacheGroup/FormCacheGroupController.js | 13 ++-----
 .../form/cacheGroup/form.cacheGroup.tpl.html    | 38 ++++++++++++++++----
 2 files changed, 33 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ef61adb0/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/FormCacheGroupController.js
----------------------------------------------------------------------
diff --git 
a/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/FormCacheGroupController.js
 
b/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/FormCacheGroupController.js
index cabafc7..2f4ff7b 100644
--- 
a/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/FormCacheGroupController.js
+++ 
b/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/FormCacheGroupController.js
@@ -1,4 +1,4 @@
-var FormCacheGroupController = function(cacheGroup, $scope, formUtils, 
stringUtils, locationUtils, cacheGroupService, typeService) {
+var FormCacheGroupController = function(cacheGroup, $scope, formUtils, 
locationUtils, cacheGroupService, typeService) {
 
     var getCacheGroups = function() {
         cacheGroupService.getCacheGroups()
@@ -16,15 +16,6 @@ var FormCacheGroupController = function(cacheGroup, $scope, 
formUtils, stringUti
 
     $scope.cacheGroup = cacheGroup;
 
-    $scope.props = [
-        { name: 'name', type: 'text', required: true, maxLength: 45 },
-        { name: 'shortName', type: 'text', required: true, maxLength: 255 },
-        { name: 'latitude', type: 'number', required: false, pattern: new 
RegExp('^[-+]?[0-9]*\.?[0-9]+$'), invalidMsg: 'Invalid coordinate' },
-        { name: 'longitude', type: 'number', required: false, pattern: new 
RegExp('^[-+]?[0-9]*\.?[0-9]+$'), invalidMsg: 'Invalid coordinate' }
-    ];
-
-    $scope.labelize = stringUtils.labelize;
-
     $scope.navigateToPath = locationUtils.navigateToPath;
 
     $scope.hasError = formUtils.hasError;
@@ -39,5 +30,5 @@ var FormCacheGroupController = function(cacheGroup, $scope, 
formUtils, stringUti
 
 };
 
-FormCacheGroupController.$inject = ['cacheGroup', '$scope', 'formUtils', 
'stringUtils', 'locationUtils', 'cacheGroupService', 'typeService'];
+FormCacheGroupController.$inject = ['cacheGroup', '$scope', 'formUtils', 
'locationUtils', 'cacheGroupService', 'typeService'];
 module.exports = FormCacheGroupController;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ef61adb0/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html
----------------------------------------------------------------------
diff --git 
a/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html
 
b/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html
index 6f3ac5b..d3fcaf7 100644
--- 
a/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html
+++ 
b/traffic_ops/experimental/ui/app/src/common/modules/form/cacheGroup/form.cacheGroup.tpl.html
@@ -9,14 +9,38 @@
     <div class="x_content">
         <br>
         <form name="cacheGroupForm" class="form-horizontal form-label-left" 
novalidate>
-            <div class="form-group" ng-class="{'has-error': 
hasError(cacheGroupForm[prop.name]), 'has-feedback': 
hasError(cacheGroupForm[prop.name])}" ng-repeat="prop in props">
-                <label class="control-label col-md-2 col-sm-2 
col-xs-12">{{labelize(prop.name)}} <span 
ng-show="prop.required">*</span></label>
+            <div class="form-group" ng-class="{'has-error': 
hasError(cacheGroupForm.name), 'has-feedback': hasError(cacheGroupForm.name)}">
+                <label class="control-label col-md-2 col-sm-2 col-xs-12">Name 
*</label>
                 <div class="col-md-10 col-sm-10 col-xs-12">
-                    <input id="{{prop.name}}" name="{{prop.name}}" 
type="{{prop.type}}" class="form-control" ng-model="cacheGroup[prop.name]" 
ng-readonly="prop.readonly" ng-required="prop.required" 
ng-maxlength="prop.maxLength" ng-pattern="prop.pattern" autofocus>
-                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm[prop.name], 
'required')">Required</small>
-                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm[prop.name], 'maxlength')">Too 
Long</small>
-                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm[prop.name], 
'pattern')">{{prop.invalidMsg}}</small>
-                    <span ng-show="hasError(cacheGroupForm[prop.name])" 
class="form-control-feedback"><i class="fa fa-times"></i></span>
+                    <input id="name" name="name" type="text" 
class="form-control" ng-model="cacheGroup.name" ng-required="true" 
ng-maxlength="45" autofocus>
+                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm.name, 'required')">Required</small>
+                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm.name, 'maxlength')">Too Long</small>
+                    <span ng-show="hasError(cacheGroupForm.name)" 
class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+            <div class="form-group" ng-class="{'has-error': 
hasError(cacheGroupForm.shortName), 'has-feedback': 
hasError(cacheGroupForm.shortName)}">
+                <label class="control-label col-md-2 col-sm-2 col-xs-12">Short 
Name *</label>
+                <div class="col-md-10 col-sm-10 col-xs-12">
+                    <input id="shortName" name="shortName" type="text" 
class="form-control" ng-model="cacheGroup.shortName" ng-required="true" 
ng-maxlength="255" autofocus>
+                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm.shortName, 
'required')">Required</small>
+                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm.shortName, 'maxlength')">Too 
Long</small>
+                    <span ng-show="hasError(cacheGroupForm.shortName)" 
class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+            <div class="form-group" ng-class="{'has-error': 
hasError(cacheGroupForm.latitude), 'has-feedback': 
hasError(cacheGroupForm.latitude)}">
+                <label class="control-label col-md-2 col-sm-2 
col-xs-12">Latitude *</label>
+                <div class="col-md-10 col-sm-10 col-xs-12">
+                    <input id="latitude" name="latitude" type="text" 
class="form-control" ng-model="cacheGroup.latitude" 
ng-pattern="/^[-+]?[0-9]*\.?[0-9]+$/" autofocus>
+                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm.latitude, 'pattern')">Invalid 
coordinate</small>
+                    <span ng-show="hasError(cacheGroupForm.latitude)" 
class="form-control-feedback"><i class="fa fa-times"></i></span>
+                </div>
+            </div>
+            <div class="form-group" ng-class="{'has-error': 
hasError(cacheGroupForm.longitude), 'has-feedback': 
hasError(cacheGroupForm.longitude)}">
+                <label class="control-label col-md-2 col-sm-2 
col-xs-12">Longitude *</label>
+                <div class="col-md-10 col-sm-10 col-xs-12">
+                    <input id="longitude" name="longitude" type="text" 
class="form-control" ng-model="cacheGroup.longitude" 
ng-pattern="/^[-+]?[0-9]*\.?[0-9]+$/" autofocus>
+                    <small class="input-error" 
ng-show="hasPropertyError(cacheGroupForm.longitude, 'pattern')">Invalid 
coordinate</small>
+                    <span ng-show="hasError(cacheGroupForm.longitude)" 
class="form-control-feedback"><i class="fa fa-times"></i></span>
                 </div>
             </div>
             <div class="form-group" ng-class="{'has-error': 
hasError(cacheGroupForm.type), 'has-feedback': hasError(cacheGroupForm.type)}">

Reply via email to