This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "openssl" | |
require "time" | |
begin | |
require "origami" | |
rescue LoadError | |
abort "origami not installed: gem install origami" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# https://johnbeatty.co/2018/03/09/stimulus-js-tutorial-how-do-i-drag-and-drop-items-in-a-list/ | |
.grid--draggable{ 'data-controller': 'seating-plan', | |
'data-seating-plan-endpoint': endpoint, | |
'data-action': 'dragstart->seating-plan#onDragStart dragover->seating-plan#onDragOver dragenter->seating-plan#onDragEnter drop->seating-plan#onDrop dragend->seating-plan#onDragEnd' } | |
- seating_plan.each do |seat| | |
- if seat[:is_empty] | |
.grid__item.grid__item--empty{ 'data-row': seat[:row], | |
'data-col': seat[:col], | |
style: "grid-row: #{seat[:row]}; grid-column: #{seat[:col]};", | |
class: ('grid__item--border' if seat[:is_border]) } |