From 65a797669662f4e604ecaa210b5948be62bb8f42 Mon Sep 17 00:00:00 2001 From: Saiat Kalbiev Date: Tue, 20 Aug 2019 12:44:01 +0400 Subject: [PATCH] Update main component form template --- src/Generator.js | 27 ++++--- src/templates/form.component.template | 112 ++++++++++++++++++-------- 2 files changed, 96 insertions(+), 43 deletions(-) diff --git a/src/Generator.js b/src/Generator.js index 83150e9..2e812fe 100644 --- a/src/Generator.js +++ b/src/Generator.js @@ -184,9 +184,13 @@ class Generator { const labelText = GeneralHelper.eachWordCapitalize(this.field_names[i].replace('_', ' ')); returnData += ` - - - \n`; + + \n`; } return returnData; @@ -202,9 +206,7 @@ class Generator {
-
- {{innerData}} -
+ {{innerData}}
`; @@ -213,13 +215,16 @@ class Generator { for (let i = 0; i < this.translatable_field_names.length; i++) { const labelText = GeneralHelper.eachWordCapitalize(this.translatable_field_names[i].replace('_', ' ')); + const vModelText = `${this.unCapitalizedComponentName}['${this.translatable_field_names[i]}'][locale.key]`; innerData += ` - - - - \n`; - + + \n`; } return returnData.replace('{{innerData}}', innerData); diff --git a/src/templates/form.component.template b/src/templates/form.component.template index d793df3..a4dede8 100644 --- a/src/templates/form.component.template +++ b/src/templates/form.component.template @@ -4,11 +4,25 @@

{{$t('Update')}} {{$t('{{componentNameVisual}}')}}

{{$t('Create')}} {{$t('{{componentNameVisual}}')}}

+ + - {{inputFields}} - {{translatableInputFields}} - {{$t('Submit')}} - {{$t('Reset')}} + {{inputFields}}{{translatableInputFields}} + + + {{$t('Submit')}} + + + + {{$t('Cancel')}} + @@ -18,52 +32,86 @@