+ <% if !@small %>
+
<%= helpers.format_event_time(event.start_time) %>
+ <% end %>
+
+
+
+
+ <% if event.organization && !@small %>
+
<%= event.organization.name %>
+ <% end %>
+
+ <% if event.location.present? %>
+
+
+
<%= event.location %>
+
+
+ <% else %>
+
+ <% end %>
+
+ <% if @small %>
+
<%= helpers.format_event_time(event.start_time) %>
+ <% end %>
+
+
+
+ <%= truncate(event.description, length: 150) %>
+
+
+ <% if event.type_of_event.present? %>
+ <%
+ # Helper method to categorize event types
+ def categorize_event_type(event_type)
+ return "Other" if event_type.blank?
+
+ type = event_type.first.to_s.downcase
+
+ # Fundraiser events
+ if type.include?('fundraiser') || type.include?('fundraising')
+ return "Fundraiser"
+ end
+
+ # Volunteer events
+ if type.include?('volunteer') || type.include?('volunteering')
+ return "Volunteer"
+ end
+
+ # Outreach events (community, education, awareness, etc.)
+ if type.include?('community') || type.include?('outreach') ||
+ type.include?('awareness') || type.include?('education') ||
+ type.include?('workshop') || type.include?('training') ||
+ type.include?('class') || type.include?('program') ||
+ type.include?('event') || type.include?('meeting') ||
+ type.include?('cultural') || type.include?('art') ||
+ type.include?('music') || type.include?('sports') ||
+ type.include?('recreation') || type.include?('job') ||
+ type.include?('technology')
+ return "Outreach"
+ end
+
+ # Everything else
+ return "Other"
+ end
+
+ badge_bg_colors = {
+ "Fundraiser" => "#9ae2e0",
+ "Volunteer" => "#fc8383",
+ "Outreach" => "#113c7b",
+ "Other" => "#0782d0"
+ }
+ %>
+ <% badge_text_colors = { "Fundraiser" => "#ffffff", "Volunteer" => "#ffffff", "Outreach" => "#ffffff", "Other" => "#ffffff" } %>
+
+ <% event.type_of_event.each do |type| %>
+ <% category = categorize_event_type([type]) %>
+ <%= type %>
+ <% end %>
+
+ <% end %>
+
+ <% if @event.image.attached? %>
+ <%= image_tag url_for(@event.image), alt: @event.title, class: 'shadow rounded logo-size bg-white' %>
+ <% end %>
+
+
+ <% if event.published %>
+ Published
+ <% else %>
+ Draft
+ <% end %>
+
+