From a75c4585a9c6b6b0a46ecd3b18d87e4db7f3d7a6 Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai <53624695+Sami-Aiyathurai@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:56:59 -0400 Subject: [PATCH 01/29] Update README.md Added name --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 85f6c86ae..650231a44 100644 --- a/README.md +++ b/README.md @@ -155,3 +155,5 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses. + +Sami Aiyathurai From a81a8ea22517573e07198fa9a3110ab1135f181b Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai <53624695+Sami-Aiyathurai@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:59:40 -0400 Subject: [PATCH 02/29] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 650231a44..d9f01f9d9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # ValetBike +Calicoders Smith College CSC223: Software Engineering\ Starter App for ValetBike project From 12ad31eebffe50d071b94dc574399534de4cf495 Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai Date: Thu, 2 Nov 2023 11:46:07 -0400 Subject: [PATCH 03/29] testing --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d9f01f9d9..5d900aaed 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # ValetBike Calicoders +local version testing Smith College CSC223: Software Engineering\ Starter App for ValetBike project From af1b8c9e91b5b6f6d5ca4bae3611d3ec4411a25f Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai Date: Thu, 2 Nov 2023 14:44:27 -0400 Subject: [PATCH 04/29] Who knows --- Gemfile.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile.lock b/Gemfile.lock index c3e104938..c90d46043 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -223,6 +223,7 @@ GEM PLATFORMS arm64-darwin-20 + arm64-darwin-22 x86_64-linux DEPENDENCIES From 77ffc8c7042b20720f611274d09f3aebb407946a Mon Sep 17 00:00:00 2001 From: achristen Date: Thu, 2 Nov 2023 15:32:11 -0400 Subject: [PATCH 05/29] skeleton pages --- app/controllers/about_controller.rb | 4 ++++ app/controllers/account_controller.rb | 4 ++++ app/controllers/active_trip_controller.rb | 4 ++++ app/controllers/add_more_time_controller.rb | 4 ++++ app/controllers/edit_current_trip_controller.rb | 4 ++++ app/controllers/help_controller.rb | 4 ++++ app/controllers/home_page_controller.rb | 4 ++++ app/controllers/how_it_works_controller.rb | 4 ++++ app/controllers/login_sign_up_controller.rb | 4 ++++ app/controllers/membership_plans_controller.rb | 4 ++++ app/controllers/past_trips_controller.rb | 4 ++++ app/controllers/payment_information_controller.rb | 4 ++++ app/controllers/report_a_problem_controller.rb | 4 ++++ app/controllers/settings_controller.rb | 4 ++++ app/controllers/trip_planning_controller.rb | 4 ++++ app/helpers/about_helper.rb | 2 ++ app/helpers/accoutn_helper.rb | 2 ++ app/helpers/active_trip_helper.rb | 2 ++ app/helpers/add_more_time_helper.rb | 2 ++ app/helpers/edit_current_trip_helper.rb | 2 ++ app/helpers/help_helper.rb | 2 ++ app/helpers/home_page_helper.rb | 2 ++ app/helpers/how_it_works_helper.rb | 2 ++ app/helpers/login_sign_up_helper.rb | 2 ++ app/helpers/membership_plans_helper.rb | 2 ++ app/helpers/past_trips_helper.rb | 2 ++ app/helpers/payment_information_helper.rb | 2 ++ app/helpers/report_a_problem_helper.rb | 2 ++ app/helpers/settings_helper.rb | 2 ++ app/helpers/trip_planning_helper.rb | 2 ++ app/views/about/index.html.erb | 4 ++++ app/views/accoutn/index.html.erb | 4 ++++ app/views/active_trip/index.html.erb | 4 ++++ app/views/add_more_time/index.html.erb | 4 ++++ app/views/edit_current_trip/index.html.erb | 4 ++++ app/views/help/index.html.erb | 4 ++++ app/views/home_page/index.html.erb | 4 ++++ app/views/how_it_works/index.html.erb | 4 ++++ app/views/login_sign_up/index.html.erb | 4 ++++ app/views/membership_plans/index.html.erb | 4 ++++ app/views/past_trips/index.html.erb | 4 ++++ app/views/payment_information/index.html.erb | 4 ++++ app/views/report_a_problem/index.html.erb | 4 ++++ app/views/settings/index.html.erb | 4 ++++ app/views/trip_planning/index.html.erb | 4 ++++ config/routes.rb | 15 +++++++++++++++ test/controllers/about_controller_test.rb | 8 ++++++++ test/controllers/accoutn_controller_test.rb | 8 ++++++++ test/controllers/active_trip_controller_test.rb | 8 ++++++++ test/controllers/add_more_time_controller_test.rb | 8 ++++++++ .../edit_current_trip_controller_test.rb | 8 ++++++++ test/controllers/help_controller_test.rb | 8 ++++++++ test/controllers/home_page_controller_test.rb | 8 ++++++++ test/controllers/how_it_works_controller_test.rb | 8 ++++++++ test/controllers/login_sign_up_controller_test.rb | 8 ++++++++ .../membership_plans_controller_test.rb | 8 ++++++++ test/controllers/past_trips_controller_test.rb | 8 ++++++++ .../payment_information_controller_test.rb | 8 ++++++++ .../report_a_problem_controller_test.rb | 8 ++++++++ test/controllers/settings_controller_test.rb | 8 ++++++++ test/controllers/trip_planning_controller_test.rb | 8 ++++++++ 61 files changed, 285 insertions(+) create mode 100644 app/controllers/about_controller.rb create mode 100644 app/controllers/account_controller.rb create mode 100644 app/controllers/active_trip_controller.rb create mode 100644 app/controllers/add_more_time_controller.rb create mode 100644 app/controllers/edit_current_trip_controller.rb create mode 100644 app/controllers/help_controller.rb create mode 100644 app/controllers/home_page_controller.rb create mode 100644 app/controllers/how_it_works_controller.rb create mode 100644 app/controllers/login_sign_up_controller.rb create mode 100644 app/controllers/membership_plans_controller.rb create mode 100644 app/controllers/past_trips_controller.rb create mode 100644 app/controllers/payment_information_controller.rb create mode 100644 app/controllers/report_a_problem_controller.rb create mode 100644 app/controllers/settings_controller.rb create mode 100644 app/controllers/trip_planning_controller.rb create mode 100644 app/helpers/about_helper.rb create mode 100644 app/helpers/accoutn_helper.rb create mode 100644 app/helpers/active_trip_helper.rb create mode 100644 app/helpers/add_more_time_helper.rb create mode 100644 app/helpers/edit_current_trip_helper.rb create mode 100644 app/helpers/help_helper.rb create mode 100644 app/helpers/home_page_helper.rb create mode 100644 app/helpers/how_it_works_helper.rb create mode 100644 app/helpers/login_sign_up_helper.rb create mode 100644 app/helpers/membership_plans_helper.rb create mode 100644 app/helpers/past_trips_helper.rb create mode 100644 app/helpers/payment_information_helper.rb create mode 100644 app/helpers/report_a_problem_helper.rb create mode 100644 app/helpers/settings_helper.rb create mode 100644 app/helpers/trip_planning_helper.rb create mode 100644 app/views/about/index.html.erb create mode 100644 app/views/accoutn/index.html.erb create mode 100644 app/views/active_trip/index.html.erb create mode 100644 app/views/add_more_time/index.html.erb create mode 100644 app/views/edit_current_trip/index.html.erb create mode 100644 app/views/help/index.html.erb create mode 100644 app/views/home_page/index.html.erb create mode 100644 app/views/how_it_works/index.html.erb create mode 100644 app/views/login_sign_up/index.html.erb create mode 100644 app/views/membership_plans/index.html.erb create mode 100644 app/views/past_trips/index.html.erb create mode 100644 app/views/payment_information/index.html.erb create mode 100644 app/views/report_a_problem/index.html.erb create mode 100644 app/views/settings/index.html.erb create mode 100644 app/views/trip_planning/index.html.erb create mode 100644 test/controllers/about_controller_test.rb create mode 100644 test/controllers/accoutn_controller_test.rb create mode 100644 test/controllers/active_trip_controller_test.rb create mode 100644 test/controllers/add_more_time_controller_test.rb create mode 100644 test/controllers/edit_current_trip_controller_test.rb create mode 100644 test/controllers/help_controller_test.rb create mode 100644 test/controllers/home_page_controller_test.rb create mode 100644 test/controllers/how_it_works_controller_test.rb create mode 100644 test/controllers/login_sign_up_controller_test.rb create mode 100644 test/controllers/membership_plans_controller_test.rb create mode 100644 test/controllers/past_trips_controller_test.rb create mode 100644 test/controllers/payment_information_controller_test.rb create mode 100644 test/controllers/report_a_problem_controller_test.rb create mode 100644 test/controllers/settings_controller_test.rb create mode 100644 test/controllers/trip_planning_controller_test.rb diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb new file mode 100644 index 000000000..a14c52853 --- /dev/null +++ b/app/controllers/about_controller.rb @@ -0,0 +1,4 @@ +class AboutController < ApplicationController + def index + end +end diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb new file mode 100644 index 000000000..2b5f2610c --- /dev/null +++ b/app/controllers/account_controller.rb @@ -0,0 +1,4 @@ +class AccountController < ApplicationController + def index + end +end diff --git a/app/controllers/active_trip_controller.rb b/app/controllers/active_trip_controller.rb new file mode 100644 index 000000000..28ecfde94 --- /dev/null +++ b/app/controllers/active_trip_controller.rb @@ -0,0 +1,4 @@ +class ActiveTripController < ApplicationController + def index + end +end diff --git a/app/controllers/add_more_time_controller.rb b/app/controllers/add_more_time_controller.rb new file mode 100644 index 000000000..eefb9b94b --- /dev/null +++ b/app/controllers/add_more_time_controller.rb @@ -0,0 +1,4 @@ +class AddMoreTimeController < ApplicationController + def index + end +end diff --git a/app/controllers/edit_current_trip_controller.rb b/app/controllers/edit_current_trip_controller.rb new file mode 100644 index 000000000..782c87a78 --- /dev/null +++ b/app/controllers/edit_current_trip_controller.rb @@ -0,0 +1,4 @@ +class EditCurrentTripController < ApplicationController + def index + end +end diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb new file mode 100644 index 000000000..b22280d2f --- /dev/null +++ b/app/controllers/help_controller.rb @@ -0,0 +1,4 @@ +class HelpController < ApplicationController + def index + end +end diff --git a/app/controllers/home_page_controller.rb b/app/controllers/home_page_controller.rb new file mode 100644 index 000000000..80ae7ee98 --- /dev/null +++ b/app/controllers/home_page_controller.rb @@ -0,0 +1,4 @@ +class HomePageController < ApplicationController + def index + end +end diff --git a/app/controllers/how_it_works_controller.rb b/app/controllers/how_it_works_controller.rb new file mode 100644 index 000000000..c7f759f7d --- /dev/null +++ b/app/controllers/how_it_works_controller.rb @@ -0,0 +1,4 @@ +class HowItWorksController < ApplicationController + def index + end +end diff --git a/app/controllers/login_sign_up_controller.rb b/app/controllers/login_sign_up_controller.rb new file mode 100644 index 000000000..e53b2c29e --- /dev/null +++ b/app/controllers/login_sign_up_controller.rb @@ -0,0 +1,4 @@ +class LoginSignUpController < ApplicationController + def index + end +end diff --git a/app/controllers/membership_plans_controller.rb b/app/controllers/membership_plans_controller.rb new file mode 100644 index 000000000..0f119e7fe --- /dev/null +++ b/app/controllers/membership_plans_controller.rb @@ -0,0 +1,4 @@ +class MembershipPlansController < ApplicationController + def index + end +end diff --git a/app/controllers/past_trips_controller.rb b/app/controllers/past_trips_controller.rb new file mode 100644 index 000000000..4dd5b583b --- /dev/null +++ b/app/controllers/past_trips_controller.rb @@ -0,0 +1,4 @@ +class PastTripsController < ApplicationController + def index + end +end diff --git a/app/controllers/payment_information_controller.rb b/app/controllers/payment_information_controller.rb new file mode 100644 index 000000000..96087ded7 --- /dev/null +++ b/app/controllers/payment_information_controller.rb @@ -0,0 +1,4 @@ +class PaymentInformationController < ApplicationController + def index + end +end diff --git a/app/controllers/report_a_problem_controller.rb b/app/controllers/report_a_problem_controller.rb new file mode 100644 index 000000000..d03128eb9 --- /dev/null +++ b/app/controllers/report_a_problem_controller.rb @@ -0,0 +1,4 @@ +class ReportAProblemController < ApplicationController + def index + end +end diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb new file mode 100644 index 000000000..b9adfb98c --- /dev/null +++ b/app/controllers/settings_controller.rb @@ -0,0 +1,4 @@ +class SettingsController < ApplicationController + def index + end +end diff --git a/app/controllers/trip_planning_controller.rb b/app/controllers/trip_planning_controller.rb new file mode 100644 index 000000000..41e3463d7 --- /dev/null +++ b/app/controllers/trip_planning_controller.rb @@ -0,0 +1,4 @@ +class TripPlanningController < ApplicationController + def index + end +end diff --git a/app/helpers/about_helper.rb b/app/helpers/about_helper.rb new file mode 100644 index 000000000..68e69aee1 --- /dev/null +++ b/app/helpers/about_helper.rb @@ -0,0 +1,2 @@ +module AboutHelper +end diff --git a/app/helpers/accoutn_helper.rb b/app/helpers/accoutn_helper.rb new file mode 100644 index 000000000..791a994a3 --- /dev/null +++ b/app/helpers/accoutn_helper.rb @@ -0,0 +1,2 @@ +module AccoutnHelper +end diff --git a/app/helpers/active_trip_helper.rb b/app/helpers/active_trip_helper.rb new file mode 100644 index 000000000..3ab0d7135 --- /dev/null +++ b/app/helpers/active_trip_helper.rb @@ -0,0 +1,2 @@ +module ActiveTripHelper +end diff --git a/app/helpers/add_more_time_helper.rb b/app/helpers/add_more_time_helper.rb new file mode 100644 index 000000000..1bd23d821 --- /dev/null +++ b/app/helpers/add_more_time_helper.rb @@ -0,0 +1,2 @@ +module AddMoreTimeHelper +end diff --git a/app/helpers/edit_current_trip_helper.rb b/app/helpers/edit_current_trip_helper.rb new file mode 100644 index 000000000..9e98a5752 --- /dev/null +++ b/app/helpers/edit_current_trip_helper.rb @@ -0,0 +1,2 @@ +module EditCurrentTripHelper +end diff --git a/app/helpers/help_helper.rb b/app/helpers/help_helper.rb new file mode 100644 index 000000000..6a35490ac --- /dev/null +++ b/app/helpers/help_helper.rb @@ -0,0 +1,2 @@ +module HelpHelper +end diff --git a/app/helpers/home_page_helper.rb b/app/helpers/home_page_helper.rb new file mode 100644 index 000000000..363d843ff --- /dev/null +++ b/app/helpers/home_page_helper.rb @@ -0,0 +1,2 @@ +module HomePageHelper +end diff --git a/app/helpers/how_it_works_helper.rb b/app/helpers/how_it_works_helper.rb new file mode 100644 index 000000000..35af31803 --- /dev/null +++ b/app/helpers/how_it_works_helper.rb @@ -0,0 +1,2 @@ +module HowItWorksHelper +end diff --git a/app/helpers/login_sign_up_helper.rb b/app/helpers/login_sign_up_helper.rb new file mode 100644 index 000000000..dda167c29 --- /dev/null +++ b/app/helpers/login_sign_up_helper.rb @@ -0,0 +1,2 @@ +module LoginSignUpHelper +end diff --git a/app/helpers/membership_plans_helper.rb b/app/helpers/membership_plans_helper.rb new file mode 100644 index 000000000..5fa08cc25 --- /dev/null +++ b/app/helpers/membership_plans_helper.rb @@ -0,0 +1,2 @@ +module MembershipPlansHelper +end diff --git a/app/helpers/past_trips_helper.rb b/app/helpers/past_trips_helper.rb new file mode 100644 index 000000000..0bc65eaa8 --- /dev/null +++ b/app/helpers/past_trips_helper.rb @@ -0,0 +1,2 @@ +module PastTripsHelper +end diff --git a/app/helpers/payment_information_helper.rb b/app/helpers/payment_information_helper.rb new file mode 100644 index 000000000..f12c2da02 --- /dev/null +++ b/app/helpers/payment_information_helper.rb @@ -0,0 +1,2 @@ +module PaymentInformationHelper +end diff --git a/app/helpers/report_a_problem_helper.rb b/app/helpers/report_a_problem_helper.rb new file mode 100644 index 000000000..5f72c6822 --- /dev/null +++ b/app/helpers/report_a_problem_helper.rb @@ -0,0 +1,2 @@ +module ReportAProblemHelper +end diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb new file mode 100644 index 000000000..ffbedbaf4 --- /dev/null +++ b/app/helpers/settings_helper.rb @@ -0,0 +1,2 @@ +module SettingsHelper +end diff --git a/app/helpers/trip_planning_helper.rb b/app/helpers/trip_planning_helper.rb new file mode 100644 index 000000000..c5c140477 --- /dev/null +++ b/app/helpers/trip_planning_helper.rb @@ -0,0 +1,2 @@ +module TripPlanningHelper +end diff --git a/app/views/about/index.html.erb b/app/views/about/index.html.erb new file mode 100644 index 000000000..d71f2f861 --- /dev/null +++ b/app/views/about/index.html.erb @@ -0,0 +1,4 @@ +
+

