Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 40 additions & 39 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,72 +1,73 @@
source 'https://rubygems.org'
source "https://rubygems.org"

ruby '3.4.1'
ruby "3.4.1"

gem 'rails', '~> 7.2'
gem 'rack', '~> 2.2'
gem "rails", "~> 7.2"
gem "rack", "~> 2.2"

gem 'pg'
gem 'unicorn'
gem "pg"
gem "unicorn"

# Use SCSS for stylesheets
gem 'sassc-rails'
gem 'terser', '~> 1.2'
gem "sassc-rails"
gem "terser", "~> 1.2"
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
gem "jquery-rails"

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem "turbolinks"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2'
gem "jbuilder", "~> 2"

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
gem "spring", group: :development

gem 'haml', '~> 6'
gem 'formtastic'
gem 'responders', '~> 3.1'
gem "haml", "~> 6"
gem "formtastic"
gem "responders", "~> 3.1"

gem 'fancybox2-rails'
gem "fancybox2-rails"

gem 'annealer'
gem "annealer"

gem 'icalendar', '~> 2.4'
gem 'redcarpet', '~> 3.1'
gem 'bcrypt-ruby', '~> 3.1'
gem 'authlogic', '~> 6'
gem 'cancancan'
gem 'csv', '~> 3.3'
gem 'nokogiri'
gem "icalendar", "~> 2.4"
gem "redcarpet", "~> 3.1"
gem "bcrypt-ruby", "~> 3.1"
gem "authlogic", "~> 6"
gem "cancancan"
gem "csv", "~> 3.3"
gem "nokogiri"

# active admin
gem 'devise'
gem 'activeadmin', '4.0.0.beta21'
gem "devise"
gem "activeadmin", "4.0.0.beta21"

# Asset pipeline for ActiveAdmin v4
gem 'cssbundling-rails'
gem 'importmap-rails'
gem "cssbundling-rails"
gem "importmap-rails"

group :development, :test do
gem 'ffaker'
gem 'ruby-progressbar', require: false
gem "ffaker"
gem "ruby-progressbar", require: false
gem "rspec-rails", "~> 7.1"
gem 'rails-controller-testing'
gem 'capybara'
gem 'pry'
gem "rails-controller-testing"
gem "capybara"
gem "pry"
gem "simplecov", "~> 0.22.0"
gem "letter_opener", "~> 1.10"
gem "standard"
end

group :test do
gem 'shoulda-matchers'
gem 'factory_bot_rails'
gem 'database_cleaner'
gem "shoulda-matchers"
gem "factory_bot_rails"
gem "database_cleaner"
gem "selenium-webdriver", "~> 4.9"
gem 'puma'
gem "puma"
gem "benchmark", "~> 0.4"
end

