diff options
author | Přemysl Janouch <p@janouch.name> | 2019-04-14 21:38:26 +0200 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2019-04-14 21:38:26 +0200 |
commit | 32ad36a287f1eded549e42ad1bed77acb148be3b (patch) | |
tree | f5be294598f496ee79eefd522c6002ce5b423d9c /label-tool/main.go | |
parent | 412efcb1aea3a0803dd3eeae24f80ce62de86238 (diff) | |
download | sklad-32ad36a287f1eded549e42ad1bed77acb148be3b.tar.gz sklad-32ad36a287f1eded549e42ad1bed77acb148be3b.tar.xz sklad-32ad36a287f1eded549e42ad1bed77acb148be3b.zip |
label-tool: unindent template
Diffstat (limited to 'label-tool/main.go')
-rw-r--r-- | label-tool/main.go | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/label-tool/main.go b/label-tool/main.go index b085bf8..39a840c 100644 --- a/label-tool/main.go +++ b/label-tool/main.go @@ -19,59 +19,59 @@ import ( var font *bdf.Font var tmpl = template.Must(template.New("form").Parse(` - <!DOCTYPE html> - <html><body> - <h1>PT-CBP label printing tool</h1> - <table><tr> - <td valign=top> - <img border=1 src='?img&scale={{.Scale}}&text={{.Text}}'> - </td> - <td valign=top> - <fieldset> - {{ if .Printer }} - - <p>Printer: {{ .Printer.Manufacturer }} {{ .Printer.Model }} - <p>Tape: - {{ if .Printer.LastStatus }} - {{ .Printer.LastStatus.MediaWidthMM }} mm × - {{ .Printer.LastStatus.MediaLengthMM }} mm - - {{ if .MediaInfo }} - (offset: {{ .MediaInfo.SideMarginPins }} pt, - print area: {{ .MediaInfo.PrintAreaPins }} pt) - {{ else }} - (unknown media) - {{ end }} - - {{ if .Printer.LastStatus.Errors }} - {{ range .Printer.LastStatus.Errors }} - <p>Error: {{ . }} - {{ end }} - {{ end }} - - {{ end }} - {{ if .InitErr }} - {{ .InitErr }} - {{ end }} - - {{ else }} - <p>Error: {{ .PrinterErr }} - {{ end }} - </fieldset> - <fieldset> - <p>Font: {{ .Font.Name }} - </fieldset> - <form><fieldset> - <p><label for=text>Text:</label> - <input id=text name=text value='{{.Text}}'> - <label for=scale>Scale:</label> - <input id=scale name=scale value='{{.Scale}}' size=1> - <p><input type=submit value='Update'> - <input type=submit name=print value='Update and Print'> - </fieldset></form> - </td> - </tr></table> - </body></html> +<!DOCTYPE html> +<html><body> +<h1>PT-CBP label printing tool</h1> +<table><tr> +<td valign=top> + <img border=1 src='?img&scale={{.Scale}}&text={{.Text}}'> +</td> +<td valign=top> + <fieldset> + {{ if .Printer }} + + <p>Printer: {{ .Printer.Manufacturer }} {{ .Printer.Model }} + <p>Tape: + {{ if .Printer.LastStatus }} + {{ .Printer.LastStatus.MediaWidthMM }} mm × + {{ .Printer.LastStatus.MediaLengthMM }} mm + + {{ if .MediaInfo }} + (offset: {{ .MediaInfo.SideMarginPins }} pt, + print area: {{ .MediaInfo.PrintAreaPins }} pt) + {{ else }} + (unknown media) + {{ end }} + + {{ if .Printer.LastStatus.Errors }} + {{ range .Printer.LastStatus.Errors }} + <p>Error: {{ . }} + {{ end }} + {{ end }} + + {{ end }} + {{ if .InitErr }} + {{ .InitErr }} + {{ end }} + + {{ else }} + <p>Error: {{ .PrinterErr }} + {{ end }} + </fieldset> + <fieldset> + <p>Font: {{ .Font.Name }} + </fieldset> + <form><fieldset> + <p><label for=text>Text:</label> + <input id=text name=text value='{{.Text}}'> + <label for=scale>Scale:</label> + <input id=scale name=scale value='{{.Scale}}' size=1> + <p><input type=submit value='Update'> + <input type=submit name=print value='Update and Print'> + </fieldset></form> +</td> +</tr></table> +</body></html> `)) func getPrinter() (*ql.Printer, error) { |