summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2021-12-11 21:06:06 +0100
committerDaniel Weipert <code@drogueronin.de>2022-01-10 11:29:13 +0100
commitc288098b171870c87f57d4585b72339ddaf628e2 (patch)
treef3c953a40e1841dc87d1116622d7600aba6d7b40 /templates
Initial commit
Diffstat (limited to 'templates')
-rw-r--r--templates/config/config.toml11
-rw-r--r--templates/config/templates/field-input.html9
-rw-r--r--templates/config/templates/form.html8
-rw-r--r--templates/form/fields/_fields.toml6
-rw-r--r--templates/form/fields/email.toml8
-rw-r--r--templates/form/fields/name.toml7
6 files changed, 49 insertions, 0 deletions
diff --git a/templates/config/config.toml b/templates/config/config.toml
new file mode 100644
index 0000000..03977a1
--- /dev/null
+++ b/templates/config/config.toml
@@ -0,0 +1,11 @@
+[app]
+title = "Flat-File Forms"
+
+[email]
+host = localhost
+user = root
+password = 123456
+
+[api]
+keys = []
+
diff --git a/templates/config/templates/field-input.html b/templates/config/templates/field-input.html
new file mode 100644
index 0000000..407bde0
--- /dev/null
+++ b/templates/config/templates/field-input.html
@@ -0,0 +1,9 @@
+<input
+ type="{{ field.type }}"
+ name="{{ field.name }}"
+ placeholder="{{ field.placeholder }}"
+ {% for key, value in field.attributes %}
+ {{ key }}="{{ value }}"
+ {% endfor %}
+>
+
diff --git a/templates/config/templates/form.html b/templates/config/templates/form.html
new file mode 100644
index 0000000..b880ee4
--- /dev/null
+++ b/templates/config/templates/form.html
@@ -0,0 +1,8 @@
+<form action="{{ form.action }}" method="POST">
+ {{ csrf() }}
+
+ {% for field in fields %}
+ {{ field.render() }}
+ {% endfor %}
+</form>
+
diff --git a/templates/form/fields/_fields.toml b/templates/form/fields/_fields.toml
new file mode 100644
index 0000000..2be25cc
--- /dev/null
+++ b/templates/form/fields/_fields.toml
@@ -0,0 +1,6 @@
+[field.name]
+file = "name.toml"
+
+[field.email]
+file = "email.toml"
+
diff --git a/templates/form/fields/email.toml b/templates/form/fields/email.toml
new file mode 100644
index 0000000..9e2626a
--- /dev/null
+++ b/templates/form/fields/email.toml
@@ -0,0 +1,8 @@
+type = "email"
+name = "email"
+placeholder = "E-Mail"
+
+attributes = {
+ "data-email" = "test@example.org"
+}
+
diff --git a/templates/form/fields/name.toml b/templates/form/fields/name.toml
new file mode 100644
index 0000000..5f45d87
--- /dev/null
+++ b/templates/form/fields/name.toml
@@ -0,0 +1,7 @@
+type = "text"
+name = "name"
+
+attributes = {
+ "data-value" = 123,
+}
+