prep for selfservice
This commit is contained in:
parent
0dc4505630
commit
24b3acb3de
|
@ -23,7 +23,7 @@
|
||||||
packages.default = mach-lib.mkPython {
|
packages.default = mach-lib.mkPython {
|
||||||
requirements = builtins.readFile ./requirements.txt;
|
requirements = builtins.readFile ./requirements.txt;
|
||||||
};
|
};
|
||||||
devShells.default = pkgs.devshell.mkShell {packages = with pkgs; [packages.default imagemagick resvg python3Packages.brother-ql];};
|
devShells.default = pkgs.devshell.mkShell {packages = with pkgs; [packages.default imagemagick resvg];};
|
||||||
formatter = pkgs.alejandra;
|
formatter = pkgs.alejandra;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,3 +2,4 @@ quart
|
||||||
pyinstaller
|
pyinstaller
|
||||||
aiohttp
|
aiohttp
|
||||||
aiofiles
|
aiofiles
|
||||||
|
brother_ql
|
||||||
|
|
|
@ -20,28 +20,48 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>ISO7010 Warning Stickers On Demand</h1>
|
<div>
|
||||||
|
<h1>ISO7010 Warning Stickers On Demand</h1>
|
||||||
|
<p>Brought to you by @samw@hacksrus.xyz. Label tape donations received with...</p>
|
||||||
|
<img src="/static/manythanks.png" height="100px">
|
||||||
|
</div>
|
||||||
{% for section, ws in ws.items() %}
|
{% for section, ws in ws.items() %}
|
||||||
<h2>{{ section }}</h2>
|
<h2>{{ section }}</h2>
|
||||||
<div id="things">
|
<div id="things">
|
||||||
{% for w in ws %}
|
{% for w in ws %}
|
||||||
<div class="thing">
|
<div class="thing" onclick="printme('{{w.name}}')">
|
||||||
<img src="{{ w.url }}" width="100%">
|
<img src="{{ w.url }}" width="100%">
|
||||||
<div>
|
<div style="text-align: center; font-size: 20px;"> {{ w.name }} </div>
|
||||||
<div>
|
<button style="height: 30px; width: 100%">PRINT IT</button>
|
||||||
{{ w.name }}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{{ counts.get(w.name, 0) }}
|
|
||||||
</div>
|
|
||||||
<form method="POST">
|
|
||||||
<input type="number" min="1" max="10" value="1" name="count">
|
|
||||||
<button type="submit" name="w" value="{{ w.name }}">Print</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<script>
|
||||||
|
printing = false;
|
||||||
|
function printme(it) {
|
||||||
|
if (printing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
printing = true;
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append("w", it);
|
||||||
|
formData.append("count", 1);
|
||||||
|
for (e of document.getElementsByTagName("button")) {
|
||||||
|
e.disabled = true;
|
||||||
|
e.innerText = "printing....";
|
||||||
|
}
|
||||||
|
fetch("/", {
|
||||||
|
method: "POST",
|
||||||
|
body: new URLSearchParams(formData),
|
||||||
|
}).finally(() => {
|
||||||
|
for (e of document.getElementsByTagName("button")) {
|
||||||
|
e.disabled = false;
|
||||||
|
e.innerText = "PRINT IT";
|
||||||
|
}
|
||||||
|
printing = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue