latest design for menu

workspace
Brendan Howell 8 years ago
parent 252c3cf4b2
commit d881188296

@ -1,4 +1,5 @@
import json
import os.path
import subprocess
import code128
@ -68,7 +69,11 @@ class InhumanResources(Bureau):
cmd = data["cmd"]
cmdname = data["cmdname"]
desc = data["desc"]
cmd_code = prefix + cmd + "."
barcode = clean_svg(code128.svg(prefix + cmd + "."))
barcode_png = os.path.join(self.datadir, cmd_code + "png")
code128.image(cmd_code).save(barcode_png)
barcode_png = str(barcode_png)
except KeyError as e:
print("cannot add invalid command:", str(e))
return
@ -79,7 +84,8 @@ class InhumanResources(Bureau):
else:
self.menu[prefix]["commands"][cmd] = {"name": cmdname,
"desc": desc,
"barcode": barcode}
"barcode": barcode,
"barcode_png": barcode_png}
@add_api("addapi", "Register API Method")
def add_api_method(self, data):

@ -1,15 +1,18 @@
<html>
<html lang="en">
<head>
<title>The Screenless Office - Main Menu</title>
<style type="text/css">
body {
font-family: Junicode;
font-size: 12pt;
font-family: "FreeUniversal";
font-size: 11pt;
}
h1, h3 {
font-family: "TeX Gyre Adventor";
}
#title {
font-size: 20pt;
}
.bureau {
padding-top: 1em;
clear: both;
width: 100%;
page-break-inside: avoid;
@ -19,6 +22,15 @@
}
.bureau .description {
line-height: 1.2;
float: left;
width: 63%;
padding-right: 3%;
margin: 0 0 2em 0;
}
.bureau .prefix {
width: 30%;
float: left;
padding-right: 3%;
}
.cmd {
clear: both;
@ -34,18 +46,28 @@
width: 100%;
height: 41px;
}
.cmdcol img {
height: 50px;
float: right;
max-width: 100%;
}
.cmddesc {
margin-top: 0;
line-height: 1.1;
hyphens: auto;
}
.cmdname {
font-weight: bold;
font-family: "TeX Gyre Adventor";
text-transform: uppercase;
line-height: 1.1;
}
.cmdtxt {
margin-top: 1em;
}
.cmdtxt kbd {
font-size: 10pt;
font-family: Courier;
}
</style>
</head>
<body>
@ -68,7 +90,8 @@
<div class="cmdcol">
<p class="cmddesc">${cmd["desc"]}</p>
</div>
<div class="cmdcol">${cmd["barcode"]}</div>
<!--div class="cmdcol">${cmd["barcode"]}</div-->
<div class="cmdcol"><img src="${cmd["barcode_png"]}" /></div>
</div>
% endif
%endfor

Loading…
Cancel
Save