wip making UI actions for notes

This commit is contained in:
Ryan Peters
2025-07-17 16:42:25 -04:00
parent 11f468a5c1
commit 14e56285f5
7 changed files with 55 additions and 30 deletions

View File

@@ -2,13 +2,20 @@
<textarea id="content" name="content" spellcheck="false">@Model.Text</textarea>
<div class="note-names">
@foreach (var note in Model.NoteNames.Order())
{
var css = note.Equals(Model.CurrentNote, StringComparison.OrdinalIgnoreCase) ? "current" : null;
<div class="note-actions">
<select id="note-dropdown" class="note-dropdown">
@foreach (var note in Model.NoteNames.Order())
{
var selected = note.Equals(Model.CurrentNote, StringComparison.OrdinalIgnoreCase) ? "selected" : null;
<option value="@note" selected="@selected">@note</option>
}
</select>
<a href="@note" class="@css">@note</a>
}
<a asp-action="Delete" asp-controller="Note" asp-route-noteName="@Model.CurrentNote" class="btn btn-danger">Delete</a>
<form method="post" class="action-form" asp-action="Create" asp-controller="Note">
<input type="text" name="noteName" placeholder="Note name" />
<button type="submit" class="btn btn-primary">Create</button>
</form>
</div>
<div class="toast" id="saved-indicator">Saved</div>