diff --git a/assets/app.js b/assets/app.js index dc44da08cc2031eccc3c88d613b8d0e2459fddac..7c659ed0f0a45f0b6174d9916d613388b1c629d8 100644 --- a/assets/app.js +++ b/assets/app.js @@ -19,3 +19,9 @@ import './styles/app.scss'; // start the Stimulus application import './bootstrap'; + +$(function() { + $('select.choice-auto-submit').on('change', function () { + $(this).parents('form').submit(); + }); +}) diff --git a/assets/styles/app.scss b/assets/styles/app.scss index 84e8b43719c15a4f54829ed46493dcbf2e72aba1..0896d1f31098e5465c821504d95235328050359d 100644 --- a/assets/styles/app.scss +++ b/assets/styles/app.scss @@ -28,14 +28,6 @@ form input[type=checkbox]{ border: 1px solid; } -button[type=submit]{ - border: none; - border-radius: 3px; - color: #FFF; - opacity: 1; - background: #3B8C7E; -} - .memorekall-logo { height: 200px; } diff --git a/src/Form/FilterByGroupFormType.php b/src/Form/FilterByGroupFormType.php index 7e17f84042e952c6ca6b2c021fb9d3bf2ec0fb1e..e2f8087a1df2c0d3783d688355eb9bbb7a59cefc 100644 --- a/src/Form/FilterByGroupFormType.php +++ b/src/Form/FilterByGroupFormType.php @@ -27,12 +27,7 @@ class FilterByGroupFormType extends AbstractType 'choice_value' => 'name', 'choice_name' => 'name', 'expanded' => false - ]) - ->add( - 'filter', - SubmitType::class, - ['label' => 'groups.filter.button'] - ); + ]); } public function configureOptions(OptionsResolver $resolver): void diff --git a/templates/capsule/index.html.twig b/templates/capsule/index.html.twig index 66f6ed155b010b7db57320239174c14adb268690..b5e815ae0e194a448131e0184fcd78cf34d0c73e 100644 --- a/templates/capsule/index.html.twig +++ b/templates/capsule/index.html.twig @@ -17,8 +17,7 @@ {% if current_user.getGroups()|length > 1 %} <div class="mb-3 mb-sm-0"> {{ form_start(filterByGroupForm, {'attr': {novalidate: 'novalidate', 'class': 'd-flex flex-column flex-sm-row mb-0 align-items-center pt-3'}}) }} - {{ form_row(filterByGroupForm.name, {'attr': {'class': ''}}) }} - {{ form_row(filterByGroupForm.filter, {'attr': {'class': 'ms-2'}}) }} + {{ form_row(filterByGroupForm.name, {'attr': {'class': 'choice-auto-submit'}}) }} {{ form_end(filterByGroupForm) }} </div> {% endif %}