<h1><%= @event.name %></h1>
<p><%= @event.date.strftime("%m/%d/%y")%></p>
<p><%= @event.time.strftime("%l:%M %p") %></p>
<p><%= @event.location %></p>
<h2>Attendees</h2>
<ul><% @event.attending_users.each do |user| %>
  <li><%= user.email%></li>
  <!-- link to profile? later -->
<% end %></ul>

<% if @event.attending_users.include?(User.find(session[:user_id])) %>

	<p>You are bringing <%= @event_wine.wine.name %>. <%= @event_wine.wine.description %></p>

  <%= button_to "Edit Event", edit_event_path(@event), :method => :get, :class =>"button [radius round]" %>
<% end %>

<!-- User shouldn't see either of these if they've already taken all of their tastings, but they should see them if they've only taken some of them. -->

<% if Time.now > @event.time %>
	<%= button_to "Start Tasting!", "/events/#{@event.id}/quiz", :method => :get, :class =>"button [radius round]", :id => "taste" %>
	<%= link_to "See Results", "/events/#{@event.id}/my_results", :method => :get, :class =>"button [radius round]" %>
<% end %>

<h1><%= @event.name %></h1>
<p><%= @event.date.strftime("%m/%d/%y")%></p>
<p><%= @event.time.strftime("%l:%M %p") %></p>
<p><%= @event.location %></p>
<h2>Attendees</h2>
<ul><% @event.attending_users.each do |user| %>
  <li><%= user.email%></li>
<% end %></ul>

<% if @event.attending_users.include?(User.find(session[:user_id])) %>

	<p>You are bringing <%= @event_wine.wine.name %>. <%= @event_wine.wine.description %></p>

  <%= button_to "Edit Event", edit_event_path(@event), :method => :get, :class =>"button [radius round]" %>
<% end %>

<!-- User shouldn't see either of these if they've already taken all of their tastings, but they should see them if they've only taken some of them. -->

<% if Time.now > @event.time %>
	<%= button_to "Start Tasting!", "/events/#{@event.id}/quiz", :method => :get, :class =>"button [radius round]", :id => "taste" %>
<% end  %>
<% if Time.now > @event.time && @user_tastings != nil  %>
	<%= link_to "See Results", "/events/#{@event.id}/my_results", :method => :get, :class =>"button [radius round]" %>
<% end %>

Hide button if no results
Hide button if no results
