diff --git a/templates/blogindex.html b/templates/blogindex.html index faee0b6..6d6d558 100644 --- a/templates/blogindex.html +++ b/templates/blogindex.html @@ -2,70 +2,74 @@ {% load i18n static %} {% load humanize %} {% block head %} - TipPy Blog + TipPy Blog {% endblock %} {% block nav %} -{% include "nav.html" with ls=ls season=season %} + {% include "nav.html" with ls=ls season=season %} {% endblock %} {% block body %} -
-
-
-

TipPy Blog

-

- Neue Nachricht -

-
-
- {% for post, avatar in posts %} -
-
-
-
- {{post.author.first_name}} schrieb {{post.created|naturaltime}} +
+
+
+

TipPy Blog

+

+ Neue Nachricht +

+
-
- {% if avatar %} - Profile Pic - {% else %} - Profile Pic - {% endif %} - {{post.content|safe}} -
-
-
-
- {% endfor %} -
-
- + +
+
+ +
+
-
-
{% endblock %} diff --git a/templates/chat.xhtml b/templates/chat.xhtml new file mode 100644 index 0000000..18bf97d --- /dev/null +++ b/templates/chat.xhtml @@ -0,0 +1,28 @@ +{% load humanize %} +
+

+ neuer Post +

+ + diff --git a/templates/md.html b/templates/md.html index 36b260c..f629996 100644 --- a/templates/md.html +++ b/templates/md.html @@ -2,128 +2,119 @@ {% load i18n static %} {% load humanize %} {% block head %} - + {% endblock %} {% block nav %} -{% include "nav.html" with ls=ls season=season %} + {% include "nav.html" with ls=ls season=season %} {% endblock %} {% block body %} -
-
-
-

Neueste Nachrichten

-

- zum Blog -

- {% for post, avatar in posts %} -
-
- {{post.author.first_name}} schrieb {{post.created|naturaltime}} +
+
+
+

Deine Tipps

+ +
{% csrf_token %} +
+ + + + + + + + + {% for match in matches %} + {% if match.started and not match.finished %} + {% else %} + {% endif %} + + {% if match.iconURLTeam1 != "" %} + + {% if match.iconURLTeam1 != "" %} + + + + + + {% endfor %} +
AnstoßHeimGastErg.Tipp
{{ match.matchDateTime }} + {% else %} + + {% endif %} + + {{ match.abbrTeam1 }} + + {% else %} + + {% endif %} + + {{ match.abbrTeam2 }} + {{ match.matchResult }}{{ match.tippFormTeam1 }}{{ match.tippFormTeam2 }}
+
+ +
+
-
- {% if avatar %} - Profile Pic - {% else %} - Profile Pic - {% endif %} - {{post.content|safe}} -
-
- {% endfor %} -
-
-
-
-

Deine Tipps

- -
{% csrf_token %} -
- - - - - - - - - {% for match in matches %} - {% if match.started and not match.finished %} - {% else %}{% endif %} - - {% if match.iconURLTeam1 != "" %} - - {% if match.iconURLTeam1 != "" %} - - - - +
+ {% for mandant, list in mandant_dict.items %} +
+

Mitspieler {{ mandant }}

+
+
AnstoßHeimGastErg.Tipp
{{ match.matchDateTime }} - {% else %} - - {% endif %} - - {{ match.abbrTeam1 }} - - {% else %} - - {% endif %} - - {{ match.abbrTeam2 }} - {{ match.matchResult }}{{ match.tippFormTeam1 }}{{ match.tippFormTeam2 }}
+ + + + {% for match in matches %} + + {% endfor %} + + {% for mate in list %} + + + + {% for tipp in mate.tipps %} + + {% endfor %} + {% endfor %} + +
TipperGesamt + {% if match.iconURLTeam1 != "" %} + + {% else %} + + {% endif %} +

+ {% if match.iconURLTeam2 != "" %} + + {% else %} + + {% endif %} +
{{ mate.mate.first_name }}{{ mate.sum_score }}{{ tipp }}
+
+
{% endfor %} -
- - +
+
+

Chat

+ {% block chat %} + {% include "chat.xhtml" with posts=posts %} + {% endblock %} +
+
-
-
- {% for mandant, list in mandant_dict.items %} -
-

Mitspieler {{ mandant }}

-
- - - - - {% for match in matches %} - - {% endfor %} - - {% for mate in list %} - - - - {% for tipp in mate.tipps %} - - {% endfor %} - {% endfor %} - -
TipperGesamt - {% if match.iconURLTeam1 != "" %} - - {% else %} - - {% endif %} -

- {% if match.iconURLTeam2 != "" %} - - {% else %} - - {% endif %} -
{{ mate.mate.first_name }}{{ mate.sum_score }}{{ tipp }}
-
-
- {% endfor %} -
-
{% endblock %} diff --git a/templates/newblogpost.html b/templates/newblogpost.html index 4b45e87..68899d8 100644 --- a/templates/newblogpost.html +++ b/templates/newblogpost.html @@ -1,58 +1,58 @@ {% extends "base.html" %} {% load i18n static %} {% block head %} - TipPy Blog + TipPy Blog {% endblock %} {% block nav %} -{% include "nav.html" with ls=ls season=season %} + {% include "nav.html" with ls=ls season=season %} {% endblock %} {% block body %} -
- {% if form_bp.errors %} -
-

- {% if form_bp.errors.items|length == 1 %} - {% trans "Please correct the error below." %} - {% else %} - {% trans "Please correct the errors below." %} - {% endif %}

-
- {% endif %} -
-
-
{% csrf_token %} -
- {{form_bp.content.errors}} - -
- - {% if cnt_mandants > 1 %} - {{ form_mandants.mandants.label_tag }} - {% for choice in form_mandants.mandants %} - - {% endfor %} - {% endif %} -
+
+ {% if form_bp.errors %} +
+

+ {% if form_bp.errors.items|length == 1 %} + {% trans "Please correct the error below." %} + {% else %} + {% trans "Please correct the errors below." %} + {% endif %}

+
+ {% endif %} +
+
+ {% csrf_token %} +
+ {{ form_bp.content.errors }} +
+
+ + {% if cnt_mandants > 1 %} + {{ form_mandants.mandants.label_tag }} + {% for choice in form_mandants.mandants %} + + {% endfor %} + {% endif %} +
+
+
+
+ +
+
+ +
-
-
- -
-
- + {% if debug %} +
+
+

{{ debug }}

+
+
+ {% endif %}
-
- {% if debug %} -
-
-

{{ debug }}

-
-
- {% endif %} -
{% endblock %} diff --git a/tipp/urls.py b/tipp/urls.py index 79dc6d6..573d50c 100644 --- a/tipp/urls.py +++ b/tipp/urls.py @@ -25,7 +25,8 @@ urlpatterns = [ re_path(r'^accounts/login/', auth_views.LoginView.as_view()), re_path(r'^accounts/logout/', auth_views.LogoutView.as_view()) ] - +# Redirect on logout +LOGOUT_REDIRECT_URL = "home" if settings.DEBUG is True: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/tipp/views.py b/tipp/views.py index 890fb8c..1f8e978 100644 --- a/tipp/views.py +++ b/tipp/views.py @@ -446,7 +446,7 @@ def matchday(request, ls, season, matchday, template_name='md.html'): pm = RelPostMandant.objects.filter(mandant__in=mandants). \ values_list('post', flat=True) posts = [] - for post in Post.objects.filter(id__in=pm, published=True)[:1]: + for post in Post.objects.filter(id__in=pm, published=True)[:5]: try: avatar = UserProfile.objects.get(user_id=post.author_id). \ avatar.name