summaryrefslogtreecommitdiff
path: root/app/controllers/menu_items_controller.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-30 19:52:09 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-30 19:52:09 +0200
commitbc116a2acfe2450d85229379d54c3344e485db6a (patch)
treebd49c465f45bcec6251325d406c7de3cd6733ddf /app/controllers/menu_items_controller.rb
parent6a1102e69230ed62138b8e6aec8a6348e8571b23 (diff)
Replaces the grey slab and filled-box handle with the house card idiom,
a tabler grip and icon-only edit and delete actions. Shows each item's non-default translations muted below the title, read from the translation rows rather than the accessor so the fallback chain cannot disguise a missing label as a translated one. Adds move up/down buttons via acts_as_list, the single-pointer alternative WCAG 2.5.7 requires: the jQuery UI sortable binds mouse events only, so dragging works neither on touch nor from the keyboard. The grip is hidden below the desktop breakpoint for the same reason. The sort handler dropped dataType: "json" against a head :ok response, which sent every success down the error path, and now reloads so the disabled chevron states match the stored order after a drag.
Diffstat (limited to 'app/controllers/menu_items_controller.rb')
-rw-r--r--app/controllers/menu_items_controller.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/menu_items_controller.rb b/app/controllers/menu_items_controller.rb
index 48018800..f169e0ca 100644
--- a/app/controllers/menu_items_controller.rb
+++ b/app/controllers/menu_items_controller.rb
@@ -54,6 +54,16 @@ class MenuItemsController < ApplicationController
54 head :ok 54 head :ok
55 end 55 end
56 56
57 def move_up
58 MenuItem.find(params[:id]).move_higher
59 redirect_to menu_items_path
60 end
61
62 def move_down
63 MenuItem.find(params[:id]).move_lower
64 redirect_to menu_items_path
65 end
66
57 private 67 private
58 68
59 def menu_item_params 69 def menu_item_params