-
-
Notifications
You must be signed in to change notification settings - Fork 262
/
show.html.erb
169 lines (155 loc) · 6.85 KB
/
show.html.erb
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<%= content_for(:header_text, @event.title) %>
<% if @can_edit || @checkiner %>
<div class="organizer-breadcrumb">
<%= event_special_permissions_text(@event, @can_edit ? :editor : :checkiner) %>
<div class="header-actions">
<% if @can_edit %>
<%= link_to 'Edit', edit_event_path(@event), class: "btn fa-before fa-edit" %>
<%= link_to 'Organizer Console', event_organizer_tools_path(@event), class: "btn fa-before fa-bullhorn" %>
<% elsif @checkiner %>
<%= link_to 'Checkin Console', event_event_sessions_path(@event), class: "btn" %>
<% end %>
<% if @can_publish && !@event.published? %>
<%= render 'events/unpublished_events/publish_event_button', event: @event %>
<% if current_user.admin? || current_user.publisher? %>
<%= render 'events/unpublished_events/mark_as_spam_button', event: @event %>
<% end %>
<% end %>
</div>
</div>
<% end %>
<div class="row">
<div class="col-md-8">
<% unless @event.has_multiple_locations? %>
<div class="location-text">
<% if @event.location %>
<%= link_to pretty_print_address(@event.location), location_map_link(@event.location) %>
<% else %>
This event currently has no location!
<% end %>
</div>
<% end %>
<div class='session-display'>
<% @event.event_sessions.each do |event_session| %>
<div class='event-session'>
<h2 class='name'><%= event_session.name %></h2>
<div class='date'><%= formatted_session_date(event_session) %></div>
<div class='time'>Start time: <%= formatted_session_time(event_session, :starts_at) %></div>
<div class='time'>End time: <%= formatted_session_time(event_session, :ends_at) %></div>
<div class='ical'>
<%= link_to event_event_session_path(@event, event_session, format: :ics), download: "#{event_session.id}.ics" do %>
<i class="fa fa-calendar-plus-o"></i> Export to iCal
<% end %>
</div>
<div class='gcal'>
<%= link_to google_calendar_event_url(@event, event_session), target: "_blank" do %>
<i class="fa fa-calendar-plus-o"></i> Export to Google Calendar
<% end %>
</div>
<% if @event.has_multiple_locations? %>
<div class='location-text' style="margin-top: 10px;">
<%= link_to pretty_print_address(event_session.true_location), location_map_link(event_session.true_location) %>
</div>
<% end %>
</div>
<% end %>
</div>
<% if @event.course %>
<div id="course">
<h2>Course</h2>
<p>
<%= @event.course.description.html_safe %>
</p>
<p>
<%= link_to "Click here for more information about class levels in this course!", levels_event_path(@event) %>
</p>
</div>
<% end %>
<div class="details">
<%= simple_format_with_html(@event.details) %>
<% if current_user %>
<% if @event.volunteer?(current_user) || @can_edit %>
<h2>Volunteer Details</h2>
<%= simple_format_with_html(@event.volunteer_details) %>
<% end %>
<% if @event.allow_student_rsvp? && (@event.student?(current_user) || @can_edit) %>
<h2>Student Details</h2>
<%= simple_format_with_html(@event.student_details) %>
<% end %>
<% end %>
</div>
</div>
<div class="col-md-4">
<div class='location-display'>
<% if @event.location.present? && !Rails.env.test? %>
<%= render "shared/map", locations: @event.all_locations %>
<% end %>
</div>
<% unless @event.historical? || @event.past? %>
<div class='rsvp-actions'>
<% if user_signed_in? %>
<%= render 'shared/rsvp_actions', event: @event %>
<% else %>
<%= render 'shared/rsvp_actions_unauthenticated', event: @event, stay_on_event: false %>
<% end %>
</div>
<% end %>
<% if user_signed_in? && @event.public_email.present? %>
<p class='public-email'>Questions? Email <%= mail_to @event.public_email %></p>
<% end %>
<div class="organizers">
<h3>Organized By:</h3>
<ul class="attendees">
<% if organizer_list.any? %>
<% organizer_list.each do |organizer| %>
<li class='attendee'><%= user_gravatar(organizer) %><%= link_to organizer.full_name, organizer.profile_path %></li>
<% end %>
<% else %>
<li>No Organizer Assigned</li>
<% end %>
</ul>
</div>
<h3><%= pluralize(@event.checked_in_rsvps(Role::VOLUNTEER).count, "volunteer") %>!</h3>
<% if @ordered_rsvps[Role::VOLUNTEER].none? %>
<div class="mb20">
No volunteers are currently signed up for this event.
</div>
<% else %>
<ul class="attendees">
<% @ordered_rsvps[Role::VOLUNTEER].each do |rsvp| %>
<li class='attendee'><%= user_gravatar(rsvp.loaded_user) %><%= link_to rsvp.loaded_user.full_name, rsvp.loaded_user.profile_path, class: rsvp_class(rsvp) %></li>
<% end %>
</ul>
<% end %>
<% if @event.allow_student_rsvp? %>
<h3><%= pluralize(@event.checked_in_rsvps(Role::STUDENT).count, "student") %>!</h3>
<% if @ordered_rsvps[Role::STUDENT].none? %>
<div class="mb20">
No students are currently signed up for this event.
</div>
<% else %>
<ul class="attendees">
<% @ordered_rsvps[Role::STUDENT].each do |rsvp| %>
<li class='attendee'><%= user_gravatar(rsvp.loaded_user) %><%= link_to rsvp.loaded_user.full_name, rsvp.loaded_user.profile_path, class: rsvp_class(rsvp) %></li>
<% end %>
</ul>
<% end %>
<% end %>
<% if @ordered_waitlist_rsvps[Role::VOLUNTEER].any? %>
<h3><%= @ordered_waitlist_rsvps[Role::VOLUNTEER].length %> waitlisted <%= "volunteer".pluralize(@ordered_waitlist_rsvps[Role::VOLUNTEER]) %>!</h3>
<ul class="attendees">
<% @ordered_waitlist_rsvps[Role::VOLUNTEER].each do |rsvp| %>
<li class='attendee'><%= user_gravatar(rsvp.loaded_user) %><%= link_to rsvp.loaded_user.full_name, rsvp.loaded_user.profile_path %><span class='waitlist-number pull-right'>#<%= rsvp.waitlist_position %></span></li>
<% end %>
</ul>
<% end %>
<% if @ordered_waitlist_rsvps[Role::STUDENT].any? %>
<h3><%= @ordered_waitlist_rsvps[Role::STUDENT].length %> waitlisted <%= "student".pluralize(@ordered_waitlist_rsvps[Role::STUDENT]) %>!</h3>
<ul class="attendees">
<% @ordered_waitlist_rsvps[Role::STUDENT].each do |rsvp| %>
<li class='attendee'><%= user_gravatar(rsvp.loaded_user) %><%= link_to rsvp.loaded_user.full_name, rsvp.loaded_user.profile_path %><span class='waitlist-number pull-right'>#<%= rsvp.waitlist_position %></span></li>
<% end %>
</ul>
<% end %>
</div>
</div>