From 5bd922d109dc75d2376a98766d2ccb611b6a0b13 Mon Sep 17 00:00:00 2001 From: Thomas Rupprecht Date: Sat, 10 Dec 2022 02:24:20 +0100 Subject: [PATCH] code improvements unify lowercase variant of form method post remove duplicate class selector improve comments --- includes/sys_template.php | 1 - resources/assets/js/forms.js | 11 +++++++---- resources/views/admin/log.twig | 2 +- resources/views/admin/schedule/load.twig | 2 +- resources/views/pages/settings/oauth.twig | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/includes/sys_template.php b/includes/sys_template.php index 412615d6..4071f1bf 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -120,7 +120,6 @@ function progress_bar($valuemin, $valuemax, $valuenow, $class = '', $content = ' * * @param string $icon_name * @param string $class - * * @return string */ function icon(string $icon_name, string $class = ''): string diff --git a/resources/assets/js/forms.js b/resources/assets/js/forms.js index 3e41ef3f..9de1ea48 100644 --- a/resources/assets/js/forms.js +++ b/resources/assets/js/forms.js @@ -111,7 +111,7 @@ ready(() => { }); }); -/* +/** * Button to set current time in time input fields. */ ready(() => { @@ -152,7 +152,7 @@ ready(() => { */ ready(() => { [ - ['welcome-title', '.btn-group.btn-group .btn.d-none'], + ['welcome-title', '.btn-group .btn.d-none'], ['settings-title', '.user-settings .nav-item'], ['oauth-settings-title', 'table tr.d-none'], ].forEach(([id, selector]) => { @@ -183,8 +183,11 @@ ready(() => { return; } - const onChange = (e) => { - localStorage.setItem('collapseShiftsFilterSelect', e.type); + /** + * @param {Event} event + */ + const onChange = (event) => { + localStorage.setItem('collapseShiftsFilterSelect', event.type); }; document.getElementById('collapseShiftsFilterSelect') diff --git a/resources/views/admin/log.twig b/resources/views/admin/log.twig index bb723000..e7bc240c 100644 --- a/resources/views/admin/log.twig +++ b/resources/views/admin/log.twig @@ -11,7 +11,7 @@
-
+ {{ csrf() }} {{ f.input('search', __('form.search'), 'text', {'value': search, 'hide_label': true}) }} diff --git a/resources/views/admin/schedule/load.twig b/resources/views/admin/schedule/load.twig index 2d09d771..4592af3c 100644 --- a/resources/views/admin/schedule/load.twig +++ b/resources/views/admin/schedule/load.twig @@ -4,7 +4,7 @@ {% block title %}{{ __('schedule.import.load.title') }}{% endblock %} {% block row_content %} - + {{ csrf() }}
diff --git a/resources/views/pages/settings/oauth.twig b/resources/views/pages/settings/oauth.twig index a2c68532..929a3a80 100644 --- a/resources/views/pages/settings/oauth.twig +++ b/resources/views/pages/settings/oauth.twig @@ -32,13 +32,13 @@ {% if not user.oauth.contains('provider', name) %} - + {{ csrf() }} {{ f.submit(__('form.connect'), {'size' : 'sm'}) }} {% else %} -
+ {{ csrf() }} {{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'size' : 'sm'}) }}