feat: wire book detail page with working shelf/status moves and note posting
- Add spine-move-book: move book between shelves by cutting/pasting headline - Add spine-set-status: change TODO keyword (WANT/READING/READ/none) - Add action=shelf and action=status cases to httpd/edit POST handler - Wrap shelf/status selects in forms with onchange auto-submit to /edit - Wire note composer as POST form to /edit with action=note - Redirect all edit POSTs back to /book?id=X - 7 new tests for move-book and set-status (error handling, property preservation)
This commit is contained in:
+16
-10
@@ -76,26 +76,30 @@
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px;">
|
||||
<div>
|
||||
<form method="post" action="/edit">
|
||||
<input type="hidden" name="id" value="{{id}}">
|
||||
<input type="hidden" name="action" value="shelf">
|
||||
<label style="font-size: 13px; color: var(--text-secondary); display: block; margin-bottom: 4px;">
|
||||
<i class="ti ti-folder" style="font-size: 14px; vertical-align: -2px; margin-right: 4px;" aria-hidden="true"></i>Shelf
|
||||
</label>
|
||||
<select>
|
||||
<select name="value" onchange="this.form.submit()">
|
||||
{{#shelf_options}}
|
||||
<option{{#selected}} selected{{/selected}}>{{name}}</option>
|
||||
{{/shelf_options}}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
</form>
|
||||
<form method="post" action="/edit">
|
||||
<input type="hidden" name="id" value="{{id}}">
|
||||
<input type="hidden" name="action" value="status">
|
||||
<label style="font-size: 13px; color: var(--text-secondary); display: block; margin-bottom: 4px;">
|
||||
<i class="ti ti-bookmark" style="font-size: 14px; vertical-align: -2px; margin-right: 4px;" aria-hidden="true"></i>Status
|
||||
</label>
|
||||
<select>
|
||||
<select name="value" onchange="this.form.submit()">
|
||||
{{#status_options}}
|
||||
<option{{#selected}} selected{{/selected}}>{{name}}</option>
|
||||
{{/status_options}}
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div style="border-top: 0.5px solid var(--border-tertiary); padding-top: 14px; margin-bottom: 16px;">
|
||||
@@ -132,10 +136,12 @@
|
||||
<span style="flex: 1; font-size: 14px; line-height: 1.5;">{{text}}</span>
|
||||
</div>
|
||||
{{/notes}}
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<input type="text" placeholder="Add a note…" style="flex: 1;" />
|
||||
<button style="width: auto; padding: 0 12px; border: 0.5px solid var(--border-secondary); border-radius: var(--radius-md);"><i class="ti ti-plus" style="font-size: 15px; vertical-align: -2px; margin-right: 4px;" aria-hidden="true"></i>Log note</button>
|
||||
</div>
|
||||
<form method="post" action="/edit" style="display: flex; gap: 8px; margin-top: 14px;">
|
||||
<input type="hidden" name="id" value="{{id}}">
|
||||
<input type="hidden" name="action" value="note">
|
||||
<input type="text" name="text" placeholder="Add a note…" style="flex: 1;" required />
|
||||
<button type="submit" style="width: auto; padding: 0 12px; border: 0.5px solid var(--border-secondary); border-radius: var(--radius-md);"><i class="ti ti-plus" style="font-size: 15px; vertical-align: -2px; margin-right: 4px;" aria-hidden="true"></i>Log note</button>
|
||||
</form>
|
||||
</div>
|
||||
{{/notes}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user