Skip to content

Commit 9c02ad0

Browse files
authored
Merge pull request #139 from gamosoft/features/code-blocks
Features/code blocks
2 parents 847eea6 + abeb618 commit 9c02ad0

File tree

9 files changed

+163
-71
lines changed

9 files changed

+163
-71
lines changed

backend/main.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ async def login_page(request: Request, error: str = None):
269269
async with aiofiles.open(login_path, 'r', encoding='utf-8') as f:
270270
content = await f.read()
271271

272-
# No server-side manipulation needed - frontend handles error display via URL params
272+
# Inject app name throughout the login page
273+
app_name = config['app']['name']
274+
content = content.replace('NoteDiscovery', app_name)
273275

274276
return content
275277

@@ -320,15 +322,6 @@ async def logout(request: Request):
320322
# Application Routes (with auth via router dependencies)
321323
# ============================================================================
322324

323-
@pages_router.get("/", response_class=HTMLResponse)
324-
async def root(request: Request):
325-
"""Serve the main application page"""
326-
index_path = static_path / "index.html"
327-
async with aiofiles.open(index_path, 'r', encoding='utf-8') as f:
328-
content = await f.read()
329-
return content
330-
331-
332325
@api_router.get("")
333326
async def api_documentation():
334327
"""API Documentation - List all available endpoints"""
@@ -1252,20 +1245,22 @@ async def health_check():
12521245
# Catch-all route for SPA (Single Page Application) routing
12531246
# This allows URLs like /folder/note to work for direct navigation
12541247
@pages_router.get("/{full_path:path}", response_class=HTMLResponse)
1248+
@limiter.limit("120/minute")
12551249
async def catch_all(full_path: str, request: Request):
12561250
"""
1257-
Serve index.html for all non-API routes.
1251+
Serve index.html for all non-API routes (including root /).
12581252
This enables client-side routing (e.g., /folder/note)
12591253
"""
12601254
# Skip if it's an API route or static file (shouldn't reach here, but just in case)
12611255
if full_path.startswith('api/') or full_path.startswith('static/'):
12621256
raise HTTPException(status_code=404, detail="Not found")
12631257

1264-
# Serve index.html for all other routes
1258+
# Serve index.html with app name injected
12651259
index_path = static_path / "index.html"
12661260
async with aiofiles.open(index_path, 'r', encoding='utf-8') as f:
12671261
content = await f.read()
1268-
return content
1262+
app_name = config['app']['name']
1263+
return content.replace('<title>NoteDiscovery</title>', f'<title>{app_name}</title>')
12691264

12701265

12711266
# ============================================================================

frontend/app.js

Lines changed: 141 additions & 51 deletions
Large diffs are not rendered by default.

locales/de-DE.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"loading": "Laden...",
2424
"saved": "✓ Gespeichert",
2525
"saving": "Speichern...",
26-
"copied": "✓ Kopiert!",
26+
"copied": "Kopiert!",
27+
"copy_to_clipboard": "In Zwischenablage kopieren",
2728
"failed": "{{action}} fehlgeschlagen. Bitte versuche es erneut."
2829
},
2930

locales/en-GB.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"loading": "Loading...",
2424
"saved": "✓ Saved",
2525
"saving": "Saving...",
26-
"copied": "✓ Copied!",
26+
"copied": "Copied!",
27+
"copy_to_clipboard": "Copy to clipboard",
2728
"failed": "Failed to {{action}}. Please try again."
2829
},
2930

locales/en-US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"loading": "Loading...",
2424
"saved": "✓ Saved",
2525
"saving": "Saving...",
26-
"copied": "✓ Copied!",
26+
"copied": "Copied!",
27+
"copy_to_clipboard": "Copy to clipboard",
2728
"failed": "Failed to {{action}}. Please try again."
2829
},
2930

locales/es-ES.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"loading": "Cargando...",
2424
"saved": "✓ Guardado",
2525
"saving": "Guardando...",
26-
"copied": "✓ ¡Copiado!",
26+
"copied": "¡Copiado!",
27+
"copy_to_clipboard": "Copiar al portapapeles",
2728
"failed": "Error al {{action}}. Por favor, inténtalo de nuevo."
2829
},
2930

locales/fr-FR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"loading": "Chargement...",
2424
"saved": "✓ Enregistré",
2525
"saving": "Enregistrement...",
26-
"copied": "✓ Copié !",
26+
"copied": "Copié !",
27+
"copy_to_clipboard": "Copier dans le presse-papiers",
2728
"failed": "Échec de {{action}}. Veuillez réessayer."
2829
},
2930

locales/sl-SI.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"loading": "Nalaganje...",
2424
"saved": "✓ Shranjeno",
2525
"saving": "Shranjevanje...",
26-
"copied": "✓ Kopirano!",
26+
"copied": "Kopirano!",
27+
"copy_to_clipboard": "Kopiraj v odložišče",
2728
"failed": "Napaka pri {{action}}. Prosimo, poskusite znova."
2829
},
2930

locales/zh-CN.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"loading": "加载中...",
2424
"saved": "✓ 已保存",
2525
"saving": "保存中...",
26-
"copied": "✓ 已复制!",
26+
"copied": "已复制!",
27+
"copy_to_clipboard": "复制到剪贴板",
2728
"failed": "{{action}} 失败。请重试。"
2829
},
2930

0 commit comments

Comments
 (0)