About#index

+

Find me in app/views/about/index.html.erb

+
diff --git a/app/views/accoutn/index.html.erb b/app/views/accoutn/index.html.erb new file mode 100644 index 000000000..60f25e4b4 --- /dev/null +++ b/app/views/accoutn/index.html.erb @@ -0,0 +1,4 @@ +
+

Accoutn#index

+

Find me in app/views/accoutn/index.html.erb

+
diff --git a/app/views/active_trip/index.html.erb b/app/views/active_trip/index.html.erb new file mode 100644 index 000000000..600b066ab --- /dev/null +++ b/app/views/active_trip/index.html.erb @@ -0,0 +1,4 @@ +
+

ActiveTrip#index

+

Find me in app/views/active_trip/index.html.erb

+
diff --git a/app/views/add_more_time/index.html.erb b/app/views/add_more_time/index.html.erb new file mode 100644 index 000000000..2927a9a3f --- /dev/null +++ b/app/views/add_more_time/index.html.erb @@ -0,0 +1,4 @@ +
+

AddMoreTime#index

+

Find me in app/views/add_more_time/index.html.erb

+
diff --git a/app/views/edit_current_trip/index.html.erb b/app/views/edit_current_trip/index.html.erb new file mode 100644 index 000000000..81455b5c6 --- /dev/null +++ b/app/views/edit_current_trip/index.html.erb @@ -0,0 +1,4 @@ +
+

EditCurrentTrip#index

+

Find me in app/views/edit_current_trip/index.html.erb

+
diff --git a/app/views/help/index.html.erb b/app/views/help/index.html.erb new file mode 100644 index 000000000..e4df382f8 --- /dev/null +++ b/app/views/help/index.html.erb @@ -0,0 +1,4 @@ +
+

Help#index

+

Find me in app/views/help/index.html.erb

+
diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb new file mode 100644 index 000000000..e820ef758 --- /dev/null +++ b/app/views/home_page/index.html.erb @@ -0,0 +1,4 @@ +
+

HomePage#index

+

Find me in app/views/home_page/index.html.erb

+
diff --git a/app/views/how_it_works/index.html.erb b/app/views/how_it_works/index.html.erb new file mode 100644 index 000000000..1179eaf51 --- /dev/null +++ b/app/views/how_it_works/index.html.erb @@ -0,0 +1,4 @@ +
+

