Build a documentation evidence repository with versioning and audit logs.
- User
Build a documentation evidence repository with versioning and audit logs.
Assistant
The user wants to build a documentation evidence repository with versioning and audit logs. This is a complex system that needs:
- A way to upload/store documentation evidence
- Version control for documents
- Audit logging for all actions
- A clean, professional interface
Let me design this with:
- A document repository system with upload capability (simulated with local data)
- Version history tracking
- Audit logs showing who did what and when
- Search and filter capabilities
- Clean, professional design (avoiding the typical purple gradient template look)
Design direction:
- Technical/professional aesthetic - think documentation systems like Notion, Confluence
- Dark theme with high contrast for a serious, professional feel
- Sharp accent color - maybe a teal/cyan or amber for highlights
- Clean typography with good hierarchy
- Grid-based layout
Features to implement:
- Document list with status indicators
- Document detail view with version history
- Audit log panel
- Upload/add document modal
- Search and filter
- Version comparison view
- Status management (draft, reviewed, approved, archived)
Typography:
- Display: "Space Grotesk" or "JetBrains Mono" for a technical feel
- UI: "IBM Plex Sans" or similar
Color scheme:
- Dark base (#0a0a0f or similar deep dark)
- Off-white text
- Cyan/teal accent (#00d4aa or similar)
- Subtle grays for borders and cards
Let me build this comprehensive system.
Documentation Evidence Repository
A professional-grade document management system with version control, audit trails, and compliance tracking. Built with a technical, enterprise aesthetic.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Evidence Repository | Documentation Control</title> <script src="https://cdn.tailwindcss.com"></script> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> <style> :root { --bg: #07080c; --bg-elevated: #0d0f14; --card: #12151c; --card-hover: #181c26; --border: #1e2330; --border-focus: #2a3142; --fg: #e8eaed; --fg-muted: #8b919e; --fg-dim: #5a6070; --accent: #00c896; --accent-dim: rgba(0, 200, 150, 0.15); --warning: #f0a030; --error: #e05050; --info: #5090e0; } * { box-sizing: border-box; } body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--fg); min-height: 100vh; } .font-mono { font-family: 'JetBrains Mono', monospace; } /* Custom scrollbar */ ::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: var(--bg); } ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: var(--border-focus); } /* Background pattern */ .bg-pattern { background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 200, 150, 0.08), transparent), linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%); } /* Grid background */ .grid-bg { background-size: 40px 40px; background-image: linear-gradient(to right, rgba(30, 35, 48, 0.5) 1px, transparent 1px), linear-gradient(to bottom, rgba(30, 35, 48, 0.5) 1px, transparent 1px); } /* Card styles */ .doc-card { background: var(--card); border: 1px solid var(--border); transition: all 0.2s ease; } .doc-card:hover { background: var(--card-hover); border-color: var(--border-focus); transform: translateY(-2px); } /* Status badges */ .status-draft { background: rgba(139, 145, 158, 0.2); color: #8b919e; } .status-pending { background: rgba(240, 160, 48, 0.2); color: #f0a030; } .status-approved { background: rgba(0, 200, 150, 0.2); color: #00c896; } .status-archived { background: rgba(90, 96, 112, 0.2); color: #5a6070; } .status-rejected { background: rgba(224, 80, 80, 0.2); color: #e05050; } /* Action log colors */ .log-create { border-left-color: #00c896; } .log-update { border-left-color: #5090e0; } .log-delete { border-left-color: #e05050; } .log-review { border-left-color: #f0a030; } .log-approve { border-left-color: #00c896; } /* Button styles */ .btn-primary { background: var(--accent); color: var(--bg); font-weight: 600; transition: all 0.15s ease; } .btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(0, 200, 150, 0.3); } .btn-primary:active { transform: scale(0.98); } .btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--fg-muted); transition: all 0.15s ease; } .btn-ghost:hover { background: var(--card); border-color: var(--border-focus); color: var(--fg); } /* Input styles */ .input-field { background: var(--bg); border: 1px solid var(--border); color: var(--fg); transition: all 0.15s ease; } .input-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); } .input-field::placeholder { color: var(--fg-dim); } /* Animations */ @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } @keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } } @keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } } .animate-fade-in { animation: fadeIn 0.3s ease forwards; } .animate-slide-in { animation: slideIn 0.3s ease forwards; } .animate-scale-in { animation: scaleIn 0.2s ease forwards; } @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } } /* Modal backdrop */ .modal-backdrop { background: rgba(7, 8, 12, 0.9); backdrop-filter: blur(4px); } /* Version connector line */ .version-line::before { content: ''; position: absolute; left: 11px; top: 28px; bottom: -8px; width: 2px; background: var(--border); } .version-line:last-child::before { display: none; } /* Pulse indicator */ .pulse-dot { animation: pulse 2s infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } </style> </head> <body class="bg-pattern"> <!-- Header --> <header class="sticky top-0 z-40 border-b border-[var(--border)] bg-[var(--bg)]/80 backdrop-blur-xl"> <div class="max-w-[1600px] mx-auto px-4 sm:px-6 lg:px-8"> <div class="flex items-center justify-between h-16"> <!-- Logo --> <div class="flex items-center gap-3"> <div class="w-9 h-9 rounded-lg bg-[var(--accent-dim)] flex items-center justify-center"> <svg class="w-5 h-5 text-[var(--accent)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/> </svg> </div> <div> <h1 class="font-mono font-semibold text-sm tracking-tight">EVIDENCE.REPO</h1> <p class="text-[10px] text-[var(--fg-dim)] uppercase tracking-wider">Documentation Control v2.4</p> </div> </div> <!-- Search --> <div class="hidden md:flex flex-1 max-w-md mx-8"> <div class="relative w-full"> <svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--fg-dim)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/> </svg> <input type="text" id="searchInput" placeholder="Search documents..." class="input-field w-full pl-10 pr-4 py-2 rounded-lg text-sm"> </div> </div> <!-- Actions --> <div class="flex items-center gap-3"> <button id="toggleAuditBtn" class="btn-ghost px-3 py-2 rounded-lg text-sm flex items-center gap-2"> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/> </svg> <span class="hidden sm:inline">Audit Log</span> </button> <button id="addDocBtn" class="btn-primary px-4 py-2 rounded-lg text-sm flex items-center gap-2"> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/> </svg> <span class="hidden sm:inline">Add Document</span> </button> </div> </div> </div> </header> <main class="max-w-[1600px] mx-auto px-4 sm:px-6 lg:px-8 py-6"> <!-- Stats Bar --> <div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-6"> <div class="doc-card rounded-xl p-4"> <div class="flex items-center justify-between"> <div> <p class="text-[var(--fg-dim)] text-xs uppercase tracking-wider mb-1">Total Docs</p> <p class="font-mono text-2xl font-bold" id="statTotal">0</p> </div> <div class="w-10 h-10 rounded-lg bg-[var(--accent-dim)] flex items-center justify-center"> <svg class="w-5 h-5 text-[var(--accent)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/> </svg> </div> </div> </div> <div class="doc-card rounded-xl p-4"> <div class="flex items-center justify-between"> <div> <p class="text-[var(--fg-dim)] text-xs uppercase tracking-wider mb-1">Approved</p> <p class="font-mono text-2xl font-bold text-[var(--accent)]" id="statApproved">0</p> </div> <div class="w-10 h-10 rounded-lg bg-[rgba(0,200,150,0.15)] flex items-center justify-center"> <svg class="w-5 h-5 text-[var(--accent)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/> </svg> </div> </div> </div> <div class="doc-card rounded-xl p-4"> <div class="flex items-center justify-between"> <div> <p class="text-[var(--fg-dim)] text-xs uppercase tracking-wider mb-1">Pending Review</p> <p class="font-mono text-2xl font-bold text-[var(--warning)]" id="statPending">0</p> </div> <div class="w-10 h-10 rounded-lg bg-[rgba(240,160,48,0.15)] flex items-center justify-center"> <svg class="w-5 h-5 text-[var(--warning)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/> </svg> </div> </div> </div> <div class="doc-card rounded-xl p-4"> <div class="flex items-center justify-between"> <div> <p class="text-[var(--fg-dim)] text-xs uppercase tracking-wider mb-1">Total Versions</p> <p class="font-mono text-2xl font-bold" id="statVersions">0</p> </div> <div class="w-10 h-10 rounded-lg bg-[rgba(80,144,224,0.15)] flex items-center justify-center"> <svg class="w-5 h-5 text-[var(--info)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"/> </svg> </div> </div> </div> </div> <!-- Filters --> <div class="flex flex-wrap items-center gap-3 mb-6"> <div class="flex items-center gap-2 text-sm"> <span class="text-[var(--fg-dim)]">Status:</span> <div class="flex gap-1"> <button class="filter-btn active px-3 py-1.5 rounded-md text-xs font-medium transition-all" data-filter="all">All</button> <button class="filter-btn px-3 py-1.5 rounded-md text-xs font-medium transition-all" data-filter="draft">Draft</button> <button class="filter-btn px-3 py-1.5 rounded-md text-xs font-medium transition-all" data-filter="pending">Pending</button> <button class="filter-btn px-3 py-1.5 rounded-md text-xs font-medium transition-all" data-filter="approved">Approved</button> <button class="filter-btn px-3 py-1.5 rounded-md text-xs font-medium transition-all" data-filter="archived">Archived</button> </div> </div> <div class="ml-auto flex items-center gap-2"> <select id="sortSelect" class="input-field px-3 py-1.5 rounded-md text-xs"> <option value="newest">Newest First</option> <option value="oldest">Oldest First</option> <option value="name">Name A-Z</option> <option value="versions">Most Versions</option> </select> </div> </div> <!-- Main Content --> <div class="flex gap-6"> <!-- Document Grid --> <div id="documentGrid" class="flex-1 grid grid-cols-1 lg:grid-cols-2 gap-4"> <!-- Documents will be rendered here --> </div> <!-- Audit Log Sidebar --> <aside id="auditSidebar" class="hidden w-80 lg:w-96 flex-shrink-0"> <div class="doc-card rounded-xl p-4 sticky top-24"> <div class="flex items-center justify-between mb-4"> <h2 class="font-mono font-semibold text-sm">AUDIT LOG</h2> <span class="pulse-dot w-2 h-2 rounded-full bg-[var(--accent)]"></span> </div> <div id="auditLogList" class="space-y-3 max-h-[70vh] overflow-y-auto pr-2"> <!-- Audit entries will be rendered here --> </div> </div> </aside> </div> </main> <!-- Add/Edit Document Modal --> <div id="documentModal" class="fixed inset-0 z-50 hidden"> <div class="modal-backdrop absolute inset-0" id="modalBackdrop"></div> <div class="relative flex items-center justify-center min-h-screen p-4"> <div class="doc-card rounded-2xl w-full max-w-lg p-6 animate-scale-in"> <div class="flex items-center justify-between mb-6"> <h2 class="font-mono font-semibold text-lg" id="modalTitle">Add Document</h2> <button id="closeModalBtn" class="text-[var(--fg-dim)] hover:text-[var(--fg)] transition-colors"> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/> </svg> </button> </div> <form id="documentForm" class="space-y-4"> <input type="hidden" id="docId"> <div> <label class="block text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-2">Document Title</label> <input type="text" id="docTitle" class="input-field w-full px-4 py-2.5 rounded-lg" placeholder="Enter document title" required> </div> <div> <label class="block text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-2">Category</label> <select id="docCategory" class="input-field w-full px-4 py-2.5 rounded-lg" required> <option value="">Select category</option> <option value="compliance">Compliance</option> <option value="technical">Technical</option> <option value="policy">Policy</option> <option value="procedure">Procedure</option> <option value="evidence">Evidence</option> </select> </div> <div> <label class="block text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-2">Description</label> <textarea id="docDescription" class="input-field w-full px-4 py-2.5 rounded-lg resize-none" rows="3" placeholder="Brief description of the document"></textarea> </div> <div class="grid grid-cols-2 gap-4"> <div> <label class="block text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-2">Status</label> <select id="docStatus" class="input-field w-full px-4 py-2.5 rounded-lg"> <option value="draft">Draft</option> <option value="pending">Pending Review</option> <option value="approved">Approved</option> <option value="archived">Archived</option> </select> </div> <div> <label class="block text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-2">Priority</label> <select id="docPriority" class="input-field w-full px-4 py-2.5 rounded-lg"> <option value="low">Low</option> <option value="medium">Medium</option> <option value="high">High</option> <option value="critical">Critical</option> </select> </div> </div> <div class="flex gap-3 pt-4"> <button type="button" id="cancelFormBtn" class="btn-ghost flex-1 py-2.5 rounded-lg text-sm">Cancel</button> <button type="submit" class="btn-primary flex-1 py-2.5 rounded-lg text-sm">Save Document</button> </div> </form> </div> </div> </div> <!-- Document Detail Modal --> <div id="detailModal" class="fixed inset-0 z-50 hidden"> <div class="modal-backdrop absolute inset-0" id="detailBackdrop"></div> <div class="relative flex items-center justify-center min-h-screen p-4"> <div class="doc-card rounded-2xl w-full max-w-2xl max-h-[90vh] overflow-hidden animate-scale-in"> <div class="p-6 border-b border-[var(--border)]"> <div class="flex items-start justify-between"> <div> <div class="flex items-center gap-3 mb-2"> <span id="detailStatus" class="px-2.5 py-1 rounded-md text-xs font-medium status-approved">Approved</span> <span id="detailCategory" class="text-xs text-[var(--fg-dim)] uppercase tracking-wider">Category</span> </div> <h2 id="detailTitle" class="font-mono font-semibold text-xl">Document Title</h2> </div> <button id="closeDetailBtn" class="text-[var(--fg-dim)] hover:text-[var(--fg)] transition-colors"> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/> </svg> </button> </div> </div> <div class="p-6 overflow-y-auto max-h-[60vh]"> <div class="grid grid-cols-2 gap-6 mb-6"> <div> <p class="text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-1">Created</p> <p id="detailCreated" class="font-mono text-sm">-</p> </div> <div> <p class="text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-1">Last Modified</p> <p id="detailModified" class="font-mono text-sm">-</p> </div> <div> <p class="text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-1">Author</p> <p id="detailAuthor" class="text-sm">-</p> </div> <div> <p class="text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-1">Priority</p> <p id="detailPriority" class="text-sm">-</p> </div> </div> <div class="mb-6"> <p class="text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-2">Description</p> <p id="detailDescription" class="text-sm text-[var(--fg-muted)]">-</p> </div> <!-- Version History --> <div> <div class="flex items-center justify-between mb-4"> <p class="text-xs uppercase tracking-wider text-[var(--fg-dim)]">Version History</p> <button id="addVersionBtn" class="btn-ghost px-3 py-1 rounded-md text-xs flex items-center gap-1"> <svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/> </svg> New Version </button> </div> <div id="versionHistory" class="space-y-3"> <!-- Version entries will be rendered here --> </div> </div> </div> <div class="p-6 border-t border-[var(--border)] flex gap-3"> <button id="editDocBtn" class="btn-ghost flex-1 py-2.5 rounded-lg text-sm flex items-center justify-center gap-2"> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/> </svg> Edit </button> <button id="deleteDocBtn" class="btn-ghost flex-1 py-2.5 rounded-lg text-sm flex items-center justify-center gap-2 text-[var(--error)] border-[rgba(224,80,80,0.3)] hover:bg-[rgba(224,80,80,0.1)]"> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/> </svg> Delete </button> </div> </div> </div> </div> <!-- New Version Modal --> <div id="versionModal" class="fixed inset-0 z-[60] hidden"> <div class="modal-backdrop absolute inset-0" id="versionBackdrop"></div> <div class="relative flex items-center justify-center min-h-screen p-4"> <div class="doc-card rounded-2xl w-full max-w-md p-6 animate-scale-in"> <div class="flex items-center justify-between mb-6"> <h2 class="font-mono font-semibold text-lg">Create New Version</h2> <button id="closeVersionBtn" class="text-[var(--fg-dim)] hover:text-[var(--fg)] transition-colors"> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/> </svg> </button> </div> <form id="versionForm" class="space-y-4"> <div> <label class="block text-xs uppercase tracking-wider text-[var(--fg-dim)] mb-2">Change Summary</label> <textarea id="versionSummary" class="input-field w-full px-4 py-2.5 rounded-lg resize-none" rows="3" placeholder="Describe what changed in this version" required></textarea> </div> <div class="flex gap-3 pt-2"> <button type="button" id="cancelVersionBtn" class="btn-ghost flex-1 py-2.5 rounded-lg text-sm">Cancel</button> <button type="submit" class="btn-primary flex-1 py-2.5 rounded-lg text-sm">Create Version</button> </div> </form> </div> </div> </div> <script> // Initialize data stores let documents = []; let auditLog = []; let currentFilter = 'all'; let currentSort = 'newest'; let currentDetailDoc = null; // User simulation const currentUser = { id: 'user_001', name: 'Alex Chen', role: 'Documentation Manager' }; const users = [ { id: 'user_001', name: 'Alex Chen', role: 'Documentation Manager' }, { id: 'user_002', name: 'Sarah Miller', role: 'Compliance Officer' }, { id: 'user_003', name: 'James Wilson', role: 'Technical Lead' }, { id: 'user_004', name: 'Emily Davis', role: 'Auditor' } ]; // Sample data const sampleDocuments = [ { id: 'doc_001', title: 'GDPR Compliance Assessment 2024', category: 'compliance', description: 'Annual GDPR compliance assessment report including data processing activities, consent mechanisms, and cross-border transfer documentation.', status: 'approved', priority: 'critical', author: users[0], createdAt: '2024-01-15T10:30:00Z', updatedAt: '2024-02-20T14:45:00Z', versions: [ { version: 3, author: users[0], date: '2024-02-20T14:45:00Z', summary: 'Final review updates and executive summary added' }, { version: 2, author: users[1], date: '2024-02-10T09:15:00Z', summary: 'Added consent flow diagrams and DPO review notes' }, { version: 1, author: users[0], date: '2024-01-15T10:30:00Z', summary: 'Initial document creation' } ] }, { id: 'doc_002', title: 'Security Penetration Test Report Q1', category: 'technical', description: 'Comprehensive penetration testing results for Q1 2024, including vulnerability assessments and remediation recommendations.', status: 'pending', priority: 'high', author: users[2], createdAt: '2024-02-01T08:00:00Z', updatedAt: '2024-02-28T16:20:00Z', versions: [ { version: 2, author: users[2], date: '2024-02-28T16:20:00Z', summary: 'Addressed reviewer comments, added remediation timeline' }, { version: 1, author: users[2], date: '2024-02-01T08:00:00Z', summary: 'Initial penetration test report' } ] }, { id: 'doc_003', title: 'Data Retention Policy v3.2', category: 'policy', description: 'Updated data retention policy covering all data types, retention periods, and disposal procedures in compliance with regulatory requirements.', status: 'approved', priority: 'high', author: users[1], createdAt: '2023-11-20T11:00:00Z', updatedAt: '2024-01-10T13:30:00Z', versions: [ { version: 5, author: users[1], date: '2024-01-10T13:30:00Z', summary: 'Legal review complete, policy approved' }, { version: 4, author: users[0], date: '2024-01-05T10:00:00Z', summary: 'Incorporated legal team feedback' }, { version: 3, author: users[1], date: '2023-12-15T14:20:00Z', summary: 'Updated retention periods per new regulations' }, { version: 2, author: users[1], date: '2023-12-01T09:45:00Z', summary: 'Added new data categories' }, { version: 1, author: users[1], date: '2023-11-20T11:00:00Z', summary: 'Initial policy draft' } ] }, { id: 'doc_004', title: 'Incident Response Procedure', category: 'procedure', description: 'Step-by-step incident response procedures including initial detection, escalation paths, containment strategies, and post-incident review processes.', status: 'approved', priority: 'critical', author: users[2], createdAt: '2024-01-05T09:00:00Z', updatedAt: '2024-02-15T11:30:00Z', versions: [ { version: 3, author: users[2], date: '2024-02-15T11:30:00Z', summary: 'Updated escalation contacts and added decision tree' }, { version: 2, author: users[0], date: '2024-01-20T15:00:00Z', summary: 'Added communication templates' }, { version: 1, author: users[2], date: '2024-01-05T09:00:00Z', summary: 'Initial procedure document' } ] }, { id: 'doc_005', title: 'Vendor Risk Assessment - CloudProvider Inc', category: 'evidence', description: 'Third-party vendor risk assessment for CloudProvider Inc including security questionnaire responses, SOC 2 report review, and risk scoring.', status: 'draft', priority: 'medium', author: users[3], createdAt: '2024-02-25T10:15:00Z', updatedAt: '2024-02-25T10:15:00Z', versions: [ { version: 1, author: users[3], date: '2024-02-25T10:15:00Z', summary: 'Initial assessment draft' } ] }, { id: 'doc_006', title: 'Access Control Matrix Q4 2023', category: 'compliance', description: 'Quarterly access control matrix documentation showing user roles, permissions, and access levels across all critical systems.', status: 'archived', priority: 'medium', author: users[0], createdAt: '2023-12-01T08:30:00Z', updatedAt: '2024-01-15T12:00:00Z', versions: [ { version: 2, author: users[0], date: '2024-01-15T12:00:00Z', summary: 'Final Q4 matrix archived' }, { version: 1, author: users[0], date: '2023-12-01T08:30:00Z', summary: 'Initial Q4 access matrix' } ] } ]; const sampleAuditLog = [ { id: 'log_001', action: 'approve', documentId: 'doc_001', documentTitle: 'GDPR Compliance Assessment 2024', user: users[1], timestamp: '2024-02-20T14:45:00Z', details: 'Document approved after final review' }, { id: 'log_002', action: 'update', documentId: 'doc_002', documentTitle: 'Security Penetration Test Report Q1', user: users[2], timestamp: '2024-02-28T16:20:00Z', details: 'Created version 2 with remediation timeline' }, { id: 'log_003', action: 'create', documentId: 'doc_005', documentTitle: 'Vendor Risk Assessment - CloudProvider Inc', user: users[3], timestamp: '2024-02-25T10:15:00Z', details: 'New document created' }, { id: 'log_004', action: 'review', documentId: 'doc_002', documentTitle: 'Security Penetration Test Report Q1', user: users[0], timestamp: '2024-02-22T11:30:00Z', details: 'Requested remediation timeline' }, { id: 'log_005', action: 'approve', documentId: 'doc_003', documentTitle: 'Data Retention Policy v3.2', user: users[1], timestamp: '2024-01-10T13:30:00Z', details: 'Policy approved by legal team' }, { id: 'log_006', action: 'update', documentId: 'doc_004', documentTitle: 'Incident Response Procedure', user: users[2], timestamp: '2024-02-15T11:30:00Z', details: 'Updated escalation contacts' }, { id: 'log_007', action: 'archive', documentId: 'doc_006', documentTitle: 'Access Control Matrix Q4 2023', user: users[0], timestamp: '2024-01-15T12:00:00Z', details: 'Document archived after quarter end' } ]; // Initialize app function init() { documents = [...sampleDocuments]; auditLog = [...sampleAuditLog]; renderDocuments(); renderAuditLog(); updateStats(); setupEventListeners(); } // Render documents function renderDocuments() { const grid = document.getElementById('documentGrid'); let filteredDocs = [...documents]; // Apply filter if (currentFilter !== 'all') { filteredDocs = filteredDocs.filter(doc => doc.status === currentFilter); } // Apply search const searchTerm = document.getElementById('searchInput').value.toLowerCase(); if (searchTerm) { filteredDocs = filteredDocs.filter(doc => doc.title.toLowerCase().includes(searchTerm) || doc.description.toLowerCase().includes(searchTerm) || doc.category.toLowerCase().includes(searchTerm) ); } // Apply sort switch (currentSort) { case 'newest': filteredDocs.sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt)); break; case 'oldest': filteredDocs.sort((a, b) => new Date(a.updatedAt) - new Date(b.updatedAt)); break; case 'name': filteredDocs.sort((a, b) => a.title.localeCompare(b.title)); break; case 'versions': filteredDocs.sort((a, b) => b.versions.length - a.versions.length); break; } grid.innerHTML = filteredDocs.map((doc, index) => ` <article class="doc-card rounded-xl p-5 cursor-pointer animate-fade-in" style="animation-delay: ${index * 50}ms" data-id="${doc.id}" tabindex="0" role="button" aria-label="View ${doc.title}"> <div class="flex items-start justify-between mb-3"> <div class="flex items-center gap-2"> <span class="status-${doc.status} px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider"> ${doc.status} </span> <span class="text-[10px] text-[var(--fg-dim)] uppercase tracking-wider">${doc.category}</span> </div> <span class="font-mono text-xs text-[var(--fg-dim)]">v${doc.versions.length}</span> </div> <h3 class="font-semibold text-base mb-2 line-clamp-2">${doc.title}</h3> <p class="text-sm text-[var(--fg-muted)] mb-4 line-clamp-2">${doc.description}</p> <div class="flex items-center justify-between text-xs text-[var(--fg-dim)]"> <div class="flex items-center gap-2"> <div class="w-5 h-5 rounded-full bg-[var(--border)] flex items-center justify-center text-[10px] font-medium"> ${doc.author.name.split(' ').map(n => n[0]).join('')} </div> <span>${doc.author.name}</span> </div> <span class="font-mono">${formatDate(doc.updatedAt)}</span> </div> ${doc.priority === 'critical' || doc.priority === 'high' ? ` <div class="mt-3 pt-3 border-t border-[var(--border)] flex items-center gap-2"> <span class="w-2 h-2 rounded-full ${doc.priority === 'critical' ? 'bg-[var(--error)]' : 'bg-[var(--warning)]'}"></span> <span class="text-[10px] uppercase tracking-wider ${doc.priority === 'critical' ? 'text-[var(--error)]' : 'text-[var(--warning)]'}">${doc.priority} priority</span> </div> ` : ''} </article> `).join(''); // Add click handlers grid.querySelectorAll('article').forEach(card => { card.addEventListener('click', () => openDetailModal(card.dataset.id)); card.addEventListener('keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openDetailModal(card.dataset.id); } }); }); } // Render audit log function renderAuditLog() { const list = document.getElementById('auditLogList'); const sortedLog = [...auditLog].sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp)); list.innerHTML = sortedLog.map((entry, index) => ` <div class="border-l-2 log-${entry.action} pl-3 py-1 animate-slide-in" style="animation-delay: ${index * 30}ms"> <div class="flex items-center gap-2 mb-1"> <span class="text-[10px] uppercase tracking-wider font-medium ${getActionColor(entry.action)}">${entry.action}</span> <span class="text-[10px] text-[var(--fg-dim)]">${formatTimeAgo(entry.timestamp)}</span> </div> <p class="text-xs text-[var(--fg)] mb-1 line-clamp-1">${entry.documentTitle}</p> <div class="flex items-center gap-2 text-[10px] text-[var(--fg-dim)]"> <span>${entry.user.name}</span> </div> </div> `).join(''); } // Get action color class function getActionColor(action) { const colors = { create: 'text-[var(--accent)]', update: 'text-[var(--info)]', delete: 'text-[var(--error)]', review: 'text-[var(--warning)]', approve: 'text-[var(--accent)]', archive: 'text-[var(--fg-dim)]' }; return colors[action] || 'text-[var(--fg-muted)]'; } // Update statistics function updateStats() { document.getElementById('statTotal').textContent = documents.length; document.getElementById('statApproved').textContent = documents.filter(d => d.status === 'approved').length; document.getElementById('statPending').textContent = documents.filter(d => d.status === 'pending').length; document.getElementById('statVersions').textContent = documents.reduce((sum, d) => sum + d.versions.length, 0); } // Format date function formatDate(dateStr) { const date = new Date(dateStr); return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }); } // Format time ago function formatTimeAgo(dateStr) { const date = new Date(dateStr); const now = new Date(); const seconds = Math.floor((now - date) / 1000); if (seconds < 60) return 'just now'; if (seconds < 3600) return `${Math.floor(seconds / 60)}m ago`; if (seconds < 86400) return `${Math.floor(seconds / 3600)}h ago`; if (seconds < 604800) return `${Math.floor(seconds / 86400)}d ago`; return formatDate(dateStr); } // Format full date function formatFullDate(dateStr) { const date = new Date(dateStr); return date.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric', year: 'numeric', hour: '2-digit', minute: '2-digit' }); } // Setup event listeners function setupEventListeners() { // Filter buttons document.querySelectorAll('.filter-btn').forEach(btn => { btn.addEventListener('click', () => { document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); btn.classList.add('active'); currentFilter = btn.dataset.filter; renderDocuments(); }); }); // Update filter button styles const style = document.createElement('style'); style.textContent = ` .filter-btn { color: var(--fg-dim); background: transparent; } .filter-btn:hover { color: var(--fg); background: var(--card); } .filter-btn.active { color: var(--accent); background: var(--accent-dim); } `; document.head.appendChild(style); // Sort select document.getElementById('sortSelect').addEventListener('change', (e) => { currentSort = e.target.value; renderDocuments(); }); // Search input document.getElementById('searchInput').addEventListener('input', () => { renderDocuments(); }); // Audit log toggle document.getElementById('toggleAuditBtn').addEventListener('click', () => { const sidebar = document.getElementById('auditSidebar'); sidebar.classList.toggle('hidden'); }); // Add document button document.getElementById('addDocBtn').addEventListener('click', () => { openDocumentModal(); }); // Modal close handlers document.getElementById('closeModalBtn').addEventListener('click', closeDocumentModal); document.getElementById('modalBackdrop').addEventListener('click', closeDocumentModal); document.getElementById('cancelFormBtn').addEventListener('click', closeDocumentModal); // Detail modal close handlers document.getElementById('closeDetailBtn').addEventListener('click', closeDetailModal); document.getElementById('detailBackdrop').addEventListener('click', closeDetailModal); // Document form submit document.getElementById('documentForm').addEventListener('submit', handleDocumentSubmit); // Edit document button document.getElementById('editDocBtn').addEventListener('click', () => { if (currentDetailDoc) { closeDetailModal(); openDocumentModal(currentDetailDoc); } }); // Delete document button document.getElementById('deleteDocBtn').addEventListener('click', () => { if (currentDetailDoc && confirm('Are you sure you want to delete this document?')) { deleteDocument(currentDetailDoc.id); closeDetailModal(); } }); // Version modal handlers document.getElementById('addVersionBtn').addEventListener('click', () => { document.getElementById('versionModal').classList.remove('hidden'); }); document.getElementById('closeVersionBtn').addEventListener('click', closeVersionModal); document.getElementById('versionBackdrop').addEventListener('click', closeVersionModal); document.getElementById('cancelVersionBtn').addEventListener('click', closeVersionModal); document.getElementById('versionForm').addEventListener('submit', handleVersionSubmit); // Keyboard shortcuts document.addEventListener('keydown', (e) => { if (e.key === 'Escape') { closeDocumentModal(); closeDetailModal(); closeVersionModal(); } }); } // Open document modal function openDocumentModal(doc = null) { const modal = document.getElementById('documentModal'); const title = document.getElementById('modalTitle'); const form = document.getElementById('documentForm'); if (doc) { title.textContent = 'Edit Document'; document.getElementById('docId').value = doc.id; document.getElementById('docTitle').value = doc.title; document.getElementById('docCategory').value = doc.category; document.getElementById('docDescription').value = doc.description; document.getElementById('docStatus').value = doc.status; document.getElementById('docPriority').value = doc.priority; } else { title.textContent = 'Add Document'; form.reset(); document.getElementById('docId').value = ''; } modal.classList.remove('hidden'); document.getElementById('docTitle').focus(); } // Close document modal function closeDocumentModal() { document.getElementById('documentModal').classList.add('hidden'); } // Open detail modal function openDetailModal(docId) { const doc = documents.find(d => d.id === docId); if (!doc) return; currentDetailDoc = doc; document.getElementById('detailTitle').textContent = doc.title; document.getElementById('detailStatus').textContent = doc.status; document.getElementById('detailStatus').className = `px-2.5 py-1 rounded-md text-xs font-medium status-${doc.status}`; document.getElementById('detailCategory').textContent = doc.category; document.getElementById('detailCreated').textContent = formatFullDate(doc.createdAt); document.getElementById('detailModified').textContent = formatFullDate(doc.updatedAt); document.getElementById('detailAuthor').textContent = doc.author.name; document.getElementById('detailPriority').textContent = doc.priority.charAt(0).toUpperCase() + doc.priority.slice(1); document.getElementById('detailDescription').textContent = doc.description; // Render version history const versionHistory = document.getElementById('versionHistory'); versionHistory.innerHTML = doc.versions.map((v, index) => ` <div class="relative version-line pl-8 pb-4"> <div class="absolute left-0 top-1 w-6 h-6 rounded-full ${index === 0 ? 'bg-[var(--accent)]' : 'bg-[var(--border)]'} flex items-center justify-center"> <span class="font-mono text-[10px] ${index === 0 ? 'text-[var(--bg)]' : 'text-[var(--fg-dim)]'}">${v.version}</span> </div> <div class="bg-[var(--bg)] rounded-lg p-3"> <div class="flex items-center justify-between mb-1"> <span class="text-xs font-medium">${v.author.name}</span> <span class="text-[10px] text-[var(--fg-dim)] font-mono">${formatDate(v.date)}</span> </div> <p class="text-sm text-[var(--fg-muted)]">${v.summary}</p> </div> </div> `).join(''); document.getElementById('detailModal').classList.remove('hidden'); } // Close detail modal function closeDetailModal() { document.getElementById('detailModal').classList.add('hidden'); currentDetailDoc = null; } // Close version modal function closeVersionModal() { document.getElementById('versionModal').classList.add('hidden'); document.getElementById('versionForm').reset(); } // Handle document submit function handleDocumentSubmit(e) { e.preventDefault(); const id = document.getElementById('docId').value; const docData = { title: document.getElementById('docTitle').value, category: document.getElementById('docCategory').value, description: document.getElementById('docDescription').value, status: document.getElementById('docStatus').value, priority: document.getElementById('docPriority').value }; if (id) { // Update existing document updateDocument(id, docData); } else { // Create new document createDocument(docData); } closeDocumentModal(); } // Create document function createDocument(docData) { const newDoc = { id: `doc_${String(documents.length + 1).padStart(3, '0')}`, ...docData, author: currentUser, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), versions: [ { version: 1, author: currentUser, date: new Date().toISOString(), summary: 'Initial document creation' } ] }; documents.unshift(newDoc); addAuditLog('create', newDoc.id, newDoc.title, 'New document created'); renderDocuments(); renderAuditLog(); updateStats(); } // Update document function updateDocument(id, docData) { const index = documents.findIndex(d => d.id === id); if (index === -1) return; documents[index] = { ...documents[index], ...docData, updatedAt: new Date().toISOString() }; addAuditLog('update', id, documents[index].title, 'Document updated'); renderDocuments(); renderAuditLog(); updateStats(); } // Delete document function deleteDocument(id) { const doc = documents.find(d => d.id === id); if (!doc) return; addAuditLog('delete', id, doc.title, 'Document deleted'); documents = documents.filter(d => d.id !== id); renderDocuments(); renderAuditLog(); updateStats(); } // Handle version submit function handleVersionSubmit(e) { e.preventDefault(); if (!currentDetailDoc) return; const summary = document.getElementById('versionSummary').value; const newVersion = { version: currentDetailDoc.versions.length + 1, author: currentUser, date: new Date().toISOString(), summary: summary }; currentDetailDoc.versions.unshift(newVersion); currentDetailDoc.updatedAt = new Date().toISOString(); addAuditLog('update', currentDetailDoc.id, currentDetailDoc.title, `Created version ${newVersion.version}`); closeVersionModal(); openDetailModal(currentDetailDoc.id); renderDocuments(); renderAuditLog(); updateStats(); } // Add audit log entry function addAuditLog(action, documentId, documentTitle, details) { const entry = { id: `log_${String(auditLog.length + 1).padStart(3, '0')}`, action, documentId, documentTitle, user: currentUser, timestamp: new Date().toISOString(), details }; auditLog.unshift(entry); } // Initialize on load document.addEventListener('DOMContentLoaded', init); </script> </body> </html>Key Features
Document Management
- CRUD Operations: Create, read, update, and delete documents with full form validation
- Status Tracking: Draft → Pending → Approved → Archived workflow
- Priority Levels: Low, Medium, High, Critical with visual indicators
- Category Organization: Compliance, Technical, Policy, Procedure, Evidence
Version Control
- Version History: Complete timeline of all document versions
- Change Tracking: Each version includes author, timestamp, and change summary
- Visual Timeline: Connected version nodes show document evolution
Audit Logging
- Comprehensive Trail: All actions logged with user, timestamp, and details
- Action Types: Create, Update, Delete, Review, Approve, Archive
- Real-time Updates: Log updates instantly when actions occur
- Color-coded Entries: Visual distinction between action types
UI/UX Features
- Dark Technical Theme: Professional, high-contrast design
- Responsive Layout: Works on mobile (375px) through desktop (1440px+)
- Staggered Animations: Smooth reveal effects respecting reduced motion
- Keyboard Navigation: Full accessibility with focus states
- Search & Filter: Real-time filtering by status and text search
- Sortable Views: Sort by date, name, or version count
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.