Skip to content

Commit b3b82a4

Browse files
committed
add attendees and coaches count info
1 parent 565e8c4 commit b3b82a4

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

app/assets/stylesheets/application.css

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,29 @@ input.grey {
504504
margin-bottom: .5em;
505505
}
506506

507+
.info-wrapper {
508+
display: flex;
509+
/* justify-content: space-evenly; */
510+
margin-bottom: 1em;
511+
font-weight: bold;
512+
color: #fff;
513+
}
514+
515+
.info-wrapper .info {
516+
border-right: 1px solid #ffff;
517+
padding: 15px;
518+
text-align: left;
519+
width: 30em;
520+
}
521+
522+
.cc-gradient {
523+
background: linear-gradient(to right, #28B4F0, #F0A0C8);
524+
}
525+
507526
.language-tag {
508527
padding: 0 .7em;
509528
font-size: 12px;
510529
width: fit-content;
511-
background: linear-gradient(to right, #28B4F0, #F0A0C8);
512530
color: #fff;
513531
border-radius: 5px;
514532
}

app/controllers/admin/groups_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ class Admin::GroupsController < ApplicationController
55

66
def index
77
@event_groups = @event.event_groups
8+
@coaches_count = @event.coach_applications.approved.size
9+
@attendees_count = @event.applications.application_selected.size
810
end
911

1012
# An action to regenerate

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<% if @event.has_groups? %>
22

3+
<div class="info-wrapper cc-gradient">
4+
<div class="info">Attendees: <%= @attendees_count %></div>
5+
<div class="info">Coaches: <%= @coaches_count %></div>
6+
</div>
37
<%= button_to "Regenerate groups", regenerate_admin_event_groups_path(@event), method: :post %>
48
<% @event_groups.each do |event_group| %>
59
<h2><%= event_group.name %></h2>
@@ -18,7 +22,7 @@
1822
<span>
1923
<%= application.name %>
2024
</span>
21-
<span class="language-tag">
25+
<span class="language-tag cc-gradient">
2226
<% if application.language_de === true && application.language_en === true %>
2327
both languages
2428
<% elsif application.language_de === true && application.language_en === false %>
@@ -36,7 +40,7 @@
3640
<span>
3741
<%= application.coach.name %>
3842
</span>
39-
<span class="language-tag">
43+
<span class="language-tag cc-gradient">
4044
<% if application.coach.language_de === true && application.coach.language_en === true %>
4145
both languages
4246
<% elsif application.coach.language_de === true && application.coach.language_en === false %>

0 commit comments

Comments
 (0)