HowItWorks#index

+

Find me in app/views/how_it_works/index.html.erb

+
diff --git a/app/views/login_sign_up/index.html.erb b/app/views/login_sign_up/index.html.erb new file mode 100644 index 000000000..7761674e0 --- /dev/null +++ b/app/views/login_sign_up/index.html.erb @@ -0,0 +1,4 @@ +
+

LoginSignUp#index

+

Find me in app/views/login_sign_up/index.html.erb

+
diff --git a/app/views/membership_plans/index.html.erb b/app/views/membership_plans/index.html.erb new file mode 100644 index 000000000..b0d1726a9 --- /dev/null +++ b/app/views/membership_plans/index.html.erb @@ -0,0 +1,4 @@ +
+

MembershipPlans#index

+

Find me in app/views/membership_plans/index.html.erb

+
diff --git a/app/views/past_trips/index.html.erb b/app/views/past_trips/index.html.erb new file mode 100644 index 000000000..19bede6ec --- /dev/null +++ b/app/views/past_trips/index.html.erb @@ -0,0 +1,4 @@ +
+

PastTrips#index

+

Find me in app/views/past_trips/index.html.erb

+
diff --git a/app/views/payment_information/index.html.erb b/app/views/payment_information/index.html.erb new file mode 100644 index 000000000..27c1477a3 --- /dev/null +++ b/app/views/payment_information/index.html.erb @@ -0,0 +1,4 @@ +
+

PaymentInformation#index

+

Find me in app/views/payment_information/index.html.erb

+
diff --git a/app/views/report_a_problem/index.html.erb b/app/views/report_a_problem/index.html.erb new file mode 100644 index 000000000..0b551b207 --- /dev/null +++ b/app/views/report_a_problem/index.html.erb @@ -0,0 +1,4 @@ +
+

ReportAProblem#index

+

Find me in app/views/report_a_problem/index.html.erb

+
diff --git a/app/views/settings/index.html.erb b/app/views/settings/index.html.erb new file mode 100644 index 000000000..0918bb411 --- /dev/null +++ b/app/views/settings/index.html.erb @@ -0,0 +1,4 @@ +
+

Settings#index

+

Find me in app/views/settings/index.html.erb

+
diff --git a/app/views/trip_planning/index.html.erb b/app/views/trip_planning/index.html.erb new file mode 100644 index 000000000..813120596 --- /dev/null +++ b/app/views/trip_planning/index.html.erb @@ -0,0 +1,4 @@ +
+

TripPlanning#index

+

Find me in app/views/trip_planning/index.html.erb

+
diff --git a/config/routes.rb b/config/routes.rb index f1eb0a0d8..100f520f3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,18 @@ Rails.application.routes.draw do + get 'edit_current_trip/index' + get 'report_a_problem/index' + get 'help/index' + get 'settings/index' + get 'past_trips/index' + get 'add_more_time/index' + get 'active_trip/index' + get 'trip_planning/index' + get 'payment_information/index' + get 'accoutn/index' + get 'login_sign_up/index' + get 'membership_plans/index' + get 'how_it_works/index' + get 'about/index' + get 'home_page/index' root to: "stations#index" end \ No newline at end of file diff --git a/test/controllers/about_controller_test.rb b/test/controllers/about_controller_test.rb new file mode 100644 index 000000000..c0921efd8 --- /dev/null +++ b/test/controllers/about_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class AboutControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get about_index_url + assert_response :success + end +end diff --git a/test/controllers/accoutn_controller_test.rb b/test/controllers/accoutn_controller_test.rb new file mode 100644 index 000000000..3e362a9ae --- /dev/null +++ b/test/controllers/accoutn_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class AccoutnControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get accoutn_index_url + assert_response :success + end +end diff --git a/test/controllers/active_trip_controller_test.rb b/test/controllers/active_trip_controller_test.rb new file mode 100644 index 000000000..160c7dc00 --- /dev/null +++ b/test/controllers/active_trip_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class ActiveTripControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get active_trip_index_url + assert_response :success + end +end diff --git a/test/controllers/add_more_time_controller_test.rb b/test/controllers/add_more_time_controller_test.rb new file mode 100644 index 000000000..cad502d32 --- /dev/null +++ b/test/controllers/add_more_time_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class AddMoreTimeControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get add_more_time_index_url + assert_response :success + end +end diff --git a/test/controllers/edit_current_trip_controller_test.rb b/test/controllers/edit_current_trip_controller_test.rb new file mode 100644 index 000000000..4b9a69703 --- /dev/null +++ b/test/controllers/edit_current_trip_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class EditCurrentTripControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get edit_current_trip_index_url + assert_response :success + end +end diff --git a/test/controllers/help_controller_test.rb b/test/controllers/help_controller_test.rb new file mode 100644 index 000000000..503b9cbc2 --- /dev/null +++ b/test/controllers/help_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class HelpControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get help_index_url + assert_response :success + end +end diff --git a/test/controllers/home_page_controller_test.rb b/test/controllers/home_page_controller_test.rb new file mode 100644 index 000000000..b14ef618b --- /dev/null +++ b/test/controllers/home_page_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class HomePageControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get home_page_index_url + assert_response :success + end +end diff --git a/test/controllers/how_it_works_controller_test.rb b/test/controllers/how_it_works_controller_test.rb new file mode 100644 index 000000000..b3bea31af --- /dev/null +++ b/test/controllers/how_it_works_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class HowItWorksControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get how_it_works_index_url + assert_response :success + end +end diff --git a/test/controllers/login_sign_up_controller_test.rb b/test/controllers/login_sign_up_controller_test.rb new file mode 100644 index 000000000..0903bdb9d --- /dev/null +++ b/test/controllers/login_sign_up_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class LoginSignUpControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get login_sign_up_index_url + assert_response :success + end +end diff --git a/test/controllers/membership_plans_controller_test.rb b/test/controllers/membership_plans_controller_test.rb new file mode 100644 index 000000000..917a6d6ab --- /dev/null +++ b/test/controllers/membership_plans_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class MembershipPlansControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get membership_plans_index_url + assert_response :success + end +end diff --git a/test/controllers/past_trips_controller_test.rb b/test/controllers/past_trips_controller_test.rb new file mode 100644 index 000000000..15f7a5c14 --- /dev/null +++ b/test/controllers/past_trips_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class PastTripsControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get past_trips_index_url + assert_response :success + end +end diff --git a/test/controllers/payment_information_controller_test.rb b/test/controllers/payment_information_controller_test.rb new file mode 100644 index 000000000..4c1c25ffa --- /dev/null +++ b/test/controllers/payment_information_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class PaymentInformationControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get payment_information_index_url + assert_response :success + end +end diff --git a/test/controllers/report_a_problem_controller_test.rb b/test/controllers/report_a_problem_controller_test.rb new file mode 100644 index 000000000..dd24acf2c --- /dev/null +++ b/test/controllers/report_a_problem_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class ReportAProblemControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get report_a_problem_index_url + assert_response :success + end +end diff --git a/test/controllers/settings_controller_test.rb b/test/controllers/settings_controller_test.rb new file mode 100644 index 000000000..3dff76826 --- /dev/null +++ b/test/controllers/settings_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class SettingsControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get settings_index_url + assert_response :success + end +end diff --git a/test/controllers/trip_planning_controller_test.rb b/test/controllers/trip_planning_controller_test.rb new file mode 100644 index 000000000..f3934c5b4 --- /dev/null +++ b/test/controllers/trip_planning_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class TripPlanningControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get trip_planning_index_url + assert_response :success + end +end From 90819b569501e66eac06ce8b9727fc32f604e15e Mon Sep 17 00:00:00 2001 From: achristen Date: Thu, 2 Nov 2023 17:00:30 -0400 Subject: [PATCH 06/29] routing and links --- app/views/accoutn/index.html.erb | 4 ---- app/views/home_page/index.html.erb | 7 +++++++ config/routes.rb | 21 +++++++++++++++++++-- 3 files changed, 26 insertions(+), 6 deletions(-) delete mode 100644 app/views/accoutn/index.html.erb diff --git a/app/views/accoutn/index.html.erb b/app/views/accoutn/index.html.erb deleted file mode 100644 index 60f25e4b4..000000000 --- a/app/views/accoutn/index.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -
-

Accoutn#index

-

Find me in app/views/accoutn/index.html.erb

-
diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index e820ef758..28af7f3dd 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -2,3 +2,10 @@

HomePage#index

Find me in app/views/home_page/index.html.erb

