From 597f8b4186c798768a80f7083e0775e0cb01ba34 Mon Sep 17 00:00:00 2001 From: Bradley Bain Date: Sun, 3 Nov 2019 23:37:41 -0800 Subject: [PATCH 1/2] ASPC Rideshare visible for admins --- app/models/ride.rb | 6 +++--- app/views/rides/edit.html.erb | 2 +- app/views/rides/index.html.haml | 7 ++++--- app/views/rides/new.html.haml | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/models/ride.rb b/app/models/ride.rb index 24380cd3..f54512e5 100644 --- a/app/models/ride.rb +++ b/app/models/ride.rb @@ -19,11 +19,11 @@ def is_flighttime_valid def is_aspc_valid return unless is_aspc - errors.add(:is_aspc, "ASPC-Funded Ride Booking through this website is currently disabled"); # Change these depending on the program date - aspc_ride_start_date = Date.new(2018, 12, 17) - aspc_ride_end_date = Date.new(2018, 12, 22) + # TODO: set this in admin panel + aspc_ride_start_date = Date.new(2019, 12, 17) + aspc_ride_end_date = Date.new(2019, 12, 22) if not flighttime.to_date.between? aspc_ride_start_date, aspc_ride_end_date errors.add(:flighttime, "falls outside the range of the program dates (#{aspc_ride_start_date.strftime("%B %d, %Y") + " - " + aspc_ride_end_date.strftime("%B %d, %Y")})") diff --git a/app/views/rides/edit.html.erb b/app/views/rides/edit.html.erb index 2502c5b1..ee663bac 100644 --- a/app/views/rides/edit.html.erb +++ b/app/views/rides/edit.html.erb @@ -3,4 +3,4 @@ <% end %> -<%= render 'form', :hide_aspc_signup => true %> \ No newline at end of file +<%= render 'form', :hide_aspc_signup => current_user.is_admin %> \ No newline at end of file diff --git a/app/views/rides/index.html.haml b/app/views/rides/index.html.haml index 981a7955..0b62d296 100644 --- a/app/views/rides/index.html.haml +++ b/app/views/rides/index.html.haml @@ -36,7 +36,7 @@ .section .columns - .column.is-12 + .column.is-5 .index-notification %p %strong ASPC is excited to reintroduce the 5C Rideshare service @@ -46,13 +46,14 @@ %br %p The aim of this service is to allow students going to and from Ontario or LAX to connect with each other and split the cost of the ride – simply sign in and create or join a ride at a time which works for you! - / + + - if current_user.is_admin .column.is-2 .column-divider .column.is-5 .index-notification %p - %strong Pomona Students: Youx're eligible for a free ride over winter break! + %strong Pomona Students: You're eligible for a free ride over winter break! %br %p For more details, sign in with your Pomona login and diff --git a/app/views/rides/new.html.haml b/app/views/rides/new.html.haml index a644864d..1b286223 100644 --- a/app/views/rides/new.html.haml +++ b/app/views/rides/new.html.haml @@ -1,5 +1,5 @@ =content_for :header do =render 'layouts/page_header', :title => "Create a Ride" - + #new-ride - = render 'rides/form', :hide_aspc_signup => true \ No newline at end of file + = render 'rides/form', :hide_aspc_signup => current_user.is_admin \ No newline at end of file From 9ea0510813f305698f218776e82ae157b609fd93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2019 07:43:52 +0000 Subject: [PATCH 2/2] Bump loofah from 2.0.3 to 2.3.1 Bumps [loofah](https://github.com/flavorjones/loofah) from 2.0.3 to 2.3.1. - [Release notes](https://github.com/flavorjones/loofah/releases) - [Changelog](https://github.com/flavorjones/loofah/blob/master/CHANGELOG.md) - [Commits](https://github.com/flavorjones/loofah/compare/v2.0.3...v2.3.1) Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c23a158d..b8132a86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -97,6 +97,7 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.0.5) + crass (1.0.5) cucumber (2.4.0) builder (>= 2.1.2) cucumber-core (~> 1.5.0) @@ -159,7 +160,8 @@ GEM activerecord kaminari-core (= 1.1.1) kaminari-core (1.1.1) - loofah (2.0.3) + loofah (2.3.1) + crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.6.5) mime-types (>= 1.16, < 4) @@ -167,7 +169,7 @@ GEM mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) - mini_portile2 (2.1.0) + mini_portile2 (2.4.0) minitest (5.10.1) multi_json (1.12.1) multi_test (0.1.2) @@ -176,8 +178,8 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (5.0.2) - nokogiri (1.7.1) - mini_portile2 (~> 2.1.0) + nokogiri (1.10.5) + mini_portile2 (~> 2.4.0) notifier (0.5.2) oauth2 (1.3.1) faraday (>= 0.8, < 0.12)