Skip to content

Commit d35f39a

Browse files
committed
Add information about missing sponsors
1 parent 8bc304a commit d35f39a

File tree

10 files changed

+333
-10
lines changed

10 files changed

+333
-10
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Sponsors::MissingController < ApplicationController
2+
skip_before_action :authenticate_user!
3+
4+
# GET /sponsors/missing
5+
def index
6+
@back_path = sponsors_path
7+
@events_without_sponsors = Event.conference
8+
.left_joins(:event_sponsors)
9+
.where(event_sponsors: {id: nil})
10+
.past
11+
.includes(:organisation)
12+
.order(start_date: :desc)
13+
@events_by_year = @events_without_sponsors.group_by { |event| event.start_date&.year || "Unknown" }
14+
end
15+
end

app/views/contributions/index.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
<ul>
7272
<% talks.each do |talk| %>
73-
<li><%= link_to talk.title, "https://github.com/adrienpoly/rubyvideo/edit/main/#{talk.static_metadata.__file_path}", target: "_blank" if talk.static_metadata %> (<%= link_to talk.date.to_fs(:long), talk %>, <%= time_ago_in_words(talk.date) %> ago)</li>
73+
<li><%= link_to talk.title, "https://github.com/rubyevents/rubyevents/edit/main/#{talk.static_metadata.__file_path}", target: "_blank" if talk.static_metadata %> (<%= link_to talk.date.to_fs(:long), talk %>, <%= time_ago_in_words(talk.date) %> ago)</li>
7474
<% end %>
7575
</ul>
7676
</article>
@@ -103,7 +103,7 @@
103103
<div class="prose">
104104
<ul>
105105
<% talks.each do |talk| %>
106-
<li><%= link_to talk.title, "https://github.com/adrienpoly/rubyvideo/edit/main/#{talk.static_metadata.__file_path}", target: "_blank" if talk.static_metadata %> (<%= link_to talk.date.to_fs(:long), talk %>)</li>
106+
<li><%= link_to talk.title, "https://github.com/rubyevents/rubyevents/edit/main/#{talk.static_metadata.__file_path}", target: "_blank" if talk.static_metadata %> (<%= link_to talk.date.to_fs(:long), talk %>)</li>
107107
<% end %>
108108
</ul>
109109
</div>
@@ -136,7 +136,7 @@
136136

137137
<ul>
138138
<% talks.each do |talk| %>
139-
<li><%= link_to talk.title, "https://github.com/adrienpoly/rubyvideo/edit/main/#{talk.static_metadata.__file_path}", target: "_blank" if talk.static_metadata %> (<%= link_to talk.date.to_fs(:long), talk %>, <%= time_ago_in_words(talk.date) %> ago)</li>
139+
<li><%= link_to talk.title, "https://github.com/rubyevents/rubyevents/edit/main/#{talk.static_metadata.__file_path}", target: "_blank" if talk.static_metadata %> (<%= link_to talk.date.to_fs(:long), talk %>, <%= time_ago_in_words(talk.date) %> ago)</li>
140140
<% end %>
141141
</ul>
142142
</article>
@@ -156,7 +156,7 @@
156156

157157
<p>We are checking against <a href="https://rubyconferences.org" target="_blank">rubyconferences.org</a> to identify missing events. Below, we will list conferences with video links first, followed by those without a video link.</p>
158158

159-
<p>If you would like to contribute data for any of the events listed below, please refer to <a href="https://github.com/adrienpoly/rubyvideo/blob/main/docs/contributing.md" target="_blank">this guide</a> to add the event to the site.</p>
159+
<p>If you would like to contribute data for any of the events listed below, please refer to <a href="https://github.com/rubyevents/rubyevents/blob/main/docs/contributing.md" target="_blank">this guide</a> to add the event to the site.</p>
160160
</article>
161161

162162
<h3 class="font-bold mb-3">Conferences from RubyConferences.org we already indexed</h3>

app/views/events/_navigation.html.erb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
<%= active_link_to "Schedule", event_schedules_path(event), class: "tab", active_class: "tab-active", role: "tab" %>
1818
<% end %>
1919

20-
<% if event.sponsors.any? %>
21-
<%= active_link_to "Sponsors", event_sponsors_path(event), class: "tab", active_class: "tab-active", role: "tab" %>
20+
<%= active_link_to event_sponsors_path(event), class: class_names("tab", {"text-red-500" => !event.sponsors.any?}), active_class: "tab-active", role: "tab" do %>
21+
Sponsors
22+
<% unless event.sponsors.any? %>
23+
<%= fa("question-circle", size: :xs, class: "ml-1 fill-red-500") %>
24+
<% end %>
2225
<% end %>
2326

2427
<% if false %>

app/views/events/sponsors/index.html.erb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,22 @@
1919
</div>
2020
<% end %>
2121
<% else %>
22-
<div class="text-center py-12 text-gray-500">
23-
<p class="text-lg">No sponsors for this event yet.</p>
22+
<div class="text-center py-12">
23+
<div class="max-w-md mx-auto">
24+
<div class="text-6xl mb-4">🤝</div>
25+
<h2 class="text-2xl font-bold text-gray-900 mb-4">No Sponsors Yet</h2>
26+
<p class="text-gray-600 mb-6">
27+
Help us make this information complete! Do you know who sponsored <%= @event.name %>?
28+
</p>
29+
<div class="bg-amber-50 border border-amber-200 rounded-lg p-4 text-left">
30+
<h3 class="font-semibold text-amber-800 mb-2">How to contribute:</h3>
31+
<ul class="text-sm text-amber-700 space-y-1">
32+
<li>• Check the event website or program</li>
33+
<li>• Look for sponsor logos in videos or photos</li>
34+
<li><a href="https://github.com/rubyevents/rubyevents/blob/main/docs/ADDING_SPONSORS.md" class="underline hover:text-amber-900" target="_blank">Submit sponsor data via GitHub</a></li>
35+
</ul>
36+
</div>
37+
</div>
2438
</div>
2539
<% end %>
2640
</div>

app/views/events/talks/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</p>
2828
<p class="mt-2">
2929
Please
30-
<a href="https://github.com/adrienpoly/rubyvideo/issues/new?title=<%= CGI.escape("#{@event.name} Recordings") %>&body=<%= CGI.escape("<!-- Your Content Here -->\n\nIssue opened from event page: #{event_url(@event)}") %>" class="text-primary" target="_blank">open an issue on GitHub</a>
30+
<a href="https://github.com/rubyevents/rubyevents/issues/new?title=<%= CGI.escape("#{@event.name} Recordings") %>&body=<%= CGI.escape("<!-- Your Content Here -->\n\nIssue opened from event page: #{event_url(@event)}") %>" class="text-primary" target="_blank">open an issue on GitHub</a>
3131
if you know how to get access to the recordings of this event. Thank you!
3232
</p>
3333
</div>

app/views/events/videos/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</p>
2828
<p class="mt-2">
2929
Please
30-
<a href="https://github.com/adrienpoly/rubyvideo/issues/new?title=<%= CGI.escape("#{@event.name} Recordings") %>&body=<%= CGI.escape("<!-- Your Content Here -->\n\nIssue opened from event page: #{event_url(@event)}") %>" class="text-primary" target="_blank">open an issue on GitHub</a>
30+
<a href="https://github.com/rubyevents/rubyevents/issues/new?title=<%= CGI.escape("#{@event.name} Recordings") %>&body=<%= CGI.escape("<!-- Your Content Here -->\n\nIssue opened from event page: #{event_url(@event)}") %>" class="text-primary" target="_blank">open an issue on GitHub</a>
3131
if you know how to get access to the recordings of this event. Thank you!
3232
</p>
3333
</div>

app/views/sponsors/index.html.erb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
<%= title "Sponsors" %>
44
</h1>
55

