diff --git a/platform/forms/bundle.json b/platform/forms/bundle.json new file mode 100644 index 0000000000..776d0ee596 --- /dev/null +++ b/platform/forms/bundle.json @@ -0,0 +1,42 @@ +{ + "name": "MCT Forms", + "description": "Form generator; includes directive and some controls.", + "extensions": { + "directives": [ + { + "key": "mctForm", + "implementation": "MCTForm.js" + } + ], + "templates": [ + { + "key": "_checkbox", + "templateUrl": "templates/_checkbox.html" + }, + { + "key": "_checkboxes", + "templateUrl": "templates/_checkboxes.html" + }, + { + "key": "_datetime", + "templateUrl": "templates/_datetime.html" + }, + { + "key": "_select", + "templateUrl": "templates/_select.html" + }, + { + "key": "_selects", + "templateUrl": "templates/_selects.html" + }, + { + "key": "_textfield", + "templateUrl": "templates/_textfield.html" + }, + { + "key": "_textfields", + "templateUrl": "templates/_textfields.html" + } + ] + } +} \ No newline at end of file diff --git a/platform/forms/res/templates/_checkbox.html b/platform/forms/res/templates/_checkbox.html new file mode 100644 index 0000000000..1412c4ee14 --- /dev/null +++ b/platform/forms/res/templates/_checkbox.html @@ -0,0 +1,6 @@ +
+ +
\ No newline at end of file diff --git a/platform/forms/res/templates/_checkboxes.html b/platform/forms/res/templates/_checkboxes.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/forms/res/templates/_datetime.html b/platform/forms/res/templates/_datetime.html new file mode 100644 index 0000000000..55e0f7bdcb --- /dev/null +++ b/platform/forms/res/templates/_datetime.html @@ -0,0 +1,24 @@ +
+
+
+ Date + Hour + Min + Sec + Timezone +
+ +
+ + + + + + + +
+
+
\ No newline at end of file diff --git a/platform/forms/res/templates/_select.html b/platform/forms/res/templates/_select.html new file mode 100644 index 0000000000..e778d76450 --- /dev/null +++ b/platform/forms/res/templates/_select.html @@ -0,0 +1,7 @@ +
+ +
diff --git a/platform/forms/res/templates/_selects.html b/platform/forms/res/templates/_selects.html new file mode 100644 index 0000000000..449051ed56 --- /dev/null +++ b/platform/forms/res/templates/_selects.html @@ -0,0 +1,5 @@ +
+ {#processedValues} + {#view key="_select"/} + {/processedValues} +
\ No newline at end of file diff --git a/platform/forms/res/templates/_textfield.html b/platform/forms/res/templates/_textfield.html new file mode 100644 index 0000000000..f351520231 --- /dev/null +++ b/platform/forms/res/templates/_textfield.html @@ -0,0 +1,8 @@ +
+ + + + + +
+ diff --git a/platform/forms/res/templates/form.html b/platform/forms/res/templates/form.html new file mode 100644 index 0000000000..b3dc0db27b --- /dev/null +++ b/platform/forms/res/templates/form.html @@ -0,0 +1,38 @@ +{{structure.name}} +
+ +
{{section.name}}
+
+ + + + + + + + + + +
+
{{row.name}}
+
+
+ +
+ {{item.control}} | Item.Key={{item.key}} | model={{model[item.key]}} + * + +
+
+
+
+
+
+
+ +
+CLICK! +
Model: {{model | json}}
+
\ No newline at end of file diff --git a/platform/forms/res/templates/textfields.html b/platform/forms/res/templates/textfields.html new file mode 100644 index 0000000000..39a01c489e --- /dev/null +++ b/platform/forms/res/templates/textfields.html @@ -0,0 +1,7 @@ +
+
+ {#processedValues} + {#view key="_textfield"/} {label} + {/processedValues} +
+
\ No newline at end of file diff --git a/platform/forms/src/MCTForm.js b/platform/forms/src/MCTForm.js new file mode 100644 index 0000000000..c0585d2a00 --- /dev/null +++ b/platform/forms/src/MCTForm.js @@ -0,0 +1,31 @@ +/*global define,Promise*/ + +/** + * Module defining MCTForm. Created by vwoeltje on 11/10/14. + */ +define( + [], + function () { + "use strict"; + + /** + * + * @constructor + */ + function MCTForm() { + var templatePath = [ + "platform/forms", //MCTForm.bundle.path, + "res", //MCTForm.bundle.resources, + "templates/form.html" + ].join("/"); + + return { + restrict: "E", + templateUrl: templatePath, + scope: { structure: "=", model: "=ngModel" } + }; + } + + return MCTForm; + } +); \ No newline at end of file