<%def name="render_note(note)"> <% # Check if this note is locked and by whom is_locked = note['id'] in note_locks lock_owner = note_locks.get(note['id']) if is_locked else None locked_by_other = is_locked and lock_owner != current_client_id # Only show editing style if YOU are editing (not just flagged as editing) is_editing_by_me = note['flags']['isEditing'] and not locked_by_other css_classes = 'note' if locked_by_other: css_classes += ' locked' else: css_classes += ' interactive' if is_editing_by_me: css_classes += ' editing' if note['flags'].get('isCollapsed'): css_classes += ' collapsed' if note['flags'].get('memoryMode'): css_classes += ' memory-mode' if note['flags'].get('memorySelected'): css_classes += ' memory-selected' list_style = note['flags'].get('listStyle') if list_style == 'bulleted': css_classes += ' list-bulleted' elif list_style == 'numbered': css_classes += ' list-numbered' %>
% if locked_by_other: 🔒 % endif
${note['content'] | n}
% if note.get('children'):
% for child in note['children']: ${render_note(child)} % endfor
% endif
% for note in notes: ${render_note(note)} % endfor