Inline Edit
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
<td>{{feed.feed_url}}</td>
|
||||
<td>{{feed.last_pub_date.clone().unwrap_or("None".to_string())}}</td>
|
||||
<td>
|
||||
<button hx-get="/feed/{{feed.id}}"
|
||||
<button hx-get="/feed/{{feed.id}}/edit/inline"
|
||||
hx-target="#feed_{{feed.id}}"
|
||||
hx-swap="outerHTML">
|
||||
Edit Inline
|
||||
</button>
|
||||
<button hx-get="/feedform/{{feed.id}}"
|
||||
<button hx-get="/feed/{{feed.id}}/edit/form"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Edit Dialog
|
||||
|
||||
29
templates/feed_inline.html
Normal file
29
templates/feed_inline.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<tr id="feed_{{feed.id}}">
|
||||
<td>
|
||||
<label style="width: 100%">
|
||||
<input type="text" name="name" form="update_feed_{{feed.id}}" value="{{feed.name}}">
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label style="width: 100%">
|
||||
<input type="url" name="feed_url" form="update_feed_{{feed.id}}" value="{{feed.feed_url}}">
|
||||
</label>
|
||||
</td>
|
||||
<td>{{feed.last_pub_date.clone().unwrap_or("None".to_string())}}</td>
|
||||
<td>
|
||||
<form id="update_feed_{{feed.id}}" hx-put="/feed/{{feed.id}}" hx-target="#feed_{{feed.id}}" hx-swap="outerHTML"
|
||||
hx-indicator="update_feed_{{feed.id}}_indicator" style="padding: 0; background: unset">
|
||||
<button type="reset"
|
||||
hx-get="/feed/{{feed.id}}"
|
||||
hx-target="#feed_{{feed.id}}"
|
||||
hx-swap="outerHTML">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit">
|
||||
Confirm
|
||||
<img id="update_feed_{{feed.id}}_indicator" class="htmx-indicator" src="/assets/oval.svg"
|
||||
style="height: 1rem; margin-left: 2px" alt="...">
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -22,6 +22,14 @@
|
||||
background: #161b22;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user