From 82ada111e6b5d308b9cf876fde83111064f70168 Mon Sep 17 00:00:00 2001 From: Juhana Luomanen Date: Wed, 25 Oct 2017 17:54:58 +0300 Subject: [PATCH 1/3] Remove settings menu from Infoscreen admin --- infoscreen/templates/infoscreen_admin.html | 23 ---------------------- 1 file changed, 23 deletions(-) diff --git a/infoscreen/templates/infoscreen_admin.html b/infoscreen/templates/infoscreen_admin.html index 45c49dd..9ab758e 100644 --- a/infoscreen/templates/infoscreen_admin.html +++ b/infoscreen/templates/infoscreen_admin.html @@ -40,7 +40,6 @@
  • -
  • {% trans "Settings" %}
  • @@ -146,28 +145,6 @@
    -
    -
    -
    -

    {% trans "Settings" %}

    -
    - -
    {% csrf_token %} -
    -

    {% trans "Language" %}

    -
    -
    - -
    -
    - -
    -
    -
    -
    {% include "footer.html" %} From 601050baf641288fe5390a306ed9844aefec79ca Mon Sep 17 00:00:00 2001 From: Aarni Date: Wed, 25 Oct 2017 18:27:44 +0300 Subject: [PATCH 2/3] Add full hash, date and latest tag to about.html Close #78 --- templates/about.html | 4 +++- webapp/views.py | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/templates/about.html b/templates/about.html index 7faf8f3..ecb1a17 100644 --- a/templates/about.html +++ b/templates/about.html @@ -7,6 +7,8 @@

    SIKWEB 2.0

    - {{ TAG }} +

    {{ commit }}

    +

    {{ date }}

    +

    {{ tag }}

    diff --git a/webapp/views.py b/webapp/views.py index 39e6bb3..f0fb2d8 100644 --- a/webapp/views.py +++ b/webapp/views.py @@ -11,6 +11,7 @@ from django.conf import settings import logging import requests +from dealer.git import git from webapp.models import PresetKaehmyRole, CustomKaehmyRole from webapp.models import OhlhafvChallenge, KaehmyForm, TelegramChannel @@ -81,7 +82,16 @@ def logout_view(request, *args, **kwargs): @require_http_methods(["GET"]) def about_view(request, *args, **kwargs): """Render about page.""" - return render(request, "about.html", {}) + repo = git.init_repo() + latest_commit = repo.git("rev-parse HEAD").decode('utf-8') + latest_date = repo.git("show -s --format=%ci " + latest_commit).decode('utf-8') + latest_tag = repo.git("describe --tags " + repo.git("rev-list --tags --max-count=1").decode('utf-8')).decode('utf-8') + context = { + 'commit': latest_commit, + 'date': latest_date, + 'tag': latest_tag + } + return render(request, "about.html", context) @require_http_methods(["GET"]) From 7eb4bc146b0a4a80872d5a3e1c88ba347d1a1f0d Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Wed, 25 Oct 2017 19:01:04 +0300 Subject: [PATCH 3/3] Fix stuff to make project run on Windows --- infoscreen/hsl_fetcher.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/infoscreen/hsl_fetcher.py b/infoscreen/hsl_fetcher.py index f52097e..6ad17f7 100644 --- a/infoscreen/hsl_fetcher.py +++ b/infoscreen/hsl_fetcher.py @@ -14,7 +14,7 @@ from infoscreen.models import HSLDataModel class HSLFetcher: """Main class of Infoscreen HSL fetcher.""" - last_fetched = datetime.fromtimestamp(0) # epoch + last_fetched = datetime.fromtimestamp(86400) # epoch INTERVAL = 1 # minutes logging.info( "Set up scheduled HSL API fetch every {} minutes".format(INTERVAL)) diff --git a/requirements.txt b/requirements.txt index 5204367..ef7a2fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ ptyprocess==0.5.1 pytz==2016.4 simplegeneric==0.8.1 traitlets==4.2.1 -Pillow==3.3.1 +Pillow==4.3.0 requests==2.11.1 django-nocaptcha-recaptcha==0.0.19 django-cors-headers==2.0.1