Story #106 Update Event Signup to Support Signup using a Code | User and Technical Documentation - cseseniordesign/reservations GitHub Wiki
End User Documentation
Dev Testing Instructions
Make sure you are on the most recent version of the dev-add-code-to-event branch.
Start your dev environment and log in with development2 so you have all permissions.
Navigate to the Admin -> Events page
Create a new event from a preset. Ensure that there is now an input field to enter a code. Enter a code, set the event to a time later today, then save it.
Create another new event and set it for another time later today but don't give it a code.
Go to Manage Your Studio -> Trainings.
Sign up for the event without the code and ensure it just signs you up without asking for a code.
Sign up for the event with the code and ensure it prompts you to enter a code. If you enter the wrong code it should not let you sign up.
Go to Manage Your Studio and remove yourself from the signup lists for the event. Repeat step 6 on the Manage Your Studio -> Event Calendar page.
Ensure there are no errors in the console throughout your testing and that the page is still responsive on all screen sizes.
Follow steps 3 and up from the dev testing instructions above.
Technical Documentation
models/event.rb
Added event_code to the set_data method.
new_schema.sql
Added the alter table script to add the event_code column to the event table.
routes/events.rb
Added logic to validate the code if required in the /events/:event_id/sign_up_as_non_member/? and /events/:event_id/sign_up/? post methods.
routes/tools.rb
Added logic to validate the code if required in the /tools/trainings/sign_up/:event_id/? post method.
routes/workshops.rb
Added logic to validate the code if required in the /workshops/sign_up/:event_id/? post method.
views/admin/new_event.erb
Added input field to enter a code required to signup.
views/event_details.erb
Added HTML code for a modal to prompt the code.
Added a javascript function to set the modal form action link based on the signup button clicked and updated the buttons to call this function if event_code is not null.
views/event_listing_table.erb
Added HTML code for a modal to prompt the code.
Added a javascript function to set the modal form action link based on the signup button clicked and updated the buttons to call this function if event_code is not null.