code improvements

unify lowercase variant of form method post
remove duplicate class selector
improve comments
This commit is contained in:
Thomas Rupprecht 2022-12-10 02:24:20 +01:00 committed by Igor Scheller
parent 4c3dc1e081
commit 5bd922d109
5 changed files with 11 additions and 9 deletions

View File

@ -120,7 +120,6 @@ function progress_bar($valuemin, $valuemax, $valuenow, $class = '', $content = '
* *
* @param string $icon_name * @param string $icon_name
* @param string $class * @param string $class
*
* @return string * @return string
*/ */
function icon(string $icon_name, string $class = ''): string function icon(string $icon_name, string $class = ''): string

View File

@ -111,7 +111,7 @@ ready(() => {
}); });
}); });
/* /**
* Button to set current time in time input fields. * Button to set current time in time input fields.
*/ */
ready(() => { ready(() => {
@ -152,7 +152,7 @@ ready(() => {
*/ */
ready(() => { ready(() => {
[ [
['welcome-title', '.btn-group.btn-group .btn.d-none'], ['welcome-title', '.btn-group .btn.d-none'],
['settings-title', '.user-settings .nav-item'], ['settings-title', '.user-settings .nav-item'],
['oauth-settings-title', 'table tr.d-none'], ['oauth-settings-title', 'table tr.d-none'],
].forEach(([id, selector]) => { ].forEach(([id, selector]) => {
@ -183,8 +183,11 @@ ready(() => {
return; return;
} }
const onChange = (e) => { /**
localStorage.setItem('collapseShiftsFilterSelect', e.type); * @param {Event} event
*/
const onChange = (event) => {
localStorage.setItem('collapseShiftsFilterSelect', event.type);
}; };
document.getElementById('collapseShiftsFilterSelect') document.getElementById('collapseShiftsFilterSelect')

View File

@ -11,7 +11,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="mb-3"> <div class="mb-3">
<form method="POST" action="{{ url('/admin/logs') }}" class="form-inline"> <form method="post" action="{{ url('/admin/logs') }}" class="form-inline">
{{ csrf() }} {{ csrf() }}
{{ f.input('search', __('form.search'), 'text', {'value': search, 'hide_label': true}) }} {{ f.input('search', __('form.search'), 'text', {'value': search, 'hide_label': true}) }}

View File

@ -4,7 +4,7 @@
{% block title %}{{ __('schedule.import.load.title') }}{% endblock %} {% block title %}{{ __('schedule.import.load.title') }}{% endblock %}
{% block row_content %} {% block row_content %}
<form method="POST" action="{{ url('/admin/schedule/import/' ~ schedule_id) }}"> <form method="post" action="{{ url('/admin/schedule/import/' ~ schedule_id) }}">
{{ csrf() }} {{ csrf() }}
<div class="col-lg-12"> <div class="col-lg-12">

View File

@ -32,13 +32,13 @@
</td> </td>
<td> <td>
{% if not user.oauth.contains('provider', name) %} {% if not user.oauth.contains('provider', name) %}
<form method="POST" action="{{ url('/oauth/' ~ name ~ '/connect') }}"> <form method="post" action="{{ url('/oauth/' ~ name ~ '/connect') }}">
{{ csrf() }} {{ csrf() }}
{{ f.submit(__('form.connect'), {'size' : 'sm'}) }} {{ f.submit(__('form.connect'), {'size' : 'sm'}) }}
</form> </form>
{% else %} {% else %}
<form method="POST" action="{{ url('/oauth/' ~ name ~ '/disconnect') }}"> <form method="post" action="{{ url('/oauth/' ~ name ~ '/disconnect') }}">
{{ csrf() }} {{ csrf() }}
{{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'size' : 'sm'}) }} {{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'size' : 'sm'}) }}