+<%= link_to('About','/about') %>
+<%= link_to('Report','/report') %>
+<%= link_to('Help','/help') %>
+<%= link_to('Login/Signup','/login_sign_up') %>
+<%= link_to('How It Works','/how_it_works') %>
+<%= link_to('Trip Planning','/trip_planning') %>
+<%= link_to('Membership Plans','/membership_plans') %>
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 100f520f3..341cd2a2b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,22 @@ Rails.application.routes.draw do + root "home_page#index" + + + match 'home', to: "home_page#index", via: :get + match 'edit_current_trip', to: "edit_current_trip#index", via: :get + match 'report', to: "report_a_problem#index", via: :get + match 'help', to: "help#index", via: :get + match 'settings', to: "settings#index", via: :get + match 'past_trips', to: "past_trips#index", via: :get + match 'add_more_time', to: "add_more_time#index", via: :get + match 'active_trip', to: "active_trip#index", via: :get + match 'trip_planning', to: "trip_planning#index", via: :get + match 'payment_information', to: "payment_information#index", via: :get + match 'account', to: "account#index", via: :get + match 'login_sign_up', to: "login_sign_up#index", via: :get + match 'membership_plans', to: "membership_plans#index", via: :get + match 'how_it_works', to: "how_it_works#index", via: :get + match 'about', to: "about#index", via: :get get 'edit_current_trip/index' get 'report_a_problem/index' get 'help/index' @@ -8,11 +26,10 @@ get 'active_trip/index' get 'trip_planning/index' get 'payment_information/index' - get 'accoutn/index' + get 'account/index' get 'login_sign_up/index' get 'membership_plans/index' get 'how_it_works/index' get 'about/index' get 'home_page/index' - root to: "stations#index" end \ No newline at end of file From 342e2f44c0eb00b4823f6b35160f75845cfee125 Mon Sep 17 00:00:00 2001 From: ANHTRAN Date: Mon, 6 Nov 2023 21:29:18 -0500 Subject: [PATCH 07/29] finish print bikes and stations --- app/assets/stylesheets/flexbox-ultralight.css | 0 app/controllers/bikes_controller.rb | 11 +++++++++ app/controllers/stations_controller.rb | 6 +++++ app/views/bikes/index.html.erb | 8 +++++++ app/views/bikes/show.html.erb | 2 ++ app/views/home_page/index.html.erb | 23 ++++++++++--------- app/views/stations/index.html.erb | 17 +++++++------- app/views/stations/show.html.erb | 3 +++ bin/bundle | 0 bin/dev | 0 bin/importmap | 0 bin/rails | 0 bin/rake | 0 bin/setup | 0 config/routes.rb | 6 +++++ 15 files changed, 56 insertions(+), 20 deletions(-) mode change 100755 => 100644 app/assets/stylesheets/flexbox-ultralight.css create mode 100644 app/controllers/bikes_controller.rb create mode 100644 app/views/bikes/index.html.erb create mode 100644 app/views/bikes/show.html.erb create mode 100644 app/views/stations/show.html.erb mode change 100755 => 100644 bin/bundle mode change 100755 => 100644 bin/dev mode change 100755 => 100644 bin/importmap mode change 100755 => 100644 bin/rails mode change 100755 => 100644 bin/rake mode change 100755 => 100644 bin/setup diff --git a/app/assets/stylesheets/flexbox-ultralight.css b/app/assets/stylesheets/flexbox-ultralight.css old mode 100755 new mode 100644 diff --git a/app/controllers/bikes_controller.rb b/app/controllers/bikes_controller.rb new file mode 100644 index 000000000..4c9fc784a --- /dev/null +++ b/app/controllers/bikes_controller.rb @@ -0,0 +1,11 @@ +class BikesController < ApplicationController + def index + @bikes = Bike.all.order(identifier: :asc) + end + + def show + @bike = Bike.find(params[:id]) + rescue ActiveRecord::RecordNotfound + redirect_to root_path + end +end diff --git a/app/controllers/stations_controller.rb b/app/controllers/stations_controller.rb index 88090af16..4bf15f336 100644 --- a/app/controllers/stations_controller.rb +++ b/app/controllers/stations_controller.rb @@ -3,5 +3,11 @@ class StationsController < ApplicationController def index @stations = Station.all.order(identifier: :asc) end + + def show + @station = Station.find(params[:id]) + rescue ActiveRecord::RecordNotfound + redirect_to root_path + end end diff --git a/app/views/bikes/index.html.erb b/app/views/bikes/index.html.erb new file mode 100644 index 000000000..17fe7213c --- /dev/null +++ b/app/views/bikes/index.html.erb @@ -0,0 +1,8 @@ +

Bikes

+
    + <% @bikes.each do |bike| %> +
  • + <%= link_to bike.identifier, bike %> +
  • + <% end %> +
\ No newline at end of file diff --git a/app/views/bikes/show.html.erb b/app/views/bikes/show.html.erb new file mode 100644 index 000000000..facb9cbf0 --- /dev/null +++ b/app/views/bikes/show.html.erb @@ -0,0 +1,2 @@ +

Bike ID: <%= @bike.identifier %>

+

Current Station: <%= @bike.current_station.blank? ? "In use" : "Docked (#{bike.current_station.address})" %>

diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index 28af7f3dd..185de8857 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -1,11 +1,12 @@ -
-

HomePage#index

-

Find me in app/views/home_page/index.html.erb

-
-<%= link_to('About','/about') %>
-<%= link_to('Report','/report') %>
-<%= link_to('Help','/help') %>
-<%= link_to('Login/Signup','/login_sign_up') %>
-<%= link_to('How It Works','/how_it_works') %>
-<%= link_to('Trip Planning','/trip_planning') %>
-<%= link_to('Membership Plans','/membership_plans') %>
\ No newline at end of file +
+ Logo + +<%= link_to('About','/about') %> +<%= link_to('Report','/report') %> +<%= link_to('Help','/help') %> +<%= link_to('Login/Signup','/login_sign_up') %> +<%= link_to('How It Works','/how_it_works') %> +<%= link_to('Trip Planning','/trip_planning') %> +<%= link_to('Membership Plans','/membership_plans') %> + +
\ No newline at end of file diff --git a/app/views/stations/index.html.erb b/app/views/stations/index.html.erb index d211dda42..61e58a5e1 100644 --- a/app/views/stations/index.html.erb +++ b/app/views/stations/index.html.erb @@ -1,16 +1,15 @@
- Welcome to ValetBike! + Welcome to ValetBike
-
- <% if @stations.present? %> - <%= render(partial: "stations/row", collection: @stations, as: :station) %> - <% else %> -
- No stations found. -
- <% end %> +
+ All Stations + <% @stations.each do |station| %> +
+

<%= link_to station.name, station %>

+
+ <% end %>
diff --git a/app/views/stations/show.html.erb b/app/views/stations/show.html.erb new file mode 100644 index 000000000..34e5f22ec --- /dev/null +++ b/app/views/stations/show.html.erb @@ -0,0 +1,3 @@ +

Name: <%= @station.name %>

+

Address: <%= @station.address %>

+

Number of docked bikes: <%= @station.docked_bikes.count %>

\ No newline at end of file diff --git a/bin/bundle b/bin/bundle old mode 100755 new mode 100644 diff --git a/bin/dev b/bin/dev old mode 100755 new mode 100644 diff --git a/bin/importmap b/bin/importmap old mode 100755 new mode 100644 diff --git a/bin/rails b/bin/rails old mode 100755 new mode 100644 diff --git a/bin/rake b/bin/rake old mode 100755 new mode 100644 diff --git a/bin/setup b/bin/setup old mode 100755 new mode 100644 diff --git a/config/routes.rb b/config/routes.rb index 341cd2a2b..f791083de 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,4 +32,10 @@ get 'how_it_works/index' get 'about/index' get 'home_page/index' + get "/stations/:id", to: "stations#show", as: :station + get "/bikes", to: "bikes#index" + get "/bikes/:id", to: "bikes#show", as: :bike + + get "about", to: "main#about" + get"/stations", to: "stations#index" end \ No newline at end of file From f2d7205f64afaa3bc8f52fafcceba5b3a4fbd886 Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai Date: Tue, 7 Nov 2023 09:45:45 -0500 Subject: [PATCH 08/29] update bikes and stations --- db/migrate/20231107143736_add_capacity_to_stations.rb | 5 +++++ db/migrate/20231107144233_add_charge_and_avail_to_bikes.rb | 6 ++++++ db/schema.rb | 5 ++++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20231107143736_add_capacity_to_stations.rb create mode 100644 db/migrate/20231107144233_add_charge_and_avail_to_bikes.rb diff --git a/db/migrate/20231107143736_add_capacity_to_stations.rb b/db/migrate/20231107143736_add_capacity_to_stations.rb new file mode 100644 index 000000000..ba919df54 --- /dev/null +++ b/db/migrate/20231107143736_add_capacity_to_stations.rb @@ -0,0 +1,5 @@ +class AddCapacityToStations < ActiveRecord::Migration[7.0] + def change + add_column(:stations, :capacity, :integer, index: true) + end +end diff --git a/db/migrate/20231107144233_add_charge_and_avail_to_bikes.rb b/db/migrate/20231107144233_add_charge_and_avail_to_bikes.rb new file mode 100644 index 000000000..484c8abc1 --- /dev/null +++ b/db/migrate/20231107144233_add_charge_and_avail_to_bikes.rb @@ -0,0 +1,6 @@ +class AddChargeAndAvailToBikes < ActiveRecord::Migration[7.0] + def change + add_column(:bikes, :charge, :integer) + add_column(:bikes, :avail, :boolean) + end +end diff --git a/db/schema.rb b/db/schema.rb index b98268f0e..6947ea51d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,12 +10,14 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2022_08_31_090719) do +ActiveRecord::Schema[7.0].define(version: 2023_11_07_144233) do create_table "bikes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.integer "identifier" t.integer "current_station_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "charge" + t.boolean "avail" end create_table "stations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| @@ -24,6 +26,7 @@ t.string "address" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "capacity" end end From 7ed882800bff2559bf4044518b595dd757352da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMei=E2=80=9D?= Date: Tue, 7 Nov 2023 10:22:44 -0500 Subject: [PATCH 09/29] Header and Footer --- app/assets/stylesheets/application.css | 77 ++++++++++++++++++++++++++ app/views/home_page/index.html.erb | 51 +++++++++++++++-- 2 files changed, 123 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 288b9ab71..f960931da 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -13,3 +13,80 @@ *= require_tree . *= require_self */ + +/* styles.css */ + +/* Apply styles to the header element */ +header { + background-color: #9698fc; /* Background color for the header */ + color: #fff; /* Text color for the header */ + padding: 10px; /* Padding around the header content */ + width: 100%; /* Make the header take up the whole width */ + margin: 0; /* Remove default margin */ + +} + +/* Style the navigation links */ +header nav ul { + list-style: none; + padding: 20px 0; + margin: 0; + text-align: right; /* Align the links to the right */ +} + +header nav ul li { + display: inline; + margin-right: 20px; +} + +header nav ul li a { + text-decoration: none; + color: #fff; +} + +/* Style for the header links on hover */ +header nav ul li a:hover { + text-decoration: underline; +} + + + + +/* styles.css */ + +/* Apply styles to the footer element */ +footer { + background-color: #9698fc; /* Background color for the footer */ + color: #fff; /* Text color for the footer */ + padding: 10px; /* Padding around the footer content */ + width: 100%; /* Make the footer take up the whole width */ + margin: 0; /* Remove default margin */ + position: fixed; /* Position the footer as fixed */ + bottom: 0; /* Stick it to the bottom of the viewport */ + left: 0; /* Align to the left of the viewport */ + right: 0; /* Align to the right of the viewport */ +} + +/* Style the footer links */ +footer ul { + list-style: none; /* Remove bullet points from the list */ + padding: 20px 0; + margin: 0; + text-align: right; /* Align the links to the right */ +} + +footer li { + display: inline; /* Display the list items horizontally */ + margin-right: 20px; /* Add space between list items */ +} + +footer a { + text-decoration: none; /* Remove underlines from the links */ + color: #fff; /* Text color for the links */ +} + +/* Style for the footer links on hover */ +footer a:hover { + text-decoration: underline; /* Underline the links on hover */ +} + diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index 28af7f3dd..8ed3def29 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -1,11 +1,52 @@ -
-

