Quellcode durchsuchen

added visual improvements + started working on file editing

turos.robert vor 3 Wochen
Ursprung
Commit
76d29060e1

+ 92 - 0
cmds/webservice/bin/templates/edit_notes.tmpl

@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+<html lang="ro">
+
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>Editează notița</title>
+  <script src="https://cdn.tailwindcss.com"></script>
+</head>
+
+<body class="bg-[#0b0d12] text-white font-sans min-h-screen">
+  <div class="max-w-4xl mx-auto px-6 py-10">
+
+    <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-8">
+      <div>
+        <h1 class="text-3xl md:text-4xl font-bold tracking-tight text-white">
+          Editează notița
+        </h1>
+        <p class="text-gray-400 mt-2 text-sm md:text-base">
+          Modifică titlul și conținutul, apoi salvează schimbările.
+        </p>
+      </div>
+
+      <div class="flex gap-3">
+        <a href="/list_notes"
+          class="inline-flex items-center justify-center rounded-xl border border-[#313846] bg-[#171b22] px-4 py-3 text-sm font-semibold text-gray-200 transition hover:bg-[#20252f] hover:text-white">
+          Înapoi la listă
+        </a>
+        <a href="/notes/?note={{.Path}}"
+          class="inline-flex items-center justify-center rounded-xl border border-[#313846] bg-[#171b22] px-4 py-3 text-sm font-semibold text-gray-200 transition hover:bg-[#20252f] hover:text-white">
+          Vezi notița
+        </a>
+      </div>
+    </div>
+
+    <div class="rounded-2xl border border-[#2a3140] bg-[#11151b] shadow-2xl overflow-hidden">
+      <div class="border-b border-[#252b37] bg-[#181d27] px-6 py-5">
+        <h2 class="text-xl md:text-2xl font-bold text-[#b899ff]">
+          Formular editare
+        </h2>
+        <p class="text-sm text-gray-400 mt-1">
+          Editezi notița selectată.
+        </p>
+      </div>
+
+      <div class="p-6 md:p-8">
+        <form method="POST" action="/api/update_note" class="space-y-6">
+
+          <input type="hidden" name="path" value="{{.Path}}">
+
+          <div>
+            <label class="block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">
+              Titlu fișier
+            </label>
+            <input type="text" name="titlu" value="{{.Titlu}}" placeholder="Titlul notiței"
+              class="w-full rounded-xl border border-[#323949] bg-[#1a1f29] px-4 py-3 text-sm text-gray-200 outline-none transition placeholder:text-gray-500 focus:border-[#7b58ad] focus:ring-2 focus:ring-[#7b58ad]/30">
+          </div>
+
+          <div>
+            <label class="block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">
+              Conținut notiță
+            </label>
+            <textarea name="notita" rows="18" placeholder="Conținutul notiței..."
+              class="w-full rounded-xl border border-[#323949] bg-[#1a1f29] px-4 py-3 text-sm text-gray-200 outline-none transition placeholder:text-gray-500 focus:border-[#7b58ad] focus:ring-2 focus:ring-[#7b58ad]/30 resize-y">{{.Continut}}</textarea>
+          </div>
+
+          <div class="flex flex-col sm:flex-row gap-3 pt-2">
+            <button type="submit"
+              class="flex-1 rounded-xl bg-[#7b58ad] px-5 py-3 text-sm font-bold text-white transition hover:bg-[#9974d0] shadow-lg shadow-purple-900/20">
+              Salvează modificările
+            </button>
+
+            <a href="/notes/?note={{.Path}}"
+              class="flex-1 rounded-xl border border-[#3a3f4b] bg-[#171a21] px-5 py-3 text-center text-sm font-semibold text-gray-200 transition hover:bg-[#20242d] hover:text-white">
+              Anulează
+            </a>
+          </div>
+        </form>
+      </div>
+
+      <div class="border-t border-[#252b37] bg-[#12151b] px-6 py-4 flex justify-between items-center text-[11px] uppercase tracking-widest text-gray-500">
+        <span>Status: Edit Mode</span>
+        <span class="flex items-center gap-2">
+          <span class="w-2 h-2 rounded-full bg-amber-400"></span>
+          Loaded
+        </span>
+      </div>
+    </div>
+  </div>
+</body>
+
+</html>

