mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-15 14:20:54 +00:00
Fixes error when viewing team pages when not logged in
This commit is contained in:
parent
277e660717
commit
29dc3e0e29
1 changed files with 12 additions and 10 deletions
|
@ -9,18 +9,20 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if cuser.teamers.joining.count == 0 && @team.active %>
|
<% if cuser && cuser.teamers %>
|
||||||
<%= form_for @teamer do |f| %>
|
<% if cuser.teamers.joining.count == 0 && @team.active %>
|
||||||
<%= f.error_messages %>
|
<%= form_for @teamer do |f| %>
|
||||||
<%= f.hidden_field :user_id, :value => cuser.id %>
|
<%= f.error_messages %>
|
||||||
<%= f.hidden_field :team_id, :value => @team.id %>
|
<%= f.hidden_field :user_id, :value => cuser.id %>
|
||||||
|
<%= f.hidden_field :team_id, :value => @team.id %>
|
||||||
|
|
||||||
<div class="controls inline">
|
<div class="controls inline">
|
||||||
<%= f.submit "Request To Join", class: 'button' %>
|
<%= f.submit "Request To Join", class: 'button' %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% elsif cuser.teamers.joining.first.team != @team %>
|
||||||
|
<%= link_to 'Request To Join', edit_teamer_path("teamer" => cuser.teamers.joining.first), method: :get,confirm: "You have already requested to join #{cuser.teamers.joining.first.team}. Do you want to request to join #{@team} instead?", class: 'button' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% elsif cuser.teamers.joining.first.team != @team %>
|
|
||||||
<%= link_to 'Request To Join', edit_teamer_path("teamer" => cuser.teamers.joining.first), method: :get,confirm: "You have already requested to join #{cuser.teamers.joining.first.team}. Do you want to request to join #{@team} instead?", class: 'button' %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div id="team" class="tabbed">
|
<div id="team" class="tabbed">
|
||||||
|
|
Loading…
Reference in a new issue