- getSeason() only for staff members
- new view staff() - updated bootstrap to version 3.4.1 - updated jquery to 3.6.3 - changed container layout in main view 'matchday'
This commit is contained in:
6
CHANGELOG
Normal file
6
CHANGELOG
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
- getSeason() only for staff members
|
||||||
|
- new view staff()
|
||||||
|
- updated bootstrap to version 3.4.1
|
||||||
|
- updated jquery to 3.6.3
|
||||||
|
- changed container layout in main view 'matchday'
|
||||||
|
|
||||||
@@ -16,7 +16,6 @@ import os
|
|||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
||||||
|
|
||||||
@@ -28,9 +27,7 @@ DEBUG = True
|
|||||||
|
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = []
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
@@ -77,7 +74,6 @@ WSGI_APPLICATION = 'TipPy.wsgi.application'
|
|||||||
|
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||||
@@ -91,7 +87,6 @@ DATABASES = {
|
|||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
AUTH_PASSWORD_VALIDATORS = [
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||||
@@ -109,13 +104,9 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/4.0/topics/i18n/
|
# https://docs.djangoproject.com/en/4.0/topics/i18n/
|
||||||
|
|
||||||
LANGUAGE_CODE = 'de-de'
|
LANGUAGE_CODE = 'de-de'
|
||||||
|
|
||||||
TIME_ZONE = 'Europe/Berlin'
|
TIME_ZONE = 'Europe/Berlin'
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
# Absolute filesystem path to the directory that will hold user-uploaded files.
|
||||||
@@ -149,7 +140,6 @@ STATICFILES_DIRS = [
|
|||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
|
|
||||||
# Redirect on logout
|
# Redirect on logout
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Django~=4.0.6
|
Django~=4.1.7
|
||||||
psycopg2~=2.9.3
|
psycopg2~=2.9.5
|
||||||
suds~=1.1.2
|
suds~=1.1.2
|
||||||
Pillow~=9.2.0
|
Pillow~=9.4.0
|
||||||
pytz~=2022.1
|
pytz~=2023.2
|
||||||
urllib3~=1.26.10
|
urllib3~=1.26.15
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<!-- jQuery (wird für Bootstrap JavaScript-Plugins benötigt) -->
|
<!-- jQuery (wird für Bootstrap JavaScript-Plugins benötigt) -->
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||||
<!-- Binde alle kompilierten Plugins zusammen ein (wie hier unten) oder such dir einzelne Dateien nach Bedarf aus -->
|
<!-- Binde alle kompilierten Plugins zusammen ein (wie hier unten) oder such dir einzelne Dateien nach Bedarf aus -->
|
||||||
<script src="{% static 'js/bootstrap.min.js'%}"></script>
|
<script src="{% static 'js/bootstrap.min.js'%}"></script>
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<div class="col-md-7">
|
<div class="col-md-7">
|
||||||
<p>
|
<p>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
© Martin Bley, 2014-2022 | Dank an
|
© Martin Bley, 2014-2023 | Dank an
|
||||||
<a href="http://openligadb.de">OpenLigaDB</a> für die Bereitstellung der
|
<a href="http://openligadb.de">OpenLigaDB</a> für die Bereitstellung der
|
||||||
Spielergebnisse.
|
Spielergebnisse.
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
{% block body %}
|
{% block body %}
|
||||||
<div id="content-main">
|
<div id="content-main">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-7">
|
<div class="col-md-6">
|
||||||
<h2>Deine Tipps</h2>
|
<h3>Deine Tipps</h3>
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="pager">
|
<ul class="pager">
|
||||||
<li data-toggle="tooltip" title="{% trans 'previous' %}" class="previous"><a
|
<li data-toggle="tooltip" title="{% trans 'previous' %}" class="previous"><a
|
||||||
@@ -67,12 +67,9 @@
|
|||||||
<span class="glyphicon glyphicon-saved" aria-hidden="true"></span> Tipps abgeben
|
<span class="glyphicon glyphicon-saved" aria-hidden="true"></span> Tipps abgeben
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
{% for mandant, list in mandant_dict.items %}
|
||||||
<div class="row">
|
<h3>Mitspieler {{ mandant }}</h3>
|
||||||
{% for mandant, list in mandant_dict.items %}
|
|
||||||
<div class="col-md-7">
|
|
||||||
<h4>Mitspieler {{ mandant }}</h4>
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover table-condensed">
|
<table class="table table-hover table-condensed">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -105,12 +102,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{% endfor %}
|
||||||
{% endfor %}
|
</div>
|
||||||
</div>
|
<div class="col-md-6">
|
||||||
<div class="row">
|
<h3>Chat</h3>
|
||||||
<div class="col-md-7">
|
|
||||||
<h2>Chat</h2>
|
|
||||||
{% block chat %}
|
{% block chat %}
|
||||||
{% include "chat.xhtml" with posts=posts %}
|
{% include "chat.xhtml" with posts=posts %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
<li><a href="/">Tipps</a></li>
|
<li><a href="/">Tipps</a></li>
|
||||||
<li><a href="/charts/{{ ls }}/{{ season }}{% if pos %}/{{ pos }}{% endif %}">Bestenliste</a></li>
|
<li><a href="/charts/{{ ls }}/{{ season }}{% if pos %}/{{ pos }}{% endif %}">Bestenliste</a></li>
|
||||||
<li><a href="/blog/1">Blog</a></li>
|
<li><a href="/blog/1">Blog</a></li>
|
||||||
|
{% if request.user.is_active and request.user.is_staff %}
|
||||||
|
<li><a href="/staff">Staff</a></li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
{% if has_refresh %}
|
{% if has_refresh %}
|
||||||
|
|||||||
34
templates/staff.html
Normal file
34
templates/staff.html
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n static %}
|
||||||
|
{% load humanize %}
|
||||||
|
{% block head %}
|
||||||
|
<script type="text/javascript" src="{% static 'javascript/tippy.js' %}"></script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block nav %}
|
||||||
|
{% include "nav.html" with ls=ls season=season %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<div id="content-main">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h3>Wettbewerbe</h3>
|
||||||
|
{% for comp in competitions %}
|
||||||
|
{{ comp }}<br/>
|
||||||
|
{% endfor %}
|
||||||
|
<h3></h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% if debug %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h2 class="form-signin-heading">{% trans 'Debug' %}</h2>
|
||||||
|
{% for line in debug %}
|
||||||
|
<p>{{ line }}</p>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with TipPy. If not, see <http://www.gnu.org/licenses/>.
|
along with TipPy. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from django.db import models
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
class UserProfile(models.Model):
|
class UserProfile(models.Model):
|
||||||
user = models.OneToOneField(
|
user = models.OneToOneField(
|
||||||
@@ -31,13 +31,15 @@ class UserProfile(models.Model):
|
|||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.user.username
|
return self.user.username
|
||||||
|
|
||||||
|
|
||||||
class Competition(models.Model):
|
class Competition(models.Model):
|
||||||
leagueShortcut = models.CharField(max_length=32)
|
leagueShortcut = models.CharField(max_length=32)
|
||||||
leagueName = models.CharField(max_length=128)
|
leagueName = models.CharField(max_length=128)
|
||||||
season = models.CharField(max_length=4)
|
season = models.CharField(max_length=4)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return(self.leagueShortcut)
|
return (self.leagueShortcut)
|
||||||
|
|
||||||
|
|
||||||
class Team(models.Model):
|
class Team(models.Model):
|
||||||
teamID = models.IntegerField(unique=True, primary_key=True)
|
teamID = models.IntegerField(unique=True, primary_key=True)
|
||||||
@@ -55,7 +57,7 @@ class Team(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class Match(models.Model):
|
class Match(models.Model):
|
||||||
matchID = models.IntegerField(unique=True,primary_key=True)
|
matchID = models.IntegerField(unique=True, primary_key=True)
|
||||||
matchDateTime = models.DateTimeField()
|
matchDateTime = models.DateTimeField()
|
||||||
group = models.IntegerField()
|
group = models.IntegerField()
|
||||||
matchday = models.IntegerField()
|
matchday = models.IntegerField()
|
||||||
@@ -77,6 +79,7 @@ class Match(models.Model):
|
|||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return (str(self.matchID))
|
return (str(self.matchID))
|
||||||
|
|
||||||
|
|
||||||
class Tipp(models.Model):
|
class Tipp(models.Model):
|
||||||
matchID = models.ForeignKey(
|
matchID = models.ForeignKey(
|
||||||
Match,
|
Match,
|
||||||
@@ -95,12 +98,15 @@ class Tipp(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("matchID", "tipperID")
|
unique_together = ("matchID", "tipperID")
|
||||||
|
|
||||||
|
|
||||||
class Mandant(models.Model):
|
class Mandant(models.Model):
|
||||||
name = models.CharField(max_length=32, unique=True)
|
name = models.CharField(max_length=32, unique=True)
|
||||||
description = models.CharField(max_length=255)
|
description = models.CharField(max_length=255)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class Score(models.Model):
|
class Score(models.Model):
|
||||||
client = models.ForeignKey(
|
client = models.ForeignKey(
|
||||||
Mandant,
|
Mandant,
|
||||||
@@ -110,9 +116,11 @@ class Score(models.Model):
|
|||||||
exact = models.PositiveSmallIntegerField()
|
exact = models.PositiveSmallIntegerField()
|
||||||
diff = models.PositiveSmallIntegerField()
|
diff = models.PositiveSmallIntegerField()
|
||||||
tendency = models.PositiveSmallIntegerField()
|
tendency = models.PositiveSmallIntegerField()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return str(self.client)
|
return str(self.client)
|
||||||
|
|
||||||
|
|
||||||
class chart(models.Model):
|
class chart(models.Model):
|
||||||
team = models.ForeignKey(
|
team = models.ForeignKey(
|
||||||
Team,
|
Team,
|
||||||
@@ -129,6 +137,7 @@ class chart(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("team", "competition")
|
unique_together = ("team", "competition")
|
||||||
|
|
||||||
|
|
||||||
class RelUserMandant(models.Model):
|
class RelUserMandant(models.Model):
|
||||||
user = models.ForeignKey(
|
user = models.ForeignKey(
|
||||||
User,
|
User,
|
||||||
@@ -141,9 +150,11 @@ class RelUserMandant(models.Model):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("user", "mandant")
|
unique_together = ("user", "mandant")
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return (str(self.user) + " -> " + str(self.mandant))
|
return (str(self.user) + " -> " + str(self.mandant))
|
||||||
|
|
||||||
|
|
||||||
class Post(models.Model):
|
class Post(models.Model):
|
||||||
content = models.TextField()
|
content = models.TextField()
|
||||||
published = models.BooleanField(default=True)
|
published = models.BooleanField(default=True)
|
||||||
@@ -159,6 +170,7 @@ class Post(models.Model):
|
|||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return u'%s' % self.created
|
return u'%s' % self.created
|
||||||
|
|
||||||
|
|
||||||
class RelPostMandant(models.Model):
|
class RelPostMandant(models.Model):
|
||||||
post = models.ForeignKey(
|
post = models.ForeignKey(
|
||||||
Post,
|
Post,
|
||||||
@@ -171,6 +183,6 @@ class RelPostMandant(models.Model):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ("post", "mandant")
|
unique_together = ("post", "mandant")
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return (str(self.post) + " -> " + str(self.mandant))
|
return (str(self.post) + " -> " + str(self.mandant))
|
||||||
|
|
||||||
|
|||||||
@@ -18,20 +18,20 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with TipPy. If not, see <http://www.gnu.org/licenses/>.
|
# along with TipPy. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
import sys
|
|
||||||
import locale
|
import locale
|
||||||
from suds.client import Client
|
|
||||||
import urllib.request
|
|
||||||
import urllib.error
|
import urllib.error
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import psycopg2
|
import urllib.request
|
||||||
|
|
||||||
|
from suds.client import Client
|
||||||
|
|
||||||
|
|
||||||
class OpenLiga(object):
|
class OpenLiga(object):
|
||||||
version = "0.1"
|
version = "0.1"
|
||||||
error = ""
|
error = ""
|
||||||
proxyurl = None
|
proxyurl = None
|
||||||
debug = None
|
debug = None
|
||||||
client = None
|
client = None
|
||||||
|
|
||||||
def __init__(self, proxyurl=None, debug=False):
|
def __init__(self, proxyurl=None, debug=False):
|
||||||
|
|
||||||
@@ -45,29 +45,29 @@ class OpenLiga(object):
|
|||||||
try:
|
try:
|
||||||
self.client = Client(
|
self.client = Client(
|
||||||
'http://www.openligadb.de/'
|
'http://www.openligadb.de/'
|
||||||
+ 'Webservices/Sportsdata.asmx?WSDL')
|
+ 'Webservices/Sportsdata.asmx?WSDL')
|
||||||
except (urllib.error.URLError):
|
except (urllib.error.URLError):
|
||||||
self.error += "Connect to webservice failed."
|
self.error += "Connect to webservice failed."
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
t = suds.transport.http.HttpTransport()
|
t = suds.transport.http.HttpTransport()
|
||||||
proxy = urllib.request.ProxyHandler({'http':proxyurl})
|
proxy = urllib.request.ProxyHandler({'http': proxyurl})
|
||||||
opener = urllib.request.build_opener(proxy)
|
opener = urllib.request.build_opener(proxy)
|
||||||
t.urlopener = opener
|
t.urlopener = opener
|
||||||
self.client = suds.client.Client(
|
self.client = suds.client.Client(
|
||||||
'http://www.openligadb.de/Webservices/'
|
'http://www.openligadb.de/Webservices/'
|
||||||
+ 'Sportsdata.asmx?WSDL', transport=t)
|
+ 'Sportsdata.asmx?WSDL', transport=t)
|
||||||
except urllib.error.URLError as e:
|
except urllib.error.URLError as e:
|
||||||
self.error += "Connect to webservice failed " \
|
self.error += "Connect to webservice failed " \
|
||||||
+ "(via proxy " + proxyurl + "): " + str(e) + "\n"
|
+ "(via proxy " + proxyurl + "): " + str(e) + "\n"
|
||||||
|
|
||||||
def getSeason(self, season, league='bl1'):
|
def getSeason(self, season, league='bl1'):
|
||||||
""" Get the whole season.
|
""" Get the whole season.
|
||||||
|
|
||||||
Args: season and league shortcut (optional)
|
Args: season and league shortcut (optional)
|
||||||
"""
|
"""
|
||||||
return(self.client.service.GetMatchdataByLeagueSaison(
|
return (self.client.service.GetMatchdataByLeagueSaison(
|
||||||
leagueShortcut=league,leagueSaison=season)
|
leagueShortcut=league, leagueSaison=season)
|
||||||
)
|
)
|
||||||
|
|
||||||
def getMatchday(self, season, matchdaynumber, league='bl1'):
|
def getMatchday(self, season, matchdaynumber, league='bl1'):
|
||||||
@@ -75,22 +75,19 @@ class OpenLiga(object):
|
|||||||
|
|
||||||
Args: season, matchdaynumber and league shortcut (optional)
|
Args: season, matchdaynumber and league shortcut (optional)
|
||||||
"""
|
"""
|
||||||
return(self.client.service.GetMatchdataByGroupLeagueSaison(
|
return (self.client.service.GetMatchdataByGroupLeagueSaison(
|
||||||
groupOrderID=matchdaynumber,
|
groupOrderID=matchdaynumber,
|
||||||
leagueShortcut=league,
|
leagueShortcut=league,
|
||||||
leagueSaison=season)
|
leagueSaison=season)
|
||||||
)
|
)
|
||||||
|
|
||||||
def getTeams(self, season, league='bl1'):
|
def getTeams(self, season, league='bl1'):
|
||||||
return(self.client.service.GetTeamsByLeagueSaison(
|
return (self.client.service.GetTeamsByLeagueSaison(
|
||||||
leagueShortcut=league,
|
leagueShortcut=league,
|
||||||
leagueSaison=season)
|
leagueSaison=season)
|
||||||
)
|
)
|
||||||
|
|
||||||
def getCurrentGroup(self, league):
|
def getCurrentGroup(self, league):
|
||||||
return(self.client.service.GetCurrentGroup(
|
return (self.client.service.GetCurrentGroup(
|
||||||
leagueShortcut=league)
|
leagueShortcut=league)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ urlpatterns = [
|
|||||||
re_path(r'^blog/newpost$', views.newBlogpost),
|
re_path(r'^blog/newpost$', views.newBlogpost),
|
||||||
re_path(r'^blog/(?P<page>\d)$', views.blogindex),
|
re_path(r'^blog/(?P<page>\d)$', views.blogindex),
|
||||||
re_path(r'^about$', views.about),
|
re_path(r'^about$', views.about),
|
||||||
|
re_path(r'^staff', views.staff),
|
||||||
re_path(r'^accounts/login/', auth_views.LoginView.as_view()),
|
re_path(r'^accounts/login/', auth_views.LoginView.as_view()),
|
||||||
re_path(r'^accounts/logout/', auth_views.LogoutView.as_view())
|
re_path(r'^accounts/logout/', auth_views.LogoutView.as_view())
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
Copyright (c) 2015-2016 by Martin Bley (martin@mb-oss.de)
|
Copyright (c) 2015-2016 by Martin Bley (dev@mb-oss.de)
|
||||||
|
|
||||||
This file is part of TipPy.
|
This file is part of TipPy.
|
||||||
|
|
||||||
@@ -18,23 +18,25 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with TipPy. If not, see <http://www.gnu.org/licenses/>.
|
along with TipPy. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
import os
|
||||||
|
from os.path import join as pjoin
|
||||||
|
|
||||||
import django.shortcuts
|
import django.shortcuts
|
||||||
|
import pytz
|
||||||
|
from PIL import Image as PImage
|
||||||
|
from django.conf import settings
|
||||||
|
from django.contrib.admin.views.decorators import staff_member_required
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.core.paginator import Paginator, EmptyPage, \
|
from django.core.paginator import Paginator, EmptyPage, \
|
||||||
PageNotAnInteger
|
PageNotAnInteger
|
||||||
|
from django.db.models import Sum
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.db.models import Sum
|
|
||||||
from django.conf import settings
|
|
||||||
from os.path import join as pjoin
|
|
||||||
from tipp.models import *
|
|
||||||
from tipp.forms import *
|
from tipp.forms import *
|
||||||
|
from tipp.models import *
|
||||||
from tipp.openliga import *
|
from tipp.openliga import *
|
||||||
from datetime import datetime
|
|
||||||
from PIL import Image as PImage
|
|
||||||
import pytz
|
|
||||||
import os
|
|
||||||
|
|
||||||
timezoneLocal = pytz.timezone('Europe/Berlin')
|
timezoneLocal = pytz.timezone('Europe/Berlin')
|
||||||
|
|
||||||
@@ -139,8 +141,16 @@ def profile(request, pk):
|
|||||||
'img': img}
|
'img': img}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@staff_member_required
|
||||||
|
def staff(request):
|
||||||
|
season = get_current_season(),
|
||||||
|
""" get available competitions """
|
||||||
|
competitions = Competition.objects.filter(season=season).order_by('leagueName')
|
||||||
|
|
||||||
@login_required
|
return django.shortcuts.render(request, 'staff.html', {'competitions': competitions})
|
||||||
|
|
||||||
|
|
||||||
|
@staff_member_required
|
||||||
def getSeason(request, ls, season):
|
def getSeason(request, ls, season):
|
||||||
ol = OpenLiga()
|
ol = OpenLiga()
|
||||||
teams = ol.getTeams(str(season), ls)
|
teams = ol.getTeams(str(season), ls)
|
||||||
@@ -306,6 +316,7 @@ def update(request, ls, season, cur_md):
|
|||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def matchday(request, ls, season, matchday, template_name='md.html'):
|
def matchday(request, ls, season, matchday, template_name='md.html'):
|
||||||
|
update(request, ls, season, matchday)
|
||||||
debug = ''
|
debug = ''
|
||||||
debug += "Debugging: "
|
debug += "Debugging: "
|
||||||
has_refresh = True
|
has_refresh = True
|
||||||
|
|||||||
Reference in New Issue
Block a user