+ 77 - 39
cmds/webservice/bin/templates/index.html

@@ -1,61 +1,99 @@
 <!DOCTYPE html>
-
-<html lang="en">
+<html lang="ro">
 
 <head>
-  <title>Site Fain </title>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>MyNotes</title>
   <script src="https://cdn.tailwindcss.com"></script>
-
 </head>
 
-<body>
-  <div class="min-h-screen bg-[#0f0f0f] flex items-center justify-center p-6 font-sans">
+<body class="bg-[#0b0d12] text-white font-sans">
+  <div class="min-h-screen flex items-center justify-center p-6">
+    <div class="w-full max-w-2xl">
 
-    <div class="w-full max-w-md bg-[#1a1a1a] border border-[#303030] rounded-xl shadow-2xl p-8">
+      <!-- header -->
+      <div class="mb-6 flex items-center justify-between">
+        <div>
+          <h1 class="text-3xl font-bold tracking-tight text-white">MyNotes</h1>
+          <p class="text-sm text-gray-400 mt-1">Creează și organizează notițe în foldere locale</p>
+        </div>
 
-      <div class="mb-8">
-        <h2 class="text-[#9974d0] text-2xl font-bold tracking-tight">Notă Nouă</h2>
-        <p class="text-gray-500 text-sm mt-1">Salvare în arhiva locală .md</p>
+        <a href="/list_notes"
+          class="inline-flex items-center gap-2 rounded-lg border border-[#3a3f4b] bg-[#171a21] px-4 py-2 text-sm font-semibold text-gray-200 transition hover:bg-[#20242d] hover:text-white">
+          Vezi notițele
+        </a>
       </div>
 
-      <form class="space-y-6" method="POST" action="api/save_note">
+      <!-- card principal -->
+      <div class="rounded-2xl border border-[#2a2f3a] bg-[#13161d] shadow-2xl overflow-hidden">
+        <!-- top bar -->
+        <div class="border-b border-[#2a2f3a] bg-[#161a22] px-6 py-4 flex items-center justify-between">
+          <div>
+            <h2 class="text-xl font-bold text-[#b191ff]">Notă Nouă</h2>
+            <p class="text-sm text-gray-400 mt-1">Salvare în arhiva locală</p>
+          </div>
 
-        
-        <div>
-          <label class="block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">Folder</label>
-          <input type="text" name="director" placeholder="ex: scoala/istorie"
-            class="w-full bg-[#202020] border border-[#3e3e3e] text-gray-200 text-sm rounded-lg focus:ring-2 focus:ring-[#7b58ad] focus:border-transparent outline-none p-3 transition-all placeholder:text-gray-600">
+          <div class="flex items-center gap-2 text-xs text-gray-400">
+            <span class="h-2 w-2 rounded-full bg-green-500"></span>
+            Ready
+          </div>
         </div>
 
-        <div>
-          <label class="block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">Titlu Fișier</label>
-          <input type="text" name="titlu" placeholder="ex: Plan de idei 2026"
-            class="w-full bg-[#202020] border border-[#3e3e3e] text-gray-200 text-sm rounded-lg focus:ring-2 focus:ring-[#7b58ad] focus:border-transparent outline-none p-3 transition-all placeholder:text-gray-600">
-        </div>
+        <!-- form -->
+        <div class="p-6">
+          <form class="space-y-6" method="POST" action="api/save_note">
 
