Edit/delete bookmarks feature
This commit is contained in:
@@ -53,6 +53,8 @@
|
||||
{{ template "manage.html" . }}
|
||||
{{ else if eq .page "config" }}
|
||||
{{ template "config.html" . }}
|
||||
{{ else if eq .page "edit" }}
|
||||
{{ template "edit.html" . }}
|
||||
{{ end }}
|
||||
{{/* template "foundation_sample.html" . */}}
|
||||
</div>
|
||||
|
||||
7
web/templates/edit.html
Normal file
7
web/templates/edit.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="large-12 cell">
|
||||
|
||||
<h5>Edit</h5>
|
||||
{{ template "edit_form.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
32
web/templates/edit_form.html
Normal file
32
web/templates/edit_form.html
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
<form onsubmit="return false;" id="edit-form" hx-target="#edit-form">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<td>{{ .bookmark.Info.Title }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>URL</th>
|
||||
<td>{{ .bookmark.URL }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>tags</th>
|
||||
<td>
|
||||
{{ template "tags_widget.html" .tw }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Created</th>
|
||||
<td>{{ (nicetime .bookmark.TimestampCreated).HumanDuration }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Last Scraped</th>
|
||||
<td>{{ (nicetime .bookmark.TimestampLastScraped).HumanDuration }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<button type="button" hx-confirm="Delete this bookmark permanently?" hx-delete="/edit/{{.bookmark.ID}}" class="alert button">delete</button>
|
||||
<button type="button" class="button" hx-post="/edit/{{.bookmark.ID}}">save</button>
|
||||
</p>
|
||||
</form>
|
||||
2
web/templates/edit_form_deleted.html
Normal file
2
web/templates/edit_form_deleted.html
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
<p>Bookmark deleted</p>
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th> </th>
|
||||
<th>title/url</th>
|
||||
<th>tags</th>
|
||||
<th class="show-for-large">created</th>
|
||||
@@ -13,7 +13,7 @@
|
||||
</tr>
|
||||
{{ range .bookmarks }}
|
||||
<tr>
|
||||
<th>{{ .ID }}</th>
|
||||
<th><a class="button" href="/edit/{{ .ID }}">edit</a></th>
|
||||
<td>
|
||||
<a href="{{ .URL }}">{{ .Info.Title }}</a>
|
||||
<br>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
hx-target="#label-widget"
|
||||
hx-trigger="change">
|
||||
<label for="tag-entry"
|
||||
class="Xtext-right Xmiddle">Tags</label>
|
||||
class="">Tags</label>
|
||||
|
||||
<input id="tag-entry" type="text" name="tag" placeholder="enter tags" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user