mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
Add helper method for new gathers url
This commit is contained in:
parent
478dfa0ffa
commit
3bc78d58fc
3 changed files with 31 additions and 3 deletions
|
@ -189,4 +189,12 @@ module ApplicationHelper
|
||||||
def latest_rules
|
def latest_rules
|
||||||
article_path(Article::RULES)
|
article_path(Article::RULES)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def gathers_url
|
||||||
|
if Rails.env.production?
|
||||||
|
"http://gathers.ensl.org"
|
||||||
|
else
|
||||||
|
"http://gathers.staging.ensl.org"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,14 +25,19 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<%= active_link_to Gather.last, class: 'gathers' do %>
|
<%= link_to gathers_url, class: 'gathers', target: "_blank" do %>
|
||||||
Gathers
|
Gathers
|
||||||
<span class="count"><%= Gather.player_count_for_game('NS2') %>/<%= Gather::FULL %></span>
|
<span class="count" id="gathercount"></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><%= link_to "Introduction", article_url(464) %></li>
|
<li><%= link_to "Introduction", article_url(464) %></li>
|
||||||
<li><%= link_to "Archives", "/gathers/" %></li>
|
<li><%= link_to "Archives", "/gathers/" %></li>
|
||||||
|
<li>
|
||||||
|
<%= active_link_to Gather.last, class: 'gathers' do %>
|
||||||
|
Fallback
|
||||||
|
<span class="count"><%= Gather.player_count_for_game('NS2') %>/<%= Gather::FULL %></span>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown icon">
|
<li class="dropdown icon">
|
||||||
|
@ -73,3 +78,14 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
$.ajax({
|
||||||
|
datatype: "json",
|
||||||
|
url: "<%= gathers_url %>/gathers/current",
|
||||||
|
success: function (data) {
|
||||||
|
$("#gathercount").html(data.gatherers.length + "/12");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -143,6 +143,10 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h4 class="fancy add-top">
|
||||||
|
Gathers have moved to <%= link_to "gathers.ensl.org", gathers_url, target: "_blank" %>. This app is just a fallback in case something goes wrong
|
||||||
|
</h4>
|
||||||
|
|
||||||
<% if @gather and @gather.status != Gather::STATE_FINISHED %>
|
<% if @gather and @gather.status != Gather::STATE_FINISHED %>
|
||||||
<div id="gather-info">
|
<div id="gather-info">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
|
|
Loading…
Reference in a new issue