Add initial version of Markdown Notes feature.
This commit is contained in:
@@ -132,6 +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('analytics') }}" data-tooltip="Time Analytics"><i class="nav-icon">📊</i><span class="nav-text">Analytics</span></a></li>
|
||||
|
||||
<!-- Role-based menu items -->
|
||||
|
||||
600
templates/note_editor.html
Normal file
600
templates/note_editor.html
Normal file
@@ -0,0 +1,600 @@
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="timetrack-container note-editor-container">
|
||||
<div class="editor-header">
|
||||
<h2>{% if note %}Edit Note{% else %}Create Note{% endif %}</h2>
|
||||
<div class="editor-actions">
|
||||
<a href="{{ url_for('notes_list') }}" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="POST" id="note-form">
|
||||
<div class="editor-layout">
|
||||
<!-- Editor Panel -->
|
||||
<div class="editor-panel">
|
||||
<div class="form-group">
|
||||
<label for="title">Title</label>
|
||||
<input type="text" id="title" name="title" class="form-control"
|
||||
value="{{ note.title if note else '' }}" required autofocus>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="visibility">Visibility</label>
|
||||
<select id="visibility" name="visibility" class="form-control" required>
|
||||
<option value="Private" {% if not note or note.visibility.value == 'Private' %}selected{% endif %}>
|
||||
🔒 Private - Only you can see this
|
||||
</option>
|
||||
<option value="Team" {% if note and note.visibility.value == 'Team' %}selected{% endif %}>
|
||||
👥 Team - Your team members can see this
|
||||
</option>
|
||||
<option value="Company" {% if note and note.visibility.value == 'Company' %}selected{% endif %}>
|
||||
🏢 Company - Everyone in your company can see this
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="project_id">Project (Optional)</label>
|
||||
<select id="project_id" name="project_id" class="form-control">
|
||||
<option value="">No project</option>
|
||||
{% for project in projects %}
|
||||
<option value="{{ project.id }}" {% if note and note.project_id == project.id %}selected{% endif %}>
|
||||
{{ project.code }} - {{ project.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="task_id">Task (Optional)</label>
|
||||
<select id="task_id" name="task_id" class="form-control">
|
||||
<option value="">No task</option>
|
||||
{% for task in tasks %}
|
||||
<option value="{{ task.id }}" {% if note and note.task_id == task.id %}selected{% endif %}>
|
||||
#{{ task.id }} - {{ task.title }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="tags">Tags (comma-separated)</label>
|
||||
<input type="text" id="tags" name="tags" class="form-control"
|
||||
placeholder="documentation, meeting-notes, technical"
|
||||
value="{{ ', '.join(note.tags) if note and note.tags else '' }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group editor-group">
|
||||
<label for="content">Content (Markdown)</label>
|
||||
<div class="editor-toolbar">
|
||||
<button type="button" class="toolbar-btn toolbar-bold" onclick="insertMarkdown('**', '**')" title="Bold">
|
||||
<b>B</b>
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn toolbar-italic" onclick="insertMarkdown('*', '*')" title="Italic">
|
||||
<i>I</i>
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn toolbar-code" onclick="insertMarkdown('`', '`')" title="Inline Code">
|
||||
</>
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn toolbar-code-block" onclick="insertMarkdown('```\\n', '\\n```')" title="Code Block">
|
||||
[ ]
|
||||
</button>
|
||||
<span class="toolbar-separator"></span>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('# ', '')" title="Heading 1">
|
||||
H1
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('## ', '')" title="Heading 2">
|
||||
H2
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('### ', '')" title="Heading 3">
|
||||
H3
|
||||
</button>
|
||||
<span class="toolbar-separator"></span>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('- ', '')" title="Bullet List">
|
||||
≡
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('1. ', '')" title="Numbered List">
|
||||
≣
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('> ', '')" title="Quote">
|
||||
❞
|
||||
</button>
|
||||
<span class="toolbar-separator"></span>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('[', '](url)')" title="Link">
|
||||
🔗
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('')" title="Image">
|
||||
🖼
|
||||
</button>
|
||||
<button type="button" class="toolbar-btn" onclick="insertMarkdown('---\\n', '')" title="Horizontal Rule">
|
||||
—
|
||||
</button>
|
||||
</div>
|
||||
<div id="ace-editor" class="ace-editor-container">{{ note.content if note else '' }}</div>
|
||||
<textarea id="content" name="content" class="form-control markdown-editor"
|
||||
style="display: none;" required>{{ note.content if note else '' }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preview Panel -->
|
||||
<div class="preview-panel">
|
||||
<h3>Preview</h3>
|
||||
<div id="preview-content" class="markdown-content">
|
||||
<p class="preview-placeholder">Start typing to see the preview...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% if note and note.linked_notes %}
|
||||
<div class="linked-notes-section">
|
||||
<h3>Linked Notes</h3>
|
||||
<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) }}">
|
||||
{{ link.target_note.title }}
|
||||
</a>
|
||||
<span class="link-type">{{ link.link_type }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Note editor specific styles */
|
||||
.note-editor-container {
|
||||
max-width: none !important;
|
||||
width: 100% !important;
|
||||
padding: 1rem !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.editor-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.editor-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 2rem;
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
.editor-panel, .preview-panel {
|
||||
background: white;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.preview-panel {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.preview-panel h3 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border: 2px solid #e9ecef;
|
||||
border-radius: 6px;
|
||||
font-size: 1rem;
|
||||
transition: border-color 0.2s ease;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
outline: none;
|
||||
border-color: #4CAF50;
|
||||
box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
|
||||
}
|
||||
|
||||
.editor-toolbar {
|
||||
display: flex;
|
||||
gap: 0.25rem;
|
||||
padding: 0.5rem;
|
||||
background: #f8f9fa;
|
||||
border: 2px solid #e9ecef;
|
||||
border-bottom: none;
|
||||
border-radius: 6px 6px 0 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.toolbar-btn {
|
||||
padding: 0.5rem 0.75rem;
|
||||
min-width: 40px;
|
||||
border: 1px solid #dee2e6;
|
||||
background: white;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
transition: all 0.2s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.toolbar-btn:hover {
|
||||
background: #e9ecef;
|
||||
border-color: #adb5bd;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.toolbar-btn:active {
|
||||
background: #dee2e6;
|
||||
transform: translateY(1px);
|
||||
}
|
||||
|
||||
/* Special styling for specific buttons */
|
||||
.toolbar-bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.toolbar-italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.toolbar-code, .toolbar-code-block {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
/* Ensure button content is visible */
|
||||
.toolbar-btn b, .toolbar-btn i {
|
||||
font-size: 1rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.toolbar-separator {
|
||||
width: 1px;
|
||||
background: #dee2e6;
|
||||
margin: 0 0.5rem;
|
||||
}
|
||||
|
||||
.markdown-editor {
|
||||
font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0 0 6px 6px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.ace-editor-container {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
border: 2px solid #e9ecef;
|
||||
border-radius: 0 0 6px 6px;
|
||||
border-top: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown-content {
|
||||
padding: 1rem;
|
||||
min-height: 400px;
|
||||
max-height: 700px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.markdown-content h1, .markdown-content h2, .markdown-content h3,
|
||||
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.markdown-content h1 { font-size: 2rem; }
|
||||
.markdown-content h2 { font-size: 1.5rem; }
|
||||
.markdown-content h3 { font-size: 1.25rem; }
|
||||
|
||||
.markdown-content p {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.markdown-content code {
|
||||
background: #e9ecef;
|
||||
padding: 0.2rem 0.4rem;
|
||||
border-radius: 3px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.markdown-content pre {
|
||||
background: #f8f9fa;
|
||||
padding: 1rem;
|
||||
border-radius: 6px;
|
||||
overflow-x: auto;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.markdown-content pre code {
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-content blockquote {
|
||||
border-left: 4px solid #dee2e6;
|
||||
padding-left: 1rem;
|
||||
margin: 1rem 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.markdown-content ul, .markdown-content ol {
|
||||
margin-bottom: 1rem;
|
||||
padding-left: 2rem;
|
||||
}
|
||||
|
||||
.markdown-content table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.markdown-content th, .markdown-content td {
|
||||
border: 1px solid #dee2e6;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.markdown-content th {
|
||||
background: #f8f9fa;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.preview-placeholder {
|
||||
color: #999;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.linked-notes-section {
|
||||
margin-top: 2rem;
|
||||
padding: 1.5rem;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.linked-notes-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.linked-note-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.5rem 1rem;
|
||||
background: white;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.link-type {
|
||||
font-size: 0.85rem;
|
||||
color: #666;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* Responsive design */
|
||||
@media (max-width: 1024px) {
|
||||
.editor-layout {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.preview-panel {
|
||||
order: -1;
|
||||
min-height: 300px;
|
||||
max-height: 400px;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Load Ace Editor -->
|
||||
<script src="{{ url_for('static', filename='js/ace/ace.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/ace/mode-markdown.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/ace/theme-github.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/ace/theme-monokai.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/ace/ext-language_tools.js') }}"></script>
|
||||
|
||||
<script>
|
||||
// Global Ace Editor instance
|
||||
let aceEditor;
|
||||
|
||||
// Markdown toolbar functions for Ace Editor
|
||||
function insertMarkdown(before, after) {
|
||||
if (!aceEditor) return;
|
||||
|
||||
const session = aceEditor.getSession();
|
||||
const selection = aceEditor.getSelection();
|
||||
const range = selection.getRange();
|
||||
const selectedText = session.getTextRange(range);
|
||||
|
||||
if (selectedText) {
|
||||
// Replace selected text
|
||||
session.replace(range, before + selectedText + after);
|
||||
|
||||
// Select the text between the markdown markers
|
||||
const newRange = selection.getRange();
|
||||
newRange.setStart(newRange.start.row, newRange.start.column + before.length);
|
||||
newRange.setEnd(newRange.start.row, newRange.start.column + selectedText.length);
|
||||
selection.setRange(newRange);
|
||||
} else {
|
||||
// Insert at cursor position
|
||||
const position = aceEditor.getCursorPosition();
|
||||
session.insert(position, before + after);
|
||||
|
||||
// Move cursor between the markers
|
||||
aceEditor.moveCursorTo(position.row, position.column + before.length);
|
||||
}
|
||||
|
||||
aceEditor.focus();
|
||||
syncContentAndUpdatePreview();
|
||||
}
|
||||
|
||||
// Sync Ace Editor content with hidden textarea and update preview
|
||||
function syncContentAndUpdatePreview() {
|
||||
if (!aceEditor) return;
|
||||
|
||||
const content = aceEditor.getValue();
|
||||
document.getElementById('content').value = content;
|
||||
updatePreview();
|
||||
}
|
||||
|
||||
// Live preview update
|
||||
let previewTimer;
|
||||
function updatePreview() {
|
||||
clearTimeout(previewTimer);
|
||||
previewTimer = setTimeout(() => {
|
||||
const content = document.getElementById('content').value;
|
||||
const preview = document.getElementById('preview-content');
|
||||
|
||||
if (content.trim() === '') {
|
||||
preview.innerHTML = '<p class="preview-placeholder">Start typing to see the preview...</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
// Send content to server for markdown rendering
|
||||
fetch('/api/render-markdown', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ content: content })
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.html) {
|
||||
preview.innerHTML = data.html;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error rendering markdown:', error);
|
||||
});
|
||||
}, 300);
|
||||
}
|
||||
|
||||
// Initialize Ace Editor
|
||||
function initializeAceEditor() {
|
||||
// Create Ace Editor instance
|
||||
aceEditor = ace.edit("ace-editor");
|
||||
|
||||
// Set theme (use github theme for light mode)
|
||||
aceEditor.setTheme("ace/theme/github");
|
||||
|
||||
// Set markdown mode
|
||||
aceEditor.session.setMode("ace/mode/markdown");
|
||||
|
||||
// Configure editor options
|
||||
aceEditor.setOptions({
|
||||
fontSize: "14px",
|
||||
showPrintMargin: false,
|
||||
showGutter: true,
|
||||
highlightActiveLine: true,
|
||||
enableBasicAutocompletion: true,
|
||||
enableLiveAutocompletion: true,
|
||||
enableSnippets: true,
|
||||
tabSize: 2,
|
||||
useSoftTabs: true,
|
||||
wrap: true,
|
||||
showInvisibles: false,
|
||||
scrollPastEnd: 0.5
|
||||
});
|
||||
|
||||
// Set initial content from hidden textarea
|
||||
const initialContent = document.getElementById('content').value;
|
||||
aceEditor.setValue(initialContent, -1); // -1 moves cursor to start
|
||||
|
||||
// Listen for changes in Ace Editor
|
||||
aceEditor.on('change', function() {
|
||||
syncContentAndUpdatePreview();
|
||||
});
|
||||
|
||||
// Handle form submission - ensure content is synced
|
||||
document.getElementById('note-form').addEventListener('submit', function(e) {
|
||||
syncContentAndUpdatePreview();
|
||||
const submitBtn = this.querySelector('button[type="submit"]');
|
||||
submitBtn.disabled = true;
|
||||
submitBtn.textContent = 'Saving...';
|
||||
});
|
||||
|
||||
// Set focus to title field initially
|
||||
document.getElementById('title').focus();
|
||||
}
|
||||
|
||||
// Initialize when DOM is ready
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Initialize Ace Editor
|
||||
initializeAceEditor();
|
||||
|
||||
// Initial preview
|
||||
updatePreview();
|
||||
|
||||
// Add keyboard shortcuts
|
||||
if (aceEditor) {
|
||||
aceEditor.commands.addCommand({
|
||||
name: 'bold',
|
||||
bindKey: {win: 'Ctrl-B', mac: 'Command-B'},
|
||||
exec: function() { insertMarkdown('**', '**'); }
|
||||
});
|
||||
|
||||
aceEditor.commands.addCommand({
|
||||
name: 'italic',
|
||||
bindKey: {win: 'Ctrl-I', mac: 'Command-I'},
|
||||
exec: function() { insertMarkdown('*', '*'); }
|
||||
});
|
||||
|
||||
aceEditor.commands.addCommand({
|
||||
name: 'link',
|
||||
bindKey: {win: 'Ctrl-K', mac: 'Command-K'},
|
||||
exec: function() { insertMarkdown('[', '](url)'); }
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
566
templates/note_view.html
Normal file
566
templates/note_view.html
Normal file
@@ -0,0 +1,566 @@
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="timetrack-container note-view-container">
|
||||
<div class="note-header">
|
||||
<div class="note-title-section">
|
||||
<h1>{{ note.title }}</h1>
|
||||
<div class="note-meta">
|
||||
<span class="visibility-badge visibility-{{ note.visibility.value.lower() }}">
|
||||
{% if note.visibility.value == 'Private' %}🔒{% elif note.visibility.value == 'Team' %}👥{% else %}🏢{% endif %}
|
||||
{{ note.visibility.value }}
|
||||
</span>
|
||||
<span class="author">By {{ note.created_by.username }}</span>
|
||||
<span class="date">Created {{ note.created_at|format_date }}</span>
|
||||
{% if note.updated_at > note.created_at %}
|
||||
<span class="date">· Updated {{ note.updated_at|format_date }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="note-actions">
|
||||
{% 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;"
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="note-associations">
|
||||
{% if note.project %}
|
||||
<div class="association-item">
|
||||
<span class="association-label">Project:</span>
|
||||
<span class="association-value">
|
||||
<a href="{{ url_for('manage_project_tasks', project_id=note.project.id) }}">
|
||||
{{ note.project.code }} - {{ note.project.name }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if note.task %}
|
||||
<div class="association-item">
|
||||
<span class="association-label">Task:</span>
|
||||
<span class="association-value">
|
||||
<a href="{{ url_for('view_task', task_id=note.task.id) }}">
|
||||
#{{ note.task.id }} - {{ note.task.title }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if note.tags %}
|
||||
<div class="association-item">
|
||||
<span class="association-label">Tags:</span>
|
||||
<span class="association-value">
|
||||
{% for tag in note.tags %}
|
||||
<a href="{{ url_for('notes_list', tag=tag) }}" class="tag-badge">{{ tag }}</a>
|
||||
{% endfor %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="note-content markdown-content">
|
||||
{{ note.render_html()|safe }}
|
||||
</div>
|
||||
|
||||
{% if note.linked_notes or note.can_user_edit(g.user) %}
|
||||
<div class="linked-notes-section">
|
||||
<div class="section-header">
|
||||
<h3>Linked Notes</h3>
|
||||
{% if note.can_user_edit(g.user) %}
|
||||
<button id="add-link-btn" class="btn btn-sm btn-success">Add Link</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if outgoing_links or incoming_links %}
|
||||
<div class="linked-notes-grid">
|
||||
{% 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>
|
||||
<span class="link-type">→ {{ link.link_type }}</span>
|
||||
</div>
|
||||
<div class="linked-note-preview">
|
||||
{{ link.target_note.get_preview()|safe }}
|
||||
</div>
|
||||
{% if note.can_user_edit(g.user) %}
|
||||
<button class="remove-link-btn" data-target-id="{{ link.target_note_id }}">Remove Link</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% 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>
|
||||
<span class="link-type">← {{ link.link_type }}</span>
|
||||
</div>
|
||||
<div class="linked-note-preview">
|
||||
{{ link.source_note.get_preview()|safe }}
|
||||
</div>
|
||||
{% if note.can_user_edit(g.user) %}
|
||||
<button class="remove-link-btn" data-target-id="{{ link.source_note_id }}">Remove Link</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="no-links">No linked notes yet.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Add Link Modal -->
|
||||
{% if note.can_user_edit(g.user) %}
|
||||
<div id="link-modal" class="modal" style="display: none;">
|
||||
<div class="modal-content">
|
||||
<span class="close">×</span>
|
||||
<h3>Link to Another Note</h3>
|
||||
<form id="link-form">
|
||||
<div class="form-group">
|
||||
<label for="target-note">Select Note:</label>
|
||||
<select id="target-note" name="target_note_id" required>
|
||||
<option value="">Choose a note...</option>
|
||||
{% for other_note in linkable_notes %}
|
||||
{% if other_note.id != note.id %}
|
||||
<option value="{{ other_note.id }}">
|
||||
{{ other_note.title }}
|
||||
({{ other_note.visibility.value }})
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="link-type">Link Type:</label>
|
||||
<select id="link-type" name="link_type">
|
||||
<option value="related">Related</option>
|
||||
<option value="references">References</option>
|
||||
<option value="parent">Parent</option>
|
||||
<option value="child">Child</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button type="submit" class="btn btn-primary">Add Link</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancel-link">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<style>
|
||||
/* Note view specific styles */
|
||||
.note-view-container {
|
||||
max-width: 900px !important;
|
||||
margin: 0 auto !important;
|
||||
padding: 2rem !important;
|
||||
}
|
||||
|
||||
.note-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 2rem;
|
||||
padding-bottom: 1.5rem;
|
||||
border-bottom: 2px solid #e9ecef;
|
||||
}
|
||||
|
||||
.note-title-section h1 {
|
||||
margin: 0 0 0.5rem 0;
|
||||
font-size: 2.5rem;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.note-meta {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
font-size: 0.9rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.visibility-badge {
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.visibility-private {
|
||||
background: #f8d7da;
|
||||
color: #721c24;
|
||||
}
|
||||
|
||||
.visibility-team {
|
||||
background: #d1ecf1;
|
||||
color: #0c5460;
|
||||
}
|
||||
|
||||
.visibility-company {
|
||||
background: #d4edda;
|
||||
color: #155724;
|
||||
}
|
||||
|
||||
.note-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.note-actions form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.note-associations {
|
||||
background: #f8f9fa;
|
||||
padding: 1rem;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.association-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.association-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.association-label {
|
||||
font-weight: 500;
|
||||
margin-right: 1rem;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.association-value {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tag-badge {
|
||||
background: #e9ecef;
|
||||
color: #495057;
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.8rem;
|
||||
text-decoration: none;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.tag-badge:hover {
|
||||
background: #dee2e6;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.note-content {
|
||||
background: white;
|
||||
padding: 2rem;
|
||||
border: 1px solid #e9ecef;
|
||||
border-radius: 8px;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.markdown-content {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.markdown-content h1, .markdown-content h2, .markdown-content h3,
|
||||
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.markdown-content h1:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.markdown-content p {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.markdown-content code {
|
||||
background: #e9ecef;
|
||||
padding: 0.2rem 0.4rem;
|
||||
border-radius: 3px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.markdown-content pre {
|
||||
background: #f8f9fa;
|
||||
padding: 1rem;
|
||||
border-radius: 6px;
|
||||
overflow-x: auto;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.markdown-content pre code {
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.markdown-content blockquote {
|
||||
border-left: 4px solid #dee2e6;
|
||||
padding-left: 1rem;
|
||||
margin: 1rem 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.markdown-content ul, .markdown-content ol {
|
||||
margin-bottom: 1rem;
|
||||
padding-left: 2rem;
|
||||
}
|
||||
|
||||
.markdown-content table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.markdown-content th, .markdown-content td {
|
||||
border: 1px solid #dee2e6;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.markdown-content th {
|
||||
background: #f8f9fa;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.linked-notes-section {
|
||||
margin-top: 3rem;
|
||||
padding: 2rem;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.section-header h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.linked-notes-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.linked-note-card {
|
||||
background: white;
|
||||
padding: 1rem;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.linked-note-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.linked-note-header h4 {
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.linked-note-header a {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.linked-note-header a:hover {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.link-type {
|
||||
font-size: 0.8rem;
|
||||
color: #666;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.linked-note-preview {
|
||||
color: #666;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.remove-link-btn {
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 0.5rem;
|
||||
background: #dc3545;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.linked-note-card:hover .remove-link-btn {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.no-links {
|
||||
color: #999;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* Modal styles */
|
||||
.modal-content {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.modal-actions {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
justify-content: flex-end;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
/* Responsive design */
|
||||
@media (max-width: 768px) {
|
||||
.note-header {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.note-title-section h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.note-meta {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.linked-notes-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
{% if note.can_user_edit(g.user) %}
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const modal = document.getElementById('link-modal');
|
||||
const addLinkBtn = document.getElementById('add-link-btn');
|
||||
const closeBtn = modal.querySelector('.close');
|
||||
const cancelBtn = document.getElementById('cancel-link');
|
||||
const linkForm = document.getElementById('link-form');
|
||||
|
||||
// Open modal
|
||||
addLinkBtn.addEventListener('click', function() {
|
||||
modal.style.display = 'block';
|
||||
});
|
||||
|
||||
// Close modal
|
||||
closeBtn.addEventListener('click', function() {
|
||||
modal.style.display = 'none';
|
||||
});
|
||||
|
||||
cancelBtn.addEventListener('click', function() {
|
||||
modal.style.display = 'none';
|
||||
});
|
||||
|
||||
window.addEventListener('click', function(event) {
|
||||
if (event.target === modal) {
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// Submit link form
|
||||
linkForm.addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const targetNoteId = document.getElementById('target-note').value;
|
||||
const linkType = document.getElementById('link-type').value;
|
||||
|
||||
fetch(`/api/notes/{{ note.id }}/link`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
target_note_id: parseInt(targetNoteId),
|
||||
link_type: linkType
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
return response.json().then(data => {
|
||||
throw new Error(data.message || 'Server error');
|
||||
});
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
location.reload();
|
||||
} else {
|
||||
alert('Error: ' + data.message);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Error: ' + error.message);
|
||||
});
|
||||
});
|
||||
|
||||
// Remove link buttons
|
||||
document.querySelectorAll('.remove-link-btn').forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
const targetId = this.getAttribute('data-target-id');
|
||||
|
||||
if (confirm('Are you sure you want to remove this link?')) {
|
||||
fetch(`/api/notes/{{ note.id }}/link`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
target_note_id: parseInt(targetId)
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
location.reload();
|
||||
} else {
|
||||
alert('Error: ' + data.message);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('An error occurred while removing the link');
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
371
templates/notes_list.html
Normal file
371
templates/notes_list.html
Normal file
@@ -0,0 +1,371 @@
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="timetrack-container notes-list-container">
|
||||
<div class="admin-header">
|
||||
<h2>Notes</h2>
|
||||
<div class="admin-actions">
|
||||
<a href="{{ url_for('create_note') }}" class="btn btn-md btn-success">Create New Note</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filter Section -->
|
||||
<div class="notes-filter-section">
|
||||
<form method="GET" action="{{ url_for('notes_list') }}" class="filter-form">
|
||||
<div class="filter-row">
|
||||
<div class="filter-group">
|
||||
<label for="visibility">Visibility:</label>
|
||||
<select name="visibility" id="visibility" onchange="this.form.submit()">
|
||||
<option value="">All Notes</option>
|
||||
<option value="private" {% if request.args.get('visibility') == 'private' %}selected{% endif %}>Private</option>
|
||||
<option value="team" {% if request.args.get('visibility') == 'team' %}selected{% endif %}>Team</option>
|
||||
<option value="company" {% if request.args.get('visibility') == 'company' %}selected{% endif %}>Company</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-group">
|
||||
<label for="tag">Tag:</label>
|
||||
<select name="tag" id="tag" onchange="this.form.submit()">
|
||||
<option value="">All Tags</option>
|
||||
{% for tag in all_tags %}
|
||||
<option value="{{ tag }}" {% if request.args.get('tag') == tag %}selected{% endif %}>{{ tag }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-group">
|
||||
<label for="project_id">Project:</label>
|
||||
<select name="project_id" id="project_id" onchange="this.form.submit()">
|
||||
<option value="">All Projects</option>
|
||||
{% for project in projects %}
|
||||
<option value="{{ project.id }}" {% if request.args.get('project_id')|int == project.id %}selected{% endif %}>
|
||||
{{ project.code }} - {{ project.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-group search-group">
|
||||
<label for="search">Search:</label>
|
||||
<input type="text" name="search" id="search" placeholder="Search notes..."
|
||||
value="{{ request.args.get('search', '') }}" class="search-input">
|
||||
<button type="submit" class="btn btn-sm btn-primary">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if notes %}
|
||||
<div class="notes-grid">
|
||||
{% for note in notes %}
|
||||
<div class="note-card">
|
||||
<div class="note-header">
|
||||
<h3 class="note-title">
|
||||
<a href="{{ url_for('view_note', slug=note.slug) }}">{{ note.title }}</a>
|
||||
</h3>
|
||||
<div class="note-meta">
|
||||
<span class="visibility-badge visibility-{{ note.visibility.value.lower() }}">
|
||||
{% if note.visibility.value == 'Private' %}🔒{% elif note.visibility.value == 'Team' %}👥{% else %}🏢{% endif %}
|
||||
{{ note.visibility.value }}
|
||||
</span>
|
||||
{% if note.updated_at > note.created_at %}
|
||||
<span class="note-date">Updated {{ note.updated_at|format_date }}</span>
|
||||
{% else %}
|
||||
<span class="note-date">Created {{ note.created_at|format_date }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="note-preview">
|
||||
{{ note.get_preview()|safe }}
|
||||
</div>
|
||||
|
||||
<div class="note-footer">
|
||||
<div class="note-tags">
|
||||
{% if note.tags %}
|
||||
{% for tag in note.tags %}
|
||||
<a href="{{ url_for('notes_list', tag=tag) }}" class="tag-badge">{{ tag }}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="note-associations">
|
||||
{% if note.project %}
|
||||
<span class="association-badge project">
|
||||
📁 {{ note.project.code }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if note.task %}
|
||||
<span class="association-badge task">
|
||||
✓ Task #{{ note.task.id }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if note.outgoing_links or note.incoming_links %}
|
||||
<span class="association-badge links">
|
||||
🔗 {{ (note.outgoing_links|length + note.incoming_links|length) }} link{% if (note.outgoing_links|length + note.incoming_links|length) != 1 %}s{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="note-actions">
|
||||
<a href="{{ url_for('view_note', slug=note.slug) }}" class="btn btn-sm btn-primary">View</a>
|
||||
{% if note.can_user_edit(g.user) %}
|
||||
<a href="{{ url_for('edit_note', slug=note.slug) }}" class="btn btn-sm btn-info">Edit</a>
|
||||
<form method="POST" action="{{ url_for('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-sm btn-danger">Delete</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
{% else %}
|
||||
<div class="no-data">
|
||||
<p>No notes found. <a href="{{ url_for('create_note') }}">Create your first note</a>.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Notes list specific styles */
|
||||
.notes-list-container {
|
||||
max-width: none !important;
|
||||
width: 100% !important;
|
||||
padding: 1rem !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.notes-filter-section {
|
||||
background: #f8f9fa;
|
||||
padding: 1.5rem;
|
||||
margin-bottom: 2rem;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.filter-form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.filter-row {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.filter-group {
|
||||
flex: 1;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.filter-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.filter-group select,
|
||||
.filter-group input {
|
||||
width: 100%;
|
||||
padding: 0.5rem;
|
||||
border: 2px solid #e9ecef;
|
||||
border-radius: 6px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.search-group {
|
||||
flex: 2;
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.notes-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
|
||||
gap: 1.5rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.note-card {
|
||||
background: white;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
transition: box-shadow 0.2s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.note-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.note-header {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.note-title {
|
||||
margin: 0 0 0.5rem 0;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.note-title a {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.note-title a:hover {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.note-meta {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
align-items: center;
|
||||
font-size: 0.85rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.visibility-badge {
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.visibility-private {
|
||||
background: #f8d7da;
|
||||
color: #721c24;
|
||||
}
|
||||
|
||||
.visibility-team {
|
||||
background: #d1ecf1;
|
||||
color: #0c5460;
|
||||
}
|
||||
|
||||
.visibility-company {
|
||||
background: #d4edda;
|
||||
color: #155724;
|
||||
}
|
||||
|
||||
.note-preview {
|
||||
flex: 1;
|
||||
margin-bottom: 1rem;
|
||||
color: #555;
|
||||
line-height: 1.6;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.note-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 1rem;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.note-tags {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tag-badge {
|
||||
background: #e9ecef;
|
||||
color: #495057;
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
text-decoration: none;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.tag-badge:hover {
|
||||
background: #dee2e6;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.note-associations {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.association-badge {
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.association-badge.project {
|
||||
background: #fff3cd;
|
||||
color: #856404;
|
||||
}
|
||||
|
||||
.association-badge.task {
|
||||
background: #cce5ff;
|
||||
color: #004085;
|
||||
}
|
||||
|
||||
.association-badge.links {
|
||||
background: #f5c6cb;
|
||||
color: #721c24;
|
||||
}
|
||||
|
||||
.note-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.note-actions form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.page-info {
|
||||
color: #666;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* Responsive design */
|
||||
@media (max-width: 768px) {
|
||||
.filter-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.filter-group {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.search-group {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.notes-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user