Skip to content

Commit

Permalink
done with articles routing
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarMAshour committed Oct 23, 2022
1 parent 348d7c9 commit 3b5127d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
Binary file modified coop_challenge/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified coop_challenge/__pycache__/views.cpython-310.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion coop_challenge/templates/coop_challenge/scanner_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<script>
function onScanSuccess(decodedText, decodedResult) {
html5QrcodeScanner.clear();
$("#resultScan").html("<div class='row d-flex justify-content-center' style='width: 60%; margin-top: 100px;'><div class='col-5 d-flex justify-content-center'><button class='btn btn-primary btn-lg'>Label drucken</button></div><div class='col-5 d-flex justify-content-center'><button class='btn btn-primary btn-lg'>Datenblatt drucken</button></div></div>");
var decodedText_int = parseInt(decodedText);
$("#resultScan").html("<div class='row d-flex justify-content-center' style='width: 60%; margin-top: 100px;'><div class='col-12 d-flex justify-content-center' style=\"font-size:18px;\"><strong>Artikelnummer/Bar code gescannt:</strong><span style=\"color:#ffa500;\">&nbsp"+decodedText+"</span></div><br><br><br><br><div class='col-5 d-flex justify-content-center'><a href=\"printlabel/"+decodedText+"\"><button class='btn btn-primary btn-lg'>Label drucken</button></a></div><div class='col-5 d-flex justify-content-center'><a href=\"printpdf/"+decodedText+"\"><button class='btn btn-primary btn-lg'>Datenblatt drucken</button></a></div></div>".replace('decodedText_str', decodedText_int));
}

var html5QrcodeScanner = new Html5QrcodeScanner(
Expand Down
3 changes: 3 additions & 0 deletions coop_challenge/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@

urlpatterns = [
path('', views.viewIndex, name='index'),
path('printlabell/', views.printLabell, name='printlabell'),
path('printlabel/<int:article>/', views.printLabel, name='printlabel'),
path('printpdf/<int:article>/', views.printPdf, name='printpdf'),
]
25 changes: 25 additions & 0 deletions coop_challenge/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,29 @@ def viewIndex(request):
# tryPDF()
# return FileResponse(open(tryPDF(), 'rb'), content_type='application/pdf')

return render(request, 'coop_challenge/scanner_1.html', {})

def printLabel(request, article):
# tryPDF()
# return FileResponse(open(tryPDF(), 'rb'), content_type='application/pdf')
print(article)
print(article)
print(article)
print(article)
print(article)
print(article)
print(article)
print(article)
return render(request, 'coop_challenge/scanner_1.html', {})

def printLabell(request):
# tryPDF()
# return FileResponse(open(tryPDF(), 'rb'), content_type='application/pdf')

return render(request, 'coop_challenge/scanner_1.html', {})

def printPdf(request, article):
# tryPDF()
# return FileResponse(open(tryPDF(), 'rb'), content_type='application/pdf')

return render(request, 'coop_challenge/scanner_1.html', {})

0 comments on commit 3b5127d

Please sign in to comment.