-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
124 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
quarkus.web-bundler.bundle.components=true | ||
quarkus.web-bundler.bundle.components.key=main | ||
quarkus.web-bundler.bundle.components.qute-tags=true | ||
#quarkus.web-bundler.dependencies.auto-import=all | ||
|
||
|
||
quarkus.web-bundler.dependencies.auto-import=all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,80 @@ | ||
{#include main.html} | ||
{#title}My Notes{/title} | ||
<div class="left-bar d-flex justify-content-between"> | ||
<div class="p-2"> | ||
<div class="mb-3 d-flex"> | ||
<a | ||
class="btn btn-light" | ||
href="{uri:Notes.newNote()}" | ||
hx-get="{uri:Notes.newNote()}" | ||
hx-push-url="true" | ||
hx-target="#note-editor" | ||
><i class="bi bi-plus"></i> New Note</a> | ||
{#NoteSearch value=search /} | ||
</div> | ||
<div class="p-2"> | ||
<div class="mb-3 d-flex"> | ||
<a | ||
class="btn btn-light" | ||
href="{uri:Notes.newNote()}" | ||
hx-get="{uri:Notes.newNote()}" | ||
hx-push-url="true" | ||
hx-target="#note-editor" | ||
><i class="bi bi-plus"></i> New Note</a> | ||
{#NoteSearch value=search /} | ||
</div> | ||
|
||
{#fragment id="noteList"} | ||
<ul | ||
id="note-list" | ||
hx-swap-oob="true" | ||
class="note-list list-group" | ||
{#fragment id="noteList"} | ||
<ul | ||
id="note-list" | ||
hx-swap-oob="true" | ||
class="note-list list-group" | ||
> | ||
{#for note in notes} | ||
<li class="{#if note.id == currentNoteId}active {/if}list-group-item note-item d-flex justify-content-between align-items-center"> | ||
<a | ||
href="{uri:Notes.editNote(note.id)}" | ||
hx-get="{uri:Notes.editNote(note.id)}" | ||
hx-push-url="true" | ||
hx-target="#note-editor" | ||
hx-swap="innerHTML" | ||
> | ||
{#for note in notes} | ||
<li class="{#if note.id == currentNoteId}active {/if}list-group-item note-item d-flex justify-content-between align-items-center" > | ||
<a | ||
href="{uri:Notes.editNote(note.id)}" | ||
hx-get="{uri:Notes.editNote(note.id)}" | ||
hx-push-url="true" | ||
hx-target="#note-editor" | ||
hx-swap="innerHTML" | ||
> | ||
{note.name} | ||
</a> | ||
{#if note.id != currentNoteId} | ||
<button class="btn note-delete" | ||
hx-delete="{uri:Notes.deleteNote(note.id)}" | ||
hx-confirm="Are you sure?" | ||
hx-target="closest .note-item" | ||
hx-swap="outerHTML swap:0.5s" | ||
/> | ||
<i class="bi bi-trash"></i> | ||
</button> | ||
{#else} | ||
<i class="bi bi-caret-right"></i> | ||
{/if} | ||
</li> | ||
{/for} | ||
</ul> | ||
{/fragment} | ||
</div> | ||
<div id="note-editor" class="flex-grow-1 p-2"> | ||
{#if currentNote} | ||
{#fragment id="noteForm"} | ||
{#let path=currentNote.id.ifTruthy(uri:Notes.saveNote(currentNote.id)).or(uri:Notes.saveNewNote())} | ||
<form class="note-form" hx-post="{path}" hx-encoding='multipart/form-data' hx-target="this" hx-push-url="true"> | ||
{#authenticityToken/} | ||
<div class="editor-wrapper"> | ||
<div> | ||
<input name="name" class="form-control {#ifError 'name'}is-invalid{/}" value="{inject:flash.get('name') ?: currentNote.name}" placeholder="Enter new note name"/> | ||
{#ifError 'name'} | ||
<div class="invalid-feedback"> | ||
Error: {#error 'name'/} | ||
</div> | ||
{/ifError} | ||
</div> | ||
<div class="mb-3"> | ||
{#NoteEditor id="note-content" name="content" value=inject:flash.get('content').or(currentNote.content) /} | ||
{#ifError 'content'} | ||
<div class="invalid-feedback"> | ||
Error: {#error 'content'/} | ||
</div> | ||
{/ifError} | ||
</div> | ||
</div> | ||
<button class="btn btn-primary">Save</button> | ||
</form> | ||
{/fragment} | ||
{note.name} | ||
</a> | ||
{#if note.id != currentNoteId} | ||
<button class="btn note-delete" | ||
hx-delete="{uri:Notes.deleteNote(note.id)}" | ||
hx-confirm="Are you sure?" | ||
hx-target="closest .note-item" | ||
hx-swap="outerHTML swap:0.5s" | ||
/> | ||
<i class="bi bi-trash"></i> | ||
</button> | ||
{#else} | ||
<i class="bi bi-caret-right"></i> | ||
{/if} | ||
</div> | ||
</li> | ||
{/for} | ||
</ul> | ||
{/fragment} | ||
</div> | ||
<div id="note-editor" class="flex-grow-1 p-2"> | ||
{#if currentNote} | ||
{#fragment id="noteForm"} | ||
{#let path=currentNote.id.ifTruthy(uri:Notes.saveNote(currentNote.id)).or(uri:Notes.saveNewNote())} | ||
<form class="note-form" hx-post="{path}" hx-encoding='multipart/form-data' hx-target="this" hx-push-url="true"> | ||
{#authenticityToken/} | ||
<div class="editor-wrapper"> | ||
<div> | ||
<input name="name" class="form-control {#ifError 'name'}is-invalid{/}" | ||
value="{inject:flash.get('name') ?: currentNote.name}" placeholder="Enter new note name"/> | ||
{#ifError 'name'} | ||
<div class="invalid-feedback"> | ||
Error: {#error 'name'/} | ||
</div> | ||
{/ifError} | ||
</div> | ||
<div class="mb-3"> | ||
{#NoteEditor id="note-content" name="content" value=inject:flash.get('content').or(currentNote.content) /} | ||
{#ifError 'content'} | ||
<div class="invalid-feedback"> | ||
Error: {#error 'content'/} | ||
</div> | ||
{/ifError} | ||
</div> | ||
</div> | ||
<button class="btn btn-primary">Save</button> | ||
</form> | ||
{/fragment} | ||
{/if} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>{#insert title/}</title> | ||
{#bundle tag="style"/} | ||
<head> | ||
<title>{#insert title/}</title> | ||
{#bundle tag="style"/} | ||
|
||
</head> | ||
<body hx-ext="morphdom-swap" hx-headers='{"{inject:csrf.headerName}":"{inject:csrf.token}"}'> | ||
<div class="navbar navbar-light bg-light"> | ||
<div class="container-fluid"> | ||
<a class="navbar-brand" href="{uri:Notes.notes}"> | ||
<img src="/static/assets/images/logo.svg" alt="" width="30" height="24" class="d-inline-block align-text-top"> | ||
My Notes | ||
</a> | ||
</div> | ||
</div> | ||
{#insert /} | ||
{#bundle tag="script"/} | ||
</body> | ||
</head> | ||
<body hx-ext="morphdom-swap" hx-headers='{"{inject:csrf.headerName}":"{inject:csrf.token}"}'> | ||
<div class="navbar navbar-light bg-light"> | ||
<div class="container-fluid"> | ||
<a class="navbar-brand" href="{uri:Notes.notes}"> | ||
<img src="/static/assets/images/logo.svg" alt="" width="30" height="24" class="d-inline-block align-text-top"> | ||
My Notes | ||
</a> | ||
</div> | ||
</div> | ||
{#insert /} | ||
{#bundle tag="script"/} | ||
</body> | ||
</html> |
42 changes: 21 additions & 21 deletions
42
src/main/resources/web/components/NoteSearch/NoteSearch.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<div class="d-flex flex-grow-1" data-controller="search" data-action="refreshNoteList@document->search#clear"> | ||
<a | ||
class="btn search-open" | ||
data-search-target="open" | ||
data-action="click->search#open" | ||
><i class="bi bi-search"></i> Search</a> | ||
<a | ||
class="btn search-close" | ||
data-search-target="close" | ||
data-action="click->search#close" | ||
><i class="bi bi-caret-left"></i></a> | ||
<input type="search" | ||
data-search-target="input" | ||
class="search form-control flex-grow-1" | ||
name="search" | ||
value="{value}" | ||
placeholder="search" | ||
hx-trigger="keyup changed delay:500ms, search" | ||
hx-params="*" | ||
hx-get="{uri:Notes.notes()}" | ||
hx-target="#note-list" | ||
/> | ||
<a | ||
class="btn search-open" | ||
data-search-target="open" | ||
data-action="click->search#open" | ||
><i class="bi bi-search"></i> Search</a> | ||
<a | ||
class="btn search-close" | ||
data-search-target="close" | ||
data-action="click->search#close" | ||
><i class="bi bi-caret-left"></i></a> | ||
<input type="search" | ||
data-search-target="input" | ||
class="search form-control flex-grow-1" | ||
name="search" | ||
value="{value}" | ||
placeholder="search" | ||
hx-trigger="keyup changed delay:500ms, search" | ||
hx-params="*" | ||
hx-get="{uri:Notes.notes()}" | ||
hx-target="#note-list" | ||
/> | ||
</div> |