diff --git a/Gemfile b/Gemfile index 6c047c6e0d2534a5beaa77a59118cc86d3519909..d7e07a97a9a873b00a8235ee8a442fe76f00041f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,11 @@ source "https://rubygems.org" -ruby '2.2.3' +ruby '2.6.5' gem 'sinatra' gem 'sinatra-contrib' gem 'activerecord', :require => 'active_record' -gem 'mysql' +gem 'mysql2' gem 'bcrypt' gem 'unicorn' gem 'pony' diff --git a/Gemfile.lock b/Gemfile.lock index 05c0eae66012a2cd5974091aa8ed2905dd1a2c1a..1ed0e8135c1b2eadece81e64e8e02ea0177a72fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,36 +1,34 @@ GEM remote: https://rubygems.org/ specs: - activemodel (4.2.6) - activesupport (= 4.2.6) - builder (~> 3.1) - activerecord (4.2.6) - activemodel (= 4.2.6) - activesupport (= 4.2.6) - arel (~> 6.0) - activesupport (4.2.6) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) + activemodel (6.0.2.1) + activesupport (= 6.0.2.1) + activerecord (6.0.2.1) + activemodel (= 6.0.2.1) + activesupport (= 6.0.2.1) + activesupport (6.0.2.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.4.0) - arel (6.0.3) - backports (3.6.8) - bcrypt (3.1.11) - builder (3.2.2) - coderay (1.1.1) + zeitwerk (~> 2.2) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + backports (3.15.0) + bcrypt (3.1.13) + coderay (1.1.2) commonjs (0.2.7) - daemons (1.2.3) - domain_name (0.5.20160310) + concurrent-ruby (1.1.5) + daemons (1.3.1) + domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - eventmachine (1.2.0.1) - ffi (1.9.10) + eventmachine (1.2.7) + ffi (1.11.3) formatador (0.2.5) - guard (2.14.0) + guard (2.16.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) - lumberjack (~> 1.0) + lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.9.12) @@ -41,95 +39,100 @@ GEM guard (~> 2.0) guard-compat (~> 1.2) less (~> 2.3) - http-cookie (1.0.2) + http-accept (1.7.0) + http-cookie (1.0.3) domain_name (~> 0.5) - i18n (0.7.0) - icalendar (2.4.1) - json (1.8.3) - kgio (2.10.0) + i18n (1.8.1) + concurrent-ruby (~> 1.0) + icalendar (2.6.1) + ice_cube (~> 0.16) + ice_cube (0.16.3) + kgio (2.11.3) less (2.6.0) commonjs (~> 0.2.7) - libv8 (3.16.14.15) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - lumberjack (1.0.10) - mail (2.6.4) - mime-types (>= 1.16, < 4) - method_source (0.8.2) - mime-types (2.99.2) - mini_portile2 (2.1.0) - minitest (5.9.0) - multi_json (1.12.1) - mysql (2.9.1) + libv8 (3.16.14.19) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + lumberjack (1.1.0) + mail (2.7.1) + mini_mime (>= 0.1.1) + method_source (0.9.2) + mime-types (3.3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.1009) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.13.0) + multi_json (1.14.1) + mustermann (1.1.1) + ruby2_keywords (~> 0.0.1) + mysql2 (0.5.3) nenv (0.3.0) netrc (0.11.0) - nokogiri (1.6.8) - mini_portile2 (~> 2.1.0) - pkg-config (~> 1.1.7) - notiffany (0.1.0) + nokogiri (1.10.7) + mini_portile2 (~> 2.4.0) + notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - pkg-config (1.1.7) - pony (1.11) + pony (1.13.1) mail (>= 2.0) - pry (0.10.3) + pry (0.12.2) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - rack (1.6.4) - rack-cas (0.13.0) + method_source (~> 0.9.0) + public_suffix (4.0.3) + rack (2.0.8) + rack-cas (0.16.1) addressable (~> 2.3) nokogiri (~> 1.5) - rack (~> 1.3) - rack-protection (1.5.3) + rack (>= 1.3) + rack-protection (2.0.8.1) rack - rack-test (0.6.3) - rack (>= 1.0) - raindrops (0.16.0) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) + raindrops (0.19.1) + rb-fsevent (0.10.3) + rb-inotify (0.10.1) + ffi (~> 1.0) ref (2.0.0) - rest-client (1.8.0) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - ruby_dep (1.3.1) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + ruby2_keywords (0.0.2) shellany (0.0.1) - shotgun (0.9.1) + shotgun (0.9.2) rack (>= 1.0) - sinatra (1.4.7) - rack (~> 1.5) - rack-protection (~> 1.4) - tilt (>= 1.3, < 3) - sinatra-contrib (1.4.7) - backports (>= 2.0) + sinatra (2.0.8.1) + mustermann (~> 1.0) + rack (~> 2.0) + rack-protection (= 2.0.8.1) + tilt (~> 2.0) + sinatra-contrib (2.0.8.1) + backports (>= 2.8.2) multi_json - rack-protection - rack-test - sinatra (~> 1.4.0) - tilt (>= 1.3, < 3) - slop (3.6.0) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) + mustermann (~> 1.0) + rack-protection (= 2.0.8.1) + sinatra (= 2.0.8.1) + tilt (~> 2.0) + therubyracer (0.12.3) + libv8 (~> 3.16.14.15) ref - thin (1.7.0) + thin (1.7.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (0.19.1) - thread_safe (0.3.5) - tilt (2.0.5) - tzinfo (1.2.2) + thor (1.0.1) + thread_safe (0.3.6) + tilt (2.0.10) + tzinfo (1.2.6) thread_safe (~> 0.1) unf (0.1.4) unf_ext - unf_ext (0.0.7.2) - unicorn (5.1.0) + unf_ext (0.0.7.6) + unicorn (5.5.2) kgio (~> 2.6) raindrops (~> 0.7) + zeitwerk (2.2.2) PLATFORMS ruby @@ -140,7 +143,7 @@ DEPENDENCIES guard guard-less icalendar - mysql + mysql2 pony rack-cas rest-client @@ -152,7 +155,7 @@ DEPENDENCIES unicorn RUBY VERSION - ruby 2.2.3p173 + ruby 2.6.5p114 BUNDLED WITH - 1.14.6 + 1.17.3 diff --git a/README.md b/README.md index 73a3c7a7972ad0a1665980434bd062b77d3b95b1..213466755cdf3f66b7068c538ed5ef2d1bc10032 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ Installation Using local resources --------------------- 0. Run `xcode-select --install`. Congratulations, you have saved yourself 5000 insanity points. -1. Get the right ruby on your machine. UNL Resource Scheduler currently runs on Ruby 2.2.3. Get RVM on your machine with `\curl -sSL https://get.rvm.io | bash`. -2. Now using RVM, install the ruby with `rvm install 2.2.3`. +1. Get the right ruby on your machine. UNL Resource Scheduler currently runs on Ruby 2.6.5. Get RVM on your machine with `\curl -sSL https://get.rvm.io | bash`. +2. Now using RVM, install the ruby with `rvm install 2.6.5`. 3. You probably do not have the `bundler` gem. Check with `bundle`. If not, install it with `gem install bundler`. 4. In the project root, install the gems using `bundle install`. 5. Create a mysql database you'd like to use, you can typically use one on your computer. `brew install mysql` if necessary. diff --git a/app.rb b/app.rb index 0e502999d931030c50c871561d7fb082048dbd06..c2602c7685c7129f8840e5df6407b99c31a964a7 100644 --- a/app.rb +++ b/app.rb @@ -29,6 +29,10 @@ DIRECTORY_URL = 'https://directory.unl.edu/' NIS_SS_ID = ServiceSpace.where(:name => 'Innovation Studio').first.id NIS_TOOL_RESOURCE_CLASS_ID = 1 +HALF_HOUR_HEIGHT = 28 # pixel height of half-hour sections in calendar. DO NOT CHANGE RESPONSIVELY +SIX_AM_MINUTES = 360 # start time of calendar +EIGHT_PM_MINUTES = 1200 # end time of calendar + # this gives the user messages def flash(type, header, message) session["notice"] ||= [] diff --git a/config/config.json b/config/config.json index 235d9fb44e2214f9605e060b97a7db59231f2b38..06dcf7e8da26ddf8ba052b629e25835c4886d257 100644 --- a/config/config.json +++ b/config/config.json @@ -1,6 +1,6 @@ { "database" : { - "adapter" : "mysql", + "adapter" : "mysql2", "host" : "localhost", "username" : "root", "password" : "", diff --git a/views/calendar.erb b/views/calendar.erb index c669623830b151e6ddde776b852c5ff31f03e86c..cc288c2e9a780e20e0cd80ef3fcf1e189f46f9b0 100644 --- a/views/calendar.erb +++ b/views/calendar.erb @@ -1,10 +1,6 @@ <% events_groups = events.group_by do |event| event.start_time.in_time_zone.strftime("%Y/%m/%d") -end - -HALF_HOUR_HEIGHT = 28 # pixel height of half-hour sections in calendar. DO NOT CHANGE RESPONSIVELY -SIX_AM_MINUTES = 360 # start time of calendar -EIGHT_PM_MINUTES = 1200 # end time of calendar +end %>
diff --git a/views/reserve.erb b/views/reserve.erb index 952c653b987315555cbcc2adc14bbb7a753410ce..c73b10c038f7fedd71dc93999d5ef1c68089dccd 100644 --- a/views/reserve.erb +++ b/views/reserve.erb @@ -12,11 +12,7 @@ unless reservation.nil? end start_hour += 12 if start_hour == 0 start_minute = reservation.start_time.in_time_zone.min -end - -HALF_HOUR_HEIGHT = 28 # pixel height of half-hour sections in calendar. DO NOT CHANGE RESPONSIVELY -SIX_AM_MINUTES = 360 # start time of calendar -EIGHT_PM_MINUTES = 1200 # end time of calendar +end %>

<%= reservation.nil? ? 'Reserve Time for ' : 'Edit Reservation for ' %><%= resource.name %>

diff --git a/views/resource_calendar.erb b/views/resource_calendar.erb index c1758b03239c8d4017ab681a8e34545cf073137a..1383c02ab90fd693f90cd73955bb82dbfefd13ef 100644 --- a/views/resource_calendar.erb +++ b/views/resource_calendar.erb @@ -1,10 +1,6 @@ <% reservation_groups = reservations.group_by do |reservation| reservation.start_time.in_time_zone.strftime("%Y/%m/%d") -end - -HALF_HOUR_HEIGHT = 28 # pixel height of half-hour sections in calendar. DO NOT CHANGE RESPONSIVELY -SIX_AM_MINUTES = 360 # start time of calendar -EIGHT_PM_MINUTES = 1200 # end time of calendar +end %> <% if kiosk_mode %>