From 56e321f6d91c21d6bc2bbfc65b08455cbd12025f Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 01:18:02 +0900 Subject: [PATCH 1/4] [Forms] Add textarea template Issue #1184 --- platform/forms/bundle.js | 6 ++++ .../res/templates/controls/textarea.html | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 platform/forms/res/templates/controls/textarea.html diff --git a/platform/forms/bundle.js b/platform/forms/bundle.js index daa7063ffe..d3ee14f440 100644 --- a/platform/forms/bundle.js +++ b/platform/forms/bundle.js @@ -32,6 +32,7 @@ define([ "text!./res/templates/controls/datetime.html", "text!./res/templates/controls/select.html", "text!./res/templates/controls/textfield.html", + "text!./res/templates/controls/textarea.html", "text!./res/templates/controls/button.html", "text!./res/templates/controls/color.html", "text!./res/templates/controls/composite.html", @@ -51,6 +52,7 @@ define([ datetimeTemplate, selectTemplate, textfieldTemplate, + textareaTemplate, buttonTemplate, colorTemplate, compositeTemplate, @@ -103,6 +105,10 @@ define([ "key": "textfield", "template": textfieldTemplate }, + { + "key": "textarea", + "template": textareaTemplate + }, { "key": "button", "template": buttonTemplate diff --git a/platform/forms/res/templates/controls/textarea.html b/platform/forms/res/templates/controls/textarea.html new file mode 100644 index 0000000000..45c4db4e1e --- /dev/null +++ b/platform/forms/res/templates/controls/textarea.html @@ -0,0 +1,31 @@ + + + + + + From 4429e847e8d148ef01d999e8aa9523b588cf4eed Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 01:18:26 +0900 Subject: [PATCH 2/4] [Properties] Add notes field to all item types Issue #1184 --- platform/core/bundle.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/core/bundle.js b/platform/core/bundle.js index 8b4baf83ff..8567d11fc3 100644 --- a/platform/core/bundle.js +++ b/platform/core/bundle.js @@ -252,6 +252,12 @@ define([ "pattern": "\\S+", "required": true, "cssclass": "l-input-lg" + }, + { + "name": "Notes", + "control": "textarea", + "required": false, + "cssclass": "field-notes" } ] }, From f9ce27def3a6625e9f531adc252484ef7cc8159a Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 01:27:12 +0900 Subject: [PATCH 3/4] [Frontend] Add attributes for storing notes Issue #1184 --- platform/core/bundle.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/core/bundle.js b/platform/core/bundle.js index 8567d11fc3..0f2ba311c3 100644 --- a/platform/core/bundle.js +++ b/platform/core/bundle.js @@ -255,6 +255,8 @@ define([ }, { "name": "Notes", + "key": "notes", + "property": "notes", "control": "textarea", "required": false, "cssclass": "field-notes" From 56267095cba4425ddb70e2b70ab692db05db0132 Mon Sep 17 00:00:00 2001 From: David Hudson Date: Sun, 18 Sep 2016 01:47:07 +0900 Subject: [PATCH 4/4] [Forms] Add style for small textareas Issue #1184. This allows for a generically sized text area in forms. I am anticipating some potential feedback on this given the approach and the sizing I chose may or may not be ideal for your requirements. --- platform/commonUI/general/res/sass/controls/_controls.scss | 1 + platform/core/bundle.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/commonUI/general/res/sass/controls/_controls.scss b/platform/commonUI/general/res/sass/controls/_controls.scss index 7900739668..d1935d8ce0 100644 --- a/platform/commonUI/general/res/sass/controls/_controls.scss +++ b/platform/commonUI/general/res/sass/controls/_controls.scss @@ -216,6 +216,7 @@ input[type="search"] { .l-input-lg input[type="text"] { width: 100% !important; } .l-input-med input[type="text"] { width: 200px !important; } .l-input-sm input[type="text"] { width: 50px !important; } +.l-textarea-sm textarea { position: relative; height: 50px; } .l-numeric input[type="text"] { text-align: right; } .input-labeled { diff --git a/platform/core/bundle.js b/platform/core/bundle.js index 0f2ba311c3..4b9e2b9adb 100644 --- a/platform/core/bundle.js +++ b/platform/core/bundle.js @@ -259,7 +259,7 @@ define([ "property": "notes", "control": "textarea", "required": false, - "cssclass": "field-notes" + "cssclass": "l-textarea-sm" } ] },