Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
transporte
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
Logistik
transporte
Commits
59ead195
Unverified
Commit
59ead195
authored
5 years ago
by
Hanspeter Spalinger
Browse files
Options
Downloads
Patches
Plain Diff
print transport sticker from transport tool
parent
4587216e
No related branches found
No related tags found
1 merge request
!11
print transport sticker from transport tool
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
transporte/templates/transport_details.html
+4
-1
4 additions, 1 deletion
transporte/templates/transport_details.html
transporte/templates/transport_sticker.html
+60
-0
60 additions, 0 deletions
transporte/templates/transport_sticker.html
transporte/views.py
+17
-0
17 additions, 0 deletions
transporte/views.py
with
81 additions
and
1 deletion
transporte/templates/transport_details.html
+
4
−
1
View file @
59ead195
...
...
@@ -4,7 +4,10 @@
{% if transport %}
<h1
class=
"page-header"
>
Transport Details
</h1>
<p
class=
"small"
>
Ticket
<a
href=
"https://tickets.c3loc.de/#ticket/zoom/{{ transport.ticket_id }}"
target=
"_blank"
>
#{{ transport.ticket_id }}
</a>
</p>
<p
class=
"small"
>
Ticket
<a
href=
"https://tickets.c3loc.de/#ticket/zoom/{{ transport.ticket_id }}"
target=
"_blank"
>
#{{ transport.ticket_id }}
</a>
Print
<a
href=
"{{ url_for('sticker_transport', id=transport.id) }}"
target=
"_blank"
>
Transport Sticker
</a>
</p>
<div
class=
"row"
>
<div
class=
"col-xs-3 col-sm-2"
>
...
...
This diff is collapsed.
Click to expand it.
transporte/templates/transport_sticker.html
0 → 100644
+
60
−
0
View file @
59ead195
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<link
rel=
"shortcut icon"
href=
"/static/gfx/list.jpg"
>
<title>
{{ app_name }}
</title>
{% block meta %}{% endblock %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ url_for('static', filename='css/fa-v5.5.0-all.css') }}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ url_for('static', filename='css/bootstrap-4.1.1.min.css') }}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ url_for('static', filename='css/dataTables-1.10.18.bootstrap4.min.css') }}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ url_for('static', filename='css/main.css') }}"
/>
<script
type=
"text/javascript"
src=
"{{ url_for('static', filename='js/jquery-3.3.1.min.js') }}"
></script>
<script
type=
"text/javascript"
src=
"{{ url_for('static', filename='js/bootstrap-4.1.1.min.js') }}"
></script>
<script
type=
"text/javascript"
src=
"{{ url_for('static', filename='js/jquery.dataTables-1.10.18.min.js') }}"
></script>
<script
type=
"text/javascript"
src=
"{{ url_for('static', filename='js/dataTables-1.10.18.bootstrap4.min.js') }}"
></script>
<style>
body
{
width
:
21cm
;
height
:
29.7cm
;
margin
:
30mm
45mm
30mm
45mm
;
font-size
:
2rem
;
}
</style>
</head>
<body>
<div
class=
"container"
style=
"position:relative;height:100%;"
>
<h1>
Transport Sticker
</h1>
<p><strong>
Inhalt:
</strong><br/><div
style=
"height:3em;border-bottom:solid 1px;"
></div></p>
<p><strong>
Ziel:
</strong><br/><div
style=
"border-bottom:solid 1px;"
>
{{ transport.destination|nl2br }}
</div></p>
<p><strong>
Datum:
</strong><br/><div
style=
"border-bottom:solid 1px;"
>
{{ transport.date|datetime }}, {{ transport.time }}
</div></p>
<div
class=
"container"
style=
"position: absolute; bottom:1em;"
>
<div
class=
"row"
>
<div
class=
"col-sm"
>
<p>
Transport Tool Link
</p>
<img
src=
" {{ qrcode(url_for('show_transport', id=transport.id, _external=True)) }}"
/>
</div>
<div
class=
"col-sm"
>
<p>
Ticket Link
</p>
<img
src=
" {{ qrcode('https://tickets.c3loc.de/#ticket/zoom/{}'.format(transport.ticket_id)) }}"
/>
</div>
</div>
</div>
</div>
</body>
</html>
This diff is collapsed.
Click to expand it.
transporte/views.py
+
17
−
0
View file @
59ead195
...
...
@@ -213,6 +213,23 @@ def show_transport(id=None):
return
render_template
(
'
transport_details.html
'
,
transport
=
transport
)
@app.route
(
'
/transports/sticker/<int:id>
'
)
@login_required
def
sticker_transport
(
id
=
None
):
transport
=
Transport
.
query
.
get
(
id
)
if
transport
is
None
or
not
(
transport
.
user_id
==
current_user
.
id
or
current_user
.
role
in
[
'
helpdesk
'
,
'
admin
'
]):
transport
=
None
flash
(
'
Transport is not available
'
)
else
:
if
transport
.
done
:
flash
(
'
Transport is done
'
,
'
success
'
)
elif
transport
.
cancelled
:
flash
(
'
Transport was cancelled!
'
,
'
danger
'
)
return
render_template
(
'
transport_sticker.html
'
,
transport
=
transport
)
@app.route
(
'
/transports/mark/<mark>/<int:id>
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@login_required
def
mark_transport
(
mark
,
id
=
None
):
...
...
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