forked from AgileVentures/WebsiteOne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow.html.erb
235 lines (217 loc) · 9.84 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<div class="row">
<div class="col-xs-12">
<h1><%= @event.name %></h1>
<p><%= auto_link(@event.description) %></p>
</div>
</div>
<hr/>
<div class="row">
<div class="col-xs-4">
<p>Event type: <%= @event.category %></p>
<p>Event for: <%= @event.for %></p>
</div>
<div class="col-xs-8">
<% if user_signed_in? %>
<div class="dropdown dropdown-beside-HOA pull-right">
<button class="btn btn-default dropdown-toggle" type="button" id="actions-dropdown" data-toggle="dropdown">
Event Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="actions-dropdown">
<li role="presentation">
<%= link_to 'Edit Event Details', edit_event_path(@event), role: 'menuitem', tabindex: '-1' %>
</li>
<li role="edit_hoa_link">
<%= link_to 'Edit hangout link', '#', remote: true, data: {toggle: 'collapse', target: '#edit-link-form'}, role: 'menuitem', tabindex: '-1' %>
</li>
<li role="edit_yt_link">
<%= link_to 'Edit youtube link', '#', remote: true, data: {toggle: 'collapse', target: '#edit-yt-link-form'}, role: 'menuitem', tabindex: '-1' %>
</li>
</ul>
</div>
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
<% if !@recent_hangout.try(:live?) and @event.less_than_ten_till_start?%>
<div class='btn-jitsi pull-right'>
<%= link_to @event.jitsi_room_link, target: '_blank' do %>
<button type="button" class="btn btn-primary" id='start-jitsi'>
Start Jitsi Meet
</button>
<% end %>
</div>
<div class="btn-HOA pull-right">
<%= button_to 'Start Hangout Instructions', 'https://support.google.com/youtube/answer/7083786', id: 'hoa_instructions', class: "btn btn-primary", form: {target: '_blank'} %>
</div>
<% end %>
<% end %>
</div>
</div>
<hr/>
<div class="row" id="hangout-details">
<% if @event.next_event_occurrence_with_time %>
<div class="col-xs-12 col-sm-6">
<h4>Next scheduled event:</h4>
<div class="calendar-text">
<a href='#' id='calendar_link'><i class="fa fa-calendar-plus-o"></i></a><span class="month"><%= local_time(@event.next_event_occurrence_with_time[:time],'%A, %B %d, %Y') %></span>
<div id='calendar_links'>
<i class='fa fa-google'></i><%= link_to 'Export to Google Cal', google_calendar_link(@event) %>
</div>
<br/>
<i class="fa fa-clock-o"></i><span id='local_time'><%= raw show_local_time_range(@event.next_event_occurrence_with_time[:time], @event.duration) %></span><br/>
<% if @event.schedule.recurrence_rules.map { |rule| rule.class.name }.include?('IceCube::WeeklyRule') %>
<% if @event.repeats_every_n_weeks == 2 %>
<p class="help-block">Occurs every two weeks at the specified times</p>
<% else %>
<p class="help-block">Occurs weekly at the specified times</p>
<% end %>
<% end %>
</div>
</div>
<% end %>
<% if @event.creator %>
<%= set_column_width %>
<div class="col-xs-12 col-sm-2">
<div class="row text-center">
<%= link_to @event.creator.presenter.gravatar_image(size: 80, id: 'user-gravatar', class: 'img-circle'), user_path(@event.creator) %>
</div>
<div class="row text-center">
created by:
</div>
<div class="row text-center">
<%= link_to @event.creator.display_name, user_path(@event.creator) %>
</div>
<div class="row text-center">
<%= @event.created_at.strftime "%F" %>
</div>
</div>
<% end %>
<% if @event.modifier_id %>
<div class="col-xs-12 col-sm-2">
<div class="row text-center">
<%= link_to @event.modifier.presenter.gravatar_image(size: 80, id: 'user-gravatar', class: 'img-circle'), user_path(@event.modifier) %>
</div>
<div class="row text-center">
updated by:
</div>
<div class="row text-center">
<%= link_to @event.modifier.display_name, user_path(@event.modifier) %>
</div>
<div class="row text-center">
<%= @event.updated_at.strftime "%F" %>
</div>
</div>
<% end %>
<div class="col-xs-12 col-sm-6">
<% if @recent_hangout.try :live? %>
<div class="event-notice">
This event is now live!
<br/>
<%= link_to 'Join now', @recent_hangout.hangout_url %>
</div>
<% elsif @event.try :within_current_event_duration? %>
<div class="event-notice">
It's time! Please start the event.
</div>
<% end %>
</div>
</div>
<% if user_signed_in? %>
<% hangout_is_live = @recent_hangout.try!(:live?) %>
<div class="row">
<div class="col-lg-12 collapse" id="edit-link-form" aria-expanded="false">
<%= form_tag hangout_url(hangout_is_live ? @recent_hangout.uid : generate_event_instance_id(current_user)), method: :put, class: 'form-horizontal', role: 'form' do %>
<%= hidden_field_tag 'title', topic(@event, @event_schedule) %>
<%= hidden_field_tag 'host_id', current_user.id %>
<%= hidden_field_tag 'event_id', @event.id %>
<%= hidden_field_tag 'url_set_directly', true %>
<%= hidden_field_tag 'notify_hangout', true %>
<%= hidden_field_tag 'category', @event.category %>
<% if @event.project %>
<%= hidden_field_tag 'project_id', @event.project.id %>
<% end %>
<%= hidden_field_tag 'yt_url', @recent_hangout.try!(:yt_url) %>
<div class="form-group">
<label class="control-label sr-only" for="hangout-url">Manually modify Hangout link</label>
</div>
<b>Hangout Link</b>
<div class="form-group">
<div class="col-sm-8">
<input type="url" required class="form-control" name="hangout_url" placeholder="Copy and paste the hangout link in here.." value="<%= @recent_hangout.try!(:hangout_url) %>">
</div>
<div class="col-sm-2">
<button type="button" class="form-control btn-default" data-toggle="collapse" data-target="#edit-link-form" id="hoa_link_cancel">Cancel</button>
</div>
<div class="col-sm-2">
<input type="submit" class="form-control btn-primary" value="Save" id="hoa_link_save"/>
</div>
</div>
<% end %>
</div>
<div class="col-lg-12 collapse" id="edit-yt-link-form" aria-expanded="false">
<%= form_tag hangout_url(hangout_is_live ? @recent_hangout.uid : generate_event_instance_id(current_user)), method: :put, class: 'form-horizontal', role: 'form' do %>
<%= hidden_field_tag 'title', topic(@event, @event_schedule) %>
<%= hidden_field_tag 'host_id', current_user.id %>
<%= hidden_field_tag 'event_id', @event.id %>
<%= hidden_field_tag 'url_set_directly', true %>
<%= hidden_field_tag 'notify_yt', true %>
<%= hidden_field_tag 'category', @event.category %>
<% if @event.project %>
<%= hidden_field_tag 'project_id', @event.project.id %>
<% end %>
<%= hidden_field_tag 'hangout_url', @recent_hangout.try!(:hangout_url) %>
<div class="form-group">
<label class="control-label sr-only" for="yt_url">Manually modify Youtube link</label>
</div>
<b>Youtube Link</b>
<div class="form-group">
<div class="col-sm-8">
<input type="url" required class="form-control" name="yt_url" placeholder="Copy and paste the youtube link in here.." value="<%= @recent_hangout.try!(:yt_url) %>">
</div>
<div class="col-sm-2">
<button type="button" class="form-control btn-default" data-toggle="collapse" data-target="#edit-yt-link-form" id="yt_link_cancel">Cancel</button>
</div>
<div class="col-sm-2">
<input type="submit" class="form-control btn-primary" value="Save" id="yt_link_save"/>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
<hr/>
<div class="row" id="attendees">
<div class="col-xs-12 col-sm-6">
<% if [email protected]_attendance %>
<div class="event-notice">
<%= @event.creator.display_name %> cannot attend the event.
</div>
<% end %>
</div>
<div class="col-xs-12 col-sm-4"></div>
<div class="col-xs-12 col-sm-2">
<% if (user_signed_in? and @event.creator and current_user.id == @event.creator.id) %>
<%= form_for @event, url: url_for(controller: "events", action: "update"), html: {class: "form-class"} do |f| %>
<%= check_box 'event', 'creator_attendance', { id: 'attendance_checkbox', 'data-toggle':'toggle', 'data-on':'Attend', 'data-off':'Cannot Attend', 'data-onstyle':'success', 'data-offstyle':'danger' }, 'true', 'false' %>
<% end %>
<% end %>
</div>
</div>
<hr/>
<div class="row" id="recent_event_list">
<% unless @event_instances.first %>
<p>No previous instances of this event</p>
<% end %>
<ol>
<% @event_instances.each do |event_instance| %>
<li>
<%= link_to "#{event_instance.created_at.strftime '%A, %B %-d, %Y'} - link to video", "https://www.youtube.com/watch?v=#{event_instance.yt_video_id}" %>
</li>
<% end %>
</ol>
</div>
<hr/>
<div class="row">
<div class="col-xs-12">
<p><%= link_to 'Learn more about Scrums', static_page_path('Getting started') %></p>
</div>
</div>