latest design for menu

workspace
Brendan Howell 8 years ago
parent 252c3cf4b2
commit d881188296

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

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

Loading…
Cancel
Save