From 325ae1d817f3058e46d02fbce6aa694f19f8d6ae Mon Sep 17 00:00:00 2001 From: Melissa Xie Date: Sun, 10 Sep 2023 13:36:23 -0400 Subject: [PATCH] Replace Heroku instructions with Fly.io Also includes info on how to update the website to reflect event info. --- README.md | 30 ++++++++++++++++-------------- app/helpers/application_helper.rb | 4 ---- app/helpers/events_helper.rb | 7 +++++-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 91f8a28..805fb1f 100644 --- a/README.md +++ b/README.md @@ -19,25 +19,27 @@ Running the app locally $ bin/rails server $ open http://localhost:3000/ -Hiding registration +Showing registration ------------------- -Sometimes we create an event, make it live, but don't want people to sign up -yet. In that case we can set `ENV["HIDE_REGISTRATION]` to `"true"` on Heroku, -and the registration link won't be shown at all: +In order to show registration info, you'll need to set the following environment variables: - heroku config:set HIDE_REGISTRATION=true +* `EVENT_URL` - URL of the workshop signup +* `VENUE_NAME` - name of the venue +* `VENUE_ADDRESS` - one-liner full address of the venue +* `VENUE_MAP_URL` - an embedded map URL +* `HIDE_REGISTRATION=true` -Don't forget to un-hide it! +You can do this by running: + fly secrets set EVENT_URL=... VENUE_NAME=... ... -Using real event data ---------------------- +This command will automatically redeploy the app for the new variables to go into effect. -If you'd like to work with actual Eventbrite data, you'll have to set the -`EVENTBRITE_ACCESS_TOKEN` variable to a real token in your `.env` file. -You can get this via `heroku config:get EVENTBRITE_ACCESS_TOKEN` if you have -Heroku access or from [Eventbrite App Management] if you have access to the -RailsBridge Boston Eventbrite account. Otherwise, ask a maintainer for access. +Sometimes we create an event, make it live, but don't want people to sign up +yet. In that case we can set `ENV["HIDE_REGISTRATION]` to `"true"` on Heroku, +and the registration link won't be shown at all: -[Eventbrite App Management]: http://www.eventbrite.com/myaccount/apps/ + fly secrets set HIDE_REGISTRATION=true + +Don't forget to un-hide it! diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5e39e23..c551e1b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,10 +3,6 @@ def signup_form_url "//getform.io/f/170d6d2e-01ba-481a-a532-74405f3ed4bc" end - def venue_map_url - ENV.fetch("VENUE_MAP_URL", "") - end - def data_links @data_links ||= YAML.load_file(Rails.root.join("app/data/links.yml")) end diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index c65b392..557fdd2 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -4,20 +4,23 @@ def next_event venue: venue, url: ENV.fetch("EVENT_URL", "") ) - # @next_event ||= Eventbrite::EventFinder.find(ENV.fetch("NEXT_EVENT_ID")) end def next_event_venue next_event.venue end - def venue + def venue OpenStruct.new( name: ENV.fetch("VENUE_NAME", ""), address: ENV.fetch("VENUE_ADDRESS", "") ) end + def venue_map_url + ENV.fetch("VENUE_MAP_URL", "") + end + def show_registration? ENV["HIDE_REGISTRATION"] != "true" && next_event.url.present? end