From 0438fb5a2e1c8d0abc92a21bcc02af2b626616b1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 Jun 2023 10:09:45 +0200 Subject: [PATCH] fix: remove and replace old form functions --- resources/views/accounts/create.twig | 13 +- resources/views/accounts/edit.twig | 1 - resources/views/form/amount-no-currency.twig | 2 +- resources/views/form/amount-small.twig | 25 +--- resources/views/form/amount.twig | 34 +----- .../views/form/assetAccountCheckList.twig | 6 +- resources/views/form/balance.twig | 34 +----- resources/views/form/checkbox.twig | 2 +- resources/views/form/date.twig | 2 +- resources/views/form/file.twig | 2 +- resources/views/form/integer.twig | 2 +- resources/views/form/location.twig | 115 +----------------- .../rules/rule-group/select-transactions.twig | 18 ++- resources/views/tags/create.twig | 13 +- resources/views/tags/edit.twig | 1 - 15 files changed, 40 insertions(+), 230 deletions(-) diff --git a/resources/views/accounts/create.twig b/resources/views/accounts/create.twig index b83bb08dcc..46876560cc 100644 --- a/resources/views/accounts/create.twig +++ b/resources/views/accounts/create.twig @@ -9,7 +9,8 @@ var mapboxToken = "{{ config('firefly.mapbox_api_key') }}"; -
+ @@ -58,7 +59,6 @@ {# only correct way to do active checkbox #} {{ ExpandedForm.checkbox('include_net_worth', 1) }} {{ ExpandedForm.textarea('notes',null,{helpText: trans('firefly.field_supports_markdown')}) }} - {{ ExpandedForm.location('location', null, {locations: locations}) }} {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }} @@ -89,13 +89,16 @@ var iOwe = '{{ 'i_owe_amount'|_|escape('js') }}'; - + {% endblock %} {% block styles %} - - + + {% endblock %} diff --git a/resources/views/accounts/edit.twig b/resources/views/accounts/edit.twig index 0a47e571ff..0f981e5558 100644 --- a/resources/views/accounts/edit.twig +++ b/resources/views/accounts/edit.twig @@ -73,7 +73,6 @@ {{ ExpandedForm.checkbox('active', 1) }} {# only correct way to do active checkbox #} - {{ ExpandedForm.location('location', null, {locations: locations}) }} {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }} diff --git a/resources/views/form/amount-no-currency.twig b/resources/views/form/amount-no-currency.twig index 411bd76787..d558f52f0c 100644 --- a/resources/views/form/amount-no-currency.twig +++ b/resources/views/form/amount-no-currency.twig @@ -1,7 +1,7 @@
- {{ Form.input('number', name, value, options) }} + {{ Html.input('number', name, value).class('form-control').attribute('step','any').attribute('autocomplete','off').attribute('spellcheck','false') }} {% include 'form.help' %} {% include 'form.feedback' %}
diff --git a/resources/views/form/amount-small.twig b/resources/views/form/amount-small.twig index 213c3f25ad..34abc84399 100644 --- a/resources/views/form/amount-small.twig +++ b/resources/views/form/amount-small.twig @@ -1,24 +1 @@ -
-
- - -
- {{ Form.input('number', name, value, options) }} - - -
- +TODO REPLACE ME diff --git a/resources/views/form/amount.twig b/resources/views/form/amount.twig index 4f318676b3..34abc84399 100644 --- a/resources/views/form/amount.twig +++ b/resources/views/form/amount.twig @@ -1,33 +1 @@ -
- - -
-
-
- - -
- {{ Form.input('number', name, value, options) }} - - -
- - {% include 'form.feedback' %} -
- - -
+TODO REPLACE ME diff --git a/resources/views/form/assetAccountCheckList.twig b/resources/views/form/assetAccountCheckList.twig index 836ab52449..13c085ffd2 100644 --- a/resources/views/form/assetAccountCheckList.twig +++ b/resources/views/form/assetAccountCheckList.twig @@ -3,14 +3,14 @@
{% for groupName, accounts in grouped %} - {{ groupName }}
+ {{ groupName }}
{% for id, account in accounts %}
diff --git a/resources/views/form/balance.twig b/resources/views/form/balance.twig index 627bd5ce8c..a9b69caf52 100644 --- a/resources/views/form/balance.twig +++ b/resources/views/form/balance.twig @@ -1,33 +1 @@ -
- - -
-
-
- - -
- {{ Form.input('number', name, value, options) }} - - -
- - {% include 'form.feedback' %} -
- - -
+TODO REMOVE ME diff --git a/resources/views/form/checkbox.twig b/resources/views/form/checkbox.twig index e235ffc557..9c65dbbfe1 100644 --- a/resources/views/form/checkbox.twig +++ b/resources/views/form/checkbox.twig @@ -10,7 +10,7 @@
{% include 'form.help' %} diff --git a/resources/views/form/date.twig b/resources/views/form/date.twig index 4eba6608ea..7bd80eb22e 100644 --- a/resources/views/form/date.twig +++ b/resources/views/form/date.twig @@ -6,7 +6,7 @@
- {{ Form.input('date', name, value, options) }} + {{ Html.input('date', name, value).class('form-control').attribute('autocomplete','off').attribute('spellcheck','false') }}
{% include 'form.help' %} {% include 'form.feedback' %} diff --git a/resources/views/form/file.twig b/resources/views/form/file.twig index 0533dda5dc..7f656e5c19 100644 --- a/resources/views/form/file.twig +++ b/resources/views/form/file.twig @@ -2,7 +2,7 @@
- {{ Form.file(name, options) }} + {{ Html.input('file',name).attribute('multiple','multiple').class('form-control') }} {% include 'form.help' %} {% include 'form.feedback' %}
diff --git a/resources/views/form/integer.twig b/resources/views/form/integer.twig index 1eac145903..535de496a3 100644 --- a/resources/views/form/integer.twig +++ b/resources/views/form/integer.twig @@ -2,7 +2,7 @@
- {{ Form.input('number', name, value, options) }} + {{ Html.input('number', name, value).attribute('step',options.step).attribute('autocomplete','off').attribute('spellcheck', 'false').class('form-control') }} {% include 'form.help' %} {% include 'form.feedback' %}
diff --git a/resources/views/form/location.twig b/resources/views/form/location.twig index df18f28068..a9b69caf52 100644 --- a/resources/views/form/location.twig +++ b/resources/views/form/location.twig @@ -1,114 +1 @@ -
- -
- {% if config('firefly.mapbox_api_key') == '' %} -

- {{ trans('firefly.mapbox_api_key')|raw }} -

- {% else %} -
-
-

- {{ 'press_object_location'|_ }} - -

- {# latitude #} - - - {# longitude #} - - - {# zoomlevel #} - - - {# has location set? #} - - {% include 'form.feedback' %} - {% endif %} -
-
- -{% if config('firefly.mapbox_api_key') != '' %} - {% set latitudevar = name~'_latitude' %} - {% set longitudevar = name~'_longitude' %} - {% set zoomlevelvar = name~'_zoom_level' %} - {% set haslocationvar = name~'_has_location' %} - {% set clearvar = name~'_clear_location' %} - - -{% endif %} +TODO REMOVE ME diff --git a/resources/views/rules/rule-group/select-transactions.twig b/resources/views/rules/rule-group/select-transactions.twig index e04b098681..842458804f 100644 --- a/resources/views/rules/rule-group/select-transactions.twig +++ b/resources/views/rules/rule-group/select-transactions.twig @@ -6,7 +6,8 @@ {% block content %} - +
@@ -31,7 +32,8 @@
@@ -39,12 +41,16 @@
{% endblock %} {% block scripts %} - + - + {% endblock %} {% block styles %} - - + + {% endblock %} diff --git a/resources/views/tags/create.twig b/resources/views/tags/create.twig index 3b3d080e92..7d466def5a 100644 --- a/resources/views/tags/create.twig +++ b/resources/views/tags/create.twig @@ -10,7 +10,8 @@ var locations = {{ locations|json_encode|raw }}; var mapboxToken = "{{ config('firefly.mapbox_api_key') }}"; -
+
@@ -33,7 +34,6 @@
{{ ExpandedForm.date('date') }} {{ ExpandedForm.textarea('description') }} - {{ ExpandedForm.location('location', null, {locations: locations}) }} {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}
@@ -62,12 +62,15 @@ {% endblock %} {% block scripts %} - + {% endblock %} {% block styles %} - - + + {% endblock %} diff --git a/resources/views/tags/edit.twig b/resources/views/tags/edit.twig index 112eb5f457..85614b5fc3 100644 --- a/resources/views/tags/edit.twig +++ b/resources/views/tags/edit.twig @@ -38,7 +38,6 @@
{{ ExpandedForm.date('date', tag.date.format('Y-m-d')) }} {{ ExpandedForm.textarea('description', tag.description) }} - {{ ExpandedForm.location('location', null, {locations: locations}) }} {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }}