event_details.erb 2.39 KB
Newer Older
Tyler Lemburg's avatar
Tyler Lemburg committed
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
<div class="event-details">
	<div>
		<h3>
	    	<%= event.title %><span class="wdn-subhead"><%= event.type.description %></span>
	    </h3>
	</div>
	<div>
		<span class="date-wrapper eventicon-calendar-empty">
	    	<time class="dtstart"><%= event.start_time.in_time_zone.strftime('%b %d, %Y') %></time>
		</span>
		<span class="time-wrapper eventicon-clock">
	    	<%= event.start_time.in_time_zone.strftime('%l:%M %P') %><%= event.end_time.in_time_zone.strftime('%l:%M %P') %>
	    </span>
		<div class="location eventicon-location">
			<%= event.location.name %>
		</div>
		<% unless event.imagedata.nil? %>
		<div class="inset-image">
			<img src="<%= event.image_src %>" alt="Image for Event: <%= event.title %>">
		</div>
		<% end %>
		<div class="description">
	    	<%= event.description.nl2br.force_encoding("UTF-8") %>
	    </div>
	</div>
</div>

<% # free events do not require signup but users can mark it on their homepage %>
<% if @user && event.signups.map(&:user_id).include?(@user.id) %>
	<% # the user is already signed up %>
	<% if event.type.description == 'Free Event' %>
		This event is noted on your homepage.<br>
		<a href="<%= @space.href %>" class="wdn-button wdn-button-triad">View Homepage</a>
	<% else %>
		You have signed up for this event.<br>
		<a href='<%= @space.href %>' class="wdn-button wdn-button-triad">View Homepage</a>
	<% end %>
<% elsif @user %>
	<% # the user is logged in but not signed up %>
	<% if event.max_signups.nil? || event.signups.count < event.max_signups %>
41
	<form action="/<%= @space.url_name %>/events/<%= event.id %>/sign_up/" class="delete-form" method="POST">
Tyler Lemburg's avatar
Tyler Lemburg committed
42
43
44
45
46
47
	<button type="submit" class="wdn-button wdn-button-brand">
		<% if event.type.description == 'Free Event' %>
			Note event on my homepage
		<% else %>
			Sign up for this event
		<% end %>
48
	</button>
Tyler Lemburg's avatar
Tyler Lemburg committed
49
50
51
52
53
54
55
56
	</form>
	<% else %>
	All slots for this event are filled.
	<% end %>
<% else %>
	<% # a non user. May still sign up for the event UNLESS it is a tool training %>
	<% if event.type.description != 'Machine Training' %>
		<% if event.max_signups.nil? || event.signups.count < event.max_signups %>
57
		<a class="wdn-button wdn-button-brand" href="/<%= @space.url_name %>/events/<%= event.id %>/sign_up_as_non_member/">Sign up for this event</a> 
Tyler Lemburg's avatar
Tyler Lemburg committed
58
59
60
61
		<% else %>
		All slots for this event are filled.
		<% end %>
	<% end %>
62
63
<% end %>
<a href="<%= event.download_link %>" class="download-ics wdn-button wdn-button-triad">Download</a>