-        <div>
-          <label class="block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">Conținut Notita</label>
-          <textarea rows="5" name="notita" placeholder="Începe să scrii..."
-            class="w-full bg-[#202020] border border-[#3e3e3e] text-gray-200 text-sm rounded-lg focus:ring-2 focus:ring-[#7b58ad] focus:border-transparent outline-none p-3 transition-all placeholder:text-gray-600 resize-none"></textarea>
+            <div>
+              <label class="block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">
+                Folder
+              </label>
+              <input type="text" name="director" placeholder="ex: scoala/istorie"
+                class="w-full rounded-xl border border-[#323847] bg-[#1a1f29] px-4 py-3 text-sm text-gray-200 outline-none transition placeholder:text-gray-500 focus:border-[#8d6bdb] focus:ring-2 focus:ring-[#8d6bdb]/30">
+              <p class="mt-2 text-xs text-gray-500">Alege folderul în care va fi salvată notița.</p>
+            </div>
+
+            <div>
+              <label class="block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">
+                Titlu Fișier
+              </label>
+              <input type="text" name="titlu" placeholder="ex: Plan de idei 2026"
+                class="w-full rounded-xl border border-[#323847] bg-[#1a1f29] px-4 py-3 text-sm text-gray-200 outline-none transition placeholder:text-gray-500 focus:border-[#8d6bdb] focus:ring-2 focus:ring-[#8d6bdb]/30">
+            </div>
+
+            <div>
+              <label class="block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">
+                Conținut Notiță
+              </label>
+              <textarea rows="10" name="notita" placeholder="Începe să scrii..."
+                class="w-full rounded-xl border border-[#323847] bg-[#1a1f29] px-4 py-3 text-sm text-gray-200 outline-none transition placeholder:text-gray-500 focus:border-[#8d6bdb] focus:ring-2 focus:ring-[#8d6bdb]/30 resize-none"></textarea>
+            </div>
+
+            <div class="flex flex-col sm:flex-row gap-3">
+              <button type="submit"
+                class="flex-1 rounded-xl bg-[#7b58ad] px-5 py-3 text-sm font-bold text-white transition hover:bg-[#9974d0] shadow-lg shadow-purple-900/20">
+                Creează Notă
+              </button>
+
+              <a href="/list_notes"
+                class="flex-1 rounded-xl border border-[#3a3f4b] bg-[#171a21] px-5 py-3 text-center text-sm font-semibold text-gray-200 transition hover:bg-[#20242d] hover:text-white">
+                Deschide lista notițelor
+              </a>
+            </div>
+          </form>
         </div>
 
-        <button type="submit"
-          class="w-full bg-[#7b58ad] hover:bg-[#9974d0] text-white font-bold py-3 px-4 rounded-lg transition-colors duration-200 shadow-lg shadow-purple-900/20">
-          Creează Notă
-        </button>
-      </form>
-
-      <div
-        class="mt-6 pt-6 border-t border-[#303030] flex justify-between items-center text-[10px] text-gray-600 uppercase tracking-widest">
-        <span>Status: Ready</span>
-        <span class="flex items-center gap-1">
-          <span class="w-1.5 h-1.5 bg-green-500 rounded-full"></span> Linked
-        </span>
+        <!-- footer -->
+        <div class="border-t border-[#2a2f3a] bg-[#12151b] px-6 py-4 flex justify-between items-center text-[11px] uppercase tracking-widest text-gray-500">
+          <span>Status: Ready</span>
+          <span class="flex items-center gap-2">
+            <span class="w-2 h-2 rounded-full bg-green-500"></span>
+            Linked
+          </span>
+        </div>
       </div>
-
     </div>
   </div>
-
 </body>
 
 </html>

+ 61 - 22
cmds/webservice/bin/templates/list_notes.tmpl

@@ -7,40 +7,79 @@
   <script src="https://cdn.tailwindcss.com"></script>
 </head>
 
-<body class="bg-[#0f0f0f] text-white p-10 font-sans">
-  <h1 class="text-3xl mb-8 text-[#9974d0] font-bold">Notițele existente</h1>
+<body class="bg-[#0b0d12] text-white font-sans min-h-screen">
+  <div class="max-w-5xl mx-auto px-6 py-10">
 
-  {{template "folder" .}}
+    <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-10">
+      <div>
+        <h1 class="text-3xl md:text-4xl font-bold tracking-tight text-white">
+          Lista notițelor
+        </h1>
+        <p class="text-gray-400 mt-2 text-sm md:text-base">
+          Explorează folderele și deschide sau editează notițele.
+        </p>
+      </div>
 
-</body>
+      <a href="/index.html"
+        class="inline-flex items-center justify-center rounded-xl border border-[#313846] bg-[#171b22] px-4 py-3 text-sm font-semibold text-gray-200 transition hover:bg-[#20252f] hover:text-white">
+        Notă nouă
+      </a>
+    </div>
 
