Skip to content

Commit 90d6fec

Browse files
authored
Merge pull request #250 from rubymonsters/coach_improvements
Change gender selection closes #242
2 parents c95da1d + 19d4b87 commit 90d6fec

25 files changed

+168
-27
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Layout/HashAlignment:
1717
Naming/PredicateName:
1818
Enabled: false
1919

20+
Style/MutableConstant:
21+
Enabled: false
22+
2023
Style/HashEachMethods:
2124
Enabled: false
2225

app/assets/stylesheets/application.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ input[type=submit].button_link {
219219
margin-top: 100px;
220220
}
221221

222+
#info-for-coaches {
223+
background-color: #e7f6fd;
224+
text-align: center;
225+
border: thin solid #1e64b4;
226+
color: #1e64b4;
227+
}
228+
222229
/*Table*/
223230

224231
table {

app/controllers/admin/events_controller.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ def event_params
7171
:copy_templates_from_event_id,
7272
:confirmation_deadline,
7373
:reminder_date,
74-
:coach_registration_enabled)
74+
:coach_registration_enabled,
75+
:coach_the_coaches_date,
76+
:coach_the_coaches_start_time,
77+
:coach_the_coaches_end_time,
78+
:installation_get_together_date,
79+
:installation_get_together_start_time,
80+
:installation_get_together_end_time)
7581
end
7682

7783
def send_selection_emails(applications)

app/controllers/coach_applications_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def find_coach_application
5656

5757
def create_coach_application_params
5858
params.require(:coach_application).
59-
permit(:installationparty, :workshopday, :lightningtalk, :notes, :first_time_coaching)
59+
permit(:installationparty, :workshopday, :lightningtalk, :notes, :first_time_coaching, :coach_the_coaches, :sponsor)
6060
end
6161

6262
def check_application_status

app/controllers/coaches_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def update
3636

3737
def coach_params
3838
params.require(:coach).permit(:name,
39-
:female,
39+
:gender,
4040
:language_en,
4141
:language_de,
4242
:notifications,

app/helpers/coaches_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module CoachesHelper
2+
def genders_for_form
3+
Coach::GENDERS.map do |gender|
4+
[gender.to_s.humanize, gender]
5+
end
6+
end
7+
end

app/models/coach.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class Coach < ApplicationRecord
2+
GENDERS = [:female, :male, :other, :prefer_not_to_say]
23
belongs_to :user
34
accepts_nested_attributes_for :user
45
has_many :coach_applications

app/views/admin/coach_applications/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<th><%= link_to("Email", order: order("upper(email)"), class: "table-header-link") %></th>
1111
<th><div class="tooltip"><span class="tooltiptext">English</span><%= link_to("🇬🇧", order: order("language_en")) %></div></th>
1212
<th><div class="tooltip"><span class="tooltiptext">German</span><%= link_to("🇩🇪", order: order("language_de")) %></div></th>
13-
<th><div class="tooltip"><span class="tooltiptext">Female</span>👩</div></th>
13+
<th><div class="tooltip"><span class="tooltiptext">Gender</span>Gender</div></th>
1414
<th><div class="tooltip"><span class="tooltiptext">Installation party</span>🖥</div></th>
1515
<th><div class="tooltip"><span class="tooltiptext">Workshop day</span>🎓</div></th>
1616
<th><div class="tooltip"><span class="tooltiptext">Lightning talk approved</span>🆗</div></th>
@@ -28,7 +28,7 @@
2828
<td><%= application.coach.user.email %></td>
2929
<td class="center"><% if application.coach.language_en %><% end %></td>
3030
<td class="center"><% if application.coach.language_de %><% end %></td>
31-
<td class="center"><% if application.coach.female %><% end %></td>
31+
<td class="center"><%= application.coach.gender.humanize %></td>
3232
<td class="center"><% if application.installationparty %><% end %></td>
3333
<td class="center"><% if application.workshopday %><% end %></td>
3434
<td>

app/views/admin/events/edit.html.erb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,30 @@
2222
<%= error_message(@event, :end_time) %>
2323
<p><%= f.text_field :end_time %></p>
2424

25+
<p><%= f.label(:coach_the_coaches_date, "Coach the Coaches date:") %></p>
26+
<%= error_message(@event, :coach_the_coaches_date) %>
27+
<p><%= f.date_select :coach_the_coaches_date %></p>
28+
29+
<p><%= f.label(:coach_the_coaches_start_time, "Coach the coaches starts at:") %></p>
30+
<%= error_message(@event, :coach_the_coaches_start_time) %>
31+
<p><%= f.time_select :coach_the_coaches_start_time %></p>
32+
33+
<p><%= f.label(:coach_the_coaches_end_time, "Coach the coaches ends at:") %></p>
34+
<%= error_message(@event, :coach_the_coaches_end_time) %>
35+
<p><%= f.time_select :coach_the_coaches_end_time %></p>
36+
37+
<p><%= f.label(:installation_get_together_date, "Installation Get-Together date:") %></p>
38+
<%= error_message(@event, :installation_get_together_date) %>
39+
<p><%= f.date_select :installation_get_together_date %></p>
40+
41+
<p><%= f.label(:installation_get_together_start_time, "Installation Get-Together starts at:") %></p>
42+
<%= error_message(@event, :installation_get_together_start_time) %>
43+
<p><%= f.time_select :installation_get_together_start_time %></p>
44+
45+
<p><%= f.label(:installation_get_together_end_time, "Installation Get-Together ends at:") %></p>
46+
<%= error_message(@event, :installation_get_together_end_time) %>
47+
<p><%= f.time_select :installation_get_together_end_time %></p>
48+
2549
<p><%= f.label(:application_start, "Applications start on:") %></p>
2650
<%= error_message(@event, :application_start) %>
2751
<p><%= f.date_select :application_start %></p>

app/views/applications/_info.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1><%= @event.name %> <%= l @event.scheduled_at %> </h1>
1+
<h1><%= @event.name %> <%= l @event.installation_get_together_date, format: :short %> & <%= l @event.scheduled_at %> </h1>
22

33
<article>
44
<% if @application.nil? || @application.errors.empty? %>

0 commit comments

Comments
 (0)