Skip to content

Commit 58faf9f

Browse files
committed
Focus support references on regular runners
1 parent 74b21ff commit 58faf9f

File tree

9 files changed

+26
-12
lines changed

9 files changed

+26
-12
lines changed

app/controllers/static_pages_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class StaticPagesController < ApplicationController
2-
allow_unauthenticated_access(only: [ :about, :home, :results, :support ])
2+
allow_unauthenticated_access(only: [ :about, :home, :results ])
33

44
def about
55
end

app/helpers/application_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ def format_total_time(seconds)
1919

2020
parts.join(" ")
2121
end
22+
23+
def repeat_runner?
24+
authenticated? && Current.user.results.count >= 3
25+
end
2226
end

app/views/event_mailer/participation_notification.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,10 @@
307307
<ul style="padding: 0; margin: 0 0 10px 0; list-style-type: disc;">
308308
<li style="margin:0 0 10px 30px;" class="list-item-first">Come along to the <a href="<%= courses_url %>" style="color: #DB2955;">next event</a></li>
309309
<li style="margin:0 0 10px 30px;">Tell a friend (or running foe) about it</li>
310-
<li style="margin:0 0 10px 30px;">Share your participation on Strava or social media</li>
310+
<li style="margin:<%= @result_count >= 3 ? '0 0 10px 30px' : '0 0 0 30px' %>;" class="<%= @result_count >= 3 ? '' : 'list-item-last' %>">Share your participation on Strava or social media</li>
311+
<% if @result_count >= 3 %>
311312
<li style="margin: 0 0 0 30px;" class="list-item-last">Consider <a href="<%= support_url %>" style="color: #DB2955;">supporting WS10 financially</a></li>
313+
<% end %>
312314
</ul>
313315
</td>
314316
</tr>

app/views/event_mailer/participation_notification.text.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ If you enjoyed this event, please:
1616
- Come along to the next event (<%= courses_url %>)
1717
- Tell a friend (or running foe) about it
1818
- Share your participation on Strava or social media
19-
- Consider supporting WS10 financially (<%= support_url %>)
19+
<% if @result_count >= 3 %> - Consider supporting WS10 financially (<%= support_url %>)
20+
<% end %>
2021

2122
Western Sydney 10 is a young event and we're still learning. If you've got any suggestions for how to improve the events, the website, or these results emails, simply reply to this email to let me know!
2223

app/views/event_mailer/result_notification.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,10 @@
306306
<ul style="padding: 0; margin: 0 0 10px 0; list-style-type: disc;">
307307
<li style="margin:0 0 10px 30px;" class="list-item-first">Come along to the <a href="<%= courses_url %>" style="color: #DB2955;">next event</a></li>
308308
<li style="margin:0 0 10px 30px;">Tell a friend (or running foe) about it</li>
309-
<li style="margin:0 0 10px 30px;">Share your result on Strava or social media</li>
309+
<li style="margin:<%= @result_count >= 3 ? '0 0 10px 30px' : '0 0 0 30px' %>;" class="<%= @result_count >= 3 ? '' : 'list-item-last' %>">Share your result on Strava or social media</li>
310+
<% if @result_count >= 3 %>
310311
<li style="margin: 0 0 0 30px;" class="list-item-last">Consider <a href="<%= support_url %>" style="color: #DB2955;">supporting WS10 financially</a></li>
312+
<% end %>
311313
</ul>
312314
</td>
313315
</tr>

app/views/event_mailer/result_notification.text.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ If you enjoyed this event, please:
1616
- Come along to the next event (<%= courses_url %>)
1717
- Tell a friend (or running foe) about it
1818
- Share your result on Strava or social media
19-
- Consider supporting WS10 financially (<%= support_url %>)
19+
<% if @result_count >= 3 %> - Consider supporting WS10 financially (<%= support_url %>)
20+
<% end %>
2021

2122
Western Sydney 10 is a young event and we're still learning. If you've got any suggestions for how to improve the events, the website or these results emails, simply reply to this email to let me know!
2223

app/views/events/show.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@
4545
<p class="mt-2 text-gray-700"><%= sanitize @event.description %></p>
4646
<% end %>
4747

48-
<% if @event.finalised? %>
48+
<% if @event.finalised? && repeat_runner? %>
4949
<div class="text-center my-4">
50-
<span class="text-base text-gray-600 mr-3">Enjoyed the event?</span>
51-
<%= link_to "Support WS10", support_path, class: "font-medium text-primary underline underline-offset-3 hover:text-primary-hover hover:no-underline" %>
50+
<span class="text-base text-gray-600">Enjoyed the event? You might like to
51+
</span>
52+
<%= link_to "support WS10", support_path, class: "font-medium text-primary underline underline-offset-3 hover:text-primary-hover hover:no-underline" %>
5253
</div>
5354
<% end %>
5455

app/views/static_pages/about.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@
4545
<li>Come along and participate! Having a friendly group of people makes it worth organising.</li>
4646
<li>Invite others! Bring along some friendly, enthusiastic people to run with us.</li>
4747
<li>Volunteer occasionally! Perhaps you can do the timing one month? Or bring an esky and some water bottles? Let me know if you're keen to help and we can figure something out!</li>
48-
<li><%= link_to "Support financially!", support_path, class: "font-medium text-brand-brown hover:text-brand-grey underline underline-offset-3 hover:no-underline" %> Your contribution helps improve the event for everyone.</li>
48+
<% if repeat_runner? %>
49+
<li><%= link_to "Support financially!", support_path, class: "font-medium text-brand-brown hover:text-brand-grey underline underline-offset-3 hover:no-underline" %> Your contribution helps improve the event for everyone.</li>
50+
<% end %>
4951
</ol>
5052
</dd>
5153
</div>
5254

5355
<div>
5456
<dt class="text-xl/7 font-medium text-gray-900" id="why-free">How much does it cost to participate?</dt>
55-
<dd class="mt-2 text-xl/7 text-gray-600">The event is free but <%= link_to "voluntary contributions are welcome", support_path, class: "font-medium text-brand-brown hover:text-brand-grey underline underline-offset-3 hover:no-underline" %>.</dd>
56-
<dd class="mt-2 text-xl/7 text-gray-600">In 2025 I was able to keep WS10 free by keeping costs super low but the event is growing and I'm keen to improve it. If you're able to chip in $5 per event you take part in or $25 for the whole year I'd be grateful.</dd>
57+
<dd class="mt-2 text-xl/7 text-gray-600">The event is completely free! Contributions from regular attendees are gratefully received, get in touch if you'd like to know more.</dd>
5758
</div>
5859

5960
<div>

app/views/static_pages/home.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@
8080
</div>
8181
<div class="text-center space-x-4">
8282
<%= link_to "Find out more", about_path, class: "inline-flex items-center justify-center px-4 py-[calc(theme(spacing.2)-1px)] rounded-full border border-transparent bg-primary shadow-md whitespace-nowrap text-base font-medium text-white hover:bg-primary-hover" %>
83-
<%= link_to "Support WS10", support_path, class: "inline-flex items-center justify-center px-4 py-2 rounded-full border border-primary whitespace-nowrap text-base font-medium text-primary hover:bg-primary-bg" %>
83+
<% if repeat_runner? %>
84+
<%= link_to "Support WS10", support_path, class: "inline-flex items-center justify-center px-4 py-2 rounded-full border border-primary whitespace-nowrap text-base font-medium text-primary hover:bg-primary-bg" %>
85+
<% end %>
8486
</div>
8587
</div>
8688
</section>

0 commit comments

Comments
 (0)