Slight formatting change to HTML output, for consistency's sake
This commit is contained in:
parent
5c7bb60dcb
commit
920bdb2615
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Version = "0.20.1"
|
var Version = "0.20.2"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(versionCmd)
|
rootCmd.AddCommand(versionCmd)
|
||||||
|
|
11
cmd/web.go
11
cmd/web.go
|
@ -166,25 +166,26 @@ func serveHtml(w http.ResponseWriter, r *http.Request, filePath, dimensions stri
|
||||||
htmlBody += fmt.Sprintf("%v (%v)", fileName, dimensions)
|
htmlBody += fmt.Sprintf("%v (%v)", fileName, dimensions)
|
||||||
htmlBody += `</title>
|
htmlBody += `</title>
|
||||||
</head>
|
</head>
|
||||||
<body>`
|
<body>
|
||||||
|
`
|
||||||
switch {
|
switch {
|
||||||
case Filter && Sort:
|
case Filter && Sort:
|
||||||
htmlBody += fmt.Sprintf(`<a href="/?include=%v&exclude=%v&sort=%v"><img src="`,
|
htmlBody += fmt.Sprintf(` <a href="/?include=%v&exclude=%v&sort=%v"><img src="`,
|
||||||
r.URL.Query().Get("include"),
|
r.URL.Query().Get("include"),
|
||||||
r.URL.Query().Get("exclude"),
|
r.URL.Query().Get("exclude"),
|
||||||
r.URL.Query().Get("sort"),
|
r.URL.Query().Get("sort"),
|
||||||
)
|
)
|
||||||
case Filter && !Sort:
|
case Filter && !Sort:
|
||||||
htmlBody += fmt.Sprintf(`<a href="/?include=%v&exclude=%v"><img src="`,
|
htmlBody += fmt.Sprintf(` <a href="/?include=%v&exclude=%v"><img src="`,
|
||||||
r.URL.Query().Get("include"),
|
r.URL.Query().Get("include"),
|
||||||
r.URL.Query().Get("exclude"),
|
r.URL.Query().Get("exclude"),
|
||||||
)
|
)
|
||||||
case !Filter && Sort:
|
case !Filter && Sort:
|
||||||
htmlBody += fmt.Sprintf(`<a href="/?sort=%v"><img src="`,
|
htmlBody += fmt.Sprintf(` <a href="/?sort=%v"><img src="`,
|
||||||
r.URL.Query().Get("sort"),
|
r.URL.Query().Get("sort"),
|
||||||
)
|
)
|
||||||
default:
|
default:
|
||||||
htmlBody += `<a href="/"><img src="`
|
htmlBody += ` <a href="/"><img src="`
|
||||||
}
|
}
|
||||||
htmlBody += PREFIX
|
htmlBody += PREFIX
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
|
|
Loading…
Reference in New Issue