mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-12 12:59:24 +00:00
Implements #520
This commit is contained in:
@ -36,6 +36,7 @@ from django.core.exceptions import ValidationError
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
from core import utils
|
||||
from core.models import User, Preferences, RealGroup, Notification, SithFile
|
||||
from club.models import Club
|
||||
|
||||
@ -46,6 +47,7 @@ class Sith(models.Model):
|
||||
alert_msg = models.TextField(_("alert message"), default="", blank=True)
|
||||
info_msg = models.TextField(_("info message"), default="", blank=True)
|
||||
weekmail_destinations = models.TextField(_("weekmail destinations"), default="")
|
||||
version = utils.get_git_revision_short_hash()
|
||||
|
||||
def is_owned_by(self, user):
|
||||
return user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID)
|
||||
|
@ -1730,6 +1730,11 @@ footer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> .version {
|
||||
margin-top: 3px;
|
||||
color: rgba(0, 0, 0, .3)
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------FORMS-------------------------------*/
|
||||
|
@ -282,6 +282,10 @@
|
||||
{% trans %}Site created by the IT Department of the AE{% endtrans %}
|
||||
</a>
|
||||
{% endblock %}
|
||||
<br>
|
||||
<code class="version">
|
||||
{% trans %}Sith version:{% endtrans %} {{ get_sith().version }}
|
||||
</code>
|
||||
</footer>
|
||||
{% endif %}
|
||||
<!--
|
||||
|
@ -22,6 +22,7 @@
|
||||
#
|
||||
#
|
||||
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
# Image utils
|
||||
@ -37,6 +38,11 @@ import PIL
|
||||
from django.conf import settings
|
||||
from django.core.files.base import ContentFile
|
||||
|
||||
def get_git_revision_short_hash() -> str:
|
||||
"""
|
||||
Return the short hash of the current commit
|
||||
"""
|
||||
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()
|
||||
|
||||
def get_start_of_semester(d=date.today()):
|
||||
"""
|
||||
|
@ -1644,6 +1644,10 @@ msgstr "Appels affichés"
|
||||
msgid "Calls to moderate"
|
||||
msgstr "Appels à modérer"
|
||||
|
||||
#: core/templates/core/base.jinja
|
||||
msgid "Site version:"
|
||||
msgstr "Version du site :"
|
||||
|
||||
#: com/templates/com/news_admin_list.jinja:242
|
||||
#: core/templates/core/base.jinja:177
|
||||
msgid "Events"
|
||||
|
Reference in New Issue
Block a user