+    <div class="rounded-2xl border border-[#262c36] bg-[#11151b] p-6 md:p-8 shadow-2xl">
+      {{template "folder" .}}
+    </div>
+  </div>
+
+</body>
 </html>
 
 
 {{define "folder"}}
+<div class="ml-0 md:ml-4 mb-6">
 
-<div class="ml-4 mb-6">
+  <div class="rounded-2xl border border-[#2a3140] bg-[#151922] overflow-hidden shadow-lg">
+    <div class="px-5 py-4 border-b border-[#252b37] bg-[#181d27]">
+      <h2 class="text-lg md:text-xl font-bold text-[#b899ff] break-words flex items-center gap-2">
+        📁 {{.Nume}}
+      </h2>
+    </div>
 
-  <h2 class="text-xl font-bold text-[#c7a6ff] mb-2">
-    {{.Nume}}
-  </h2>
+    <div class="p-4 md:p-5">
+
+      {{if .Fisiere}}
+      <div class="space-y-3 mb-4">
+        {{range .Fisiere}}
+
+        <div
+          class="flex items-center justify-between rounded-xl border border-[#323949] bg-[#1a1f29] px-4 py-3 transition hover:border-[#7b58ad] hover:bg-[#202634]">
+
+          <a href="/notes/?note={{.Path}}"
+            class="flex items-center gap-3 text-gray-200 hover:text-white font-medium">
+            📄 {{.Nume}}
+          </a>
+
+          <a href="/edit/?note={{.Path}}"
+            class="text-xs px-3 py-1 rounded-lg bg-[#2a2f3a] text-gray-300 hover:bg-[#7b58ad] hover:text-white transition">
+            Edit
+          </a>
+
+        </div>
+
+        {{end}}
+      </div>
+      {{end}}
+
+      {{if .Subfoldere}}
+      <div class="mt-4 space-y-4 border-l border-[#2b3140] pl-4">
+        {{range .Subfoldere}}
+          {{template "folder" .}}
+        {{end}}
+      </div>
+      {{end}}
 
-  {{if .Fisiere}}
-  <div class="space-y-2 mb-4">
-    {{range .Fisiere}}
-    <div class="bg-[#202020] border border-[#3e3e3e] rounded-lg p-3">
-      <a href="/notes/?note={{.Path}}" class="text-gray-200 hover:text-[#9974d0] hover:underline">
-        {{.Nume}}
-      </a>
     </div>
-    {{end}}
   </div>
-  {{end}}
-
-  {{range .Subfoldere}}
-    {{template "folder" .}}
-  {{end}}
 
 </div>
-
 {{end}}

+ 302 - 50
cmds/webservice/bin/templates/notita.tmpl

@@ -1,79 +1,331 @@
 <!DOCTYPE html>
-<html lang="en">
+<html lang="ro">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Obsidian Style Fixed</title>
+    <title>{{.Titlu}}</title>
     <script src="https://cdn.tailwindcss.com"></script>
     <style>
         :root {
-            --bg-main: #161616;
-            --bg-card: #1c1c1c;
-            --border: #303030;
-            --text-muted: #a3a3a3;
-            --text-faint: #666666;
-            --accent: #9974d0;
-            --code-bg: #000000;
+            --bg-main: #0b0d12;
+            --bg-panel: #11151b;
+            --bg-card: #161b22;
+            --border: #2a3140;
+            --border-soft: #222833;
+            --text-main: #e5e7eb;
+            --text-muted: #9ca3af;
+            --text-soft: #6b7280;
+            --accent: #a78bfa;
+            --accent-strong: #8b5cf6;
+            --code-bg: #0d1117;
+            --inline-code-bg: #1b2130;
         }
 
         body {
-            background-color: var(--bg-main);
-            color: #dcddde;
+            background:
+                radial-gradient(circle at top, rgba(139, 92, 246, 0.08), transparent 30%),
+                var(--bg-main);
+            color: var(--text-main);
             font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
-            line-height: 1.6;
+            line-height: 1.75;
         }
 
