Skip to content

Commit

Permalink
Update event template (#77)
Browse files Browse the repository at this point in the history
* Update template to be free form

* Add admin_root route

* Fix HTML entity
  • Loading branch information
crespire authored Nov 17, 2024
1 parent 6119147 commit a377597
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 81 deletions.
14 changes: 0 additions & 14 deletions app/views/events/_event.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,16 @@
<div class="flex flex-col gap-3">
<p class="mb-2"><%= event.start_time %></p>
<%= event.location %>
<p>Food and drinks provided by our sponsor.</p>
</div>
</div>

<div class="w-full md:w-1/2 my-8 pl-1">
<h2 class="mb-2">Agenda</h2>

<p class="mb-0"><em>6pm</em></p>
<p class="ml-4">
Arrive, chat, and get pizza
</p>

<p class="mb-0"><em>7pm</em></p>
<div class="ml-4">
<div class="w-4/5 mt-2">
<%= event.description %>
</div>
</div>

<p class="mb-0"><em>remainder of time until 9pm</em></p>
<p class="ml-4">
Networking and drinks
</p>

</div>
</div>
<div class="mx-auto text-center">
Expand Down
45 changes: 0 additions & 45 deletions app/views/events/_event2.html.erb

This file was deleted.

12 changes: 6 additions & 6 deletions app/views/events/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<%= content_for :event_content do %>
<%= render partial: "event2", collection: @events %>

<h2 class="hidden only:block">We're planning our next outing, stay tuned!</h2>
<% end %>

<% content_for :page_title do %>
Home
<% end %>
Expand All @@ -14,4 +8,10 @@
looking forward to seeing you!
<% end %>

<%= content_for :event_content do %>
<%= render partial: "event", collection: @events %>

<h2 class="hidden only:block">We're planning our next outing, stay tuned!</h2>
<% end %>

<%= render partial: "layouts/event_layout" %>
4 changes: 2 additions & 2 deletions app/views/events/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<% content_for :page_title do %>
<%= @event.name %>
<%== @event.name %>
<% end %>

<%= content_for :event_content do %>
<%= render partial: "events/event2", locals: { event2: @event } %>
<%= render partial: "events/event", locals: { event: @event } %>
<% end %>

<%= render partial: "layouts/event_layout" %>
9 changes: 6 additions & 3 deletions app/views/layouts/_event_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
Meetups for Toronto's Ruby community
</h1>

<p>We're a group of Ruby developers who meet up to talk about programming, the industry, and life. We're working to strengthen the local Ruby community and provide a positive space for everyone to connect.</p>
<p>We're a group of Ruby developers who meet up to talk about programming,
the industry, and life. We're working to strengthen the local Ruby
community and provide a positive space for everyone to connect.</p>
</div>
<div class="text-center flex flex-col gap-3">
<%# Event content is in the event view files %>
<%= yield(:event_content) %>
</div>
<div class="mx-auto w-4/5 md:w-2/3">
<%= render 'layouts/newsletter_form' %>
<%= render "layouts/newsletter_form" %>
</div>
<%= render 'layouts/supporting_companies' %>
<%= render "layouts/supporting_companies" %>
</div>
</main>
20 changes: 9 additions & 11 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
Rails.application.routes.draw do
resources :events, only: %i[index show], param: :slug do
collection do
get 'past', to: 'events#past'
get 'all', to: 'events#all', as: :all
get 'next', to: 'events#next'
end
end

namespace :admin do
root to: redirect('/admin/events')
resources :events
end

Expand All @@ -17,14 +10,19 @@
# Can be used by load balancers and uptime monitors to verify that the app is live.
get 'up' => 'rails/health#show', as: :rails_health_check

# Defines the root path route ("/")
# root "posts#index"
#
root 'events#index'
get 'past-events', to: redirect('/events/past')
get 'past_events', to: redirect('/events/past')
get 'chat', to: 'static#chat'
get 'about', to: 'static#about'
get 'calendar', to: 'static#calendar'
get 'code-of-conduct', to: 'static#coc'

resources :events, only: %i[index show], param: :slug do
collection do
get 'past', to: 'events#past'
get 'all', to: 'events#all', as: :all
get 'next', to: 'events#next'
end
end
end

0 comments on commit a377597

Please sign in to comment.