Files
personotes/templates/favorites.html

38 lines
1.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{if .Favorites}}
{{range .Favorites}}
<div class="favorite-item" data-path="{{.Path}}">
{{if .IsDir}}
<div class="favorite-folder" data-path="{{.Path}}">
<span class="favorite-icon"></span>
<span class="favorite-folder-icon">{{.Icon}}</span>
<span class="favorite-name">{{.Title}}</span>
<button class="favorite-remove"
onclick="removeFavorite('{{.Path}}')"
title="Retirer des favoris">×</button>
</div>
{{else}}
<a href="#"
class="favorite-file"
data-path="{{.Path}}"
hx-get="/api/notes/{{.Path}}"
hx-target="#editor-container"
hx-swap="innerHTML">
<span class="favorite-icon"></span>
<span class="favorite-file-icon">{{.Icon}}</span>
<span class="favorite-name">{{.Title}}</span>
<button class="favorite-remove"
onclick="event.preventDefault(); event.stopPropagation(); removeFavorite('{{.Path}}')"
title="Retirer des favoris">×</button>
</a>
{{end}}
</div>
{{end}}
{{else}}
<p class="favorites-empty">
Aucun favori.<br>
<span style="font-size: 0.75rem; color: var(--text-muted);">
Cliquez sur ⭐ à côté d'une note ou d'un dossier pour l'ajouter.
</span>
</p>
{{end}}