#https://devcenter.heroku.com/articles/rails-4-asset-pipeline
gem 'rails_12factor', group: :production
# https://devcenter.heroku.com/articles/rails-4-asset-pipeline
gem "rails_12factor", group: :production
43 changes: 43 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ GEM
annealer (0.3)
arbre (2.2.1)
activesupport (>= 7.0)
ast (2.4.3)
authlogic (6.6.0)
activemodel (>= 7.2, < 8.2)
activerecord (>= 7.2, < 8.2)
Expand Down Expand Up @@ -198,6 +199,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.19.8)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand All @@ -211,12 +213,14 @@ GEM
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
kgio (2.11.4)
language_server-protocol (3.17.0.5)
launchy (3.1.0)
addressable (~> 2.8)
childprocess (~> 5.0)
logger (~> 1.6)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
lint_roller (1.1.0)
logger (1.7.0)
loofah (2.25.1)
crass (~> 1.0.2)
Expand Down Expand Up @@ -264,6 +268,10 @@ GEM
racc (~> 1.4)
orm_adapter (0.5.0)
ostruct (0.6.1)
parallel (1.28.0)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
pg (1.5.9)
pp (0.6.3)
prettyprint
Expand Down Expand Up @@ -327,6 +335,7 @@ GEM
thor (~> 1.0, >= 1.2.2)
tsort (>= 0.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
raindrops (0.20.1)
rake (13.3.1)
ransack (4.3.0)
Expand Down Expand Up @@ -364,6 +373,24 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.2)
rubocop (1.84.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
ruby-progressbar (1.13.0)
rubyzip (2.4.1)
sassc (2.4.0)
Expand Down Expand Up @@ -398,6 +425,18 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
standard (1.54.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.84.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.8)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.9.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.26.0)
stringio (3.2.0)
temple (0.10.3)
terser (1.2.5)
Expand All @@ -411,6 +450,9 @@ GEM
turbolinks-source (5.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
Expand Down Expand Up @@ -479,6 +521,7 @@ DEPENDENCIES
shoulda-matchers
simplecov (~> 0.22.0)
spring
standard
terser (~> 1.2)
turbolinks
unicorn
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require File.expand_path("../config/application", __FILE__)

Sessionizer::Application.load_tasks
1 change: 0 additions & 1 deletion app/admin/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@
end
f.actions
end

end
4 changes: 2 additions & 2 deletions app/admin/categories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
row(:legacy, &:legacy?)
end

event_categories = category.event_categories.includes(:event).order('events.date DESC')
event_categories = category.event_categories.includes(:event).order("events.date DESC")
session_counts = category.sessions.group(:event_id).count

panel "Events Using This Category (#{event_categories.size})" do
Expand All @@ -47,7 +47,7 @@
end
column "# of Sessions" do |ec|
count = session_counts[ec.event_id] || 0
link_to count, admin_sessions_path(q: { event_id_eq: ec.event_id, categorizations_category_id_eq: ec.category_id })
link_to count, admin_sessions_path(q: {event_id_eq: ec.event_id, categorizations_category_id_eq: ec.category_id})
end
end
end
Expand Down
36 changes: 18 additions & 18 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
row "# of Sessions" do |event|
active_count = event.sessions.count
canceled_count = event.sessions.with_canceled.canceled.count
text_node link_to(active_count, admin_sessions_path(q: { event_id_eq: event.id }))
text_node link_to(active_count, admin_sessions_path(q: {event_id_eq: event.id}))
text_node " (+#{canceled_count} canceled)" if canceled_count > 0
end
row "# of Rooms" do |event|
Expand All @@ -32,7 +32,7 @@
end
end

panel ("Current Event Settings (#{link_to 'edit', edit_admin_setting_path(1)})").html_safe do
panel "Current Event Settings (#{link_to "edit", edit_admin_setting_path(1)})".html_safe do
attributes_table_for Settings.first do
row "Allow New Sessions" do
settings.allow_new_sessions
Expand All @@ -53,35 +53,35 @@
end
end

panel ("#{link_to 'Current Event Sessions', admin_sessions_path(q: { event_id_eq: Event.current_event.id })} (#{Event.current_event.sessions.with_canceled.count})").html_safe do
panel "#{link_to "Current Event Sessions", admin_sessions_path(q: {event_id_eq: Event.current_event.id})} (#{Event.current_event.sessions.with_canceled.count})".html_safe do
# Define allowed sort columns and their database equivalents
sortable_columns = {
'title' => 'sessions.title',
'attendances_count' => 'sessions.attendances_count',
'timeslot_id' => 'sessions.timeslot_id',
'room' => 'rooms.name',
'created_at' => 'sessions.created_at'
"title" => "sessions.title",
"attendances_count" => "sessions.attendances_count",
"timeslot_id" => "sessions.timeslot_id",
"room" => "rooms.name",
"created_at" => "sessions.created_at"
}

# Get sort column and direction from params, with validation
raw_sort = params[:order]&.gsub(/_desc|_asc/, '') # Remove direction suffix
raw_sort = params[:order]&.gsub(/_desc|_asc/, "") # Remove direction suffix

# If sort param exists, use it; otherwise use default sort (timeslot, room capacity,then votes)
order_clause = if params[:order].present?
sort_column = sortable_columns[raw_sort] || 'sessions.timeslot_id'
sort_direction = params[:order]&.end_with?('desc') ? 'desc' : 'asc'
sort_column = sortable_columns[raw_sort] || "sessions.timeslot_id"
sort_direction = params[:order]&.end_with?("desc") ? "desc" : "asc"
Arel.sql("#{sort_column} #{sort_direction}")
else
Arel.sql('sessions.timeslot_id, rooms.capacity DESC, sessions.canceled_at DESC, sessions.attendances_count DESC')
Arel.sql("sessions.timeslot_id, rooms.capacity DESC, sessions.canceled_at DESC, sessions.attendances_count DESC")
end

sessions = Event.includes(:sessions)
.current_event
.sessions
.with_canceled
.includes(:presenters, :attendances, :timeslot, :room)
.joins('LEFT JOIN rooms ON rooms.id = sessions.room_id')
.order(order_clause)
.current_event
.sessions
.with_canceled
.includes(:presenters, :attendances, :timeslot, :room)
.joins("LEFT JOIN rooms ON rooms.id = sessions.room_id")
.order(order_clause)

table_for sessions, sortable: true do
column :title, sortable: :title do |session|
Expand Down
8 changes: 4 additions & 4 deletions app/admin/event_categories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
menu parent: "Events", priority: 4

config.batch_actions = false
config.sort_order = 'position_asc'
config.sort_order = "position_asc"

permit_params :event_id, :category_id, :position

Expand All @@ -16,15 +16,15 @@ def scoped_collection

def update
update! do |format|
format.html { redirect_to admin_event_categories_path(q: { event_id_eq: resource.event_id }) }
format.html { redirect_to admin_event_categories_path(q: {event_id_eq: resource.event_id}) }
end
end
end

index do
session_counts = Categorization
.joins(:session)
.where(sessions: { event_id: collection.map(&:event_id).uniq, canceled_at: nil })
.where(sessions: {event_id: collection.map(&:event_id).uniq, canceled_at: nil})
.group("sessions.event_id", :category_id)
.count

Expand All @@ -35,7 +35,7 @@ def update
column :position
column "# of Sessions" do |ec|
count = session_counts[[ec.event_id, ec.category_id]] || 0
link_to count, admin_sessions_path(q: { event_id_eq: ec.event_id, categorizations_category_id_eq: ec.category_id })
link_to count, admin_sessions_path(q: {event_id_eq: ec.event_id, categorizations_category_id_eq: ec.category_id})
end
actions
end
Expand Down
Loading
Loading