+
+
diff --git a/scores/templates/scores/teams.html b/scores/templates/scores/teams.html
index 7cc0247..728acb8 100644
--- a/scores/templates/scores/teams.html
+++ b/scores/templates/scores/teams.html
@@ -13,7 +13,6 @@
@@ -27,7 +26,13 @@
var iInterval = 2000;
var iScrollInterval = 10000;
var iFadeInterval = 500;
-
+ var iScroll = $(document).height() - $(window).height();
+
+ if (iScroll * 10 + 4000 < 15000) {
+ iScrollInterval = 10000;
+ } else {
+ iScrollInterval = iScroll * 10;
+ }
var fade = function() {
$("body").fadeOut(iFadeInterval, function(){
$("html, body").scrollTop(0);
@@ -39,6 +44,11 @@
var loop = function() {
var iScroll = $(document).height() - $(window).height();
+ if (iScroll * 10 + 4000 < 15000) {
+ iScrollInterval = 10000;
+ } else {
+ iScrollInterval = iScroll * 10;
+ }
$("html, body").animate({
scrollTop: iScroll
}, {
@@ -48,9 +58,12 @@
setTimeout(fade, iInterval);
}
});
+ setTimeout(function(){
+ window.location.reload();
+ }, Math.max(iScrollInterval * 10 + 2000, 15000));
};
setTimeout(loop, iInterval);
-
+
{% endif %}
{% if tournament.club.header %}
diff --git a/scores/templates/scores/tournament.html b/scores/templates/scores/tournament.html
index 44bdf9c..77481ec 100644
--- a/scores/templates/scores/tournament.html
+++ b/scores/templates/scores/tournament.html
@@ -11,9 +11,11 @@
{% endif %}
-
-
Padel
-
+
+
Padel
+ {% if not tv %}
+
+ {% endif %}}
@@ -23,7 +25,13 @@
var iInterval = 2000;
var iScrollInterval = 10000;
var iFadeInterval = 500;
-
+ var iScroll = $(document).height() - $(window).height();
+
+ if (iScroll * 10 + 4000 < 15000) {
+ iScrollInterval = 10000;
+ } else {
+ iScrollInterval = iScroll * 10;
+ }
var fade = function() {
$("body").fadeOut(iFadeInterval, function(){
$("html, body").scrollTop(0);
@@ -35,6 +43,11 @@
var loop = function() {
var iScroll = $(document).height() - $(window).height();
+ if (iScroll * 10 + 4000 < 15000) {
+ iScrollInterval = 10000;
+ } else {
+ iScrollInterval = iScroll * 10;
+ }
$("html, body").animate({
scrollTop: iScroll
}, {
@@ -44,6 +57,9 @@
setTimeout(fade, iInterval);
}
});
+ setTimeout(function(){
+ window.location.reload();
+ }, Math.max(iScrollInterval * 10 + 2000, 15000));
};
setTimeout(loop, iInterval);
diff --git a/scores/urls.py b/scores/urls.py
index 131d18c..56a9205 100644
--- a/scores/urls.py
+++ b/scores/urls.py
@@ -19,6 +19,9 @@ from django.urls import path
from . import views
urlpatterns = [
+ path('tv/club///classement/', views.tv_ranking, name='ranks'),
+ path('club///classement/', views.ranking, name='ranks'),
+
path('match//', views.match, name='match'),
path('tv/match//', views.match_tv, name='match'),
diff --git a/scores/views.py b/scores/views.py
index 3bb0859..0d6606a 100644
--- a/scores/views.py
+++ b/scores/views.py
@@ -186,6 +186,25 @@ def tv_teams_tournament(request, tournament_id):
}
return HttpResponse(template.render(context, request))
+def tv_ranking(request, club_name, tournament_shortname):
+ club = get_object_or_404(Club, name__iexact=club_name.lower())
+ tournament = Tournament.objects.filter(club_id=club.id, shortname__iexact=tournament_shortname.lower()).first()
+ template = loader.get_template('scores/ranks.html')
+ context = {
+ 'tournament': tournament,
+ 'tv': True,
+ }
+ return HttpResponse(template.render(context, request))
+
+def ranking(request, club_name, tournament_shortname):
+ club = get_object_or_404(Club, name__iexact=club_name.lower())
+ tournament = Tournament.objects.filter(club_id=club.id, shortname__iexact=tournament_shortname.lower()).first()
+ template = loader.get_template('scores/ranks.html')
+ context = {
+ 'tournament': tournament,
+ }
+ return HttpResponse(template.render(context, request))
+
class UserViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows users to be viewed or edited.