diff --git a/apps/dnet-is-application/src/main/resources/static/html/dsm_add_api.html b/apps/dnet-is-application/src/main/resources/static/html/dsm_add_api.html
index e4530b3f..a06058a7 100644
--- a/apps/dnet-is-application/src/main/resources/static/html/dsm_add_api.html
+++ b/apps/dnet-is-application/src/main/resources/static/html/dsm_add_api.html
@@ -5,23 +5,11 @@
+
+ {{api}}
+
- {{api}}
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield.html b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield.html
new file mode 100644
index 00000000..5a1d64b4
--- /dev/null
+++ b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield.html
@@ -0,0 +1,10 @@
+
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_static.html b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_static.html
new file mode 100644
index 00000000..f35e93d0
--- /dev/null
+++ b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_static.html
@@ -0,0 +1,8 @@
+
diff --git a/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_with_prefix.html b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_with_prefix.html
new file mode 100644
index 00000000..8ba86a04
--- /dev/null
+++ b/apps/dnet-is-application/src/main/resources/static/html/parts/form_textfield_with_prefix.html
@@ -0,0 +1,14 @@
+
diff --git a/apps/dnet-is-application/src/main/resources/static/js/is_main.js b/apps/dnet-is-application/src/main/resources/static/js/is_main.js
index 5cee5777..e1d3b0d7 100644
--- a/apps/dnet-is-application/src/main/resources/static/js/is_main.js
+++ b/apps/dnet-is-application/src/main/resources/static/js/is_main.js
@@ -19,3 +19,64 @@ app.config(['$routeProvider', function($routeProvider) {
}
]);
+app.directive('formTextfield', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ 'label' : '@',
+ 'regex' : '@',
+ 'optional' : '@',
+ 'type' : '@',
+ 'value' : '=',
+ },
+ templateUrl: './html/parts/form_textfield.html',
+ link: function(scope, element, attrs) {
+ scope.required = (scope.optional != 'true');
+ if (scope.regex) { scope.mypattern = new RegExp(scope.regex); }
+ else if (scope.type == 'NUMBER') { scope.mypattern = new RegExp("^[-+]?[0-9]+(\.[0-9]+)?$"); }
+ else if (scope.type == 'BOOLEAN') { scope.mypattern = new RegExp("^(true|false)$"); }
+ else { scope.mypattern = new RegExp(".+"); }
+ }
+ };
+});
+
+app.directive('formTextfieldStatic', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ 'label' : '@',
+ 'value' : '=',
+ },
+ templateUrl: './html/parts/form_textfield_static.html',
+ link: function(scope, element, attrs) {}
+ };
+});
+
+app.directive('formTextfieldWithPrefix', function() {
+ return {
+ restrict: 'E',
+ scope: {
+ 'label' : '@',
+ 'prefix' : '@',
+ 'optional' : '@',
+ 'value' : '='
+ },
+ templateUrl: './html/parts/form_textfield_with_prefix.html',
+ link: function(scope, element, attrs) {
+ scope.suffix = '';
+ scope.required = (scope.optional != 'true');
+
+ scope.$watch('suffix', function() {
+ var tmpId = scope.prefix + scope.suffix;
+
+ if (scope.suffix && scope.suffix.trim() != '') {
+ scope.value = tmpId;
+ } else {
+ scope.value = null;
+ }
+ });
+ }
+ }
+});
+
+