File tree Expand file tree Collapse file tree 5 files changed +87
-6
lines changed Expand file tree Collapse file tree 5 files changed +87
-6
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ def index():
9
9
if request .method == 'POST' :
10
10
qr = request .form ['qr' ]
11
11
json = decode (qr )
12
- return render_template ('json.html' , json = json )
12
+ return render_template ('json.html' , cert = json )
13
13
else :
14
14
return render_template ('form.html' )
15
15
Original file line number Diff line number Diff line change @@ -13,5 +13,6 @@ def decode(cert):
13
13
cbor_data = cbor2 .loads (cbor_data )
14
14
json_data = cbor2 .loads (cbor_data .value [2 ])
15
15
json_data = json .dumps (json_data , indent = 2 )
16
- # object = json.loads(json_data)
17
- return json_data
16
+ object = json .loads (json_data )
17
+ object = object ['-260' ]['1' ]
18
+ return object
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
2
3
+ {% block title %}
4
+ Decode your EU Digital COVID Certificate
5
+ {% endblock %}
6
+
3
7
{% block content %}
4
8
< form method ="post ">
5
- < textarea name ="qr " rows ="6 " placeholder ="HC1: … " required class ="form-control mb-3 "> </ textarea >
9
+ < div class ="form-group mb-3 ">
10
+ < label > QR-Code Text</ label >
11
+
12
+ < textarea name ="qr " rows ="10 " placeholder ="HC1: … " autofocus required minlength ="100 " maxlength ="1000 "
13
+ class ="form-control "> HC1:6BF+70790T9WJWG.FKY*4GO0.O1CV2 O5 N2FBBRW1*70HS8WY04AC*WIFN0AHCD8KD97TK0F90KECTHGWJC0FDC:5AIA%G7X+AQB9746HS80:54IBQF60R6$A80X6S1BTYACG6M+9XG8KIAWNA91AY%67092L4WJCT3EHS8XJC$+DXJCCWENF6OF63W5NW6WF6%JC QE/IAYJC5LEW34U3ET7DXC9 QE-ED8%E.JCBECB1A-:8$96646AL60A60S6Q$D.UDRYA 96NF6L/5QW6307KQEPD09WEQDD+Q6TW6FA7C466KCN9E%961A6DL6FA7D46JPCT3E5JDLA7$Q6E464W5TG6..DX%DZJC6/DTZ9 QE5$CB$DA/D JC1/D3Z8WED1ECW.CCWE.Y92OAGY8MY9L+9MPCG/D5 C5IA5N9$PC5$CUZCY$5Y$527B+A4KZNQG5TKOWWD9FL%I8U$F7O2IBM85CWOC%LEZU4R/BXHDAHN 11$CA5MRI:AONFN7091K9FKIGIY%VWSSSU9%01FO2*FTPQ3C3F</ textarea >
14
+
15
+ < small class ="form-text text-muted ">
16
+ Get your QR-Code plain contents by reading it via a reader like < a href ="https://zxing.org/w/decode.jspx " target ="_blank "> zxing.org</ a > and paste the text above
17
+ </ small >
18
+ </ div >
19
+
6
20
< input type ="submit " value ="decode " class ="btn btn-primary w-100 ">
7
21
</ form >
8
22
{% endblock %}
Original file line number Diff line number Diff line change 1
1
< nav class ="navbar navbar-dark bg-dark mb-5 ">
2
2
< div class ="container ">
3
- < a class ="navbar-brand " href ="/ "> EU Digital COVID Certificate Converter</ a >
3
+ < a class ="navbar-brand " href ="/ ">
4
+ EU Digital COVID Certificate Converter
5
+ </ a >
4
6
</ div >
5
7
</ nav >
Original file line number Diff line number Diff line change 1
1
{% extends "base.html" %}
2
2
3
+ {% block title %}
4
+ Your decoded EU Digital COVID Certificate
5
+ {% endblock %}
6
+
3
7
{% block content %}
4
- < pre > < code > {{ json }}</ code > </ pre >
8
+
9
+ <!-- <pre>
10
+ <code>
11
+ {{ cert }}
12
+ </code>
13
+ </pre> -->
14
+
15
+
16
+ < table class ="table ">
17
+ < thead >
18
+ < tr >
19
+ < th > key</ th >
20
+ < th > property</ th >
21
+ < th > value</ th >
22
+ </ tr >
23
+ </ thead >
24
+ < tbody >
25
+ <!-- level 1 -->
26
+ {% for key in cert %}
27
+ < tr >
28
+ < td > < code > {{ key }}</ code > </ td >
29
+ < td > </ td >
30
+ < td >
31
+ <!-- level 2 -->
32
+ {% if cert[key] is mapping or cert[key] is not string %}
33
+ < table class ="table ">
34
+ < tbody >
35
+ {% for key2 in cert[key] %}
36
+ < tr >
37
+ < td > < code > {{ key2 }}</ code > </ td >
38
+ < td > </ td >
39
+ < td >
40
+ <!-- level 3 -->
41
+ {% if cert[key][key2] is iterable and (cert[key][key2] is not string) %}
42
+ < table class ="table ">
43
+ < tbody >
44
+ {% for key3 in cert[key][key2] %}
45
+ < tr >
46
+ < td > < code > {{ key3 }}</ code > </ td >
47
+ < td > </ td >
48
+ < td > {{ cert[key][key2][key3] }}</ td >
49
+ </ tr >
50
+ {% endfor %}
51
+ </ tbody >
52
+ </ table >
53
+ {% else %}
54
+ {{ cert[key][key2] }}
55
+ {% endif %}
56
+ </ td >
57
+ </ tr >
58
+ {% endfor %}
59
+ </ tbody >
60
+ </ table >
61
+ {% else %}
62
+ {{ cert[key] }}
63
+ {% endif %}
64
+ </ td >
65
+ </ tr >
66
+ {% endfor %}
67
+ </ tbody >
68
+ </ table >
5
69
{% endblock %}
You can’t perform that action at this time.
0 commit comments