add action column

This commit is contained in:
Jakob Ketterl 2021-02-13 18:41:42 +01:00
parent 3b60e0b737
commit 48f26d00d6

View File

@ -22,6 +22,7 @@ class BookmarksController(AuthorizationMixin, WebpageController):
<th>Name</th> <th>Name</th>
<th class="frequency">Frequency</th> <th class="frequency">Frequency</th>
<th>Modulation</th> <th>Modulation</th>
<th>Actions</th>
</tr> </tr>
{bookmarks} {bookmarks}
</table> </table>
@ -31,13 +32,17 @@ class BookmarksController(AuthorizationMixin, WebpageController):
def render_bookmark(self, idx: int, bookmark: Bookmark): def render_bookmark(self, idx: int, bookmark: Bookmark):
return """ return """
<tr data-index="{index}"> <tr data-index="{index}" data-id="{id}">
<td>{name}</td> <td>{name}</td>
<td class="frequency">{frequency}</td> <td class="frequency">{frequency}</td>
<td>{modulation}</td> <td>{modulation}</td>
<td>
<div class="btn btn-sm btn-danger bookmark-delete">delete</div>
</td>
</tr> </tr>
""".format( """.format(
index=idx, index=idx,
id=id(bookmark),
name=bookmark.getName(), name=bookmark.getName(),
frequency=bookmark.getFrequency(), frequency=bookmark.getFrequency(),
modulation=bookmark.getModulation(), modulation=bookmark.getModulation(),