6+
<div class="bg-amber-50 border border-amber-200 rounded-lg p-4 mb-8 mt-6 hotwire-native:hidden">
7+
<div class="flex items-start">
8+
<%= fa("question-circle", size: :sm, class: "fill-amber-600 mt-0.5 mr-3 flex-shrink-0") %>
9+
<div>
10+
<h3 class="font-semibold text-amber-800 mb-1">Sponsor data is incomplete</h3>
11+
<p class="text-sm text-amber-700 mb-2">
12+
Many conferences are still missing sponsor information. Help us complete the database!
13+
</p>
14+
<%= link_to "View conferences missing sponsor data", sponsors_missing_index_path, class: "text-sm font-medium text-amber-800 underline hover:text-amber-900" %>
15+
</div>
16+
</div>
17+
</div>
18+
619
<% if @featured_sponsors.present? %>
720
<div class="my-8 hotwire-native:hidden">
821
<div class="relative" data-controller="scroll">
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<div class="container py-8">
2+
<div class="flex items-center mb-8">
3+
<%= link_to @back_path, class: "mr-4 text-gray-500 hover:text-gray-700" do %>
4+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
5+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
6+
</svg>
7+
<% end %>
8+
<h1 class="title">
9+
<%= title "Conferences Missing Sponsor Data" %>
10+
</h1>
11+
</div>
12+
13+
<div class="bg-blue-50 border border-blue-200 rounded-lg p-6 mb-8">
14+
<div class="flex items-start">
15+
<%= fa("question-circle", size: :md, class: "fill-blue-600 mt-0.5 mr-4 flex-shrink-0") %>
16+
<div>
17+
<h2 class="font-semibold text-blue-800 text-lg mb-2">Help Complete Our Database</h2>
18+
<p class="text-blue-700 mb-4">
19+
The conferences listed below are missing sponsor information. If you have knowledge about
20+
who sponsored these events, please consider contributing this data to help make RubyEvents.org
21+
more complete.
22+
</p>
23+
<div class="bg-white border border-blue-200 rounded p-4">
24+
<h3 class="font-semibold text-blue-800 mb-2">How to contribute sponsor data:</h3>
25+
<ul class="text-sm text-blue-700 space-y-1">
26+
<li>• Research the event website, program, or recorded videos</li>
27+
<li>• Look for sponsor logos and acknowledgments</li>
28+
<li><a href="https://github.com/rubyevents/rubyevents/blob/main/docs/ADDING_SPONSORS.md" class="underline hover:text-blue-900" target="_blank">Follow our contribution guide</a> to submit the data</li>
29+
<li>• Create a pull request with the sponsor information</li>
30+
</ul>
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
36+
<% if @events_by_year.any? %>
37+
<div class="space-y-8">
38+
<% @events_by_year.each do |year, events| %>
39+
<div>
40+
<h2 class="text-2xl font-bold text-gray-900 mb-4 border-b border-gray-200 pb-2">
41+
<%= year %>
42+
<span class="text-base font-normal text-gray-500 ml-2">(<%= pluralize(events.count, "event") %>)</span>
43+
</h2>
44+
45+
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
46+
<% events.each do |event| %>
47+
<%= link_to event_path(event), class: "block bg-white border border-gray-200 rounded-lg p-4 hover:shadow-md transition-shadow hover:border-gray-300" do %>
48+
<div class="flex items-start justify-between">
49+
<div class="flex-1">
50+
<h3 class="font-semibold text-gray-900 mb-1 hover:text-brand-600">
51+
<%= event.name %>
52+
</h3>
53+
<p class="text-sm text-gray-600 mb-2"><%= event.organisation.name %></p>
54+
<div class="flex items-center text-xs text-gray-500">
55+
<%= fa("clock", size: :xs, class: "fill-gray-400 mr-1") %>
56+
<%= event.start_date&.strftime("%B %Y") || "Date unknown" %>
57+
</div>
58+
<% if event.city.present? %>
59+
<div class="flex items-center text-xs text-gray-500 mt-1">
60+
<svg class="w-3 h-3 mr-1 fill-gray-400" viewBox="0 0 24 24">
61+
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" />
62+
</svg>
63+
<%= [event.city, event.country_code].compact.join(", ") %>
64+
</div>
65+
<% end %>
66+
</div>
67+
<%= fa("question-circle", size: :sm, class: "fill-red-500 ml-2 flex-shrink-0") %>
68+
</div>
69+
<% end %>
70+
<% end %>
71+
</div>
72+
</div>
73+
<% end %>
74+
</div>
75+
76+
<div class="mt-12 text-center">
77+
<p class="text-gray-600 mb-4">
78+
Total conferences missing sponsor data: <strong><%= @events_without_sponsors.count %></strong>
79+
</p>
80+
<p class="text-sm text-gray-500">
81+
Last updated: <%= Date.current.strftime("%B %d, %Y") %>
82+
</p>
83+
</div>
84+
<% else %>
85+
<div class="text-center py-12">
86+
<div class="text-6xl mb-4">🎉</div>
87+
<h2 class="text-2xl font-bold text-gray-900 mb-4">All Conferences Have Sponsor Data!</h2>
88+
<p class="text-gray-600">
89+
Great news! All conferences in our database have sponsor information.
90+
</p>
91+
</div>
92+
<% end %>
93+
</div>

config/routes.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
resources :sponsors, param: :slug, only: [:index, :show] do
66
resource :logos, only: [:show, :update], controller: "sponsors/logos"
77
end
8+
9+
namespace :sponsors do
10+
resources :missing, only: [:index]
11+
end
812
extend Authenticator
913

1014
# static pages

0 commit comments

Comments
 (0)