-
Notifications
You must be signed in to change notification settings - Fork 16
/
_host_tea_time_info.html.haml
28 lines (28 loc) · 1.39 KB
/
_host_tea_time_info.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
%h2.main.upcoming.host Hosting
- if !tea_times.count.zero?
%ul.upcoming.host
- tea_times.each do |tea_time|
%li.tea-time{ class: (:cancelled if tea_time.cancelled?) }
= render partial: 'teatime_info', locals: {tea_time: tea_time, att: nil}
- if current_user.host?
.attendees-container
- if tea_time.attendances.length > 0
%h3.attendees Attendees
- tea_time.attendances.group_by(&:status).each do |k,v|
%ul.attendees-list{:class => "#{k}"}
%h4 #{k.capitalize}
- v.map(&:user).each do |a|
%li.attendee-names= link_to a.name, "mailto:#{a.email}"
.email-all{:class => "#{k}"}= link_to "Email All", "mailto:#{tea_time.attendee_emails(filter: ->(x) { x.flake? || x.no_show?})}"
- else
%h3.attendees.none No attendees yet!
.controls
- unless tea_time.occurred? || tea_time.cancelled?
%h6.left= link_to 'Edit details', edit_tea_time_path(tea_time)
%h6.right= link_to 'Cancel tea time', cancel_tea_time_path(tea_time), :method => :put, :data => { :confirm => 'Are you sure?' }
- else
%h6.right This tea time has been cancelled.
- else
%p
You're not hosting any upcoming tea times! Let's change that.
=link_to "Create a new tea time!", new_tea_time_path