Skip to content

Commit

Permalink
Merge branch 'main' into ruby-33-for-real
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead authored Aug 1, 2024
2 parents 9640459 + 7d95d1a commit 88129e8
Show file tree
Hide file tree
Showing 92 changed files with 1,099 additions and 459 deletions.
1 change: 1 addition & 0 deletions .haml-lint_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ linters:
- "app/views/admin/events/index.html.haml"
- "app/views/admin/tracks/index.html.haml"
- "app/views/admin/tracks/show.html.haml"
- "app/views/admin/registrations/index.html.haml"
- "app/views/admin/versions/_object_desc_and_link.html.haml"
- "app/views/conference_registrations/show.html.haml"
- "app/views/layouts/_admin_sidebar.html.haml"
Expand Down
128 changes: 65 additions & 63 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,47 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
actioncable (7.0.8.1)
actionpack (= 7.0.8.1)
activesupport (= 7.0.8.1)
actioncable (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.1)
actionpack (= 7.0.8.1)
activejob (= 7.0.8.1)
activerecord (= 7.0.8.1)
activestorage (= 7.0.8.1)
activesupport (= 7.0.8.1)
actionmailbox (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.1)
actionpack (= 7.0.8.1)
actionview (= 7.0.8.1)
activejob (= 7.0.8.1)
activesupport (= 7.0.8.1)
actionmailer (7.0.8.4)
actionpack (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activesupport (= 7.0.8.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.1)
actionview (= 7.0.8.1)
activesupport (= 7.0.8.1)
actionpack (7.0.8.4)
actionview (= 7.0.8.4)
activesupport (= 7.0.8.4)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.1)
actionpack (= 7.0.8.1)
activerecord (= 7.0.8.1)
activestorage (= 7.0.8.1)
activesupport (= 7.0.8.1)
actiontext (7.0.8.4)
actionpack (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.1)
activesupport (= 7.0.8.1)
actionview (7.0.8.4)
activesupport (= 7.0.8.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -61,22 +61,22 @@ GEM
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.0.8.1)
activesupport (= 7.0.8.1)
activejob (7.0.8.4)
activesupport (= 7.0.8.4)
globalid (>= 0.3.6)
activemodel (7.0.8.1)
activesupport (= 7.0.8.1)
activerecord (7.0.8.1)
activemodel (= 7.0.8.1)
activesupport (= 7.0.8.1)
activestorage (7.0.8.1)
actionpack (= 7.0.8.1)
activejob (= 7.0.8.1)
activerecord (= 7.0.8.1)
activesupport (= 7.0.8.1)
activemodel (7.0.8.4)
activesupport (= 7.0.8.4)
activerecord (7.0.8.4)
activemodel (= 7.0.8.4)
activesupport (= 7.0.8.4)
activestorage (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activesupport (= 7.0.8.4)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.1)
activesupport (7.0.8.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -113,7 +113,7 @@ GEM
bootstrap-switch-rails (3.3.3)
bootstrap3-datetimepicker-rails (4.17.47)
momentjs-rails (>= 2.8.1)
builder (3.2.4)
builder (3.3.0)
bullet (7.0.2)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
Expand Down Expand Up @@ -158,7 +158,7 @@ GEM
rest-client (>= 2.0.0)
cocoon (1.2.15)
colorize (1.1.0)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.3)
countable-rails (0.0.1)
railties (>= 3.1)
crack (1.0.0)
Expand Down Expand Up @@ -235,7 +235,7 @@ GEM
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
railties (>= 3.2)
erubi (1.12.0)
erubi (1.13.0)
execjs (2.9.1)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -290,7 +290,7 @@ GEM
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.4)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n_data (0.17.1)
simple_po_parser (~> 1.1)
Expand Down Expand Up @@ -349,7 +349,7 @@ GEM
rake
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.22.3)
minitest (5.24.1)
momentjs-rails (2.29.4.1)
railties (>= 3.1)
monetize (1.13.0)
Expand Down Expand Up @@ -379,11 +379,11 @@ GEM
next_rails (1.3.0)
colorize (>= 0.8.1)
nio4r (2.7.0)
nokogiri (1.16.3-arm64-darwin)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-darwin)
nokogiri (1.16.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-linux)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
oauth2 (2.0.9)
faraday (>= 0.17.3, < 3.0)
Expand Down Expand Up @@ -466,7 +466,7 @@ GEM
public_suffix (5.0.4)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.3)
racc (1.8.0)
rack (2.2.9)
rack-openid (1.4.2)
rack (>= 1.1.0)
Expand All @@ -475,20 +475,20 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.1)
actioncable (= 7.0.8.1)
actionmailbox (= 7.0.8.1)
actionmailer (= 7.0.8.1)
actionpack (= 7.0.8.1)
actiontext (= 7.0.8.1)
actionview (= 7.0.8.1)
activejob (= 7.0.8.1)
activemodel (= 7.0.8.1)
activerecord (= 7.0.8.1)
activestorage (= 7.0.8.1)
activesupport (= 7.0.8.1)
rails (7.0.8.4)
actioncable (= 7.0.8.4)
actionmailbox (= 7.0.8.4)
actionmailer (= 7.0.8.4)
actionpack (= 7.0.8.4)
actiontext (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activemodel (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
bundler (>= 1.15.0)
railties (= 7.0.8.1)
railties (= 7.0.8.4)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -503,9 +503,9 @@ GEM
rails-i18n (7.0.8)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.0.8.1)
actionpack (= 7.0.8.1)
activesupport (= 7.0.8.1)
railties (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand All @@ -526,7 +526,8 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.6)
rexml (3.3.2)
strscan
rolify (6.0.1)
rqrcode (2.2.0)
chunky_png (~> 1.0)
Expand Down Expand Up @@ -646,6 +647,7 @@ GEM
dante (>= 0.2.0)
multi_json (~> 1.0)
stripe (> 5, < 6)
strscan (3.1.0)
sys-uname (1.2.2)
ffi (~> 1.1)
sysexits (1.2.0)
Expand Down
44 changes: 35 additions & 9 deletions app/assets/javascripts/osem-schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ var Schedule = {
schedule_id = schedule_id_param;
},
remove: function(element) {
var e = $("#" + element);
var event_schedule_id = e.attr("event_schedule_id");
if(event_schedule_id != null){
var my_url = url + '/' + event_schedule_id;
var e = $("#" + element);
var event_schedule_id = parseInt(e.attr("event_schedule_id"));
if(event_schedule_id > 0) {
var my_url = `${url}/${event_schedule_id}`;
var success_callback = function(data) {
e.attr("event_schedule_id", null);
e.appendTo($(".unscheduled-events"));
Expand All @@ -41,18 +41,18 @@ var Schedule = {
},
add: function (previous_parent, new_parent, event) {
event.appendTo(new_parent);
var event_schedule_id = event.attr("event_schedule_id");
// Event Schedule Id could be an empty string.
var event_schedule_id = parseInt(event.attr("event_schedule_id"));
var my_url = url;
var type = 'POST';
var params = { event_schedule: {
room_id: new_parent.attr("room_id"),
start_time: (new_parent.attr("date") + ' ' + new_parent.attr("hour"))
}};
if(event_schedule_id != null){
if (event_schedule_id > 0) {
type = 'PUT';
my_url += ('/' + event_schedule_id);
}
else{
my_url += `/${event_schedule_id}`;
} else {
params['event_schedule']['event_id'] = event.attr("event_id");
params['event_schedule']['schedule_id'] = schedule_id;
}
Expand Down Expand Up @@ -80,6 +80,32 @@ $(document).ready( function() {
$('.unscheduled-events .schedule-event-delete-button').hide();
$('.non_schedulable .schedule-event-delete-button').hide();

$('#current-event-btn').on('click', function() {
var now = new Date();
var closestEvent = null;
var smallestDiff = Infinity;

$('.event-item').each(function() {
let $event = $(this), eventTimeStr = $event.data('time');

if (!eventTimeStr) { return; }

var eventTime = new Date(eventTimeStr);
var diff = Math.abs(eventTime - now);
if (diff < smallestDiff) {
smallestDiff = diff;
closestEvent = $event;
}
});

if (closestEvent) {
// Instead of relying on hash it's probably better to scroll using javascript
// Since the users and click button->scroll->click again, which won't re-scroll
$('.highlighted').removeClass('highlighted');
$(closestEvent).addClass('highlighted').get(0).scrollIntoView({ behavior: 'smooth', block: 'start' });
}
});

// set events as draggable
$('.schedule-event').not('.non_schedulable').draggable({
snap: '.schedule-room-slot',
Expand Down
4 changes: 1 addition & 3 deletions app/assets/javascripts/osem-switch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
function checkboxSwitch(selector){
$(selector).bootstrapSwitch(

);
$(selector).bootstrapSwitch();

$(selector).on('switchChange.bootstrapSwitch', function(event, state) {
var url = $(this).attr('url') + state;
Expand Down
7 changes: 7 additions & 0 deletions app/assets/stylesheets/osem-schedule.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,10 @@
h3.event-panel-title small {
line-height: 1.4;
}

#current-event-btn {
position: fixed;
bottom: 40px;
right: 40px;
z-index: 1000;
}
2 changes: 1 addition & 1 deletion app/controllers/admin/conferences_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def conference_params
:vpositions_attributes, :use_volunteers, :color,
:sponsorship_levels_attributes, :sponsors_attributes,
:registration_limit, :organization_id, :ticket_layout,
:booth_limit, :custom_css)
:booth_limit, :custom_css, :registered_attendees_message)
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/admin/event_types_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def destroy

def event_type_params
params.require(:event_type).permit(:title, :length, :minimum_abstract_length, :maximum_abstract_length,
:submission_template, :color, :conference_id, :description)
:submission_template, :color, :conference_id, :description, :enable_public_submission)
end
end
end
11 changes: 11 additions & 0 deletions app/controllers/admin/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ def toggle_attendance
end
end

def destroy
@event = Event.find(params[:id])
if @event.destroy
flash[:notice] = 'Event successfully deleted.'
redirect_to admin_conference_program_events_path(@conference.short_title)
else
flash[:alert] = 'Event could not be deleted.'
redirect_to admin_conference_program_event_path(@conference.short_title, @event)
end
end

private

def event_params
Expand Down
Loading

0 comments on commit 88129e8

Please sign in to comment.