This commit is contained in:
Julien Constant
2023-03-14 12:15:35 +01:00
parent 6f6d65b663
commit 87b5ff12c5
5 changed files with 35 additions and 14 deletions

View File

@ -36,6 +36,7 @@ from django.core.exceptions import ValidationError
from django.utils import timezone from django.utils import timezone
from core import utils
from core.models import User, Preferences, RealGroup, Notification, SithFile from core.models import User, Preferences, RealGroup, Notification, SithFile
from club.models import Club from club.models import Club
@ -46,6 +47,7 @@ class Sith(models.Model):
alert_msg = models.TextField(_("alert message"), default="", blank=True) alert_msg = models.TextField(_("alert message"), default="", blank=True)
info_msg = models.TextField(_("info message"), default="", blank=True) info_msg = models.TextField(_("info message"), default="", blank=True)
weekmail_destinations = models.TextField(_("weekmail destinations"), default="") weekmail_destinations = models.TextField(_("weekmail destinations"), default="")
version = utils.get_git_revision_short_hash()
def is_owned_by(self, user): def is_owned_by(self, user):
return user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID) return user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID)

View File

@ -1730,6 +1730,11 @@ footer {
} }
} }
} }
> .version {
margin-top: 3px;
color: rgba(0, 0, 0, .3)
}
} }
/*---------------------------------FORMS-------------------------------*/ /*---------------------------------FORMS-------------------------------*/

View File

@ -269,20 +269,24 @@
</div> </div>
{% if not popup %} {% if not popup %}
<footer> <footer>
{% block footer %} {% block footer %}
<div> <div>
<a href="{{ url('core:page', 'contacts') }}">{% trans %}Contacts{% endtrans %}</a> <a href="{{ url('core:page', 'contacts') }}">{% trans %}Contacts{% endtrans %}</a>
<a href="{{ url('core:page', 'legals') }}">{% trans %}Legal notices{% endtrans %}</a> <a href="{{ url('core:page', 'legals') }}">{% trans %}Legal notices{% endtrans %}</a>
<a href="{{ url('core:page', 'copyright_agent') }}">{% trans %}Intellectual property{% endtrans %}</a> <a href="{{ url('core:page', 'copyright_agent') }}">{% trans %}Intellectual property{% endtrans %}</a>
<a href="{{ url('core:page', 'docs') }}">{% trans %}Help & Documentation{% endtrans %}</a> <a href="{{ url('core:page', 'docs') }}">{% trans %}Help & Documentation{% endtrans %}</a>
<a href="{{ url('core:page', 'rd') }}">{% trans %}R&D{% endtrans %}</a> <a href="{{ url('core:page', 'rd') }}">{% trans %}R&D{% endtrans %}</a>
</div> </div>
<a href="https://discord.gg/XK9WfPsUFm" target="_link"> <a href="https://discord.gg/XK9WfPsUFm" target="_link">
{% trans %}Site created by the IT Department of the AE{% endtrans %} {% trans %}Site created by the IT Department of the AE{% endtrans %}
</a> </a>
{% endblock %} {% endblock %}
</footer> <br>
<code class="version">
{% trans %}Sith version:{% endtrans %}&nbsp;{{ get_sith().version }}
</code>
</footer>
{% endif %} {% endif %}
<!-- <!--
{% block tests %} {% block tests %}

View File

@ -22,6 +22,7 @@
# #
# #
import subprocess
import re import re
# Image utils # Image utils
@ -37,6 +38,11 @@ import PIL
from django.conf import settings from django.conf import settings
from django.core.files.base import ContentFile 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()): def get_start_of_semester(d=date.today()):
""" """

View File

@ -1644,6 +1644,10 @@ msgstr "Appels affichés"
msgid "Calls to moderate" msgid "Calls to moderate"
msgstr "Appels à modérer" msgstr "Appels à modérer"
#: core/templates/core/base.jinja
msgid "Site version:"
msgstr "Version du site :"
#: com/templates/com/news_admin_list.jinja:242 #: com/templates/com/news_admin_list.jinja:242
#: core/templates/core/base.jinja:177 #: core/templates/core/base.jinja:177
msgid "Events" msgid "Events"