Skip to content

Commit

Permalink
move template files
Browse files Browse the repository at this point in the history
  • Loading branch information
viktomas committed Sep 1, 2023
1 parent 7a81464 commit 87e84f7
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tmp_dir = "tmp"
rerun = false
rerun_delay = 500
send_interrupt = false
stop_on_error = false
stop_on_error = true

[color]
app = ""
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"time"
)

//go:embed templates/similar.html
//go:embed templates/similar.tmpl.html
var simlarTemplate string

//go:embed templates/compare-similar.html
//go:embed templates/compare-similar.tmpl.html
var compareSimilarTemplate string

//go:embed assets
Expand Down
30 changes: 0 additions & 30 deletions templates/compare-similar.html

This file was deleted.

30 changes: 30 additions & 0 deletions templates/compare-similar.tmpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>gpic - Compare similar</title>
<link rel="stylesheet" href="/assets/compare-similar.css">
</head>
<body>
<h1>Decide which one will stay</h1>
<form method="post" action="/delete-similar">
{{ range $i, $pic := .pictures }}
<input type=hidden name="similar[{{ $i }}]" value="{{ $pic }}">
{{ end }}
<div class="control-bar">
<input type="submit" value="Delete pictures that are not selected"/>
</div>
<ul class="image-wrapper pic-num-{{ .grid }}">
{{ range .pictures }}
<li>
<div class="container">
<input type="checkbox" value="true" name="{{ . }}" id="{{ . }}" />
<label for="{{ . }}">
<img loading="lazy" src="/static/{{.}}" alt="{{.}}">
</label>
</div>
</li>
{{end}}
</ul>
</form>
</body>
</html>
29 changes: 0 additions & 29 deletions templates/similar.html

This file was deleted.

29 changes: 29 additions & 0 deletions templates/similar.tmpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>gpic</title>
<link rel="stylesheet" href="/assets/similar.css">
</head>
<body>
<h1>{{ .fullPath}}</h1>
<p>Select similar pictures, next screen will let you delete some of them.</p>
<p><code>gpic</code> doesn't remove any files, it creates <code>to-delete</code> subfolder and moves the pictures there.</p>
<form method="get" action="/compare-similar">
<div class="control-bar">
<input type="submit" value="Go to next screen"/>
</div>
<ul class="image-wrapper">
{{range .pictures}}
<li>
<div class="container" id="{{ . }}-container">
<input type="checkbox" value="true" name="{{ . }}" id="{{ . }}" />
<label for="{{ . }}">
<img loading="lazy" src="/static/{{.}}" alt="{{.}}">
</label>
</div>
</li>
{{end}}
</ul>
</form>
</body>
</html>

0 comments on commit 87e84f7

Please sign in to comment.