Move all Notes related parts into own modules.

This commit is contained in:
2025-07-06 23:22:20 +02:00
parent 60020e32f6
commit e12681cb08
13 changed files with 1309 additions and 1216 deletions

View File

@@ -132,7 +132,7 @@
<li><a href="{{ url_for('dashboard') }}" data-tooltip="Dashboard"><i class="nav-icon">📊</i><span class="nav-text">Dashboard</span></a></li>
<li><a href="{{ url_for('unified_task_management') }}" data-tooltip="Task Management"><i class="nav-icon">📋</i><span class="nav-text">Task Management</span></a></li>
<li><a href="{{ url_for('sprint_management') }}" data-tooltip="Sprint Management"><i class="nav-icon">🏃‍♂️</i><span class="nav-text">Sprints</span></a></li>
<li><a href="{{ url_for('notes_list') }}" data-tooltip="Notes"><i class="nav-icon">📝</i><span class="nav-text">Notes</span></a></li>
<li><a href="{{ url_for('notes.notes_list') }}" data-tooltip="Notes"><i class="nav-icon">📝</i><span class="nav-text">Notes</span></a></li>
<li><a href="{{ url_for('analytics') }}" data-tooltip="Time Analytics"><i class="nav-icon">📊</i><span class="nav-text">Analytics</span></a></li>
<!-- Role-based menu items -->

View File

@@ -145,7 +145,7 @@
<button type="submit" class="btn btn-primary">
{% if note %}Update Note{% else %}Create Note{% endif %}
</button>
<a href="{{ url_for('notes_list') }}" class="btn btn-secondary">Cancel</a>
<a href="{{ url_for('notes.notes_list') }}" class="btn btn-secondary">Cancel</a>
</div>
</div>
@@ -170,7 +170,7 @@
<div class="linked-notes-list">
{% for link in note.linked_notes %}
<div class="linked-note-item">
<a href="{{ url_for('view_note', slug=link.target_note.slug) }}">
<a href="{{ url_for('notes.view_note', slug=link.target_note.slug) }}">
{{ link.target_note.title }}
</a>
<span class="link-type">{{ link.link_type }}</span>

View File

@@ -11,7 +11,7 @@
<button type="button" class="btn btn-sm btn-secondary" onclick="toggleFullscreen()">
Fullscreen
</button>
<a href="{{ url_for('view_note', slug=note.slug) }}" class="btn btn-sm btn-info">
<a href="{{ url_for('notes.view_note', slug=note.slug) }}" class="btn btn-sm btn-info">
Back to Note
</a>
</div>

View File

@@ -31,21 +31,21 @@
Download
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="{{ url_for('download_note', slug=note.slug, format='md') }}">
<a class="dropdown-item" href="{{ url_for('notes_download.download_note', slug=note.slug, format='md') }}">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16" style="margin-right: 8px;">
<path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/>
<path d="M4.5 12.5A.5.5 0 0 1 5 12h3a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm0-2A.5.5 0 0 1 5 10h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm1.639-3.708 1.33.886 1.854-1.855a.25.25 0 0 1 .289-.047l1.888.974V8.5a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V7s1.54-1.274 1.639-1.208zM6.25 6a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/>
</svg>
Markdown (.md)
</a>
<a class="dropdown-item" href="{{ url_for('download_note', slug=note.slug, format='html') }}">
<a class="dropdown-item" href="{{ url_for('notes_download.download_note', slug=note.slug, format='html') }}">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16" style="margin-right: 8px;">
<path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/>
<path d="M8.5 6.5a.5.5 0 0 0-1 0V8H6a.5.5 0 0 0 0 1h1.5v1.5a.5.5 0 0 0 1 0V9H10a.5.5 0 0 0 0-1H8.5V6.5z"/>
</svg>
HTML (.html)
</a>
<a class="dropdown-item" href="{{ url_for('download_note', slug=note.slug, format='txt') }}">
<a class="dropdown-item" href="{{ url_for('notes_download.download_note', slug=note.slug, format='txt') }}">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16" style="margin-right: 8px;">
<path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/>
<path d="M5.5 7a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zM5 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5z"/>
@@ -54,7 +54,7 @@
</a>
</div>
</div>
<a href="{{ url_for('view_note_mindmap', slug=note.slug) }}" class="btn btn-info">
<a href="{{ url_for('notes.view_note_mindmap', slug=note.slug) }}" class="btn btn-info">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16" style="vertical-align: -2px; margin-right: 4px;">
<circle cx="8" cy="8" r="2"/>
<circle cx="3" cy="3" r="1.5"/>
@@ -66,13 +66,13 @@
Mind Map
</a>
{% if note.can_user_edit(g.user) %}
<a href="{{ url_for('edit_note', slug=note.slug) }}" class="btn btn-primary">Edit</a>
<form method="POST" action="{{ url_for('delete_note', slug=note.slug) }}" style="display: inline;"
<a href="{{ url_for('notes.edit_note', slug=note.slug) }}" class="btn btn-primary">Edit</a>
<form method="POST" action="{{ url_for('notes.delete_note', slug=note.slug) }}" style="display: inline;"
onsubmit="return confirm('Are you sure you want to delete this note?')">
<button type="submit" class="btn btn-danger">Delete</button>
</form>
{% endif %}
<a href="{{ url_for('notes_list') }}" class="btn btn-secondary">Back to Notes</a>
<a href="{{ url_for('notes.notes_list') }}" class="btn btn-secondary">Back to Notes</a>
</div>
</div>
@@ -104,7 +104,7 @@
<span class="association-label">Tags:</span>
<span class="association-value">
{% for tag in note.get_tags_list() %}
<a href="{{ url_for('notes_list', tag=tag) }}" class="tag-badge">{{ tag }}</a>
<a href="{{ url_for('notes.notes_list', tag=tag) }}" class="tag-badge">{{ tag }}</a>
{% endfor %}
</span>
</div>
@@ -129,7 +129,7 @@
{% for link in outgoing_links %}
<div class="linked-note-card">
<div class="linked-note-header">
<h4><a href="{{ url_for('view_note', slug=link.target_note.slug) }}">{{ link.target_note.title }}</a></h4>
<h4><a href="{{ url_for('notes.view_note', slug=link.target_note.slug) }}">{{ link.target_note.title }}</a></h4>
<span class="link-type">→ {{ link.link_type }}</span>
</div>
<div class="linked-note-preview">
@@ -143,7 +143,7 @@
{% for link in incoming_links %}
<div class="linked-note-card">
<div class="linked-note-header">
<h4><a href="{{ url_for('view_note', slug=link.source_note.slug) }}">{{ link.source_note.title }}</a></h4>
<h4><a href="{{ url_for('notes.view_note', slug=link.source_note.slug) }}">{{ link.source_note.title }}</a></h4>
<span class="link-type">← {{ link.link_type }}</span>
</div>
<div class="linked-note-preview">

