Skip to content

Commit

Permalink
Add version footer
Browse files Browse the repository at this point in the history
BWA-78 [DONE]
BWA-23 [DONE]
  • Loading branch information
ZyndramZM committed Apr 4, 2024
1 parent 798007c commit 0870beb
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 4 deletions.
13 changes: 13 additions & 0 deletions BaCa2/assets/css/base.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BaCa2/assets/css/base.css.map

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions BaCa2/assets/scss/_version_footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "baca2_variables";

#version_footer {
position: fixed;
bottom: 10px;
left: 10px;
color: $baca2_beige;
text-align: left;
font-size: 0.8em;
}
1 change: 1 addition & 0 deletions BaCa2/assets/scss/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ html, body {
height: 100%;
}

@import "version_footer";
@import "forms";
@import "baca2_logo";
@import "navbar";
Expand Down
1 change: 1 addition & 0 deletions BaCa2/core/settings/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
'django.template.context_processors.debug',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'util.context_processors.version_tag',
],
},
},
Expand Down
28 changes: 26 additions & 2 deletions BaCa2/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/jquery.dataTables.css"/>

<!-- DataTables - ScrollResize plugin -->
<script src="https://cdn.datatables.net/plug-ins/2.0.1/features/scrollResize/dataTables.scrollResize.min.js"></script>
<script
src="https://cdn.datatables.net/plug-ins/2.0.1/features/scrollResize/dataTables.scrollResize.min.js"></script>

<!-- Bootstrap theme - customised -->
<link rel="stylesheet" href="{% static 'css/baca2_theme.css' %}">
Expand Down Expand Up @@ -191,7 +192,30 @@
{% block scripts %}
{% endblock %}

<!-- Prism JS and autoloader -->
<!-- Prism JS and autoloader -->

{% block version_footer %}
<div class="container" id="version_footer">
<div class="row">
BaCa2 v.{{ version }}
</div>
<div class="row">
User: {{ user.email }}
</div>
{% if user %}
<div class="row">
Access:
{% if user.is_superuser %}SU
{% else %}U
{% endif %}
|
{% if user.usos_id %}UJ
{% else %}EXT
{% endif %}
</div>
{% endif %}
</div>
{% endblock %}

</body>
</html>
5 changes: 5 additions & 0 deletions BaCa2/util/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from importlib.metadata import version


def version_tag(request):
return {'version': version('baca2')}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "baca2"
version = "0.1.2-pre"
version = "1.0.1-beta"
description = "Bachelor project: automated programming task checking and scoring system BaCa2"
authors = ["BaCa2 Team"]
readme = "README.md"
Expand Down

0 comments on commit 0870beb

Please sign in to comment.