To support note deletion

This commit is contained in:
2024-06-24 15:43:03 -04:00
parent d24c304c97
commit fbf5ac564a
9 changed files with 33 additions and 17 deletions

View File

@ -332,7 +332,7 @@ class AjaxController extends AbstractController
return $res;
}
#[Route('/discard-note', name: 'app_discard_note', methods: ['POST'])]
#[Route('/delete-note', name: 'app_discard_note', methods: ['POST'])]
public function discardNote(Request $req, EntityManagerInterface $emi): Response
{
$data = json_decode($req->getContent());

View File

@ -169,6 +169,9 @@ class Note implements JsonSerializable
{
return "<a href='#' onclick=\"retrieveNote('{$this->id}')\">".
$this->title.
"</a>&nbsp;".
"<a href='#' onclick=\"deleteNote('{$this->id}', this)\">".
"<i class='fas fa-trash-alt'></i>".
"</a>".
(
$this->recording ? "<br/>".
@ -180,7 +183,7 @@ class Note implements JsonSerializable
public function toTableRow(): string
{
return "<tr>".
return "<tr data-id='row-{$this->id->toHex()}'>".
"<td>{$this->toLink()}</td>".
"<td>{$this->speaker->getName()}</td>".
"<td>{$this->passage}</td>".