-        /* Scoping everything inside a container to avoid global mess */
-        .obsidian-content {
-            max-width: 850px;
-            margin: 40px auto;
+        .note-shell {
+            max-width: 980px;
+            margin: 0 auto;
+            padding: 32px 20px 60px;
+        }
+
+        .topbar {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            gap: 16px;
+            margin-bottom: 20px;
+        }
+
+        .back-link {
+            display: inline-flex;
+            align-items: center;
+            gap: 8px;
             background: var(--bg-card);
-            padding: 4rem;
-            border-radius: 8px;
             border: 1px solid var(--border);
-            box-shadow: 0 20px 50px rgba(0,0,0,0.3);
-        }
-
-        /* Direct Tag Styling */
-        h1 { color: var(--accent); font-size: 4rem!important; font-weight: 700; margin-bottom: 1.5rem; }
-        h2 { color: var(--accent); font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-top: 2.5rem; margin-bottom: 1rem; }
-        h3 { color: var(--text-muted); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 1.5rem; }
-        
-        p { margin-bottom: 1.2rem; color: #bdbdbd; }
-        strong { color: #fff; font-weight: 600; }
-        
-        hr { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }
-
-        /* Code Block Styling */
-        pre {
-            background-color: var(--code-bg) !important;
-            padding: 1.5rem;
-            border-radius: 6px;
+            color: var(--text-muted);
+            text-decoration: none;
+            padding: 10px 14px;
+            border-radius: 12px;
+            font-size: 0.95rem;
+            transition: all 0.2s ease;
+        }
+
+        .back-link:hover {
+            color: white;
+            border-color: var(--accent-strong);
+            background: #1a2030;
+        }
+
+        .obsidian-content {
+            background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent), var(--bg-panel);
+            border: 1px solid var(--border);
+            border-radius: 24px;
+            padding: 40px 32px;
+            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
+        }
+
+        .note-header {
+            border-bottom: 1px solid var(--border-soft);
+            padding-bottom: 20px;
+            margin-bottom: 28px;
+        }
+
+        .note-label {
+            display: inline-block;
+            color: var(--accent);
+            background: rgba(167, 139, 250, 0.08);
+            border: 1px solid rgba(167, 139, 250, 0.18);
+            padding: 6px 10px;
+            border-radius: 999px;
+            font-size: 0.78rem;
+            font-weight: 700;
+            letter-spacing: 0.08em;
+            text-transform: uppercase;
+            margin-bottom: 14px;
+        }
+
+        .note-title {
+            color: #f5f3ff;
+            font-size: clamp(2.2rem, 5vw, 3.6rem);
+            font-weight: 800;
+            line-height: 1.1;
+            margin: 0;
+            letter-spacing: -0.03em;
+        }
+
+        .note-body {
+            color: var(--text-main);
+            font-size: 1.02rem;
+        }
+
+        .note-body h1,
+        .note-body h2,
+        .note-body h3,
+        .note-body h4,
+        .note-body h5,
+        .note-body h6 {
+            scroll-margin-top: 24px;
+        }
+
+        .note-body h1 {
+            color: #f5f3ff;
+            font-size: 2.1rem;
+            font-weight: 800;
+            margin-top: 2.6rem;
+            margin-bottom: 1rem;
+            letter-spacing: -0.02em;
+        }
+
+        .note-body h2 {
+            color: var(--accent);
+            font-size: 1.45rem;
+            font-weight: 700;
+            margin-top: 2.4rem;
+            margin-bottom: 0.9rem;
+            padding-bottom: 0.55rem;
+            border-bottom: 1px solid var(--border-soft);
+        }
+
+        .note-body h3 {
+            color: #d1d5db;
+            font-size: 1.1rem;
+            font-weight: 700;
+            margin-top: 1.8rem;
+            margin-bottom: 0.75rem;
+            text-transform: uppercase;
+            letter-spacing: 0.08em;
+        }
+
+        .note-body p {
+            margin-bottom: 1.15rem;
+            color: #d1d5db;
+        }
+
+        .note-body strong {
+            color: white;
+            font-weight: 700;
+        }
+
+        .note-body em {
+            color: #ddd6fe;
+        }
+
+        .note-body a {
+            color: #c4b5fd;
+            text-decoration: none;
+            border-bottom: 1px solid rgba(196, 181, 253, 0.35);
+            transition: color 0.2s ease, border-color 0.2s ease;
+        }
+
+        .note-body a:hover {
+            color: white;
+            border-color: rgba(255, 255, 255, 0.55);
+        }
+
+        .note-body hr {
+            border: 0;
+            border-top: 1px solid var(--border);
+            margin: 2.6rem 0;
+        }
+
+        .note-body ul,
+        .note-body ol {
+            margin: 1rem 0 1.3rem;
+            padding-left: 1.4rem;
+        }
+
+        .note-body ul {
+            list-style: none;
+            padding-left: 0;
+        }
+
+        .note-body ul li {
+            position: relative;
+            padding-left: 1.4rem;
+            margin-bottom: 0.6rem;
+            color: #d1d5db;
+        }
+
+        .note-body ul li::before {
+            content: "";
+            position: absolute;
+            left: 0;
+            top: 0.72em;
+            width: 8px;
+            height: 8px;
+            border-radius: 999px;
+            background: var(--accent);
+            box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12);
+            transform: translateY(-50%);
+        }
+
+        .note-body ol li {
+            margin-bottom: 0.55rem;
+        }
+
+        .note-body blockquote {
+            margin: 1.6rem 0;
+            padding: 1rem 1.1rem 1rem 1.2rem;
+            border-left: 4px solid var(--accent-strong);
+            background: rgba(167, 139, 250, 0.06);
+            border-radius: 0 14px 14px 0;
+            color: #ddd6fe;
+        }
+
+        .note-body pre {
+            background-color: var(--code-bg);
+            padding: 1.2rem 1.25rem;
+            border-radius: 16px;
             border: 1px solid var(--border);
             overflow-x: auto;
             margin: 1.5rem 0;
+            box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
         }
 
-        code {
+        .note-body code {
             font-family: 'Consolas', 'Monaco', monospace;
-            font-size: 0.95rem;
-            color: #e0e0e0;
+            font-size: 0.94rem;
+            color: #e5e7eb;
         }
 
-        /* List Styling */
-        ul { list-style: none; padding-left: 0; }
-        li::before { content: "•"; color: var(--accent); font-weight: bold; display: inline-block; width: 1em; margin-left: 0; }
+        .note-body p code,
+        .note-body li code,
+        .note-body td code,
+        .note-body blockquote code {
+            background: var(--inline-code-bg);
+            border: 1px solid #30384a;
+            padding: 0.18rem 0.42rem;
+            border-radius: 8px;
+            color: #ddd6fe;
+        }
+
+        .note-body pre code {
+            background: transparent;
+            border: none;
+            padding: 0;
+            border-radius: 0;
+            color: #e5e7eb;
+        }
+
+        .note-body table {
+            width: 100%;
+            border-collapse: collapse;
+            margin: 1.8rem 0;
+            font-size: 0.96rem;
+            overflow: hidden;
+            border-radius: 16px;
+            border-style: hidden;
+            box-shadow: 0 0 0 1px var(--border);
+        }
+
+        .note-body th {
+            text-align: left;
+            padding: 14px 16px;
+            background: #1b2230;
+            color: var(--accent);
+            font-weight: 700;
+            border-bottom: 1px solid var(--border);
+        }
+
+        .note-body td {
+            padding: 14px 16px;
+            border-top: 1px solid var(--border-soft);
+            color: #d1d5db;
+            background: #141922;
+        }
 
-        /* Table Styling */
-        table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: 0.9rem; }
-        th { text-align: left; padding: 12px; background: #252525; border: 1px solid var(--border); color: var(--accent); }
-        td { padding: 12px; border: 1px solid var(--border); }
+        .note-body img {
+            max-width: 100%;
+            border-radius: 18px;
+            border: 1px solid var(--border);
+            margin: 1.5rem 0;
+        }
+
+        @media (max-width: 768px) {
+            .note-shell {
+                padding: 20px 14px 40px;
+            }
+
+            .obsidian-content {
+                padding: 24px 18px;
+                border-radius: 18px;
+            }
+
+            .topbar {
+                flex-direction: column;
+                align-items: stretch;
+            }
+
+            .back-link {
+                justify-content: center;
+            }
+        }
     </style>
 </head>
-<body class="p-4 md:p-12">
+<body>
+    <div class="note-shell">
+        <div class="topbar">
+            <a href="/list_notes" class="back-link">← Înapoi la listă</a>
+        </div>
+
+        <article class="obsidian-content">
+            <header class="note-header">
+                <div class="note-label">Notiță</div>
+                <h1 class="note-title">{{.Titlu}}</h1>
+            </header>
 
-<div class="obsidian-content">
-    <h1>{{.Titlu}}</h1>
-    {{.HTML}}
+            <section class="note-body">
+                {{.HTML}}
+            </section>
+        </article>
+    </div>
 </body>
 </html>

+ 1 - 0
cmds/webservice/types/types.go

@@ -4,6 +4,7 @@ type Notita struct {
 	Titlu    string `json:"titlu"`
 	Continut string `json:"continut"`
 	Folder   string `json:"director"`
+	Path     string
 	HTML     string `json:"-"`
 }
 type Folder struct {

+ 40 - 3
lib/server/handlers.go

@@ -59,13 +59,15 @@ func API(w http.ResponseWriter, r *http.Request) {
 				fmt.Fprintf(w, "Error : %+v, %s", err, n.Folder)
 				return
 			}
-			err = os.MkdirAll(filepath.Join("notes_folder", n.Folder), 0755)
+			path := filepath.Join("notes_folder", n.Folder)
+			err = os.MkdirAll(path, 0755)
 			fmt.Println(n.Folder)
 			if err != nil {
 				w.WriteHeader(http.StatusBadRequest)
 				fmt.Fprintf(w, "ParseForm error: %+v , %s", err, n.Folder)
 				return
 			}
+			n.Path = path
 			fisier := fmt.Sprintf("notita-%s.json", time.Now().Format("2006-01-02-150405.999999"))
 			//fmt.Println(fisier, r.Form)
 			//return
@@ -168,8 +170,11 @@ func buildFolderStructure(path string, f *types.Folder) error {
 	if err != nil {
 		return err
 	}
-	f.Nume = filepath.Clean(path)
-
+	if filepath.Clean(path) != "notes_folder" {
+		f.Nume = filepath.Base(path)
+	} else {
+		f.Nume = "notes_folder"
+	}
 	for _, entry := range entries {
 
 		if entry.IsDir() {
@@ -189,3 +194,35 @@ func buildFolderStructure(path string, f *types.Folder) error {
 	}
 	return nil
 }
+
+func EditNotes(w http.ResponseWriter, r *http.Request, filename string) {
+
+	if r.Method == "GET" {
+		f := types.Notita{}
+		err := inout.FileToObj(filename, &f)
+		if err != nil {
+			w.WriteHeader(http.StatusBadRequest)
+			fmt.Fprintf(w, "%+v", err)
+			return
+		}
+		tmpl := template.New("editare")
+		_, err = tmpl.ParseFiles("./templates/edit_notes.tmpl")
+
+		if err != nil {
+			fmt.Println("EROARE la buildFolderStructure:", err)
+			w.WriteHeader(http.StatusBadRequest)
+			fmt.Fprintf(w, "%+v", err)
+			return
+		}
+		err = tmpl.ExecuteTemplate(w, "edit_notes.tmpl", f)
+		if err != nil {
+			fmt.Println("EROARE la buildFolderStructure:", err)
+			w.WriteHeader(http.StatusBadRequest)
+			fmt.Fprintf(w, "%+v", err)
+			return
+		}
+		return
+	}
+	w.WriteHeader(http.StatusMethodNotAllowed)
+	w.Write([]byte("methoda nepermisa"))
+}

+ 4 - 0
lib/server/srv.go

@@ -33,6 +33,10 @@ func (s *Server) Run() {
 		ListNotes(w, r)
 
 	})
+	http.HandleFunc("/edit/", func(w http.ResponseWriter, r *http.Request) {
+		note := r.URL.Query().Get("note")
+		EditNotes(w, r, note)
+	})
 
 	//running server
 	fmt.Printf("Server running at http://%s:%s/\n", s.Host, s.Port)