Skip to content
This repository has been archived by the owner on Apr 14, 2018. It is now read-only.

Commit

Permalink
Don't allow the user to join or leave an event if the event is global.
Browse files Browse the repository at this point in the history
That would be rather pointless, because they'll see it anyways.
  • Loading branch information
rye committed Jan 21, 2014
1 parent 3f9c432 commit 1ef0c10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
</p>

<div class="btn-group">
<% if !@event.global? %>
<% if @event.users.include? current_user %>
<%= link_to "Leave", leave_event_path(@event), class: "btn btn-danger" %>
<% else %>
<%= link_to "Join", join_event_path(@event), class: "btn btn-success" %>
<% end %>
<% end %>

<%= link_to 'Edit', edit_event_path(@event), class: "btn btn-primary" %>
<%= link_to 'Back', events_path, class: "btn btn-default" %>
</div>

0 comments on commit 1ef0c10

Please sign in to comment.