aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2022-06-16 16:32:31 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2022-06-16 16:32:31 +0200
commitda992500f806bb87b06559d920ee12b7680955ee (patch)
treed535f986eba7a95e5cb6b358259bc37ca6fa7ca9 /templates
parent64496464b3812839c1e4b440bdf69cc84f39c491 (diff)
downloadmdir-da992500f806bb87b06559d920ee12b7680955ee.tar.gz
mdir-da992500f806bb87b06559d920ee12b7680955ee.tar.bz2
mdir-da992500f806bb87b06559d920ee12b7680955ee.zip
feat: Add worker
Add a simple worker to manage a work queue. Right now, it is bit brittled and has no test coverage yet, but it works. Also moved from pico.css to bulma, I like the idea of classes approach of pico but for me bulma yields a better result.
Diffstat (limited to 'templates')
-rw-r--r--templates/_footer.tmpl1
-rw-r--r--templates/_head.tmpl17
-rw-r--r--templates/entry.tmpl26
-rw-r--r--templates/index.tmpl10
4 files changed, 28 insertions, 26 deletions
diff --git a/templates/_footer.tmpl b/templates/_footer.tmpl
index 543a2e6..07bc857 100644
--- a/templates/_footer.tmpl
+++ b/templates/_footer.tmpl
@@ -1,5 +1,6 @@
{{ define "_footer" }}
</main>
+ </section>
<script>
function deleteEntry(id) {
fetch("/entries/"+id, { method: 'DELETE' })
diff --git a/templates/_head.tmpl b/templates/_head.tmpl
index da96a57..2bb58c4 100644
--- a/templates/_head.tmpl
+++ b/templates/_head.tmpl
@@ -2,17 +2,12 @@
<!DOCTYPE html>
<html>
<head>
- <link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">
+ <link rel="stylesheet" href="/assets/bulma.min.css">
</head>
<body>
- <header class="container">
- <nav>
- <ul>
- <li><a href="/"><strong>Home</strong></a></li>
- </ul>
- <ul>
- </ul>
- </nav>
- </header>
- <main class="container">
+ <section class="section">
+ <div class="container">
+ <h1><a href="/"><strong>Home</strong></a></h1>
+ </div>
+ <main class="container">
{{ end }}
diff --git a/templates/entry.tmpl b/templates/entry.tmpl
index 642b501..9f1181f 100644
--- a/templates/entry.tmpl
+++ b/templates/entry.tmpl
@@ -1,24 +1,26 @@
{{ define "entry" }}
{{ template "_head" }}
+<div class="container">
{{ if (eq .ID 0) }}
<form action="/entries" method="POST">
{{ else }}
<form action="/entries/{{ .ID }}" method="POST">
{{ end }}
<input type="hidden" id="ID" name="ID" value="{{ .ID }}">
- <label for="title">
- Title
- <input type="text" id="Title" name="Title" value="{{ .Title }}" placeholder="Give a discretive name" required>
- </label>
- <label for="link">
- Link
- <input type="text" id="Link" name="Link" value="{{ .Link }}" placeholder="Paste a valid youtube-dl link" required>
- </label>
- <label for="output">
- Output folder
- <input type="text" id="OutputFolder" name="OutputFolder" value="{{ .OutputFolder }}" placeholder="Select a ralative folder" required>
- </label>
+ <div class="field">
+ <label for="title">Title</label>
+ <input class="input" type="text" id="Title" name="Title" value="{{ .Title }}" placeholder="Give a discretive name" required>
+ </div>
+ <div class="field">
+ <label for="link">Link</label>
+ <input class="input" type="text" id="Link" name="Link" value="{{ .Link }}" placeholder="Paste a valid youtube-dl link" required>
+ </div>
+ <div class="field">
+ <label for="output">Output folder</label>
+ <input class="input" type="text" id="OutputFolder" name="OutputFolder" value="{{ .OutputFolder }}" placeholder="Select a ralative folder" required>
+ </div>
<button type="submit">Submit</button>
</form>
+ </div>
{{ template "_footer" }}
{{ end }}
diff --git a/templates/index.tmpl b/templates/index.tmpl
index 0b965f5..9bb7512 100644
--- a/templates/index.tmpl
+++ b/templates/index.tmpl
@@ -1,10 +1,12 @@
{{ define "index" }}
{{ template "_head" }}
-<table role="grid">
+<div class="container">
+<table class="table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Title</th>
+ <th scope="col">Link</th>
<th scope="col">Output</th>
<th scope="col"></th>
</tr>
@@ -13,17 +15,19 @@
{{ range . }}
<tr>
<td>{{ .ID }}</td>
+ <td>{{ .Title }}</td>
<td>{{ .Link }}</td>
<td>{{ .OutputFolder }}</td>
<td>
<a href="entries/{{ .ID }}" >Edit</a>
</span>
- <a href="#" onclick="deleteEntry({{ .ID }})">Delete</a>
+ <a onclick="deleteEntry({{ .ID }})">Delete</a>
</td>
</tr>
{{ end }}
</tbody>
</table>
-<a href="/entries" role="button">Create</a>
+</div>
+<a href="/entries/createEntry" class="button">Create</a>
{{ template "_footer" }}
{{ end }}