ensl.org/app/views/gathers/_status.html.erb
jamal 4c7041e4b3 Change Gather style to volunteer captains
This will change the gather format to allow for players to volunteer to be captain / commander. The gather will not change from the running state until 2 commanders have volunteered. Once commanders have volunteered the gather will switch to the picking state. The voting state is no longer used.

Also, added a new sound alert that will be played when the gather is full but doesn't have 2 captains. This alert will loop every 10 seconds unless you're the commander. And changed the music to play once the gather switches to the picking state and only if the player doesn't have the gather page on focus.
2014-10-11 15:50:06 -04:00

86 lines
3.4 KiB
Text

<div id="gather-stats">
<% if @gather.status == Gather::STATE_RUNNING %>
<% if @gatherer and @gatherer.can_destroy? cuser %>
<% if Gather::FULL == @gather.gatherers.length %>
<p>Gather is full but we are waiting on commanders. If you would like to command, please use the button below.</p>
<% else %>
<p>Gather running, <%= Gather::FULL - @gather.gatherers.length %> more needed.</p>
<% end %>
<%= form_tag "/gathers/captain/#{@gather.id}" do %>
<%= submit_tag (@gather.captain1 == @gatherer or @gather.captain2 == @gatherer) ? 'Stop Commanding' : 'Command a Team', class: 'button tiny' %>
<% end %>
<%= link_to 'Leave Gather', @gatherer, confirm: 'Are you sure?', method: :delete, class: 'button tiny leave-gather' %>
<% elsif (g = Gatherer.new(gather: @gather, user: cuser)).can_create?(cuser) %>
<%= form_for g do |f| %>
<%= f.hidden_field :gather_id %>
<%= f.hidden_field :user_id %>
<% if Gather::FULL == @gather.gatherers.length %>
<p>Gather is full but we are waiting on commanders. If you would like to command, please use the button below.</p>
<% else %>
<p>Gather running, <%= Gather::FULL - @gather.gatherers.length %> more needed.</p>
<% end %>
<p>
You can download custom maps via the
<%= link_to "Steam Workshop", "http://steamcommunity.com/workshop/browse?searchtext=&childpublishedfileid=0&section=items&appid=4920&browsesort=trend&requiredtags%5B%5D=level" %>.
</p>
<p>
<% if cuser.gatherers.count < 5 %>
<%= f.check_box :confirm %> I have read the <%= link_to "rules", article_url(Article::G_RULES) %>, installed NS and Teamspeak3.
<% end %>
<a href="javascript:" id="gatherJoinBtn" class="button">
Click to join gather!
</a>
</p>
<% end %>
<% else %>
<p>Log in to join the gather.</p>
<% end %>
<% elsif @gather.status == Gather::STATE_VOTING %>
<p>Please vote captains and maps.</p>
<% elsif @gather.status == Gather::STATE_PICKING %>
<p>
<% if @gatherer and @gatherer.captain? %>
<% if @gatherer.turn? %>
It is your turn, please pick a player from the lobby!
<% else%>
Wait for the other captain to pick.
<% end %>
<% else %>
Captains are picking the teams, please wait. Are you a panda?<br>
<% end %>
</p>
<% elsif @gather.status == Gather::STATE_FINISHED and @gather.server %>
<p>Gather finished, join the Server and TeamSpeak 3.</p>
<p>
<strong>Maps</strong>: <%= namelink @gather.map1.map if @gather.map1 %>, <%= (namelink @gather.map2.map) if @gather.map2 %> <br>
<strong>Server</strong>:
<% if @gather.server %>
<%= @gather.server %>
(<%= @gather.server.ip %>:<%= @gather.server.port %> ;
password = <%= if @gather.server.password then @gather.server.password else "<Password not specified>" end %>)
<% end %>
</p>
<% if @gather.server and @gather.server.ip and @gather.server.password %>
<p>
<%= link_to "Click to join Server", "steam://run/4920//connect #{@gather.server.ip} #{@gather.server.password}", class: 'join button tiny' %>
</p>
<% end %>
<% end %>
<% if cuser and cuser.admin? %>
<%= link_to "Admin Page", edit_gather_url, class: 'admin button' %>
<% end %>
</div>