Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luca (strifel)
uffd
Commits
73994192
Verified
Commit
73994192
authored
4 years ago
by
nd
Browse files
Options
Downloads
Patches
Plain Diff
show version in footer, closes #13
parent
c1ce5425
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
uffd/static/style.css
+1
-1
1 addition, 1 deletion
uffd/static/style.css
uffd/template_helper.py
+3
-3
3 additions, 3 deletions
uffd/template_helper.py
uffd/templates/base.html
+4
-0
4 additions, 0 deletions
uffd/templates/base.html
with
8 additions
and
4 deletions
uffd/static/style.css
+
1
−
1
View file @
73994192
.footer
{
position
:
absolute
;
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
height
:
2em
;
...
...
This diff is collapsed.
Click to expand it.
uffd/template_helper.py
+
3
−
3
View file @
73994192
...
...
@@ -8,7 +8,7 @@ def register_template_helper(app):
return
a
==
b
@app.url_defaults
def
static_version_inject
(
endpoint
,
values
):
def
static_version_inject
(
endpoint
,
values
):
#pylint: disable=unused-variable
if
endpoint
==
'
static
'
:
values
[
'
v
'
]
=
app
.
jinja_env
.
globals
[
'
gitversion
'
][
'
longhash
'
]
#pylint: disable=no-member
...
...
@@ -23,5 +23,5 @@ def register_template_helper(app):
app
.
add_template_global
(
equalto
,
name
=
'
equalto
'
)
# get git commit
GITOUTPUT
=
subprocess
.
check_output
([
'
git
'
,
"
log
"
,
"
-g
"
,
"
-1
"
,
"
--pretty=%H#%h#%d#%s
"
]).
decode
(
'
UTF-8
'
).
split
(
'
#
'
,
3
)
app
.
jinja_env
.
globals
[
'
gitversion
'
]
=
{
'
hash
'
:
GITOUTPUT
[
1
],
'
longhash
'
:
GITOUTPUT
[
0
],
'
branch
'
:
GITOUTPUT
[
2
],
'
msg
'
:
GITOUTPUT
[
3
]}
#pylint: disable=no-member
git_output
=
subprocess
.
check_output
([
'
git
'
,
"
log
"
,
"
-g
"
,
"
-1
"
,
"
--pretty=%H#%h#%d#%s
"
]).
decode
(
'
UTF-8
'
).
split
(
'
#
'
,
3
)
app
.
jinja_env
.
globals
[
'
gitversion
'
]
=
{
'
hash
'
:
git_output
[
1
],
'
longhash
'
:
git_output
[
0
],
'
branch
'
:
git_output
[
2
],
'
msg
'
:
git_output
[
3
]}
#pylint: disable=no-member
This diff is collapsed.
Click to expand it.
uffd/templates/base.html
+
4
−
0
View file @
73994192
...
...
@@ -102,6 +102,10 @@
{% for link in config["FOOTER_LINKS"]%}
<li
class=
"list-inline-item"
><a
href=
"{{ link.url }}"
>
{{ link.title }}
</a></li>
{% endfor %}
<li
class=
"list-inline-item float-right"
>
<a
href=
"https://git.cccv.de/infra/uffd/uffd/"
>
Sourcecode
</a>
<a
target=
"_blank"
href=
"https://git.cccv.de/infra/uffd/uffd/-/commit/{{ gitversion.longhash }}"
><span
title=
"{{ gitversion.branch }} {{ gitversion.hash }}: {{ gitversion.msg }}"
data-toggle=
"tooltip"
>
Version: {{ gitversion.hash }}
</span></a>
</li>
</ul>
</div>
{% endblock footer %}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment