From 4d12c5c79091e05e06b0a74c6ae69df067060a8a Mon Sep 17 00:00:00 2001 From: mjavurek <57668028+mjavurek@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:26:50 +0100 Subject: [PATCH 1/2] Update _form.html.haml: sort ordergroup names alphabetically --- app/views/group_order_articles/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/group_order_articles/_form.html.haml b/app/views/group_order_articles/_form.html.haml index e0921d4e6..197641c90 100644 --- a/app/views/group_order_articles/_form.html.haml +++ b/app/views/group_order_articles/_form.html.haml @@ -4,7 +4,7 @@ = close_button :modal %h3= t('.amount_change_for', article: @order_article.article.name) .modal-body - = form.input :ordergroup_id, as: :select, collection: Ordergroup.undeleted.map { |g| [g.name, g.id] } + = form.input :ordergroup_id, as: :select, collection: Ordergroup.undeleted.map { |g| [g.name, g.id] }.sort_by { |name, id| name.downcase } = form.input :result, hint: I18n.t('group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix? .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} From a9f631a36932576f5bcc4fc77e1ebedfb4c2734c Mon Sep 17 00:00:00 2001 From: mjavurek <57668028+mjavurek@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:16:07 +0100 Subject: [PATCH 2/2] Update _form.html.haml: replaced sort_by() by order() --- app/views/group_order_articles/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/group_order_articles/_form.html.haml b/app/views/group_order_articles/_form.html.haml index 197641c90..3dcb422dd 100644 --- a/app/views/group_order_articles/_form.html.haml +++ b/app/views/group_order_articles/_form.html.haml @@ -4,7 +4,7 @@ = close_button :modal %h3= t('.amount_change_for', article: @order_article.article.name) .modal-body - = form.input :ordergroup_id, as: :select, collection: Ordergroup.undeleted.map { |g| [g.name, g.id] }.sort_by { |name, id| name.downcase } + = form.input :ordergroup_id, as: :select, collection: Ordergroup.undeleted.order(:name).map { |g| [g.name, g.id] } = form.input :result, hint: I18n.t('group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix? .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}