HomePage#index

-

Find me in app/views/home_page/index.html.erb

-
+ + + + + + + +
+ +
+ + + + + + + <%= link_to('About','/about') %>
<%= link_to('Report','/report') %>
<%= link_to('Help','/help') %>
<%= link_to('Login/Signup','/login_sign_up') %>
<%= link_to('How It Works','/how_it_works') %>
<%= link_to('Trip Planning','/trip_planning') %>
-<%= link_to('Membership Plans','/membership_plans') %>
\ No newline at end of file +<%= link_to('Membership Plans','/membership_plans') %>
+ + + + + + + + + From 7a006634e93513c470d38b1261a2b5020bad7b61 Mon Sep 17 00:00:00 2001 From: meic-123 <137515621+meic-123@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:30:22 -0500 Subject: [PATCH 10/29] Header and Footer CSS 11/7 - mei --- app/assets/stylesheets/application.css | 75 ++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 288b9ab71..9c7bcaade 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -13,3 +13,78 @@ *= require_tree . *= require_self */ + + +/* Apply styles to the header element */ +header { + background-color: #9698fc; /* Background color for the header */ + color: #fff; /* Text color for the header */ + padding: 10px; /* Padding around the header content */ + width: 100%; /* Make the header take up the whole width */ + margin: 0; /* Remove default margin */ + +} + +/* Style the navigation links */ +header nav ul { + list-style: none; + padding: 20px 0; + margin: 0; + text-align: right; /* Align the links to the right */ +} + +header nav ul li { + display: inline; + margin-right: 20px; +} + +header nav ul li a { + text-decoration: none; + color: #fff; +} + +/* Style for the header links on hover */ +header nav ul li a:hover { + text-decoration: underline; +} + + + + +/* styles.css */ + +/* Apply styles to the footer element */ +footer { + background-color: #9698fc; /* Background color for the footer */ + color: #fff; /* Text color for the footer */ + padding: 10px; /* Padding around the footer content */ + width: 100%; /* Make the footer take up the whole width */ + margin: 0; /* Remove default margin */ + position: fixed; /* Position the footer as fixed */ + bottom: 0; /* Stick it to the bottom of the viewport */ + left: 0; /* Align to the left of the viewport */ + right: 0; /* Align to the right of the viewport */ +} + +/* Style the footer links */ +footer ul { + list-style: none; /* Remove bullet points from the list */ + padding: 20px 0; + margin: 0; + text-align: right; /* Align the links to the right */ +} + +footer li { + display: inline; /* Display the list items horizontally */ + margin-right: 20px; /* Add space between list items */ +} + +footer a { + text-decoration: none; /* Remove underlines from the links */ + color: #fff; /* Text color for the links */ +} + +/* Style for the footer links on hover */ +footer a:hover { + text-decoration: underline; /* Underline the links on hover */ +} From a66515301254a23239094047ea70447b00412c7f Mon Sep 17 00:00:00 2001 From: meic-123 <137515621+meic-123@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:33:34 -0500 Subject: [PATCH 11/29] Header and Footer HTML 11/7 - mei --- app/views/home_page/index.html.erb | 40 +++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index 28af7f3dd..283878905 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -1,11 +1,49 @@ + + + + + + + +
+ +
+ + + <%= link_to('About','/about') %>
<%= link_to('Report','/report') %>
<%= link_to('Help','/help') %>
<%= link_to('Login/Signup','/login_sign_up') %>
<%= link_to('How It Works','/how_it_works') %>
<%= link_to('Trip Planning','/trip_planning') %>
-<%= link_to('Membership Plans','/membership_plans') %>
\ No newline at end of file +<%= link_to('Membership Plans','/membership_plans') %>
+ + + + + + + + + From b8c87744514ad06a7678bcd71d59de576a953d7e Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai Date: Tue, 7 Nov 2023 12:52:26 -0500 Subject: [PATCH 12/29] tables for users, memberships and transactions --- app/models/membership.rb | 2 ++ app/models/transaction.rb | 2 ++ app/models/user.rb | 2 ++ db/migrate/20231107174158_create_users.rb | 14 ++++++++++ .../20231107174432_create_memberships.rb | 13 ++++++++++ .../20231107174910_create_transactions.rb | 12 +++++++++ db/schema.rb | 26 ++++++++++++++++++- test/fixtures/memberships.yml | 11 ++++++++ test/fixtures/transactions.yml | 11 ++++++++ test/fixtures/users.yml | 11 ++++++++ test/models/membership_test.rb | 7 +++++ test/models/transaction_test.rb | 7 +++++ test/models/user_test.rb | 7 +++++ 13 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 app/models/membership.rb create mode 100644 app/models/transaction.rb create mode 100644 app/models/user.rb create mode 100644 db/migrate/20231107174158_create_users.rb create mode 100644 db/migrate/20231107174432_create_memberships.rb create mode 100644 db/migrate/20231107174910_create_transactions.rb create mode 100644 test/fixtures/memberships.yml create mode 100644 test/fixtures/transactions.yml create mode 100644 test/fixtures/users.yml create mode 100644 test/models/membership_test.rb create mode 100644 test/models/transaction_test.rb create mode 100644 test/models/user_test.rb diff --git a/app/models/membership.rb b/app/models/membership.rb new file mode 100644 index 000000000..55591b5b1 --- /dev/null +++ b/app/models/membership.rb @@ -0,0 +1,2 @@ +class Membership < ApplicationRecord +end diff --git a/app/models/transaction.rb b/app/models/transaction.rb new file mode 100644 index 000000000..07cc781cc --- /dev/null +++ b/app/models/transaction.rb @@ -0,0 +1,2 @@ +class Transaction < ApplicationRecord +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 000000000..379658a50 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,2 @@ +class User < ApplicationRecord +end diff --git a/db/migrate/20231107174158_create_users.rb b/db/migrate/20231107174158_create_users.rb new file mode 100644 index 000000000..6abce3aa5 --- /dev/null +++ b/db/migrate/20231107174158_create_users.rb @@ -0,0 +1,14 @@ +class CreateUsers < ActiveRecord::Migration[7.0] + def change + create_table :users do |t| + t.string :name + t.date :dob + t.text :email + + t.timestamps + end + end +end +#id is build in +#membership_id to be done later +#payment method: need to figure out structure \ No newline at end of file diff --git a/db/migrate/20231107174432_create_memberships.rb b/db/migrate/20231107174432_create_memberships.rb new file mode 100644 index 000000000..4551cfe82 --- /dev/null +++ b/db/migrate/20231107174432_create_memberships.rb @@ -0,0 +1,13 @@ +class CreateMemberships < ActiveRecord::Migration[7.0] + def change + create_table :memberships do |t| + t.string :name + t.text :rate + t.integer :rentlength + + t.timestamps + end + end +end +#membership id is built in +#need to figure out best var type for rate diff --git a/db/migrate/20231107174910_create_transactions.rb b/db/migrate/20231107174910_create_transactions.rb new file mode 100644 index 000000000..88a2ea927 --- /dev/null +++ b/db/migrate/20231107174910_create_transactions.rb @@ -0,0 +1,12 @@ +class CreateTransactions < ActiveRecord::Migration[7.0] + def change + create_table :transactions do |t| + t.decimal :amount + t.boolean :complete + t.datetime :dateandtime + + t.timestamps + end + end +end +#user_id to be done later \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 6947ea51d..877aa3552 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_11_07_144233) do +ActiveRecord::Schema[7.0].define(version: 2023_11_07_174910) do create_table "bikes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.integer "identifier" t.integer "current_station_id" @@ -20,6 +20,14 @@ t.boolean "avail" end + create_table "memberships", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.string "name" + t.text "rate" + t.integer "rentlength" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "stations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.integer "identifier" t.string "name" @@ -29,4 +37,20 @@ t.integer "capacity" end + create_table "transactions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.decimal "amount", precision: 10 + t.boolean "complete" + t.datetime "dateandtime" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.string "name" + t.date "dob" + t.text "email" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + end diff --git a/test/fixtures/memberships.yml b/test/fixtures/memberships.yml new file mode 100644 index 000000000..2ab639f5b --- /dev/null +++ b/test/fixtures/memberships.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + rate: MyText + rentlength: 1 + +two: + name: MyString + rate: MyText + rentlength: 1 diff --git a/test/fixtures/transactions.yml b/test/fixtures/transactions.yml new file mode 100644 index 000000000..149a1c03f --- /dev/null +++ b/test/fixtures/transactions.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + amount: 9.99 + complete: false + dateandtime: 2023-11-07 12:49:10 + +two: + amount: 9.99 + complete: false + dateandtime: 2023-11-07 12:49:10 diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 000000000..cfcad4c7c --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + dob: 2023-11-07 + email: MyText + +two: + name: MyString + dob: 2023-11-07 + email: MyText diff --git a/test/models/membership_test.rb b/test/models/membership_test.rb new file mode 100644 index 000000000..8506331ed --- /dev/null +++ b/test/models/membership_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class MembershipTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/transaction_test.rb b/test/models/transaction_test.rb new file mode 100644 index 000000000..dc48590cb --- /dev/null +++ b/test/models/transaction_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class TransactionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 000000000..5c07f4900 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 43e47e919466f1e462180047f17167df0b3b990f Mon Sep 17 00:00:00 2001 From: meic-123 <137515621+meic-123@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:39:53 -0500 Subject: [PATCH 13/29] Update Home Page.html.erb 11/7 - mei --- app/views/home_page/index.html.erb | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index 283878905..54cde80ce 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -1,8 +1,8 @@ @@ -13,17 +13,20 @@
+ @@ -40,9 +44,8 @@ From 6706d56c40db51a6d00300c13df334afe6957789 Mon Sep 17 00:00:00 2001 From: meic-123 <137515621+meic-123@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:40:17 -0500 Subject: [PATCH 14/29] Update index.html.erb --- app/views/home_page/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index 54cde80ce..38b762607 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -14,9 +14,9 @@
--> - - - - - -
- -
- - - - - @@ -76,7 +52,6 @@ ---> From c8529173b9cad645b71ebbfc387746a33d72a6bb Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai Date: Tue, 7 Nov 2023 15:38:16 -0500 Subject: [PATCH 18/29] Fixed href link --- app/views/home_page/index.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index 5686898dc..9433fd472 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -8,7 +8,7 @@ - +
@@ -39,7 +39,7 @@ - +
@@ -55,7 +55,7 @@ - +
From f62588942f8ec6ba066afb497419c772374f0575 Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai Date: Wed, 8 Nov 2023 10:27:07 -0500 Subject: [PATCH 19/29] created migrations for trip, favorite and report --- app/models/favorite.rb | 2 ++ app/models/report.rb | 2 ++ app/models/trip.rb | 2 ++ db/migrate/20231108152419_create_trips.rb | 10 ++++++++++ db/migrate/20231108152521_create_favorites.rb | 9 +++++++++ db/migrate/20231108152604_create_reports.rb | 10 ++++++++++ test/fixtures/favorites.yml | 7 +++++++ test/fixtures/reports.yml | 9 +++++++++ test/fixtures/trips.yml | 9 +++++++++ test/models/favorite_test.rb | 7 +++++++ test/models/report_test.rb | 7 +++++++ test/models/trip_test.rb | 7 +++++++ 12 files changed, 81 insertions(+) create mode 100644 app/models/favorite.rb create mode 100644 app/models/report.rb create mode 100644 app/models/trip.rb create mode 100644 db/migrate/20231108152419_create_trips.rb create mode 100644 db/migrate/20231108152521_create_favorites.rb create mode 100644 db/migrate/20231108152604_create_reports.rb create mode 100644 test/fixtures/favorites.yml create mode 100644 test/fixtures/reports.yml create mode 100644 test/fixtures/trips.yml create mode 100644 test/models/favorite_test.rb create mode 100644 test/models/report_test.rb create mode 100644 test/models/trip_test.rb diff --git a/app/models/favorite.rb b/app/models/favorite.rb new file mode 100644 index 000000000..72579d46c --- /dev/null +++ b/app/models/favorite.rb @@ -0,0 +1,2 @@ +class Favorite < ApplicationRecord +end diff --git a/app/models/report.rb b/app/models/report.rb new file mode 100644 index 000000000..1dfff22ff --- /dev/null +++ b/app/models/report.rb @@ -0,0 +1,2 @@ +class Report < ApplicationRecord +end diff --git a/app/models/trip.rb b/app/models/trip.rb new file mode 100644 index 000000000..a8c077a10 --- /dev/null +++ b/app/models/trip.rb @@ -0,0 +1,2 @@ +class Trip < ApplicationRecord +end diff --git a/db/migrate/20231108152419_create_trips.rb b/db/migrate/20231108152419_create_trips.rb new file mode 100644 index 000000000..004b45925 --- /dev/null +++ b/db/migrate/20231108152419_create_trips.rb @@ -0,0 +1,10 @@ +class CreateTrips < ActiveRecord::Migration[7.0] + def change + create_table :trips do |t| + t.date :happened_on + t.time :start_at + + t.timestamps + end + end +end diff --git a/db/migrate/20231108152521_create_favorites.rb b/db/migrate/20231108152521_create_favorites.rb new file mode 100644 index 000000000..67f56c048 --- /dev/null +++ b/db/migrate/20231108152521_create_favorites.rb @@ -0,0 +1,9 @@ +class CreateFavorites < ActiveRecord::Migration[7.0] + def change + create_table :favorites do |t| + t.integer :num_of_trip + + t.timestamps + end + end +end diff --git a/db/migrate/20231108152604_create_reports.rb b/db/migrate/20231108152604_create_reports.rb new file mode 100644 index 000000000..a47849119 --- /dev/null +++ b/db/migrate/20231108152604_create_reports.rb @@ -0,0 +1,10 @@ +class CreateReports < ActiveRecord::Migration[7.0] + def change + create_table :reports do |t| + t.text :description + t.datetime :reported_at + + t.timestamps + end + end +end diff --git a/test/fixtures/favorites.yml b/test/fixtures/favorites.yml new file mode 100644 index 000000000..21c7b6956 --- /dev/null +++ b/test/fixtures/favorites.yml @@ -0,0 +1,7 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + num_of_trip: 1 + +two: + num_of_trip: 1 diff --git a/test/fixtures/reports.yml b/test/fixtures/reports.yml new file mode 100644 index 000000000..dad926063 --- /dev/null +++ b/test/fixtures/reports.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + description: MyText + reported_at: 2023-11-08 10:26:04 + +two: + description: MyText + reported_at: 2023-11-08 10:26:04 diff --git a/test/fixtures/trips.yml b/test/fixtures/trips.yml new file mode 100644 index 000000000..fa684ca7e --- /dev/null +++ b/test/fixtures/trips.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + happened_on: 2023-11-08 + start_at: 2023-11-08 10:24:19 + +two: + happened_on: 2023-11-08 + start_at: 2023-11-08 10:24:19 diff --git a/test/models/favorite_test.rb b/test/models/favorite_test.rb new file mode 100644 index 000000000..aeee113a5 --- /dev/null +++ b/test/models/favorite_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class FavoriteTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/report_test.rb b/test/models/report_test.rb new file mode 100644 index 000000000..c7d4f0adc --- /dev/null +++ b/test/models/report_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ReportTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/trip_test.rb b/test/models/trip_test.rb new file mode 100644 index 000000000..c5ff46fcb --- /dev/null +++ b/test/models/trip_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class TripTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 2652aa264585fe41273bfafdab77c6e2b7ced802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMei=E2=80=9D?= Date: Wed, 8 Nov 2023 19:28:49 -0500 Subject: [PATCH 20/29] Move Stylesheets from Application to Global --- app/assets/stylesheets/application.css | 151 ------------------------- app/assets/stylesheets/global.css | 68 +++++++++++ app/views/home_page/index.html.erb | 29 +---- 3 files changed, 69 insertions(+), 179 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 2b6014438..b4e806752 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -14,154 +14,3 @@ *= require_self */ - -/* Apply styles to the header element */ -header { - background-color: #9698fc; /* Background color for the header */ - color: #fff; /* Text color for the header */ - padding: 10px; /* Padding around the header content */ - width: 100%; /* Make the header take up the whole width */ - margin: 0; /* Remove default margin */ - -} - -/* Style the navigation links */ -header nav ul { - list-style: none; - padding: 20px 0; - margin: 0; - text-align: right; /* Align the links to the right */ -} - -header nav ul li { - display: inline; - margin-right: 20px; -} - -header nav ul li a { - text-decoration: none; - color: #fff; -} - -/* Style for the header links on hover */ -header nav ul li a:hover { - text-decoration: underline; -} - - - - -/* styles.css */ - -/* Apply styles to the footer element */ -footer { - background-color: #9698fc; /* Background color for the footer */ - color: #fff; /* Text color for the footer */ - padding: 10px; /* Padding around the footer content */ - width: 100%; /* Make the footer take up the whole width */ - margin: 0; /* Remove default margin */ - position: fixed; /* Position the footer as fixed */ - bottom: 0; /* Stick it to the bottom of the viewport */ - left: 0; /* Align to the left of the viewport */ - right: 0; /* Align to the right of the viewport */ -} - -/* Style the footer links */ -footer ul { - list-style: none; /* Remove bullet points from the list */ - padding: 20px 0; - margin: 0; - text-align: right; /* Align the links to the right */ -} - -footer li { - display: inline; /* Display the list items horizontally */ - margin-right: 20px; /* Add space between list items */ -} - -footer a { - text-decoration: none; /* Remove underlines from the links */ - color: #fff; /* Text color for the links */ -} - -/* Style for the footer links on hover */ -footer a:hover { - text-decoration: underline; /* Underline the links on hover */ -} - -/* styles.css */ - -/* Apply styles to the header element */ -header { - background-color: #9698fc; /* Background color for the header */ - color: #fff; /* Text color for the header */ - padding: 10px; /* Padding around the header content */ - width: 100%; /* Make the header take up the whole width */ - margin: 0; /* Remove default margin */ - -} - -/* Style the navigation links */ -header nav ul { - list-style: none; - padding: 20px 0; - margin: 0; - text-align: right; /* Align the links to the right */ -} - -header nav ul li { - display: inline; - margin-right: 20px; -} - -header nav ul li a { - text-decoration: none; - color: #fff; -} - -/* Style for the header links on hover */ -header nav ul li a:hover { - text-decoration: underline; -} - - - - -/* styles.css */ - -/* Apply styles to the footer element */ -footer { - background-color: #9698fc; /* Background color for the footer */ - color: #fff; /* Text color for the footer */ - padding: 10px; /* Padding around the footer content */ - width: 100%; /* Make the footer take up the whole width */ - margin: 0; /* Remove default margin */ - position: fixed; /* Position the footer as fixed */ - bottom: 0; /* Stick it to the bottom of the viewport */ - left: 0; /* Align to the left of the viewport */ - right: 0; /* Align to the right of the viewport */ -} - -/* Style the footer links */ -footer ul { - list-style: none; /* Remove bullet points from the list */ - padding: 20px 0; - margin: 0; - text-align: right; /* Align the links to the right */ -} - -footer li { - display: inline; /* Display the list items horizontally */ - margin-right: 20px; /* Add space between list items */ -} - -footer a { - text-decoration: none; /* Remove underlines from the links */ - color: #fff; /* Text color for the links */ -} - -/* Style for the footer links on hover */ -footer a:hover { - text-decoration: underline; /* Underline the links on hover */ -} - diff --git a/app/assets/stylesheets/global.css b/app/assets/stylesheets/global.css index ff48f1abe..3003971b7 100644 --- a/app/assets/stylesheets/global.css +++ b/app/assets/stylesheets/global.css @@ -33,3 +33,71 @@ body { color: var(--black-color); background: var(--white-color); } + +/* Apply styles to the header element */ +header { + background-color: #9698fc; /* Background color for the header */ + color: #fff; /* Text color for the header */ + padding: 10px; /* Padding around the header content */ + width: 100%; /* Make the header take up the whole width */ + margin: 0; /* Remove default margin */ +} + +/* Style the navigation links */ +header nav ul { + list-style: none; + padding: 20px 0; + margin: 0; + text-align: right; /* Align the links to the right */ +} + +header nav ul li { + display: inline; + margin-right: 20px; +} + +header nav ul li a { + text-decoration: none; + color: #fff; +} + +/* Style for the header links on hover */ +header nav ul li a:hover { + text-decoration: underline; +} + +/* Apply styles to the footer element */ +footer { + background-color: #9698fc; /* Background color for the footer */ + color: #fff; /* Text color for the footer */ + padding: 10px; /* Padding around the footer content */ + width: 100%; /* Make the footer take up the whole width */ + margin: 0; /* Remove default margin */ + position: fixed; /* Position the footer as fixed */ + bottom: 0; /* Stick it to the bottom of the viewport */ + left: 0; /* Align to the left of the viewport */ + right: 0; /* Align to the right of the viewport */ +} + +/* Style the footer links */ +footer ul { + list-style: none; /* Remove bullet points from the list */ + padding: 20px 0; + margin: 0; + text-align: right; /* Align the links to the right */ +} + +footer li { + display: inline; /* Display the list items horizontally */ + margin-right: 20px; /* Add space between list items */ +} + +footer a { + text-decoration: none; /* Remove underlines from the links */ + color: #fff; /* Text color for the links */ +} + +/* Style for the footer links on hover */ +footer a:hover { + text-decoration: underline; /* Underline the links on hover */ +} \ No newline at end of file diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index 5686898dc..be6419fb5 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -1,5 +1,4 @@ - - - - - - - - - - - From 283b39ebbf56b2302e31fb35f98072d4cf62b3aa Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai Date: Thu, 9 Nov 2023 15:52:02 -0500 Subject: [PATCH 21/29] made relationship between memberships and users --- app/models/membership.rb | 1 + app/models/user.rb | 1 + ...231109204318_add_membership_id_to_users.rb | 5 ++++ db/schema.rb | 23 ++++++++++++++++++- 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20231109204318_add_membership_id_to_users.rb diff --git a/app/models/membership.rb b/app/models/membership.rb index 55591b5b1..1f8751933 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -1,2 +1,3 @@ class Membership < ApplicationRecord + has_many :users end diff --git a/app/models/user.rb b/app/models/user.rb index 379658a50..2ad986942 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,2 +1,3 @@ class User < ApplicationRecord + belongs_to :membership, optional: true end diff --git a/db/migrate/20231109204318_add_membership_id_to_users.rb b/db/migrate/20231109204318_add_membership_id_to_users.rb new file mode 100644 index 000000000..deeaf47e1 --- /dev/null +++ b/db/migrate/20231109204318_add_membership_id_to_users.rb @@ -0,0 +1,5 @@ +class AddMembershipIdToUsers < ActiveRecord::Migration[7.0] + def change + add_column(:users, :membership_id, :integer, index: true) + end +end diff --git a/db/schema.rb b/db/schema.rb index 877aa3552..c22b594f6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_11_07_174910) do +ActiveRecord::Schema[7.0].define(version: 2023_11_09_204318) do create_table "bikes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.integer "identifier" t.integer "current_station_id" @@ -20,6 +20,12 @@ t.boolean "avail" end + create_table "favorites", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.integer "num_of_trip" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "memberships", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.string "name" t.text "rate" @@ -28,6 +34,13 @@ t.datetime "updated_at", null: false end + create_table "reports", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.text "description" + t.datetime "reported_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "stations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.integer "identifier" t.string "name" @@ -45,12 +58,20 @@ t.datetime "updated_at", null: false end + create_table "trips", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.date "happened_on" + t.time "start_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.string "name" t.date "dob" t.text "email" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "membership_id" end end From 52c128c63d07c498d81aa7206b7a8c75f0404730 Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 9 Nov 2023 16:11:25 -0500 Subject: [PATCH 22/29] login and logout skeleton functionality --- config/routes.rb | 15 ++++++++++++++- db/schema.rb | 22 +++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index f791083de..769b5bcba 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,20 @@ Rails.application.routes.draw do + # get 'access/menu' + # get 'access/new' + # get 'access/create' + # get 'access/destroy' root "home_page#index" +get 'menu'=> 'access#menu' +get 'login'=> 'access#new' +delete 'logout' => 'access#destroy' +resource :access, controller: 'access', only:[:new, :create, :destroy] do + member do + get :menu + end +end + match 'logout', to: "access#destroy", via: :get match 'home', to: "home_page#index", via: :get match 'edit_current_trip', to: "edit_current_trip#index", via: :get match 'report', to: "report_a_problem#index", via: :get @@ -13,7 +26,7 @@ match 'trip_planning', to: "trip_planning#index", via: :get match 'payment_information', to: "payment_information#index", via: :get match 'account', to: "account#index", via: :get - match 'login_sign_up', to: "login_sign_up#index", via: :get + match 'login_sign_up', to: "access#new", via: :get match 'membership_plans', to: "membership_plans#index", via: :get match 'how_it_works', to: "how_it_works#index", via: :get match 'about', to: "about#index", via: :get diff --git a/db/schema.rb b/db/schema.rb index 877aa3552..2a4a3ca04 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_11_07_174910) do +ActiveRecord::Schema[7.0].define(version: 2023_11_08_152604) do create_table "bikes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.integer "identifier" t.integer "current_station_id" @@ -20,6 +20,12 @@ t.boolean "avail" end + create_table "favorites", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.integer "num_of_trip" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "memberships", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.string "name" t.text "rate" @@ -28,6 +34,13 @@ t.datetime "updated_at", null: false end + create_table "reports", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.text "description" + t.datetime "reported_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "stations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.integer "identifier" t.string "name" @@ -45,6 +58,13 @@ t.datetime "updated_at", null: false end + create_table "trips", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.date "happened_on" + t.time "start_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.string "name" t.date "dob" From baabc6ac9f7cc5b18009f1f4054c4e3e923f3ee8 Mon Sep 17 00:00:00 2001 From: Sami Aiyathurai Date: Thu, 9 Nov 2023 16:15:24 -0500 Subject: [PATCH 23/29] Started with the relations for trips --- app/models/membership.rb | 2 +- app/models/station.rb | 4 +++- app/models/trip.rb | 4 ++++ app/models/user.rb | 4 +++- db/migrate/20231109205324_add_relations_to_trips.rb | 8 ++++++++ db/schema.rb | 6 +++++- 6 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20231109205324_add_relations_to_trips.rb diff --git a/app/models/membership.rb b/app/models/membership.rb index 1f8751933..32fd11aef 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -1,3 +1,3 @@ class Membership < ApplicationRecord - has_many :users + has_many :users, class_name: :User, foreign_key: :membership_id end diff --git a/app/models/station.rb b/app/models/station.rb index 64b9eaada..49465314b 100644 --- a/app/models/station.rb +++ b/app/models/station.rb @@ -5,5 +5,7 @@ class Station < ApplicationRecord validates_uniqueness_of :identifier has_many :docked_bikes, class_name: :Bike, foreign_key: :current_station_id - + has_many :started_trips, class_name: :Trip, foreign_key: :start_station_id + has_many :ended_trips, class_name: :Trip, foreign_key: :end_station_id + end diff --git a/app/models/trip.rb b/app/models/trip.rb index a8c077a10..8cdcd244b 100644 --- a/app/models/trip.rb +++ b/app/models/trip.rb @@ -1,2 +1,6 @@ class Trip < ApplicationRecord + # belongs_to :bike, class_name: :Bike, foreign_key: :trip_id + belongs_to :starting_station, class_name: :Station, foreign_key: :start_station_id + belongs_to :ending_station, class_name: :Station, foreign_key: :end_station_id + belongs_to :user, class_name: :User, foreign_key: :user_id end diff --git a/app/models/user.rb b/app/models/user.rb index 2ad986942..f939d5bf6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,5 @@ class User < ApplicationRecord - belongs_to :membership, optional: true + belongs_to :membership, class_name: :Membership, foreign_key: :membership_id, optional: true + + has_many :trips, class_name: :Trip, foreign_key: :user_id end diff --git a/db/migrate/20231109205324_add_relations_to_trips.rb b/db/migrate/20231109205324_add_relations_to_trips.rb new file mode 100644 index 000000000..47dd78f92 --- /dev/null +++ b/db/migrate/20231109205324_add_relations_to_trips.rb @@ -0,0 +1,8 @@ +class AddRelationsToTrips < ActiveRecord::Migration[7.0] + def change + add_column(:trips, :bike_id, :integer) + add_column(:trips, :user_id, :integer, index: true) + add_column(:trips, :starting_station_id, :integer, index: true) + add_column(:trips, :ending_station_id, :integer, index: true) + end +end diff --git a/db/schema.rb b/db/schema.rb index c22b594f6..4abd4a96d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_11_09_204318) do +ActiveRecord::Schema[7.0].define(version: 2023_11_09_205324) do create_table "bikes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.integer "identifier" t.integer "current_station_id" @@ -63,6 +63,10 @@ t.time "start_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "bike_id" + t.integer "user_id" + t.integer "starting_station_id" + t.integer "ending_station_id" end create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| From b533e3bcfe25d315d54c7eb6d2ea582f5d70534d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMei=E2=80=9D?= Date: Sat, 11 Nov 2023 16:36:04 -0500 Subject: [PATCH 24/29] header + footer on each page --- app/views/about/index.html.erb | 38 ++++++++++++++++++ app/views/active_trip/index.html.erb | 38 ++++++++++++++++++ app/views/add_more_time/index.html.erb | 39 ++++++++++++++++++ app/views/contact_us/index.html.erb | 42 ++++++++++++++++++++ app/views/edit_current_trip/index.html.erb | 39 ++++++++++++++++++ app/views/help/index.html.erb | 38 ++++++++++++++++++ app/views/home_page/index.html.erb | 16 ++++---- app/views/how_it_works/index.html.erb | 39 ++++++++++++++++++ app/views/login_sign_up/index.html.erb | 39 ++++++++++++++++++ app/views/membership_plans/index.html.erb | 39 ++++++++++++++++++ app/views/past_trips/index.html.erb | 39 ++++++++++++++++++ app/views/payment_information/index.html.erb | 39 ++++++++++++++++++ app/views/report_a_problem/index.html.erb | 39 ++++++++++++++++++ app/views/settings/index.html.erb | 39 ++++++++++++++++++ app/views/stations/index.html.erb | 38 ++++++++++++++++++ app/views/trip_planning/index.html.erb | 39 ++++++++++++++++++ 16 files changed, 593 insertions(+), 7 deletions(-) create mode 100644 app/views/contact_us/index.html.erb diff --git a/app/views/about/index.html.erb b/app/views/about/index.html.erb index d71f2f861..2e30570a7 100644 --- a/app/views/about/index.html.erb +++ b/app/views/about/index.html.erb @@ -1,4 +1,42 @@ + + + + + +
+ +
+ + + +

About#index

Find me in app/views/about/index.html.erb

+ + + + + + + + + + \ No newline at end of file diff --git a/app/views/active_trip/index.html.erb b/app/views/active_trip/index.html.erb index 600b066ab..b82e37dd2 100644 --- a/app/views/active_trip/index.html.erb +++ b/app/views/active_trip/index.html.erb @@ -1,4 +1,42 @@ + + + + + +
+ +
+ + + +

ActiveTrip#index

Find me in app/views/active_trip/index.html.erb

+ + + + + + + + + + \ No newline at end of file diff --git a/app/views/add_more_time/index.html.erb b/app/views/add_more_time/index.html.erb index 2927a9a3f..625b794bd 100644 --- a/app/views/add_more_time/index.html.erb +++ b/app/views/add_more_time/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

AddMoreTime#index

Find me in app/views/add_more_time/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/contact_us/index.html.erb b/app/views/contact_us/index.html.erb new file mode 100644 index 000000000..e0de2e79e --- /dev/null +++ b/app/views/contact_us/index.html.erb @@ -0,0 +1,42 @@ + + + + + +
+ +
+ + + +
+

About#index

+

Find me in app/views/contact_us/index.html.erb

+
+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/edit_current_trip/index.html.erb b/app/views/edit_current_trip/index.html.erb index 81455b5c6..1dd53726e 100644 --- a/app/views/edit_current_trip/index.html.erb +++ b/app/views/edit_current_trip/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

EditCurrentTrip#index

Find me in app/views/edit_current_trip/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/help/index.html.erb b/app/views/help/index.html.erb index e4df382f8..dd131749d 100644 --- a/app/views/help/index.html.erb +++ b/app/views/help/index.html.erb @@ -1,4 +1,42 @@ + + + + + +
+ +
+ + + +

Help#index

Find me in app/views/help/index.html.erb

+ + + + + + + + + + \ No newline at end of file diff --git a/app/views/home_page/index.html.erb b/app/views/home_page/index.html.erb index be6419fb5..5c5e5e903 100644 --- a/app/views/home_page/index.html.erb +++ b/app/views/home_page/index.html.erb @@ -1,10 +1,3 @@ - - @@ -26,6 +19,15 @@ + + +
+

HomePage#index

+

Find me in app/views/home_page/index.html.erb

+
+ + + diff --git a/app/views/how_it_works/index.html.erb b/app/views/how_it_works/index.html.erb index 1179eaf51..72993accc 100644 --- a/app/views/how_it_works/index.html.erb +++ b/app/views/how_it_works/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

HowItWorks#index

Find me in app/views/how_it_works/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/login_sign_up/index.html.erb b/app/views/login_sign_up/index.html.erb index 7761674e0..7eb13631c 100644 --- a/app/views/login_sign_up/index.html.erb +++ b/app/views/login_sign_up/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

LoginSignUp#index

Find me in app/views/login_sign_up/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/membership_plans/index.html.erb b/app/views/membership_plans/index.html.erb index b0d1726a9..d79a06fc0 100644 --- a/app/views/membership_plans/index.html.erb +++ b/app/views/membership_plans/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

MembershipPlans#index

Find me in app/views/membership_plans/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/past_trips/index.html.erb b/app/views/past_trips/index.html.erb index 19bede6ec..974ba975a 100644 --- a/app/views/past_trips/index.html.erb +++ b/app/views/past_trips/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

PastTrips#index

Find me in app/views/past_trips/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/payment_information/index.html.erb b/app/views/payment_information/index.html.erb index 27c1477a3..ed1a34e6c 100644 --- a/app/views/payment_information/index.html.erb +++ b/app/views/payment_information/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

PaymentInformation#index

Find me in app/views/payment_information/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/report_a_problem/index.html.erb b/app/views/report_a_problem/index.html.erb index 0b551b207..e205fdb98 100644 --- a/app/views/report_a_problem/index.html.erb +++ b/app/views/report_a_problem/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

ReportAProblem#index

Find me in app/views/report_a_problem/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/settings/index.html.erb b/app/views/settings/index.html.erb index 0918bb411..98b2fc5f0 100644 --- a/app/views/settings/index.html.erb +++ b/app/views/settings/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

Settings#index

Find me in app/views/settings/index.html.erb

+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/stations/index.html.erb b/app/views/stations/index.html.erb index d211dda42..f19b44aa6 100644 --- a/app/views/stations/index.html.erb +++ b/app/views/stations/index.html.erb @@ -14,3 +14,41 @@ + + + + + + + + +
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/app/views/trip_planning/index.html.erb b/app/views/trip_planning/index.html.erb index 813120596..d7487bcf2 100644 --- a/app/views/trip_planning/index.html.erb +++ b/app/views/trip_planning/index.html.erb @@ -1,4 +1,43 @@ + + + + + +
+ +
+ + + +

TripPlanning#index

Find me in app/views/trip_planning/index.html.erb

+ + + + + + + + + + + \ No newline at end of file From da87593ccd669a0d692d9d96a0b72e706420f77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMei=E2=80=9D?= Date: Sun, 12 Nov 2023 14:25:56 -0500 Subject: [PATCH 25/29] edited global css --- app/assets/stylesheets/global.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/global.css b/app/assets/stylesheets/global.css index 3003971b7..057351f7a 100644 --- a/app/assets/stylesheets/global.css +++ b/app/assets/stylesheets/global.css @@ -100,4 +100,7 @@ footer a { /* Style for the footer links on hover */ footer a:hover { text-decoration: underline; /* Underline the links on hover */ -} \ No newline at end of file +} + + + From 880dd72e1c93ea77b0e5f777ab19e03d21e14d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMei=E2=80=9D?= Date: Sun, 12 Nov 2023 15:04:50 -0500 Subject: [PATCH 26/29] update routes --- app/views/about/index.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/about/index.html.erb b/app/views/about/index.html.erb index 2e30570a7..f907fd240 100644 --- a/app/views/about/index.html.erb +++ b/app/views/about/index.html.erb @@ -39,4 +39,5 @@
- \ No newline at end of file + + From ea4215651d7805c0bb02774925b5b50d994c735a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMei=E2=80=9D?= Date: Sun, 12 Nov 2023 15:08:20 -0500 Subject: [PATCH 27/29] update routes --- app/controllers/contact_us_controller.rb | 4 ++++ app/helpers/contact_us_helper.rb | 2 ++ app/views/contact_us/index.html.erb | 7 ++++--- config/routes.rb | 6 ++++-- test/controllers/contact_us_controller_test.rb | 8 ++++++++ 5 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 app/controllers/contact_us_controller.rb create mode 100644 app/helpers/contact_us_helper.rb create mode 100644 test/controllers/contact_us_controller_test.rb diff --git a/app/controllers/contact_us_controller.rb b/app/controllers/contact_us_controller.rb new file mode 100644 index 000000000..fdfaef16c --- /dev/null +++ b/app/controllers/contact_us_controller.rb @@ -0,0 +1,4 @@ +class ContactUsController < ApplicationController + def index + end +end diff --git a/app/helpers/contact_us_helper.rb b/app/helpers/contact_us_helper.rb new file mode 100644 index 000000000..e17223a76 --- /dev/null +++ b/app/helpers/contact_us_helper.rb @@ -0,0 +1,2 @@ +module ContactUsHelper +end diff --git a/app/views/contact_us/index.html.erb b/app/views/contact_us/index.html.erb index e0de2e79e..8e2c54901 100644 --- a/app/views/contact_us/index.html.erb +++ b/app/views/contact_us/index.html.erb @@ -7,9 +7,9 @@
- - + \ No newline at end of file diff --git a/app/views/contact_us/index.html.erb b/app/views/contact_us/index.html.erb index 8e2c54901..e0de2e79e 100644 --- a/app/views/contact_us/index.html.erb +++ b/app/views/contact_us/index.html.erb @@ -7,9 +7,9 @@