View File

@@ -8,7 +8,7 @@
<button type="button" class="btn btn-sm btn-success" onclick="showCreateFolderModal()">
<span>📁</span> Create Folder
</button>
<a href="{{ url_for('notes_list') }}" class="btn btn-sm btn-secondary">Back to Notes</a>
<a href="{{ url_for('notes.notes_list') }}" class="btn btn-sm btn-secondary">Back to Notes</a>
</div>
</div>

View File

@@ -8,7 +8,7 @@
<button type="button" class="btn btn-sm btn-secondary" id="toggle-sidebar">
<span>📁</span> Toggle Folders
</button>
<a href="{{ url_for('notes_folders') }}" class="btn btn-sm btn-info">
<a href="{{ url_for('notes.notes_folders') }}" class="btn btn-sm btn-info">
<span>⚙️</span> Manage Folders
</a>
</div>
@@ -18,7 +18,7 @@
<!-- Folder Tree Sidebar -->
<div class="folder-sidebar" id="folder-sidebar">
<div class="create-note-section">
<a href="{{ url_for('create_note') }}" class="btn btn-create-note">
<a href="{{ url_for('notes.create_note') }}" class="btn btn-create-note">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"/>
</svg>
@@ -117,7 +117,7 @@
<!-- Filter Section -->
<div class="notes-filter-section">
<form method="GET" action="{{ url_for('notes_list') }}" class="filter-form" id="filter-form">
<form method="GET" action="{{ url_for('notes.notes_list') }}" class="filter-form" id="filter-form">
<!-- Hidden inputs for sidebar filters -->
<input type="hidden" name="folder" id="folder" value="{{ folder_filter or '' }}">
<input type="hidden" name="tag" id="tag" value="{{ tag_filter or '' }}">
@@ -202,7 +202,7 @@
{% endif %}
</td>
<td class="column-title">
<a href="{{ url_for('view_note', slug=note.slug) }}" class="note-link">
<a href="{{ url_for('notes.view_note', slug=note.slug) }}" class="note-link">
{{ note.title }}
</a>
<div class="note-associations">
@@ -234,7 +234,7 @@
<td class="column-tags">
{% if note.tags %}
{% for tag in note.get_tags_list() %}
<a href="{{ url_for('notes_list', tag=tag) }}" class="tag-badge">{{ tag }}</a>
<a href="{{ url_for('notes.notes_list', tag=tag) }}" class="tag-badge">{{ tag }}</a>
{% endfor %}
{% endif %}
</td>
@@ -243,12 +243,12 @@
</td>
<td class="column-actions">
<div class="note-actions">
<a href="{{ url_for('view_note', slug=note.slug) }}" class="btn-action" title="View">
<a href="{{ url_for('notes.view_note', slug=note.slug) }}" class="btn-action" title="View">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</a>
<a href="{{ url_for('view_note_mindmap', slug=note.slug) }}" class="btn-action" title="Mind Map">
<a href="{{ url_for('notes.view_note_mindmap', slug=note.slug) }}" class="btn-action" title="Mind Map">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<circle cx="8" cy="8" r="2"/>
<circle cx="3" cy="3" r="1.5"/>
@@ -258,19 +258,19 @@
<path d="M6.5 6.5L4 4M9.5 6.5L12 4M6.5 9.5L4 12M9.5 9.5L12 12" stroke="currentColor" fill="none"/>
</svg>
</a>
<a href="{{ url_for('download_note', slug=note.slug, format='md') }}" class="btn-action" title="Download as Markdown">
<a href="{{ url_for('notes_download.download_note', slug=note.slug, format='md') }}" class="btn-action" title="Download as Markdown">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/>
<path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/>
</svg>
</a>
{% if note.can_user_edit(g.user) %}
<a href="{{ url_for('edit_note', slug=note.slug) }}" class="btn-action" title="Edit">
<a href="{{ url_for('notes.edit_note', slug=note.slug) }}" class="btn-action" title="Edit">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/>
</svg>
</a>
<form method="POST" action="{{ url_for('delete_note', slug=note.slug) }}" style="display: inline;"
<form method="POST" action="{{ url_for('notes.delete_note', slug=note.slug) }}" style="display: inline;"
onsubmit="return confirm('Are you sure you want to delete this note?')">
<button type="submit" class="btn-action btn-action-danger" title="Delete">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
@@ -295,7 +295,7 @@
<div class="note-card" data-note-slug="{{ note.slug }}">
<div class="note-header">
<h3 class="note-title">
<a href="{{ url_for('view_note', slug=note.slug) }}">{{ note.title }}</a>
<a href="{{ url_for('notes.view_note', slug=note.slug) }}">{{ note.title }}</a>
{% if note.is_pinned %}
<span class="pin-icon" title="Pinned">📌</span>
{% endif %}
@@ -320,7 +320,7 @@
<div class="note-tags">
{% if note.tags %}
{% for tag in note.get_tags_list() %}
<a href="{{ url_for('notes_list', tag=tag) }}" class="tag-badge">{{ tag }}</a>
<a href="{{ url_for('notes.notes_list', tag=tag) }}" class="tag-badge">{{ tag }}</a>
{% endfor %}
{% endif %}
</div>
@@ -339,12 +339,12 @@
</div>
<div class="note-actions">
<a href="{{ url_for('view_note', slug=note.slug) }}" class="btn-action" title="View">
<a href="{{ url_for('notes.view_note', slug=note.slug) }}" class="btn-action" title="View">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</a>
<a href="{{ url_for('view_note_mindmap', slug=note.slug) }}" class="btn-action" title="Mind Map">
<a href="{{ url_for('notes.view_note_mindmap', slug=note.slug) }}" class="btn-action" title="Mind Map">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<circle cx="8" cy="8" r="2"/>
<circle cx="3" cy="3" r="1.5"/>
@@ -354,19 +354,19 @@
<path d="M6.5 6.5L4 4M9.5 6.5L12 4M6.5 9.5L4 12M9.5 9.5L12 12" stroke="currentColor" fill="none"/>
</svg>
</a>
<a href="{{ url_for('download_note', slug=note.slug, format='md') }}" class="btn-action" title="Download as Markdown">
<a href="{{ url_for('notes_download.download_note', slug=note.slug, format='md') }}" class="btn-action" title="Download as Markdown">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/>
<path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/>
</svg>
</a>
{% if note.can_user_edit(g.user) %}
<a href="{{ url_for('edit_note', slug=note.slug) }}" class="btn-action" title="Edit">
<a href="{{ url_for('notes.edit_note', slug=note.slug) }}" class="btn-action" title="Edit">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/>
</svg>
</a>
<form method="POST" action="{{ url_for('delete_note', slug=note.slug) }}" style="display: inline;"
<form method="POST" action="{{ url_for('notes.delete_note', slug=note.slug) }}" style="display: inline;"
onsubmit="return confirm('Are you sure you want to delete this note?')">
<button type="submit" class="btn-action btn-action-danger" title="Delete">
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
@@ -384,7 +384,7 @@
{% else %}
<div class="no-data">
<p>No notes found. <a href="{{ url_for('create_note') }}">Create your first note</a>.</p>
<p>No notes found. <a href="{{ url_for('notes.create_note') }}">Create your first note</a>.</p>
</div>
{% endif %}
</div> <!-- End notes-content -->