64 lines
2.9 KiB
HTML
64 lines
2.9 KiB
HTML
<div id="editor-content">
|
|
<form class="editor-form" {{if not .IsHome}}hx-post="/api/notes/{{.Filename}}" hx-swap="none"{{end}}>
|
|
<div class="editor-header">
|
|
<label for="editor">
|
|
{{if .IsHome}}
|
|
<strong>{{.Filename}}</strong>
|
|
{{else}}
|
|
Édition de : <strong>{{.Filename}}</strong>
|
|
<span id="auto-save-status" class="auto-save-status"></span>
|
|
{{end}}
|
|
</label>
|
|
{{if .IsHome}}
|
|
<button type="button" class="toggle-preview-btn" hx-get="/api/home" hx-target="#editor-container" hx-swap="innerHTML" hx-push-url="true" title="Actualiser la page d'accueil">
|
|
🔄 Actualiser
|
|
</button>
|
|
{{else}}
|
|
<button type="button" id="toggle-preview-btn" class="toggle-preview-btn" onclick="togglePreview()" title="Mode: Éditeur + Preview (cliquer pour Éditeur seul)">
|
|
◫ Split
|
|
</button>
|
|
{{end}}
|
|
</div>
|
|
<div class="editor-grid {{if .IsHome}}editor-hidden{{end}}" id="editor-grid">
|
|
<div class="editor-panel {{if .IsHome}}hidden{{end}}">
|
|
<textarea id="editor" name="content">{{.Content}}</textarea>
|
|
</div>
|
|
<div class="preview-wrapper">
|
|
<div id="preview" class="preview markdown-preview">
|
|
</div>
|
|
{{if .Backlinks}}
|
|
<div id="backlinks-section" class="backlinks-section">
|
|
<h3 class="backlinks-title">🔗 Référencé par</h3>
|
|
<ul class="backlinks-list">
|
|
{{range .Backlinks}}
|
|
<li class="backlink-item">
|
|
<a href="#" onclick="return false;" hx-get="/api/notes/{{.Path}}" hx-target="#editor-container" hx-swap="innerHTML" hx-push-url="true" class="backlink-link">
|
|
📄 {{.Title}}
|
|
</a>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{if not .IsHome}}
|
|
<div class="editor-actions">
|
|
<div class="editor-actions-primary">
|
|
<button type="submit">Enregistrer</button>
|
|
<button
|
|
hx-delete="/api/notes/{{.Filename}}"
|
|
hx-confirm="Êtes-vous sûr de vouloir supprimer cette note ({{.Filename}}) ?"
|
|
hx-target="#editor-container"
|
|
hx-swap="innerHTML"
|
|
class="secondary"
|
|
type="button"
|
|
>
|
|
Supprimer
|
|
</button>
|
|
</div>
|
|
<span id="save-status" class="save-status"></span>
|
|
</div>
|
|
{{end}}
|
|
</form>
|
|
</div> |