Skip to content
Snippets Groups Projects
Verified Commit 762941e1 authored by Felix Eckhofer's avatar Felix Eckhofer :man_dancing:
Browse files

Allow stages to be sorted

parent b3f04539
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,8 @@ module Pretalx
# This is where canceled sessions are moved to, so we can still easily access them
canceled_stage = Stage.find_or_initialize_by(conference:, ref_id: 'c3lingo_canceled').tap do |stage_|
stage_.name = 'Canceled talk'
stage_.description = 'A dummy stage where talks move to when the disappear from the Fahrplan'
stage_.description = 'A dummy stage where talks move to when they disappear from the Fahrplan'
stage_.weight = 1000 # Sort it all the way to the right
stage_.save!
end
......
......@@ -126,7 +126,10 @@ current_time = Time.zone.now.in_time_zone(@conference.time_zone)
<div class="stages">
<% @sessions_by_date_and_stage[date].each do |stage, sessions| %>
<%
@sessions_by_date_and_stage[date].keys.sort_by(&:weight).each do |stage|
sessions = @sessions_by_date_and_stage[date][stage]
%>
<div class="stage">
<h4 class="sticky top-0 bg-white bg-opacity-70 w-full z-30"><%= stage.name %></h4>
<div class="stage-sessions">
......
class AddWeightToStages < ActiveRecord::Migration[7.1]
def change
add_column :stages, :weight, :integer, null: false, default: 50
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_12_23_004818) do
ActiveRecord::Schema[7.1].define(version: 2024_12_23_202350) do
create_table "assignments", force: :cascade do |t|
t.integer "user_id", null: false
t.integer "session_id", null: false
......@@ -265,6 +265,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_12_23_004818) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "ref_id"
t.integer "weight", default: 50, null: false
t.index ["conference_id"], name: "index_stages_on_conference_id"
t.index ["ref_id", "conference_id"], name: "index_stages_on_ref_id_and_conference_id", unique: true
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment