Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ruby:3.4.1

# Install dependencies
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client

WORKDIR /app

COPY Gemfile Gemfile.lock ./
RUN gem install bundler && bundle install

COPY . .

EXPOSE 3000

CMD ["rails", "server", "-b", "0.0.0.0"]
3 changes: 2 additions & 1 deletion app/controllers/participants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def participant_params
params.require(controller_name.singularize).permit(
:name, :email, :password,
:bio, :github_profile_username,
:twitter_handle, :code_of_conduct_agreement
:twitter_handle, :mastodon_url,
:bluesky_handle,:code_of_conduct_agreement
)
end

Expand Down
2 changes: 2 additions & 0 deletions app/models/sessions_json_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ def to_hash(session)
participant_id: s.participant.id,
presenter_name: s.participant.name,
presenter_twitter_handle: s.participant.twitter_handle,
presenter_mastodon_url: s.participant.mastodon_url,
presenter_bluesky_handle: s.participant.bluesky_handle,
presenter_github_username: s.participant.github_profile_username,
presenter_github_og_image: s.participant.github_og_image,
presenter_bio: s.participant.bio,
Expand Down
6 changes: 4 additions & 2 deletions app/views/participants/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
<%= f.inputs do %>
<%= f.input :name, :label => 'Your name', :hint => "Please use your real name. This will be used in our printed materials." %>
<%= f.input :email, :label => 'Your email', :hint => "Please use a real email address. We need this to contact you about your presentation." %>
<%= f.input :github_profile_username, :label => 'Your GitHub username' %>
<%= f.input :twitter_handle, :label => 'Your Twitter handle' %>
<%= f.input :github_profile_username, :label => 'Your GitHub username (optional)' %>
<%= f.input :twitter_handle, :label => 'Your Twitter (X) handle (optional)' %>
<%= f.input :mastodon_url, :label => 'Your Mastodon URL (optional)' %>
<%= f.input :bluesky_handle, :label => 'Your Bluesky handle (optional)' %>
<%= f.input :bio, :hint => 'You can use <a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a> syntax here. Examples: <strong>**bold**</strong>, <em>*italic*</em>, [link](http://example.com)'.html_safe %>
<%=
f.input :code_of_conduct_agreement,
Expand Down
14 changes: 14 additions & 0 deletions app/views/participants/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@
<div>@<%= @participant.twitter_handle %></div>
</div>
<% end %>

<% if @participant.mastodon_url.present? %>
<div class="grid_3 column">
<h4>Mastodon:</h4>
<div><%= @participant.mastodon_url %></div>
</div>
<% end %>

<% if @participant.bluesky_handle.present? %>
<div class="grid_3 column">
<h4>Bluesky:</h4>
<div>@<%= @participant.bluesky_handle %></div>
</div>
<% end %>
</div>

<div class="row bio">
Expand Down
8 changes: 4 additions & 4 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ development:
encoding: unicode
host: localhost
pool: 5
username: postgres
password:
username: sessionizer
password: asdf1234
database: sessionizer_development

test:
Expand All @@ -13,6 +13,6 @@ test:
# Database does not work in GitHub Workflows if host parameter is not specified
host: localhost
pool: 5
username: postgres
password:
username: sessionizer
password: asdf1234
database: sessionizer_test
2 changes: 2 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
t.string "github_og_image"
t.string "github_og_url"
t.string "twitter_handle"
t.string "mastodon_url"
t.string "bluesky_handle"
t.index ["email"], name: "index_participants_on_email", unique: true
t.index ["perishable_token"], name: "index_participants_on_perishable_token"
end
Expand Down
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3.9'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure "version" is obsolete and can be removed. Additionally, the new idiom is to call this file compose.yaml. Would you mind making that change?


services:
db:
image: postgres:15
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for 15 rather than 16 or 17?

restart: always
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: sessionizer
POSTGRES_PASSWORD: asdf1234
POSTGRES_DB: sessionizer_development
ports:
- "5432:5432"

web:
build: .
depends_on:
- db
volumes:
- .:/app
environment:
DATABASE_URL: postgres://db:5432/sessionizer_development
ports:
- "3000:3000"
command: >
sh -c "
bundle install &&
rails db:setup &&
bundle exec rake app:make_believe &&
rails server -b 0.0.0.0"

volumes:
postgres_data: