Merge branch 'develop' of sika.sahkoinsinoorikilta.fi:vtmk/web2.0 into feature-main-page-bugfixes

This commit is contained in:
henu
2017-10-25 20:06:33 +03:00
5 changed files with 16 additions and 27 deletions
+1 -1
View File
@@ -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))
@@ -40,7 +40,6 @@
<li class="divider">
<li class="nav-item"><a data-toggle="tab" href="#deleterot" role="tab">{% trans "Create/Delete" %}</a></li>
</ul>
<li><a data-toggle="tab" href="#settings" role="tab">{% trans "Settings" %}</a></li>
</ul>
<div class="tab-content row">
<div id="slides" class="tab-pane active">
@@ -146,28 +145,6 @@
</table>
</div>
</div>
<div id="settings" class="tab-pane">
<div>
<div class="col-md-12">
<h2>{% trans "Settings" %}</h2>
</div>
<form action="/i18n/setlang/" method="post" class="form-group"> {% csrf_token %}
<div class="col-md-12">
<h4>{% trans "Language" %}</h4>
</div>
<div class="col-md-6">
<select name="language" class="form-control">
<option value="fi" {% if LANGUAGE_CODE == "fi" %} selected {% endif %}>{% trans "Finnish" %}</option>
<option value="en" {% if LANGUAGE_CODE == "en" %} selected {% endif %}>{% trans "English" %}</option>
</select>
</div>
<div class="col-md-3">
<input type="submit" class="btn btn-success" value="{% trans "Submit" %}">
</div>
</form>
</div>
</div>
</div>
<div style="margin-top: 100px;">
{% include "footer.html" %}
+1 -1
View File
@@ -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
+3 -1
View File
@@ -7,6 +7,8 @@
</head>
<body>
<h1>SIKWEB 2.0</h1>
{{ TAG }}
<p>{{ commit }}</p>
<p>{{ date }}</p>
<p>{{ tag }}</p>
</body>
</html>
+11 -1
View File
@@ -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"])