You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
5.0 KiB
121 lines
5.0 KiB
{% extends "layout.html" %}
|
|
|
|
{% block head %} <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/ts3_viewer.css') }}"> {% endblock %}
|
|
|
|
{% block title %}Dota Noobs{% endblock %}
|
|
|
|
{% block content %}
|
|
{% cache 60*5 %}
|
|
{% set teamspeak_data = get_teamspeak_window() %}
|
|
{% set latest_news = get_latest_news() %}
|
|
<div class="uk-grid">
|
|
|
|
<div id="events_large" class="uk-width-1-2 uk-visible-large uk-panel uk-panel-space">
|
|
{% include "events_widget.html" %}
|
|
</div>
|
|
|
|
<div id="teamspeak" class="uk-width-large-1-2 uk-width-medium-1-1 uk-panel uk-panel-box uk-text-center">
|
|
<a href="#" data-uk-modal="{target: '#tsviewer'}"><div class="uk-badge uk-panel-badge uk-badge-success"><i class="uk-icon-user"></i> Users</div></a>
|
|
<h1 class="uk-panel-title">Teamspeak</h1>
|
|
<div class="uk-grid uk-margin-bottom">
|
|
<div class="uk-width-1-3 uk-panel">
|
|
<h3>Users<br/><span class="ts_num">{{ ts3_current_clients() }}</span></h3>
|
|
</div>
|
|
<div class="uk-width-1-3 uk-panel">
|
|
<h3 class="uk-text-success">Online</h3>
|
|
</div>
|
|
<div class="uk-width-1-3 uk-panel">
|
|
<h3>Countries<br/><span class="ts_num">{{ ts3_countries_active(teamspeak_data) }}</span></h3>
|
|
</div>
|
|
</div>
|
|
|
|
<a class="uk-button uk-button-success uk-width-1-1" href="ts3server://voice.dotanoobs.com"><i class="uk-icon-microphone"></i> Connect</a>
|
|
<a class="uk-button uk-width-1-1 uk-margin" href="{{ url_for('teamspeak') }}"><i class="uk-icon-globe"></i> Stats</a>
|
|
<a class="uk-button uk-width-1-1" href="http://www.teamspeak.com/?page=downloads"><i class="uk-icon-download"></i> Download</a>
|
|
|
|
<div id="tsviewer" class="uk-modal uk-text-left">
|
|
<div class="uk-modal-dialog">
|
|
<a class="uk-modal-close uk-close"></a>
|
|
{{ ts3_viewer() | safe }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="events_small" class="uk-width-1-1 uk-hidden-large uk-panel uk-panel-space">
|
|
{% include "events_widget.html" %}
|
|
</div>
|
|
|
|
<div id="streams" class="uk-width-1-1 uk-text-center uk-panel">
|
|
</div>
|
|
|
|
<div class="uk-width-1-1 uk-panel uk-panel-header uk-panel-space">
|
|
<h1 class="uk-panel-title">News and Announcements</h1>
|
|
{% for news in latest_news %}
|
|
<article class="uk-article dn-news-article">
|
|
<h4 class="uk-article-title" title="{{ news['title'] }}"><a href="{{ news['url'] }}">{{ news['title'] }}</a></h4>
|
|
<p class="uk-article-meta">{{ news['date'] }}</p>
|
|
<p>{{ news['text'] | shorten }}</p>
|
|
</article>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endcache %}
|
|
{% endblock %}
|
|
|
|
{% block pagescripts %}
|
|
<script>
|
|
$(document).ready(function() {
|
|
if ($('#events_large > dl').length < 1) {
|
|
var msg = "<h2>Events</h2><em>No events planned for the near future. Suggest one on the forum!</em>"
|
|
$('#events_small').append(msg);
|
|
$('#events_large').append(msg);
|
|
}
|
|
|
|
{% cache 60*5 %}
|
|
// Add the streams
|
|
var stream_url = "https://api.twitch.tv/kraken/streams/";
|
|
var channels = ["dotanoobs", "bearhugdota", "kreejaffakree", "prettypenguins", "shaneomad"];
|
|
for (var idx in channels) {
|
|
$.getJSON(stream_url+channels[idx]+"?callback=?", function(data) {
|
|
if (data.stream) {
|
|
var $a = $("<a href='"+data.stream.channel.url+"'></a>");
|
|
var $strm = $("<div class='dn-streamer uk-text-success uk-panel uk-panel-box' id='"+data.stream.channel.name+"'></div>");
|
|
|
|
$strm.append("<p class='uk-text-bold'>" + data.stream.channel.display_name + "</p>");
|
|
$strm.append("<img src='" + data.stream.preview.small + "' />");
|
|
$strm.append("<p><i class='uk-icon-male'></i> "+data.stream.viewers+"</p>");
|
|
|
|
$a.append($strm);
|
|
$("#streams").prepend($a);
|
|
|
|
} else {
|
|
$.getJSON(data._links.channel+"?callback=?", function(data) {
|
|
var $a = $("<a href='"+data.url+"'></a>");
|
|
var $strm = $("<div class='dn-streamer-offline uk-text-success uk-panel uk-panel-box' id='"+data.name+"'></div>");
|
|
|
|
$strm.append("<p class='uk-text-bold'>" + data.display_name + "</p>");
|
|
$strm.append("<img src='" + data.logo + "' />");
|
|
$strm.append("<p class='dn-offline'>Offline</p>");
|
|
|
|
$a.append($strm);
|
|
$("#streams").append($a);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
{% endcache %}
|
|
|
|
|
|
$("#streams").on({
|
|
mouseover: function() {
|
|
$(this).addClass('dn-streamer-hover');
|
|
},
|
|
mouseleave: function() {
|
|
$(this).removeClass('dn-streamer-hover');
|
|
}
|
|
}, "div");
|
|
});
|
|
</script>
|
|
{% endblock %}
|