From 7f8cd911f027cb8ad5c0b068ba543062292ff9f4 Mon Sep 17 00:00:00 2001 From: Simmon Li Date: Sun, 17 Nov 2024 22:44:05 +0000 Subject: [PATCH] Changes stomped because of a wreckless force push (#78) * Changes stomped because of a wreckless force push * Fix HTML ent Admin Show --- app/views/admin/events/show.html.erb | 2 +- app/views/events/_event.html.erb | 14 --------- app/views/events/_event2.html.erb | 45 ---------------------------- app/views/events/index.html.erb | 12 ++++---- app/views/events/show.html.erb | 4 +-- config/routes.rb | 17 ++++++----- 6 files changed, 18 insertions(+), 76 deletions(-) delete mode 100644 app/views/events/_event2.html.erb diff --git a/app/views/admin/events/show.html.erb b/app/views/admin/events/show.html.erb index 0a50122..9059494 100644 --- a/app/views/admin/events/show.html.erb +++ b/app/views/admin/events/show.html.erb @@ -6,5 +6,5 @@ <%= render partial: "layouts/event_layout" %> <% content_for :page_title do %> - <%= @event.name %> + <%== @event.name %> <% end %> diff --git a/app/views/events/_event.html.erb b/app/views/events/_event.html.erb index 0cc262c..35337b7 100644 --- a/app/views/events/_event.html.erb +++ b/app/views/events/_event.html.erb @@ -9,30 +9,16 @@

<%= event.start_time %>

<%= event.location %> -

Food and drinks provided by our sponsor.

Agenda

- -

6pm

-

- Arrive, chat, and get pizza -

- -

7pm

<%= event.description %>
- -

remainder of time until 9pm

-

- Networking and drinks -

-
diff --git a/app/views/events/_event2.html.erb b/app/views/events/_event2.html.erb deleted file mode 100644 index 7f1f59f..0000000 --- a/app/views/events/_event2.html.erb +++ /dev/null @@ -1,45 +0,0 @@ -
- <% future = Time.zone.now < event2.start_at %> -
-
-

<%= link_to event2.name, event2 %>

-
-

<%= event2.start_time %>

- <%= event2.location %> -
-
- -
-

Agenda

-
-
- <%= event2.description %> -
-
-
-
-
- <% if future %> -
- <%= link_to event2.rsvp_link, class: "rounded-full bg-ruby px-4 py-2.5 font-semibold text-white/100 shadow-sm ring-1 ring-inset ring-ruby hover:bg-red-400" do %> - Join the event - <% end %> -
- <% end %> - <% if event2.sponsor %> -

-
- <%= link_to event2.sponsor_link do %> - <% if event2.sponsor_logo.present? %> - <%= image_tag "sponsors/#{event2.sponsor_logo}", class: "max-h-20" %> - <% else %> - <%= event2.sponsor.titleize %> - <% end %> - <% end %> -
- <% end %> -

-
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 2bfe3dc..d8f5cd4 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -1,9 +1,3 @@ -<%= content_for :event_content do %> - <%= render partial: "event2", collection: @events %> - - -<% end %> - <% content_for :page_title do %> Home <% end %> @@ -14,4 +8,10 @@ looking forward to seeing you! <% end %> +<%= content_for :event_content do %> + <%= render partial: "event", collection: @events %> + + +<% end %> + <%= render partial: "layouts/event_layout" %> diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index ff52f60..30d696a 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -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" %> diff --git a/config/routes.rb b/config/routes.rb index e49836f..3c637d0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 @@ -27,4 +20,12 @@ 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