2637 lines
86 KiB
Python
Executable file
2637 lines
86 KiB
Python
Executable file
#!/usr/bin/env python3
|
||
"""
|
||
Generates the comprehensive index_template.html for Ekeepa 360 Agile Cockpit v2.6.
|
||
Includes:
|
||
- Robust, fixed filter system (status, member, sprint, time-tracking, rollovers, chronic)
|
||
- Dedicated Chronic / Zombie Tasks Clinic section with root-cause analysis & management suggestions
|
||
- Time-tracking transparency scorecard & warnings
|
||
- Interactive SVG charts:
|
||
1. Donut chart for sprint health
|
||
2. Multi-sprint velocity trend (S5, S6, S7, S9, S10)
|
||
3. Interactive 2-sprint comparator (Sprint A vs Sprint B)
|
||
4. Member output & velocity growth comparison (Sprint 9 vs Sprint 10)
|
||
- Separate Dev (EKD) and Marketing (EMO) analytics
|
||
- Full PRD repository integration
|
||
"""
|
||
|
||
import os
|
||
|
||
OUTPUT_PATH = "/workspace/prds/index_template.html"
|
||
|
||
HTML_CONTENT = r'''<!DOCTYPE html>
|
||
<html lang="fa" dir="rtl">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Ekeepa 360 Agile Cockpit | کاکپیت مدیریت محصول، توسعه و مارکتینگ اکیپا</title>
|
||
<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=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
|
||
<style>
|
||
:root {
|
||
--bg: #f8fafc;
|
||
--surface: #ffffff;
|
||
--surface-subtle: #f1f5f9;
|
||
--border: #e2e8f0;
|
||
--border-focus: #6366f1;
|
||
--text: #0f172a;
|
||
--text-muted: #64748b;
|
||
--primary: #4f46e5;
|
||
--primary-hover: #4338ca;
|
||
--primary-light: #eef2ff;
|
||
--success: #10b981;
|
||
--success-bg: #ecfdf5;
|
||
--warning: #f59e0b;
|
||
--warning-bg: #fffbeb;
|
||
--danger: #ef4444;
|
||
--danger-bg: #fef2f2;
|
||
--info: #0284c7;
|
||
--info-bg: #f0f9ff;
|
||
--purple: #8b5cf6;
|
||
--purple-bg: #f5f3ff;
|
||
--radius: 12px;
|
||
--radius-lg: 16px;
|
||
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
||
--shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
|
||
--shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
|
||
--shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.06);
|
||
}
|
||
|
||
* {
|
||
box-sizing: border-box;
|
||
margin: 0;
|
||
padding: 0;
|
||
font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
|
||
font-feature-settings: "tnum";
|
||
}
|
||
|
||
body {
|
||
background-color: var(--bg);
|
||
color: var(--text);
|
||
line-height: 1.6;
|
||
-webkit-font-smoothing: antialiased;
|
||
padding-bottom: 80px;
|
||
}
|
||
|
||
/* Top Navigation Header */
|
||
.top-header {
|
||
background: var(--surface);
|
||
border-bottom: 1px solid var(--border);
|
||
position: sticky;
|
||
top: 0;
|
||
z-index: 50;
|
||
backdrop-filter: blur(8px);
|
||
box-shadow: var(--shadow-sm);
|
||
}
|
||
|
||
.header-inner {
|
||
max-width: 1440px;
|
||
margin: 0 auto;
|
||
padding: 12px 24px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 16px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.brand-section {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 14px;
|
||
}
|
||
|
||
.brand-avatar {
|
||
width: 44px;
|
||
height: 44px;
|
||
background: linear-gradient(135deg, #4f46e5, #9333ea);
|
||
color: white;
|
||
border-radius: var(--radius);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 22px;
|
||
font-weight: 800;
|
||
box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
|
||
}
|
||
|
||
.brand-titles h1 {
|
||
font-size: 18px;
|
||
font-weight: 800;
|
||
color: var(--text);
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
|
||
.version-tag {
|
||
background: #e0e7ff;
|
||
color: #3730a3;
|
||
font-size: 11px;
|
||
padding: 2px 8px;
|
||
border-radius: 20px;
|
||
font-weight: 700;
|
||
}
|
||
|
||
.brand-titles p {
|
||
font-size: 12px;
|
||
color: var(--text-muted);
|
||
}
|
||
|
||
.header-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
}
|
||
|
||
.jira-status-badge {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
background: #f0fdf4;
|
||
border: 1px solid #bbf7d0;
|
||
padding: 6px 12px;
|
||
border-radius: 30px;
|
||
font-size: 12px;
|
||
color: #166534;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.pulse-dot {
|
||
width: 8px;
|
||
height: 8px;
|
||
background: #22c55e;
|
||
border-radius: 50%;
|
||
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
|
||
animation: pulse 2s infinite;
|
||
}
|
||
|
||
@keyframes pulse {
|
||
0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
|
||
70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
|
||
100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
|
||
}
|
||
|
||
.btn-action {
|
||
background: var(--surface-subtle);
|
||
border: 1px solid var(--border);
|
||
color: var(--text);
|
||
padding: 8px 14px;
|
||
border-radius: var(--radius);
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
transition: all 0.15s ease;
|
||
text-decoration: none;
|
||
}
|
||
|
||
.btn-action:hover {
|
||
background: #e2e8f0;
|
||
border-color: #cbd5e1;
|
||
}
|
||
|
||
.btn-action.primary {
|
||
background: var(--primary);
|
||
color: white;
|
||
border-color: var(--primary);
|
||
}
|
||
|
||
.btn-action.primary:hover {
|
||
background: var(--primary-hover);
|
||
}
|
||
|
||
/* Main Tab Navigation Bar */
|
||
.tabs-bar-container {
|
||
background: var(--surface);
|
||
border-bottom: 1px solid var(--border);
|
||
}
|
||
|
||
.tabs-bar {
|
||
max-width: 1440px;
|
||
margin: 0 auto;
|
||
padding: 0 24px;
|
||
display: flex;
|
||
gap: 24px;
|
||
overflow-x: auto;
|
||
}
|
||
|
||
.nav-tab {
|
||
padding: 16px 8px;
|
||
border: none;
|
||
background: none;
|
||
font-size: 14px;
|
||
font-weight: 600;
|
||
color: var(--text-muted);
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
position: relative;
|
||
transition: all 0.2s;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.nav-tab:hover {
|
||
color: var(--text);
|
||
}
|
||
|
||
.nav-tab.active {
|
||
color: var(--primary);
|
||
font-weight: 700;
|
||
}
|
||
|
||
.nav-tab.active::after {
|
||
content: '';
|
||
position: absolute;
|
||
bottom: -1px;
|
||
left: 0;
|
||
right: 0;
|
||
height: 3px;
|
||
background: var(--primary);
|
||
border-radius: 3px 3px 0 0;
|
||
}
|
||
|
||
.tab-badge {
|
||
font-size: 11px;
|
||
padding: 2px 7px;
|
||
border-radius: 12px;
|
||
background: var(--surface-subtle);
|
||
color: var(--text-muted);
|
||
font-weight: 700;
|
||
}
|
||
|
||
.nav-tab.active .tab-badge {
|
||
background: var(--primary-light);
|
||
color: var(--primary);
|
||
}
|
||
|
||
/* App Container */
|
||
.app-container {
|
||
max-width: 1440px;
|
||
margin: 0 auto;
|
||
padding: 24px;
|
||
}
|
||
|
||
.tab-pane {
|
||
display: none;
|
||
}
|
||
|
||
.tab-pane.active {
|
||
display: block;
|
||
}
|
||
|
||
/* Sub-board Switcher & Controls */
|
||
.board-header {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 16px 20px;
|
||
margin-bottom: 20px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 16px;
|
||
flex-wrap: wrap;
|
||
box-shadow: var(--shadow-sm);
|
||
}
|
||
|
||
.board-toggle-group {
|
||
display: flex;
|
||
gap: 8px;
|
||
background: var(--surface-subtle);
|
||
padding: 4px;
|
||
border-radius: var(--radius);
|
||
border: 1px solid var(--border);
|
||
}
|
||
|
||
.btn-toggle {
|
||
border: none;
|
||
background: transparent;
|
||
padding: 8px 18px;
|
||
border-radius: 8px;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: var(--text-muted);
|
||
cursor: pointer;
|
||
transition: all 0.15s;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
|
||
.btn-toggle.active {
|
||
background: var(--surface);
|
||
color: var(--text);
|
||
font-weight: 700;
|
||
box-shadow: var(--shadow-sm);
|
||
}
|
||
|
||
.sprint-context-box {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
font-size: 13px;
|
||
color: var(--text-muted);
|
||
}
|
||
|
||
.sprint-chip {
|
||
background: #eff6ff;
|
||
color: #1d4ed8;
|
||
border: 1px solid #bfdbfe;
|
||
padding: 4px 12px;
|
||
border-radius: 20px;
|
||
font-size: 12px;
|
||
font-weight: 700;
|
||
}
|
||
|
||
/* Filters Bar */
|
||
.filters-bar {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 16px 20px;
|
||
margin-bottom: 20px;
|
||
box-shadow: var(--shadow-sm);
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 12px;
|
||
}
|
||
|
||
.filter-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.filter-select {
|
||
background: var(--bg);
|
||
border: 1px solid var(--border);
|
||
color: var(--text);
|
||
padding: 9px 14px;
|
||
border-radius: var(--radius);
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
cursor: pointer;
|
||
outline: none;
|
||
transition: all 0.15s;
|
||
min-width: 170px;
|
||
}
|
||
|
||
.filter-select:focus {
|
||
border-color: var(--border-focus);
|
||
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
|
||
}
|
||
|
||
.checkbox-pill {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
cursor: pointer;
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
padding: 8px 14px;
|
||
border-radius: 30px;
|
||
border: 1px solid var(--border);
|
||
background: var(--bg);
|
||
color: var(--text);
|
||
transition: all 0.15s;
|
||
user-select: none;
|
||
}
|
||
|
||
.checkbox-pill input {
|
||
accent-color: var(--primary);
|
||
cursor: pointer;
|
||
}
|
||
|
||
.checkbox-pill.active {
|
||
background: #fef3c7;
|
||
border-color: #fde68a;
|
||
color: #92400e;
|
||
}
|
||
|
||
.checkbox-pill.danger-pill.active {
|
||
background: #fee2e2;
|
||
border-color: #fca5a5;
|
||
color: #991b1b;
|
||
}
|
||
|
||
.search-input-wrapper {
|
||
position: relative;
|
||
flex: 1;
|
||
min-width: 260px;
|
||
}
|
||
|
||
.search-input-wrapper input {
|
||
width: 100%;
|
||
background: var(--bg);
|
||
border: 1px solid var(--border);
|
||
color: var(--text);
|
||
padding: 10px 40px 10px 14px;
|
||
border-radius: var(--radius);
|
||
font-size: 13px;
|
||
outline: none;
|
||
transition: all 0.15s;
|
||
}
|
||
|
||
.search-input-wrapper input:focus {
|
||
border-color: var(--border-focus);
|
||
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
|
||
background: #ffffff;
|
||
}
|
||
|
||
.search-icon {
|
||
position: absolute;
|
||
right: 14px;
|
||
top: 50%;
|
||
transform: translateY(-50%);
|
||
color: var(--text-muted);
|
||
font-size: 14px;
|
||
}
|
||
|
||
.filter-count-badge {
|
||
font-size: 12px;
|
||
color: var(--text-muted);
|
||
font-weight: 500;
|
||
margin-right: auto;
|
||
}
|
||
|
||
/* KPI Grid */
|
||
.kpi-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||
gap: 16px;
|
||
margin-bottom: 24px;
|
||
}
|
||
|
||
.kpi-card {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 18px 20px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
box-shadow: var(--shadow-sm);
|
||
transition: transform 0.15s, box-shadow 0.15s;
|
||
}
|
||
|
||
.kpi-card:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: var(--shadow);
|
||
}
|
||
|
||
.kpi-info h6 {
|
||
font-size: 12px;
|
||
color: var(--text-muted);
|
||
font-weight: 600;
|
||
margin-bottom: 6px;
|
||
}
|
||
|
||
.kpi-number {
|
||
font-size: 26px;
|
||
font-weight: 800;
|
||
color: var(--text);
|
||
line-height: 1.1;
|
||
font-feature-settings: "tnum";
|
||
}
|
||
|
||
.kpi-subtext {
|
||
font-size: 11px;
|
||
color: var(--text-muted);
|
||
margin-top: 4px;
|
||
}
|
||
|
||
.kpi-icon {
|
||
width: 44px;
|
||
height: 44px;
|
||
border-radius: var(--radius);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 20px;
|
||
}
|
||
|
||
/* Task Cards Grid */
|
||
.tasks-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
|
||
gap: 18px;
|
||
}
|
||
|
||
.task-card {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 18px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-between;
|
||
gap: 14px;
|
||
box-shadow: var(--shadow-sm);
|
||
transition: all 0.2s ease;
|
||
position: relative;
|
||
}
|
||
|
||
.task-card:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: var(--shadow);
|
||
border-color: #cbd5e1;
|
||
}
|
||
|
||
.task-card.is-rollover {
|
||
border-right: 4px solid var(--warning);
|
||
}
|
||
|
||
.task-card.is-chronic {
|
||
border-right: 4px solid var(--danger);
|
||
background: linear-gradient(to left, #ffffff, #fffaf9);
|
||
}
|
||
|
||
.task-card.is-done {
|
||
border-right: 4px solid var(--success);
|
||
opacity: 0.95;
|
||
}
|
||
|
||
.task-card-header {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
gap: 10px;
|
||
}
|
||
|
||
.task-key-tag {
|
||
font-family: monospace;
|
||
font-size: 12px;
|
||
font-weight: 700;
|
||
color: var(--primary);
|
||
background: var(--primary-light);
|
||
padding: 3px 8px;
|
||
border-radius: 6px;
|
||
text-decoration: none;
|
||
}
|
||
|
||
.task-status-pill {
|
||
font-size: 11px;
|
||
font-weight: 700;
|
||
padding: 3px 9px;
|
||
border-radius: 20px;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.task-status-pill.done {
|
||
background: var(--success-bg);
|
||
color: #065f46;
|
||
border: 1px solid #a7f3d0;
|
||
}
|
||
|
||
.task-status-pill.in_progress {
|
||
background: var(--info-bg);
|
||
color: #0369a1;
|
||
border: 1px solid #bae6fd;
|
||
}
|
||
|
||
.task-status-pill.todo {
|
||
background: #f1f5f9;
|
||
color: #475569;
|
||
border: 1px solid #cbd5e1;
|
||
}
|
||
|
||
.task-title {
|
||
font-size: 14px;
|
||
font-weight: 700;
|
||
color: var(--text);
|
||
line-height: 1.5;
|
||
margin: 4px 0;
|
||
}
|
||
|
||
.task-desc {
|
||
font-size: 12px;
|
||
color: var(--text-muted);
|
||
line-height: 1.5;
|
||
max-height: 54px;
|
||
overflow: hidden;
|
||
display: -webkit-box;
|
||
-webkit-line-clamp: 2;
|
||
-webkit-box-orient: vertical;
|
||
}
|
||
|
||
.rollover-alert-banner {
|
||
background: #fffbeb;
|
||
border: 1px solid #fef3c7;
|
||
color: #92400e;
|
||
padding: 8px 10px;
|
||
border-radius: var(--radius);
|
||
font-size: 11px;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
|
||
.chronic-alert-banner {
|
||
background: #fef2f2;
|
||
border: 1px solid #fee2e2;
|
||
color: #991b1b;
|
||
padding: 8px 10px;
|
||
border-radius: var(--radius);
|
||
font-size: 11px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 4px;
|
||
}
|
||
|
||
.chronic-rec-pill {
|
||
background: #fee2e2;
|
||
color: #b91c1c;
|
||
font-weight: 700;
|
||
padding: 2px 6px;
|
||
border-radius: 4px;
|
||
display: inline-block;
|
||
width: fit-content;
|
||
font-size: 10px;
|
||
}
|
||
|
||
.task-card-footer {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 8px;
|
||
padding-top: 12px;
|
||
border-top: 1px solid #f1f5f9;
|
||
margin-top: 4px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.assignee-chip {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
|
||
.assignee-avatar {
|
||
width: 26px;
|
||
height: 26px;
|
||
border-radius: 50%;
|
||
background: #e2e8f0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 13px;
|
||
}
|
||
|
||
.assignee-name {
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
color: var(--text);
|
||
}
|
||
|
||
.assignee-role {
|
||
font-size: 10px;
|
||
color: var(--text-muted);
|
||
display: block;
|
||
}
|
||
|
||
.task-badges-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
|
||
.time-badge {
|
||
font-size: 11px;
|
||
padding: 2px 8px;
|
||
border-radius: 6px;
|
||
background: var(--surface-subtle);
|
||
color: var(--text-muted);
|
||
font-weight: 600;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.time-badge.missing {
|
||
background: #fff1f2;
|
||
color: #e11d48;
|
||
border: 1px solid #ffe4e6;
|
||
}
|
||
|
||
.btn-view-prd {
|
||
background: var(--purple-bg);
|
||
color: #6b21a8;
|
||
border: 1px solid #e9d5ff;
|
||
padding: 4px 10px;
|
||
border-radius: 6px;
|
||
font-size: 11px;
|
||
font-weight: 700;
|
||
cursor: pointer;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
transition: all 0.15s;
|
||
}
|
||
|
||
.btn-view-prd:hover {
|
||
background: #f3e8ff;
|
||
border-color: #d8b4fe;
|
||
}
|
||
|
||
/* SECTION: Chronic Tasks Clinic (عارضهیابی تسکهای فسیلشده) */
|
||
.chronic-clinic-section {
|
||
background: var(--surface);
|
||
border: 1px solid #fca5a5;
|
||
border-radius: var(--radius-lg);
|
||
padding: 24px;
|
||
margin-bottom: 28px;
|
||
box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
|
||
position: relative;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.chronic-clinic-section::before {
|
||
content: '';
|
||
position: absolute;
|
||
top: 0;
|
||
right: 0;
|
||
width: 6px;
|
||
height: 100%;
|
||
background: #ef4444;
|
||
}
|
||
|
||
.clinic-header {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
gap: 16px;
|
||
margin-bottom: 20px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.clinic-title-box h3 {
|
||
font-size: 17px;
|
||
font-weight: 800;
|
||
color: #991b1b;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
|
||
.clinic-title-box p {
|
||
font-size: 13px;
|
||
color: var(--text-muted);
|
||
margin-top: 4px;
|
||
max-width: 800px;
|
||
}
|
||
|
||
.clinic-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
|
||
gap: 16px;
|
||
}
|
||
|
||
.clinic-card {
|
||
background: #fffaf9;
|
||
border: 1px solid #fed7d7;
|
||
border-radius: var(--radius);
|
||
padding: 16px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
transition: all 0.15s;
|
||
}
|
||
|
||
.clinic-card:hover {
|
||
background: #ffffff;
|
||
box-shadow: var(--shadow);
|
||
border-color: #fca5a5;
|
||
}
|
||
|
||
.clinic-card-top {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 8px;
|
||
}
|
||
|
||
.clinic-delay-pill {
|
||
background: #ef4444;
|
||
color: white;
|
||
font-size: 11px;
|
||
font-weight: 800;
|
||
padding: 3px 10px;
|
||
border-radius: 20px;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.clinic-card h4 {
|
||
font-size: 14px;
|
||
font-weight: 800;
|
||
color: var(--text);
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.clinic-cause-box {
|
||
background: #f8fafc;
|
||
border: 1px solid #e2e8f0;
|
||
border-radius: 8px;
|
||
padding: 10px;
|
||
font-size: 12px;
|
||
color: #475569;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.clinic-cause-box strong {
|
||
color: #1e293b;
|
||
display: block;
|
||
margin-bottom: 2px;
|
||
}
|
||
|
||
.clinic-rec-box {
|
||
background: #ecfdf5;
|
||
border: 1px solid #a7f3d0;
|
||
border-radius: 8px;
|
||
padding: 10px;
|
||
font-size: 12px;
|
||
color: #065f46;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.clinic-rec-box strong {
|
||
color: #047857;
|
||
display: block;
|
||
margin-bottom: 2px;
|
||
}
|
||
|
||
.clinic-action-footer {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding-top: 6px;
|
||
font-size: 11px;
|
||
}
|
||
|
||
/* SECTION: Visual Analytics (Charts & Comparisons) */
|
||
.analytics-grid-two {
|
||
display: grid;
|
||
grid-template-columns: 1fr 1fr;
|
||
gap: 20px;
|
||
margin-bottom: 24px;
|
||
}
|
||
|
||
@media (max-width: 960px) {
|
||
.analytics-grid-two {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
}
|
||
|
||
.chart-panel-card {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 22px;
|
||
box-shadow: var(--shadow-sm);
|
||
}
|
||
|
||
.chart-panel-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 18px;
|
||
gap: 12px;
|
||
}
|
||
|
||
.chart-panel-header h3 {
|
||
font-size: 15px;
|
||
font-weight: 800;
|
||
color: var(--text);
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
|
||
.chart-panel-header p {
|
||
font-size: 12px;
|
||
color: var(--text-muted);
|
||
margin-top: 2px;
|
||
}
|
||
|
||
/* SVG Donut Chart */
|
||
.donut-wrapper {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-around;
|
||
gap: 20px;
|
||
flex-wrap: wrap;
|
||
padding: 10px 0;
|
||
}
|
||
|
||
.donut-svg-container {
|
||
position: relative;
|
||
width: 180px;
|
||
height: 180px;
|
||
}
|
||
|
||
.donut-center-label {
|
||
position: absolute;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translate(-50%, -50%);
|
||
text-align: center;
|
||
}
|
||
|
||
.donut-center-pct {
|
||
font-size: 28px;
|
||
font-weight: 900;
|
||
color: var(--text);
|
||
line-height: 1;
|
||
}
|
||
|
||
.donut-center-sub {
|
||
font-size: 11px;
|
||
color: var(--text-muted);
|
||
margin-top: 2px;
|
||
}
|
||
|
||
.donut-legend {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 10px;
|
||
min-width: 160px;
|
||
}
|
||
|
||
.legend-item {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.legend-bullet {
|
||
width: 10px;
|
||
height: 10px;
|
||
border-radius: 3px;
|
||
display: inline-block;
|
||
}
|
||
|
||
.legend-name {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
color: var(--text);
|
||
font-weight: 500;
|
||
}
|
||
|
||
.legend-val {
|
||
font-weight: 700;
|
||
color: var(--text);
|
||
}
|
||
|
||
/* SVG Bar Trend Chart */
|
||
.trend-chart-box {
|
||
width: 100%;
|
||
overflow-x: auto;
|
||
padding: 10px 0;
|
||
}
|
||
|
||
/* Interactive Sprint Comparator */
|
||
.comparator-panel {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 22px;
|
||
margin-bottom: 24px;
|
||
box-shadow: var(--shadow-sm);
|
||
}
|
||
|
||
.comparator-selectors {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 14px;
|
||
margin-bottom: 20px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.comparator-matrix {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||
gap: 14px;
|
||
}
|
||
|
||
.matrix-card {
|
||
background: var(--bg);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius);
|
||
padding: 14px;
|
||
text-align: center;
|
||
}
|
||
|
||
.matrix-title {
|
||
font-size: 11px;
|
||
color: var(--text-muted);
|
||
font-weight: 600;
|
||
margin-bottom: 8px;
|
||
}
|
||
|
||
.matrix-comparison-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 12px;
|
||
font-size: 16px;
|
||
font-weight: 800;
|
||
}
|
||
|
||
.matrix-val-a {
|
||
color: #3b82f6;
|
||
}
|
||
|
||
.matrix-vs {
|
||
font-size: 11px;
|
||
color: #94a3b8;
|
||
font-weight: 400;
|
||
}
|
||
|
||
.matrix-val-b {
|
||
color: #10b981;
|
||
}
|
||
|
||
.matrix-delta {
|
||
font-size: 11px;
|
||
font-weight: 700;
|
||
margin-top: 6px;
|
||
}
|
||
|
||
.matrix-delta.positive {
|
||
color: #16a34a;
|
||
}
|
||
|
||
.matrix-delta.negative {
|
||
color: #dc2626;
|
||
}
|
||
|
||
/* Member Velocity & Growth Grid */
|
||
.growth-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
||
gap: 16px;
|
||
margin-bottom: 28px;
|
||
}
|
||
|
||
.growth-card {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 18px;
|
||
box-shadow: var(--shadow-sm);
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 12px;
|
||
}
|
||
|
||
.growth-card-top {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.growth-member-info {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
|
||
.growth-delta-pill {
|
||
font-size: 11px;
|
||
font-weight: 800;
|
||
padding: 3px 8px;
|
||
border-radius: 20px;
|
||
}
|
||
|
||
.growth-delta-pill.positive {
|
||
background: #dcfce7;
|
||
color: #15803d;
|
||
}
|
||
|
||
.growth-delta-pill.negative {
|
||
background: #fee2e2;
|
||
color: #b91c1c;
|
||
}
|
||
|
||
.growth-delta-pill.neutral {
|
||
background: #f1f5f9;
|
||
color: #475569;
|
||
}
|
||
|
||
.growth-bars-box {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 6px;
|
||
}
|
||
|
||
.bar-label-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 11px;
|
||
color: var(--text-muted);
|
||
}
|
||
|
||
.multi-progress-bar {
|
||
height: 8px;
|
||
background: #e2e8f0;
|
||
border-radius: 4px;
|
||
overflow: hidden;
|
||
display: flex;
|
||
width: 100%;
|
||
}
|
||
|
||
.bar-segment {
|
||
height: 100%;
|
||
transition: width 0.3s;
|
||
}
|
||
|
||
/* Time tracking scorecard */
|
||
.time-scorecard-section {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 22px;
|
||
margin-bottom: 28px;
|
||
box-shadow: var(--shadow-sm);
|
||
}
|
||
|
||
.time-table {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
font-size: 13px;
|
||
margin-top: 14px;
|
||
}
|
||
|
||
.time-table th {
|
||
text-align: right;
|
||
padding: 10px 14px;
|
||
background: var(--surface-subtle);
|
||
color: var(--text-muted);
|
||
font-weight: 700;
|
||
border-bottom: 1px solid var(--border);
|
||
}
|
||
|
||
.time-table td {
|
||
padding: 12px 14px;
|
||
border-bottom: 1px solid var(--border);
|
||
color: var(--text);
|
||
}
|
||
|
||
.time-table tr:hover td {
|
||
background: #f8fafc;
|
||
}
|
||
|
||
/* PRD Repository Section Styles */
|
||
.prd-category-pills {
|
||
display: flex;
|
||
gap: 8px;
|
||
overflow-x: auto;
|
||
padding-bottom: 8px;
|
||
margin-bottom: 20px;
|
||
}
|
||
|
||
.prd-cat-btn {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
padding: 6px 14px;
|
||
border-radius: 20px;
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
color: var(--text-muted);
|
||
cursor: pointer;
|
||
transition: all 0.15s;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.prd-cat-btn:hover {
|
||
border-color: #cbd5e1;
|
||
color: var(--text);
|
||
}
|
||
|
||
.prd-cat-btn.active {
|
||
background: var(--primary);
|
||
color: white;
|
||
border-color: var(--primary);
|
||
}
|
||
|
||
.prd-card-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
|
||
gap: 20px;
|
||
}
|
||
|
||
.prd-card {
|
||
background: var(--surface);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius-lg);
|
||
padding: 20px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: space-between;
|
||
gap: 14px;
|
||
box-shadow: var(--shadow-sm);
|
||
transition: all 0.2s;
|
||
}
|
||
|
||
.prd-card:hover {
|
||
box-shadow: var(--shadow);
|
||
border-color: #cbd5e1;
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
/* Modal Styles */
|
||
.modal-overlay {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background: rgba(15, 23, 42, 0.6);
|
||
backdrop-filter: blur(4px);
|
||
z-index: 100;
|
||
display: none;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 20px;
|
||
}
|
||
|
||
.modal-overlay.open {
|
||
display: flex;
|
||
}
|
||
|
||
.modal-dialog {
|
||
background: var(--surface);
|
||
border-radius: var(--radius-lg);
|
||
width: 100%;
|
||
max-width: 900px;
|
||
max-height: 90vh;
|
||
display: flex;
|
||
flex-direction: column;
|
||
box-shadow: var(--shadow-lg);
|
||
animation: modalIn 0.2s ease-out;
|
||
}
|
||
|
||
@keyframes modalIn {
|
||
from { opacity: 0; transform: scale(0.96); }
|
||
to { opacity: 1; transform: scale(1); }
|
||
}
|
||
|
||
.modal-header {
|
||
padding: 18px 24px;
|
||
border-bottom: 1px solid var(--border);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.modal-header h3 {
|
||
font-size: 16px;
|
||
font-weight: 800;
|
||
color: var(--text);
|
||
}
|
||
|
||
.modal-close-btn {
|
||
background: none;
|
||
border: none;
|
||
font-size: 20px;
|
||
color: var(--text-muted);
|
||
cursor: pointer;
|
||
width: 32px;
|
||
height: 32px;
|
||
border-radius: 8px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.modal-close-btn:hover {
|
||
background: var(--surface-subtle);
|
||
color: var(--text);
|
||
}
|
||
|
||
.modal-body {
|
||
padding: 24px;
|
||
overflow-y: auto;
|
||
flex: 1;
|
||
font-size: 14px;
|
||
line-height: 1.8;
|
||
color: #334155;
|
||
}
|
||
|
||
.modal-body pre {
|
||
background: #0f172a;
|
||
color: #f8fafc;
|
||
padding: 16px;
|
||
border-radius: var(--radius);
|
||
overflow-x: auto;
|
||
direction: ltr;
|
||
text-align: left;
|
||
font-family: monospace;
|
||
font-size: 13px;
|
||
margin: 14px 0;
|
||
}
|
||
|
||
.modal-body code {
|
||
background: #e2e8f0;
|
||
padding: 2px 6px;
|
||
border-radius: 4px;
|
||
font-family: monospace;
|
||
font-size: 12px;
|
||
direction: ltr;
|
||
display: inline-block;
|
||
}
|
||
|
||
.modal-footer {
|
||
padding: 14px 24px;
|
||
border-top: 1px solid var(--border);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
background: var(--surface-subtle);
|
||
border-radius: 0 0 var(--radius-lg) var(--radius-lg);
|
||
}
|
||
|
||
/* Toast */
|
||
.toast-popup {
|
||
position: fixed;
|
||
bottom: 24px;
|
||
left: 24px;
|
||
background: #1e293b;
|
||
color: white;
|
||
padding: 12px 20px;
|
||
border-radius: var(--radius);
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
box-shadow: var(--shadow-lg);
|
||
z-index: 1000;
|
||
display: none;
|
||
align-items: center;
|
||
gap: 8px;
|
||
animation: toastIn 0.2s ease-out;
|
||
}
|
||
|
||
@keyframes toastIn {
|
||
from { transform: translateY(20px); opacity: 0; }
|
||
to { transform: translateY(0); opacity: 1; }
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
|
||
<!-- Top Sticky Bar -->
|
||
<header class="top-header">
|
||
<div class="header-inner">
|
||
<div class="brand-section">
|
||
<div class="brand-avatar">E</div>
|
||
<div class="brand-titles">
|
||
<h1>Ekeepa 360 Agile Cockpit <span class="version-tag">v2.6 Enterprise</span></h1>
|
||
<p>اتصال زنده به جیرا (jira.ekeepa-dev.ir) • مدیریت اسپرینتهای فنی (EKD)، مارکتینگ (EMO) و PRDها</p>
|
||
</div>
|
||
</div>
|
||
<div class="header-actions">
|
||
<div class="jira-status-badge">
|
||
<div class="pulse-dot"></div>
|
||
<span>جیرا آنلاین: اسپرینت ۱۰ فعال</span>
|
||
</div>
|
||
<button class="btn-action primary" onclick="copyAllPRDsSummary()">📋 کپی متون PRDها</button>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
<!-- Navigation Tabs -->
|
||
<nav class="tabs-bar-container">
|
||
<div class="tabs-bar">
|
||
<button class="nav-tab active" onclick="switchTab('boards', this)">
|
||
<span>📋 کارها و بردهای تیمی</span>
|
||
<span class="tab-badge" id="tabBadgeTasks">۰</span>
|
||
</button>
|
||
<button class="nav-tab" onclick="switchTab('prds', this)">
|
||
<span>📑 اسناد نیازمندیها (PRDs)</span>
|
||
<span class="tab-badge" id="tabBadgePrds">۳</span>
|
||
</button>
|
||
<button class="nav-tab" onclick="switchTab('analytics', this)">
|
||
<span>📈 هوش اسپرینت و گزارش تحلیلی</span>
|
||
<span class="tab-badge" style="background:#dbeafe; color:#1e40af;">اسپرینت ۱۰ + روند</span>
|
||
</button>
|
||
</div>
|
||
</nav>
|
||
|
||
<main class="app-container">
|
||
|
||
<!-- ========================================== -->
|
||
<!-- TAB 1: BOARDS & TASKS -->
|
||
<!-- ========================================== -->
|
||
<section id="paneBoards" class="tab-pane active">
|
||
|
||
<!-- Board Switcher & Active Context -->
|
||
<div class="board-header">
|
||
<div class="board-toggle-group">
|
||
<button id="btnTrackDev" class="btn-toggle active" onclick="switchTrack('develop')">
|
||
<span>🛠️ برد توسعه فنی (EKD)</span>
|
||
</button>
|
||
<button id="btnTrackMkt" class="btn-toggle" onclick="switchTrack('marketing')">
|
||
<span>📢 برد مارکتینگ و عملیات (EMO)</span>
|
||
</button>
|
||
</div>
|
||
<div class="sprint-context-box">
|
||
<span>وضعیت اسپرینت:</span>
|
||
<span class="sprint-chip" id="sprintChipName">هفته سوم و چهارم شهریور (فعال)</span>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- KPI Summary Cards for Selected Board -->
|
||
<div class="kpi-grid" id="boardKpiGrid">
|
||
<!-- Dynamically rendered -->
|
||
</div>
|
||
|
||
<!-- Robust Filters & Search Bar -->
|
||
<div class="filters-bar">
|
||
<div class="filter-row">
|
||
<select id="sprintSelect" class="filter-select" onchange="handleFiltersChange()">
|
||
<option value="current">📍 اسپرینت فعلی (هفته ۳ و ۴ شهریور)</option>
|
||
<option value="s9">⏮️ اسپرینت گذشته (هفته ۱ و ۲ شهریور)</option>
|
||
<option value="all">🌐 تمام تسکهای اخیر (هر دو اسپرینت)</option>
|
||
</select>
|
||
|
||
<select id="memberSelect" class="filter-select" onchange="handleFiltersChange()">
|
||
<option value="all">👥 همه اعضای تیم</option>
|
||
<!-- Populated dynamically -->
|
||
</select>
|
||
|
||
<select id="statusSelect" class="filter-select" onchange="handleFiltersChange()">
|
||
<option value="all">🎯 همه وضعیتها</option>
|
||
<option value="done">✅ انجام شده (Done / Closed / Resolved)</option>
|
||
<option value="in_progress">⚡ در حال انجام / تست (In Progress / Testing)</option>
|
||
<option value="todo">⏳ برای انجام (To Do / Backlog / Open)</option>
|
||
</select>
|
||
|
||
<select id="timeFilterSelect" class="filter-select" onchange="handleFiltersChange()">
|
||
<option value="all">⏱️ همه تسکها (زماندار و بدون زمان)</option>
|
||
<option value="missing_time">⚠️ فقط فاقد لاگ زمان (بدون ساعت)</option>
|
||
<option value="has_time">✅ فقط دارای لاگ زمان</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="filter-row">
|
||
<label class="checkbox-pill" id="pillRollover">
|
||
<input type="checkbox" id="rolloverOnlyCheck" onchange="handleFiltersChange()">
|
||
<span>⚠️ فقط تسکهای منتقلشده (Spillover)</span>
|
||
</label>
|
||
|
||
<label class="checkbox-pill danger-pill" id="pillChronic">
|
||
<input type="checkbox" id="chronicOnlyCheck" onchange="handleFiltersChange()">
|
||
<span>🔥 فقط تسکهای مزمن (۳+ اسپرینت تاخیر)</span>
|
||
</label>
|
||
|
||
<div class="search-input-wrapper">
|
||
<span class="search-icon">🔍</span>
|
||
<input type="text" id="taskSearchInput" placeholder="جستجو در کلید تسک (EKD-531)، عنوان، نام مسئول..." oninput="handleFiltersChange()">
|
||
</div>
|
||
|
||
<div class="filter-count-badge" id="filterResultCount">نمایش ۷۶ از ۷۶ تسک</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Tasks Cards Grid -->
|
||
<div class="tasks-grid" id="tasksContainer">
|
||
<!-- Rendered dynamically -->
|
||
</div>
|
||
</section>
|
||
|
||
<!-- ========================================== -->
|
||
<!-- TAB 2: PRD REPOSITORY -->
|
||
<!-- ========================================== -->
|
||
<section id="panePrds" class="tab-pane">
|
||
<div class="board-header">
|
||
<div>
|
||
<h2 style="font-size: 16px; font-weight: 800; color: var(--text);">📑 رجیستری مرکزی اسناد نیازمندی محصول (PRDs)</h2>
|
||
<p style="font-size: 12px; color: var(--text-muted);">اسناد فنی و محصولی تدوینشده همراه با نگاشت مستقیم به تسکهای جیرا و لاگ تغییرات</p>
|
||
</div>
|
||
<div>
|
||
<span class="sprint-chip">۳ سند فعال در کدبیس</span>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Category Filter Pills -->
|
||
<div class="prd-category-pills">
|
||
<button class="prd-cat-btn active" onclick="filterPRDsCategory('all', this)">همه اسناد (۳)</button>
|
||
<button class="prd-cat-btn" onclick="filterPRDsCategory('backend', this)">بکاند (Node.js)</button>
|
||
<button class="prd-cat-btn" onclick="filterPRDsCategory('frontend', this)">فرانتاند (Next.js)</button>
|
||
<button class="prd-cat-btn" onclick="filterPRDsCategory('fullstack', this)">فولاستک</button>
|
||
<button class="prd-cat-btn" onclick="filterPRDsCategory('implemented', this)">پیادهسازی شده (Live)</button>
|
||
<button class="prd-cat-btn" onclick="filterPRDsCategory('backlog', this)">در انتظار گرومینگ</button>
|
||
</div>
|
||
|
||
<!-- PRD Cards Grid -->
|
||
<div class="prd-card-grid" id="prdsGrid">
|
||
<!-- Dynamically rendered -->
|
||
</div>
|
||
</section>
|
||
|
||
<!-- ========================================== -->
|
||
<!-- TAB 3: SPRINT ANALYTICS & INTELLIGENCE -->
|
||
<!-- ========================================== -->
|
||
<section id="paneAnalytics" class="tab-pane">
|
||
|
||
<!-- Sub-Toggle for Analytics Track: Dev vs Marketing -->
|
||
<div class="board-header">
|
||
<div class="board-toggle-group">
|
||
<button id="btnAnalyticsDev" class="btn-toggle active" onclick="switchAnalyticsTrack('develop')">
|
||
<span>🛠️ گزارش تحلیلی فنی (EKD Analytics)</span>
|
||
</button>
|
||
<button id="btnAnalyticsMkt" class="btn-toggle" onclick="switchAnalyticsTrack('marketing')">
|
||
<span>📢 گزارش تحلیلی مارکتینگ و عملیات (EMO Analytics)</span>
|
||
</button>
|
||
</div>
|
||
<div class="sprint-context-box">
|
||
<span>بازه ارزیابی:</span>
|
||
<span class="sprint-chip">اسپرینت ۵ تا ۱۰ (تابستان ۱۴۰۵)</span>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Container for Dev Analytics View -->
|
||
<div id="analyticsDevView">
|
||
|
||
<!-- 1. CHRONIC / ZOMBIE TASKS CLINIC -->
|
||
<div class="chronic-clinic-section">
|
||
<div class="clinic-header">
|
||
<div class="clinic-title-box">
|
||
<h3>🗄️ اتاق عارضهیابی و جراحی تسکهای مزمن (Zombie Tasks Clinic)</h3>
|
||
<p>این تسکها بیش از ۳ تا ۷ اسپرینت است که بدون بسته شدن تکرار میشوند. در جدول زیر ریشه اصلی عدم انجام هر تسک و پیشنهاد صریح مدیریتی جهت تعیینتکلیف ارائه شده است:</p>
|
||
</div>
|
||
<div class="clinic-delay-pill">🔥 ۹ تسک مزمن شناسایی شد</div>
|
||
</div>
|
||
<div class="clinic-grid" id="chronicClinicGrid">
|
||
<!-- Dynamically populated from chronicRecommendations -->
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 2. VISUAL CHARTS (DONUT & 5-SPRINT TREND) -->
|
||
<div class="analytics-grid-two">
|
||
<!-- Donut Chart: Sprint 10 Health -->
|
||
<div class="chart-panel-card">
|
||
<div class="chart-panel-header">
|
||
<div>
|
||
<h3>📊 ساختار وضعیت اسپرینت جاری</h3>
|
||
<p>تفکیک سهم کارهای تکمیلشده، در جریان و سهم تسکهای سرریز (Spillover)</p>
|
||
</div>
|
||
</div>
|
||
<div class="donut-wrapper" id="donutContainer">
|
||
<!-- SVG Donut Chart rendered via JS -->
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Multi-Sprint Trend Bar/Line Chart -->
|
||
<div class="chart-panel-card">
|
||
<div class="chart-panel-header">
|
||
<div>
|
||
<h3>📈 روند تحویل اسپرینتها (۵ اسپرینت اخیر)</h3>
|
||
<p>مقایسه کل تسکهای برنامهریزیشده vs تحویلشده و نرخ پیشرفت</p>
|
||
</div>
|
||
</div>
|
||
<div class="trend-chart-box" id="trendChartContainer">
|
||
<!-- SVG Trend Chart rendered via JS -->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 3. INTERACTIVE 2-SPRINT COMPARATOR -->
|
||
<div class="comparator-panel">
|
||
<div class="chart-panel-header">
|
||
<div>
|
||
<h3>🔄 ابزار مقایسه رودرروی اسپرینتها</h3>
|
||
<p>دو اسپرینت دلخواه را انتخاب کنید تا تغییرات شاخصها و ظرفیت تیم کنار هم مقایسه شوند:</p>
|
||
</div>
|
||
</div>
|
||
<div class="comparator-selectors">
|
||
<label style="font-size: 13px; font-weight: 600;">اسپرینت اول (پایه):</label>
|
||
<select id="compSprintA" class="filter-select" onchange="renderSprintComparison()">
|
||
<option value="9">اسپرینت ۹ (هفته ۱ و ۲ شهریور)</option>
|
||
<option value="7">اسپرینت ۷ (هفته ۳ و ۴ مرداد)</option>
|
||
<option value="6">اسپرینت ۶ (هفته ۱ و ۲ مرداد)</option>
|
||
<option value="5">اسپرینت ۵ (هفته آخر تیر)</option>
|
||
</select>
|
||
|
||
<label style="font-size: 13px; font-weight: 600;">اسپرینت دوم (هدف):</label>
|
||
<select id="compSprintB" class="filter-select" onchange="renderSprintComparison()">
|
||
<option value="10" selected>اسپرینت ۱۰ (هفته ۳ و ۴ شهریور - جاری)</option>
|
||
<option value="9">اسپرینت ۹ (هفته ۱ و ۲ شهریور)</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="comparator-matrix" id="comparisonMatrixGrid">
|
||
<!-- Dynamically rendered -->
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 4. TEAM MEMBER OUTPUT & VELOCITY GROWTH -->
|
||
<div class="chart-panel-card" style="margin-bottom: 24px;">
|
||
<div class="chart-panel-header">
|
||
<div>
|
||
<h3>👥 کارنامه رشد و حجم خروجی اعضای تیم (اسپرینت ۹ vs اسپرینت ۱۰)</h3>
|
||
<p>مقایسه تعداد تسکهای Done شده توسط هر عضو تیم و تغییرات نسبت به اسپرینت گذشته</p>
|
||
</div>
|
||
</div>
|
||
<div class="growth-grid" id="memberGrowthGrid">
|
||
<!-- Dynamically populated -->
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 5. TIME-TRACKING TRANSPARENCY SCORECARD -->
|
||
<div class="time-scorecard-section">
|
||
<div class="chart-panel-header">
|
||
<div>
|
||
<h3>⏱️ کارنامه شفافیت و ثبت زمان (Time-Tracking Scorecard)</h3>
|
||
<p>میزان ثبت ساعت کاری و برآورد زمان توسط اعضای تیم در اسپرینت جاری</p>
|
||
</div>
|
||
<div id="timeOverallBadge" class="clinic-delay-pill" style="background:#f59e0b;">
|
||
⚠️ ۶۰.۵٪ تسکها بدون لاگ زمان!
|
||
</div>
|
||
</div>
|
||
<div style="overflow-x: auto;">
|
||
<table class="time-table" id="timeTrackingTable">
|
||
<thead>
|
||
<tr>
|
||
<th>عضو تیم</th>
|
||
<th>نقش</th>
|
||
<th>کل تسکها</th>
|
||
<th>تسکهای زماندار</th>
|
||
<th>تسکهای بدون زمان</th>
|
||
<th>درصد عدم ثبت زمان</th>
|
||
<th>وضعیت انضباط زمانی</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id="timeTrackingTbody">
|
||
<!-- Dynamically populated -->
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!-- Container for Marketing Analytics View -->
|
||
<div id="analyticsMktView" style="display: none;">
|
||
<div class="analytics-grid-two">
|
||
<div class="chart-panel-card">
|
||
<div class="chart-panel-header">
|
||
<div>
|
||
<h3>📢 توزیع تسکهای مارکتینگ و عملیات (EMO)</h3>
|
||
<p>تفکیک حجم کارهای کمپینها، عملیات مالی و لاین تجربه</p>
|
||
</div>
|
||
</div>
|
||
<div class="donut-wrapper" id="mktDonutContainer">
|
||
<!-- SVG Donut for Marketing -->
|
||
</div>
|
||
</div>
|
||
|
||
<div class="chart-panel-card">
|
||
<div class="chart-panel-header">
|
||
<div>
|
||
<h3>⚠️ دیدهبان شفافیت تیم محتوا و سوشال</h3>
|
||
<p>وضعیت ثبت تسکهای هفتگی توسط اعضای تیم مارکتینگ و مدیا</p>
|
||
</div>
|
||
</div>
|
||
<div style="display: flex; flex-direction: column; gap: 12px; margin-top: 14px;">
|
||
<div class="clinic-card" style="border-color: #fde68a; background: #fffbeb;">
|
||
<div class="clinic-card-top">
|
||
<span style="font-size: 13px; font-weight: 700; color: #92400e;">📱 پرستو سماوات (لید سوشال مدیا)</span>
|
||
<span style="background: #fef3c7; color: #92400e; font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 700;">عدم ثبت تسک</span>
|
||
</div>
|
||
<p style="font-size: 12px; color: #78350f; line-height: 1.5;">در بردهای اخیر جیرا تسک فعالی برای تقویم محتوایی یا برنامههای سوشال ثبت نشده است. پیشنهاد میشود خروجیهای هفتگی اینستاگرام به عنوان تیکت در EMO تعریف شوند.</p>
|
||
</div>
|
||
|
||
<div class="clinic-card" style="border-color: #fde68a; background: #fffbeb;">
|
||
<div class="clinic-card-top">
|
||
<span style="font-size: 13px; font-weight: 700; color: #92400e;">🎬 مبینا بیات (ادیتور مدیا و ویدیو)</span>
|
||
<span style="background: #fef3c7; color: #92400e; font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 700;">عدم ثبت تسک</span>
|
||
</div>
|
||
<p style="font-size: 12px; color: #78350f; line-height: 1.5;">پروژههای ادیت ویدیویی و آمادهسازی ریلزها در جیرا لاگ نمیشوند. ثبت تسک برای هر تیزر یا ریلز به ارزیابی ظرفیت تیم مدیا کمک میکند.</p>
|
||
</div>
|
||
|
||
<div class="clinic-card" style="border-color: #bbf7d0; background: #f0fdf4;">
|
||
<div class="clinic-card-top">
|
||
<span style="font-size: 13px; font-weight: 700; color: #166534;">🎪 غزاله مددی (کارمرشیال و لاین تجربه)</span>
|
||
<span style="background: #dcfce7; color: #15803d; font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 700;">۱۸ تسک انجامشده</span>
|
||
</div>
|
||
<p style="font-size: 12px; color: #14532d; line-height: 1.5;">تمام ۱۸ تسک مربوط به هماهنگی رویدادها، کلاسهای سفالگری، شمعسازی و پشتیبانی تجربه با موفقیت ۱۰۰٪ بسته شدهاند.</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</section>
|
||
|
||
</main>
|
||
|
||
<!-- PRD Full-Content Modal -->
|
||
<div class="modal-overlay" id="prdModalOverlay" onclick="if(event.target === this) closeModal()">
|
||
<div class="modal-dialog">
|
||
<div class="modal-header">
|
||
<div>
|
||
<span id="modalPrdCategory" style="font-size: 11px; font-weight: 700; background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 4px;"></span>
|
||
<h3 id="modalPrdTitle" style="margin-top: 4px;"></h3>
|
||
</div>
|
||
<button class="modal-close-btn" onclick="closeModal()">✕</button>
|
||
</div>
|
||
<div class="modal-body" id="modalPrdBody">
|
||
<!-- Rendered markdown / preview content -->
|
||
</div>
|
||
<div class="modal-footer">
|
||
<div style="font-size: 12px; color: var(--text-muted);" id="modalPrdVersionInfo"></div>
|
||
<div style="display: flex; gap: 8px;">
|
||
<button class="btn-action" onclick="copyModalContent()">📋 کپی متن سند</button>
|
||
<button class="btn-action primary" id="btnModalDownload" onclick="handleModalDownload()">⬇️ دانلود مستقیم فایل MD</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Toast Notification -->
|
||
<div class="toast-popup" id="toast">پیام سیستم</div>
|
||
|
||
<!-- ========================================== -->
|
||
<!-- EMBEDDED DATA PLACEHOLDERS -->
|
||
<!-- ========================================== -->
|
||
<script>
|
||
/* __COCKPIT_DATA_START__ */
|
||
window.__COCKPIT_DATA__ = null;
|
||
/* __COCKPIT_DATA_END__ */
|
||
|
||
/* __PRDS_DATA_START__ */
|
||
window.__PRDS_DATA__ = [];
|
||
/* __PRDS_DATA_END__ */
|
||
</script>
|
||
|
||
<!-- ========================================== -->
|
||
<!-- APPLICATION JAVASCRIPT -->
|
||
<!-- ========================================== -->
|
||
<script>
|
||
let currentTrack = "develop"; // "develop" | "marketing"
|
||
let currentAnalyticsTrack = "develop";
|
||
let currentSprintFilter = "current";
|
||
let currentMemberFilter = "all";
|
||
let currentStatusFilter = "all";
|
||
let currentTimeFilter = "all";
|
||
let currentPrdCategory = "all";
|
||
let currentActiveModalPrd = null;
|
||
|
||
window.addEventListener("hashchange", checkHashRoute);
|
||
function checkHashRoute() {
|
||
const hash = window.location.hash.replace("#", "");
|
||
if (hash === "analytics" || hash === "prds" || hash === "boards") {
|
||
const btn = document.querySelector(`button[onclick*="'${hash}'"]`);
|
||
switchTab(hash, btn);
|
||
}
|
||
}
|
||
|
||
document.addEventListener("DOMContentLoaded", () => {
|
||
initApp();
|
||
checkHashRoute();
|
||
});
|
||
|
||
function initApp() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const prds = window.__PRDS_DATA__;
|
||
|
||
if (!data) {
|
||
console.error("Cockpit data not found.");
|
||
return;
|
||
}
|
||
|
||
// Update badge counters
|
||
const s10Count = (data.issues && data.issues.s10) ? data.issues.s10.length : 0;
|
||
document.getElementById("tabBadgeTasks").innerText = s10Count.toLocaleString("fa-IR");
|
||
document.getElementById("tabBadgePrds").innerText = (prds ? prds.length : 0).toLocaleString("fa-IR");
|
||
|
||
populateMemberDropdown(data.teamMembers);
|
||
renderBoardKPIs();
|
||
renderTasks();
|
||
renderPRDs();
|
||
renderAnalytics();
|
||
}
|
||
|
||
/* Tab Switching */
|
||
function switchTab(tabId, btn) {
|
||
document.querySelectorAll(".nav-tab").forEach(t => t.classList.remove("active"));
|
||
if (btn) btn.classList.add("active");
|
||
|
||
document.querySelectorAll(".tab-pane").forEach(p => p.classList.remove("active"));
|
||
if (tabId === "boards") document.getElementById("paneBoards").classList.add("active");
|
||
if (tabId === "prds") document.getElementById("panePrds").classList.add("active");
|
||
if (tabId === "analytics") {
|
||
document.getElementById("paneAnalytics").classList.add("active");
|
||
renderAnalytics();
|
||
}
|
||
}
|
||
|
||
/* Track Switching (Dev vs Marketing) in Tab 1 */
|
||
function switchTrack(track) {
|
||
currentTrack = track;
|
||
document.getElementById("btnTrackDev").classList.toggle("active", track === "develop");
|
||
document.getElementById("btnTrackMkt").classList.toggle("active", track === "marketing");
|
||
|
||
const sprintSel = document.getElementById("sprintSelect");
|
||
if (track === "marketing") {
|
||
sprintSel.style.display = "none";
|
||
document.getElementById("sprintChipName").innerText = "برد کانبان مارکتینگ (EMO)";
|
||
} else {
|
||
sprintSel.style.display = "inline-block";
|
||
document.getElementById("sprintChipName").innerText = "هفته سوم و چهارم شهریور (فعال)";
|
||
}
|
||
|
||
// Reset member filter to all when track changes to avoid cross-track mismatch
|
||
currentMemberFilter = "all";
|
||
document.getElementById("memberSelect").value = "all";
|
||
|
||
populateMemberDropdown(window.__COCKPIT_DATA__.teamMembers);
|
||
renderBoardKPIs();
|
||
renderTasks();
|
||
}
|
||
|
||
/* Member Dropdown population */
|
||
function populateMemberDropdown(members) {
|
||
const select = document.getElementById("memberSelect");
|
||
select.innerHTML = '<option value="all">👥 همه اعضای تیم</option>';
|
||
|
||
// Add unassigned option
|
||
const optUnassigned = document.createElement("option");
|
||
optUnassigned.value = "unassigned";
|
||
optUnassigned.innerText = "❓ بدون مسئول (Unassigned)";
|
||
select.appendChild(optUnassigned);
|
||
|
||
Object.values(members).forEach(m => {
|
||
if (currentTrack === "develop" && m.track === "marketing") return;
|
||
if (currentTrack === "marketing" && m.track === "develop") return;
|
||
|
||
const opt = document.createElement("option");
|
||
opt.value = m.id;
|
||
opt.innerText = `${m.avatar} ${m.name} (${m.role})`;
|
||
select.appendChild(opt);
|
||
});
|
||
}
|
||
|
||
/* Render KPI Cards for Tab 1 */
|
||
function renderBoardKPIs() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const kpiContainer = document.getElementById("boardKpiGrid");
|
||
kpiContainer.innerHTML = "";
|
||
|
||
if (currentTrack === "develop") {
|
||
const s = data.stats.s10;
|
||
kpiContainer.innerHTML = `
|
||
<div class="kpi-card">
|
||
<div class="kpi-info">
|
||
<h6>کل تسکهای اسپرینت</h6>
|
||
<div class="kpi-number">${s.total.toLocaleString("fa-IR")}</div>
|
||
<div class="kpi-subtext">اسپرینت جاری (شهریور)</div>
|
||
</div>
|
||
<div class="kpi-icon" style="background: #eef2ff; color: #4f46e5;">📋</div>
|
||
</div>
|
||
<div class="kpi-card">
|
||
<div class="kpi-info">
|
||
<h6>تسکهای انجامشده (Done)</h6>
|
||
<div class="kpi-number" style="color: var(--success);">${s.done.toLocaleString("fa-IR")}</div>
|
||
<div class="kpi-subtext">نرخ پیشرفت: ${s.completionRate}٪</div>
|
||
</div>
|
||
<div class="kpi-icon" style="background: var(--success-bg); color: var(--success);">🚀</div>
|
||
</div>
|
||
<div class="kpi-card">
|
||
<div class="kpi-info">
|
||
<h6>در حال انجام / تست</h6>
|
||
<div class="kpi-number" style="color: var(--info);">${s.inProgress.toLocaleString("fa-IR")}</div>
|
||
<div class="kpi-subtext">توسعه، تحلیل و تست</div>
|
||
</div>
|
||
<div class="kpi-icon" style="background: var(--info-bg); color: var(--info);">⚡</div>
|
||
</div>
|
||
<div class="kpi-card">
|
||
<div class="kpi-info">
|
||
<h6>تسکهای سرریز (Spillover)</h6>
|
||
<div class="kpi-number" style="color: #b45309;">${s.rollovers.toLocaleString("fa-IR")}</div>
|
||
<div class="kpi-subtext">۴۸.۷٪ ظرفیت از قبل آمده</div>
|
||
</div>
|
||
<div class="kpi-icon" style="background: var(--warning-bg); color: #b45309;">⚠️</div>
|
||
</div>
|
||
`;
|
||
} else {
|
||
const emo = data.stats.emo;
|
||
kpiContainer.innerHTML = `
|
||
<div class="kpi-card">
|
||
<div class="kpi-info">
|
||
<h6>کل تسکهای اخیر مارکتینگ</h6>
|
||
<div class="kpi-number">${emo.total.toLocaleString("fa-IR")}</div>
|
||
<div class="kpi-subtext">پروژه EMO</div>
|
||
</div>
|
||
<div class="kpi-icon" style="background: #eef2ff; color: #4f46e5;">📢</div>
|
||
</div>
|
||
<div class="kpi-card">
|
||
<div class="kpi-info">
|
||
<h6>تسکهای تکمیل شده</h6>
|
||
<div class="kpi-number" style="color: var(--success);">${emo.done.toLocaleString("fa-IR")}</div>
|
||
<div class="kpi-subtext">عملیات و کمپینها</div>
|
||
</div>
|
||
<div class="kpi-icon" style="background: var(--success-bg); color: var(--success);">✅</div>
|
||
</div>
|
||
<div class="kpi-card">
|
||
<div class="kpi-info">
|
||
<h6>در جریان / نیازمند پیگیری</h6>
|
||
<div class="kpi-number" style="color: var(--info);">${(emo.inProgress + emo.open).toLocaleString("fa-IR")}</div>
|
||
<div class="kpi-subtext">تیکتهای باز</div>
|
||
</div>
|
||
<div class="kpi-icon" style="background: var(--info-bg); color: var(--info);">⏳</div>
|
||
</div>
|
||
`;
|
||
}
|
||
}
|
||
|
||
/* Filters change handler */
|
||
function handleFiltersChange() {
|
||
currentSprintFilter = document.getElementById("sprintSelect").value;
|
||
currentMemberFilter = document.getElementById("memberSelect").value;
|
||
currentStatusFilter = document.getElementById("statusSelect").value;
|
||
currentTimeFilter = document.getElementById("timeFilterSelect").value;
|
||
|
||
const rolloverCheck = document.getElementById("rolloverOnlyCheck");
|
||
const chronicCheck = document.getElementById("chronicOnlyCheck");
|
||
document.getElementById("pillRollover").classList.toggle("active", rolloverCheck.checked);
|
||
document.getElementById("pillChronic").classList.toggle("active", chronicCheck.checked);
|
||
|
||
renderTasks();
|
||
}
|
||
|
||
/* Render Tasks in Tab 1 */
|
||
function renderTasks() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const container = document.getElementById("tasksContainer");
|
||
container.innerHTML = "";
|
||
|
||
let list = [];
|
||
if (currentTrack === "develop") {
|
||
if (currentSprintFilter === "current") list = data.issues.s10 || [];
|
||
else if (currentSprintFilter === "s9") list = data.issues.s9 || [];
|
||
else list = [...(data.issues.s10 || []), ...(data.issues.s9 || [])];
|
||
} else {
|
||
list = data.issues.emo || [];
|
||
}
|
||
|
||
const searchQuery = document.getElementById("taskSearchInput").value.trim().toLowerCase();
|
||
const rolloverOnly = document.getElementById("rolloverOnlyCheck").checked;
|
||
const chronicOnly = document.getElementById("chronicOnlyCheck").checked;
|
||
|
||
const filtered = list.filter(t => {
|
||
// Assignee Filter (Exact ID or Unassigned or Tolerant Match)
|
||
if (currentMemberFilter !== "all") {
|
||
if (currentMemberFilter === "unassigned") {
|
||
if (t.assigneeId) return false;
|
||
} else {
|
||
if (t.assigneeId !== currentMemberFilter && !t.assigneeName.toLowerCase().includes(currentMemberFilter.toLowerCase())) {
|
||
return false;
|
||
}
|
||
}
|
||
}
|
||
|
||
// Status Category Filter (Matches Jira semantic categories)
|
||
if (currentStatusFilter !== "all") {
|
||
if (currentStatusFilter === "done") {
|
||
if (t.statusCategory !== "done" && t.status !== "Closed" && t.status !== "Resolved" && t.status !== "Done") return false;
|
||
} else if (currentStatusFilter === "in_progress") {
|
||
if (t.statusCategory !== "indeterminate" && t.status !== "In Progress" && t.status !== "Testing" && t.status !== "Analysis") return false;
|
||
} else if (currentStatusFilter === "todo") {
|
||
if (t.statusCategory !== "new" && t.status !== "Open" && t.status !== "To Do" && t.status !== "Backlog") return false;
|
||
}
|
||
}
|
||
|
||
// Time Filter
|
||
if (currentTimeFilter === "missing_time" && t.hasTimeLog) return false;
|
||
if (currentTimeFilter === "has_time" && !t.hasTimeLog) return false;
|
||
|
||
// Rollover Checkbox
|
||
if (rolloverOnly && !t.isRollover) return false;
|
||
|
||
// Chronic Checkbox (>= 3 sprints delay)
|
||
if (chronicOnly && (t.rolloverCount < 3)) return false;
|
||
|
||
// Search text
|
||
if (searchQuery) {
|
||
const matchKey = (t.key || "").toLowerCase().includes(searchQuery);
|
||
const matchSum = (t.summary || "").toLowerCase().includes(searchQuery);
|
||
const matchAssignee = (t.assigneeName || "").toLowerCase().includes(searchQuery);
|
||
const matchDesc = (t.description || "").toLowerCase().includes(searchQuery);
|
||
if (!matchKey && !matchSum && !matchAssignee && !matchDesc) return false;
|
||
}
|
||
|
||
return true;
|
||
});
|
||
|
||
// Update counter
|
||
document.getElementById("filterResultCount").innerText = `نمایش ${filtered.length.toLocaleString("fa-IR")} از ${list.length.toLocaleString("fa-IR")} تسک`;
|
||
|
||
if (filtered.length === 0) {
|
||
container.innerHTML = `
|
||
<div style="grid-column: 1/-1; text-align: center; padding: 48px; background: white; border-radius: 16px; border: 1px dashed #cbd5e1;">
|
||
<div style="font-size: 36px; margin-bottom: 8px;">🔍</div>
|
||
<h4 style="color: #475569; font-weight: 700;">تسکی با این مشخصات یافت نشد</h4>
|
||
<p style="color: #94a3b8; font-size: 13px;">فیلترها را تغییر دهید یا واژه دیگری را جستجو کنید.</p>
|
||
</div>
|
||
`;
|
||
return;
|
||
}
|
||
|
||
filtered.forEach(task => {
|
||
const isChronic = task.rolloverCount >= 3;
|
||
const card = document.createElement("div");
|
||
card.className = `task-card ${task.isRollover ? 'is-rollover' : ''} ${isChronic ? 'is-chronic' : ''} ${task.statusCategory === 'done' ? 'is-done' : ''}`;
|
||
|
||
let statusClass = "todo";
|
||
let statusPrefix = "⏳ ";
|
||
if (task.statusCategory === "done") {
|
||
statusClass = "done";
|
||
statusPrefix = "✅ ";
|
||
} else if (task.statusCategory === "indeterminate") {
|
||
statusClass = "in_progress";
|
||
statusPrefix = "⚡ ";
|
||
}
|
||
|
||
let alertBanner = "";
|
||
if (isChronic && task.chronicRecommendation) {
|
||
alertBanner = `
|
||
<div class="chronic-alert-banner">
|
||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||
<span>🔥 <strong>تسک مزمن (${task.rolloverCount} اسپرینت تاخیر)</strong></span>
|
||
<span class="chronic-rec-pill" style="background:${task.chronicRecommendation.actionColor}20; color:${task.chronicRecommendation.actionColor};">${task.chronicRecommendation.actionBadge}</span>
|
||
</div>
|
||
<div style="font-size: 11px;">${task.chronicRecommendation.recommendation}</div>
|
||
</div>
|
||
`;
|
||
} else if (task.isRollover) {
|
||
alertBanner = `
|
||
<div class="rollover-alert-banner">
|
||
<span>⚠️</span>
|
||
<span><strong>${task.rolloverCount} اسپرینت تاخیر:</strong> انتقال یافته از ${task.previousSprints.join("، ")}</span>
|
||
</div>
|
||
`;
|
||
}
|
||
|
||
let timeHtml = "";
|
||
if (task.hasTimeLog) {
|
||
const tText = task.timeSpent ? `صرفشده: ${task.timeSpent}` : `تخمین: ${task.timeEstimate}`;
|
||
timeHtml = `<span class="time-badge">⏱️ ${tText}</span>`;
|
||
} else {
|
||
timeHtml = `<span class="time-badge missing">⚠️ بدون لاگ زمان</span>`;
|
||
}
|
||
|
||
let prdButton = "";
|
||
if (task.hasPRD) {
|
||
prdButton = `<button class="btn-view-prd" onclick="openPRDByTaskKey('${task.key}')">📄 مشاهده PRD</button>`;
|
||
}
|
||
|
||
card.innerHTML = `
|
||
<div>
|
||
<div class="task-card-header">
|
||
<span class="task-key-tag">${task.key}</span>
|
||
<span class="task-status-pill ${statusClass}">${statusPrefix}${task.status}</span>
|
||
</div>
|
||
<h4 class="task-title">${task.summary}</h4>
|
||
<p class="task-desc">${task.description || "بدون توضیحات تکمیلی"}</p>
|
||
${alertBanner}
|
||
</div>
|
||
|
||
<div class="task-card-footer">
|
||
<div class="assignee-chip">
|
||
<div class="assignee-avatar">${task.userAvatar}</div>
|
||
<div>
|
||
<span class="assignee-name">${task.assigneeName}</span>
|
||
<span class="assignee-role">${task.roleLabel}</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="task-badges-row">
|
||
${timeHtml}
|
||
${prdButton}
|
||
</div>
|
||
</div>
|
||
`;
|
||
container.appendChild(card);
|
||
});
|
||
}
|
||
|
||
/* ========================================== */
|
||
/* TAB 3: ANALYTICS & EXECUTIVE REPORTS */
|
||
/* ========================================== */
|
||
function switchAnalyticsTrack(track) {
|
||
currentAnalyticsTrack = track;
|
||
document.getElementById("btnAnalyticsDev").classList.toggle("active", track === "develop");
|
||
document.getElementById("btnAnalyticsMkt").classList.toggle("active", track === "marketing");
|
||
|
||
document.getElementById("analyticsDevView").style.display = track === "develop" ? "block" : "none";
|
||
document.getElementById("analyticsMktView").style.display = track === "marketing" ? "block" : "none";
|
||
|
||
if (track === "marketing") renderMarketingAnalytics();
|
||
}
|
||
|
||
function renderAnalytics() {
|
||
renderChronicClinic();
|
||
renderDonutChart();
|
||
renderTrendChart();
|
||
renderSprintComparison();
|
||
renderMemberGrowth();
|
||
renderTimeTrackingTable();
|
||
}
|
||
|
||
/* 1. Chronic Clinic Grid */
|
||
function renderChronicClinic() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const grid = document.getElementById("chronicClinicGrid");
|
||
grid.innerHTML = "";
|
||
|
||
const s10 = data.issues.s10 || [];
|
||
const chronicTasks = s10.filter(t => t.rolloverCount >= 3 && t.chronicRecommendation);
|
||
|
||
chronicTasks.sort((a, b) => b.rolloverCount - a.rolloverCount);
|
||
|
||
chronicTasks.forEach(task => {
|
||
const rec = task.chronicRecommendation;
|
||
const card = document.createElement("div");
|
||
card.className = "clinic-card";
|
||
card.innerHTML = `
|
||
<div class="clinic-card-top">
|
||
<span class="task-key-tag">${task.key}</span>
|
||
<span class="clinic-delay-pill">🔥 ${task.rolloverCount} اسپرینت تاخیر</span>
|
||
</div>
|
||
<h4>${task.summary}</h4>
|
||
<div style="font-size: 11px; color: var(--text-muted);">
|
||
مسئول: <strong>${task.assigneeName}</strong> • وضعیت فعلی: <strong style="color:#2563eb;">${task.status}</strong>
|
||
</div>
|
||
|
||
<div class="clinic-cause-box">
|
||
<strong>🔍 ریشهیابی و علت تاخیر:</strong>
|
||
${rec.rootCause}
|
||
</div>
|
||
|
||
<div class="clinic-rec-box">
|
||
<strong>💡 پیشنهاد صریح پروداکت / مدیریت:</strong>
|
||
${rec.recommendation}
|
||
</div>
|
||
|
||
<div class="clinic-action-footer">
|
||
<span style="color:#64748b;">پیشینهها: ${task.previousSprints.slice(0, 3).join("، ")}${task.previousSprints.length > 3 ? '...' : ''}</span>
|
||
<span class="chronic-rec-pill" style="background:${rec.actionColor}20; color:${rec.actionColor}; font-size:11px;">${rec.actionBadge}</span>
|
||
</div>
|
||
`;
|
||
grid.appendChild(card);
|
||
});
|
||
}
|
||
|
||
/* 2. Donut Chart (Sprint Health) */
|
||
function renderDonutChart() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const s = data.stats.s10;
|
||
const container = document.getElementById("donutContainer");
|
||
|
||
const total = s.total || 1;
|
||
const done = s.done;
|
||
const inProg = s.inProgress;
|
||
const todo = s.todo;
|
||
const roll = s.rollovers;
|
||
|
||
const pDone = Math.round(done / total * 100);
|
||
const pInProg = Math.round(inProg / total * 100);
|
||
const pTodo = 100 - pDone - pInProg;
|
||
|
||
const stop1 = pDone;
|
||
const stop2 = Math.min(100, pDone + pInProg);
|
||
|
||
container.innerHTML = `
|
||
<div style="width: 170px; height: 170px; border-radius: 50%; background: conic-gradient(#10b981 0% ${stop1}%, #0284c7 ${stop1}% ${stop2}%, #cbd5e1 ${stop2}% 100%); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.04);">
|
||
<div style="width: 124px; height: 124px; border-radius: 50%; background: #ffffff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);">
|
||
<div style="font-size: 26px; font-weight: 900; color: #0f172a; line-height: 1;">${s.completionRate}٪</div>
|
||
<div style="font-size: 11px; color: #64748b; margin-top: 4px;">نرخ موفقیت</div>
|
||
</div>
|
||
</div> </div>
|
||
|
||
<div class="donut-legend">
|
||
<div class="legend-item">
|
||
<span class="legend-name"><span class="legend-bullet" style="background:#10b981;"></span>انجامشده (Done)</span>
|
||
<span class="legend-val">${done} (${pDone}٪)</span>
|
||
</div>
|
||
<div class="legend-item">
|
||
<span class="legend-name"><span class="legend-bullet" style="background:#0284c7;"></span>در حال انجام (In Progress)</span>
|
||
<span class="legend-val">${inProg} (${pInProg}٪)</span>
|
||
</div>
|
||
<div class="legend-item">
|
||
<span class="legend-name"><span class="legend-bullet" style="background:#cbd5e1;"></span>برای انجام (To Do)</span>
|
||
<span class="legend-val">${todo} (${pTodo}٪)</span>
|
||
</div>
|
||
<div class="legend-item" style="border-top:1px dashed #e2e8f0; padding-top:6px; margin-top:2px;">
|
||
<span class="legend-name"><span class="legend-bullet" style="background:#f59e0b;"></span>تسکهای سرریز (Spillover)</span>
|
||
<span class="legend-val" style="color:#b45309;">${roll} (${Math.round(roll/total*100)}٪)</span>
|
||
</div>
|
||
</div>
|
||
`;
|
||
}
|
||
|
||
/* 3. Trend Chart (5 Historical Sprints) */
|
||
function renderTrendChart() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const sprints = data.historicalSprints || [];
|
||
const container = document.getElementById("trendChartContainer");
|
||
|
||
let barsHtml = "";
|
||
const maxVal = 100; // max scale
|
||
|
||
sprints.forEach((sp, idx) => {
|
||
const heightTotal = Math.round((sp.total / maxVal) * 120);
|
||
const heightDone = Math.round((sp.done / maxVal) * 120);
|
||
|
||
barsHtml += `
|
||
<div style="display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 60px;">
|
||
<div style="font-size: 11px; font-weight: 800; color: #10b981;">${sp.rate}٪</div>
|
||
<div style="height: 130px; display: flex; align-items: flex-end; gap: 4px;">
|
||
<!-- Planned bar -->
|
||
<div style="width: 16px; height: ${heightTotal}px; background: #e2e8f0; border-radius: 4px 4px 0 0; position: relative;" title="کل تسکها: ${sp.total}"></div>
|
||
<!-- Done bar -->
|
||
<div style="width: 16px; height: ${heightDone}px; background: #4f46e5; border-radius: 4px 4px 0 0; position: relative;" title="تکمیل شده: ${sp.done}"></div>
|
||
</div>
|
||
<div style="font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap;">اسپرینت ${sp.id}</div>
|
||
<div style="font-size: 10px; color: var(--text-muted);">${sp.done}/${sp.total}</div>
|
||
</div>
|
||
`;
|
||
});
|
||
|
||
container.innerHTML = `
|
||
<div style="display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 10px 10px 0 10px; border-bottom: 2px solid #e2e8f0;">
|
||
${barsHtml}
|
||
</div>
|
||
<div style="display: flex; justify-content: center; gap: 20px; margin-top: 14px; font-size: 11px; color: var(--text-muted);">
|
||
<span style="display: flex; align-items: center; gap: 6px;"><span style="width:10px; height:10px; background:#e2e8f0; border-radius:2px;"></span>کل تسکها (Planned)</span>
|
||
<span style="display: flex; align-items: center; gap: 6px;"><span style="width:10px; height:10px; background:#4f46e5; border-radius:2px;"></span>انجامشده (Done)</span>
|
||
<span style="display: flex; align-items: center; gap: 6px;"><strong style="color:#10b981;">٪</strong> نرخ موفقیت</span>
|
||
</div>
|
||
`;
|
||
}
|
||
|
||
/* 4. Sprint Comparator */
|
||
function renderSprintComparison() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const idA = parseInt(document.getElementById("compSprintA").value, 10);
|
||
const idB = parseInt(document.getElementById("compSprintB").value, 10);
|
||
const grid = document.getElementById("comparisonMatrixGrid");
|
||
|
||
const spA = data.historicalSprints.find(s => s.id === idA) || data.historicalSprints[3];
|
||
const spB = data.historicalSprints.find(s => s.id === idB) || data.historicalSprints[4];
|
||
|
||
const diffTotal = spB.total - spA.total;
|
||
const diffDone = spB.done - spA.done;
|
||
const diffRate = (spB.rate - spA.rate).toFixed(1);
|
||
const diffSpill = spB.spillover - spA.spillover;
|
||
|
||
grid.innerHTML = `
|
||
<div class="matrix-card">
|
||
<div class="matrix-title">کل تسکهای اسپرینت</div>
|
||
<div class="matrix-comparison-row">
|
||
<span class="matrix-val-a">${spA.total}</span>
|
||
<span class="matrix-vs">در برابر</span>
|
||
<span class="matrix-val-b">${spB.total}</span>
|
||
</div>
|
||
<div class="matrix-delta ${diffTotal >= 0 ? 'positive' : 'negative'}">
|
||
${diffTotal >= 0 ? '+' : ''}${diffTotal} تسک
|
||
</div>
|
||
</div>
|
||
|
||
<div class="matrix-card">
|
||
<div class="matrix-title">تسکهای انجامشده (Done)</div>
|
||
<div class="matrix-comparison-row">
|
||
<span class="matrix-val-a">${spA.done}</span>
|
||
<span class="matrix-vs">در برابر</span>
|
||
<span class="matrix-val-b">${spB.done}</span>
|
||
</div>
|
||
<div class="matrix-delta ${diffDone >= 0 ? 'positive' : 'negative'}">
|
||
${diffDone >= 0 ? '+' : ''}${diffDone} تسک
|
||
</div>
|
||
</div>
|
||
|
||
<div class="matrix-card">
|
||
<div class="matrix-title">نرخ موفقیت اسپرینت</div>
|
||
<div class="matrix-comparison-row">
|
||
<span class="matrix-val-a">${spA.rate}٪</span>
|
||
<span class="matrix-vs">در برابر</span>
|
||
<span class="matrix-val-b">${spB.rate}٪</span>
|
||
</div>
|
||
<div class="matrix-delta ${parseFloat(diffRate) >= 0 ? 'positive' : 'negative'}">
|
||
${parseFloat(diffRate) >= 0 ? '+' : ''}${diffRate}٪ تغییر
|
||
</div>
|
||
</div>
|
||
|
||
<div class="matrix-card">
|
||
<div class="matrix-title">تسکهای سرریز (Spillover)</div>
|
||
<div class="matrix-comparison-row">
|
||
<span class="matrix-val-a">${spA.spillover}</span>
|
||
<span class="matrix-vs">در برابر</span>
|
||
<span class="matrix-val-b">${spB.spillover}</span>
|
||
</div>
|
||
<div class="matrix-delta ${diffSpill <= 0 ? 'positive' : 'negative'}">
|
||
${diffSpill > 0 ? '+' : ''}${diffSpill} تسک تاخیری
|
||
</div>
|
||
</div>
|
||
`;
|
||
}
|
||
|
||
/* 5. Member Velocity & Growth */
|
||
function renderMemberGrowth() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const grid = document.getElementById("memberGrowthGrid");
|
||
grid.innerHTML = "";
|
||
|
||
const members = data.memberComparison || [];
|
||
|
||
members.forEach(m => {
|
||
if (m.s10Total === 0 && m.s9Total === 0) return;
|
||
|
||
const card = document.createElement("div");
|
||
card.className = "growth-card";
|
||
|
||
let pillClass = "neutral";
|
||
let deltaPrefix = "";
|
||
if (m.growthDelta > 0) {
|
||
pillClass = "positive";
|
||
deltaPrefix = "+";
|
||
} else if (m.growthDelta < 0) {
|
||
pillClass = "negative";
|
||
}
|
||
|
||
const totalS10 = m.s10Total || 1;
|
||
const pDone = Math.round((m.s10Done / totalS10) * 100);
|
||
const pInProg = Math.round((m.s10InProgress / totalS10) * 100);
|
||
const pTodo = 100 - pDone - pInProg;
|
||
|
||
card.innerHTML = `
|
||
<div class="growth-card-top">
|
||
<div class="growth-member-info">
|
||
<span style="font-size: 24px;">${m.avatar}</span>
|
||
<div>
|
||
<strong style="font-size: 14px; color: var(--text);">${m.name}</strong>
|
||
<span style="font-size: 11px; color: var(--text-muted); display: block;">${m.role}</span>
|
||
</div>
|
||
</div>
|
||
<span class="growth-delta-pill ${pillClass}">
|
||
${deltaPrefix}${m.growthDelta} Done (${deltaPrefix}${m.growthPct}٪)
|
||
</span>
|
||
</div>
|
||
|
||
<div style="display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px;">
|
||
<span>اسپرینت ۹: <strong>${m.s9Done}</strong> از ${m.s9Total} Done</span>
|
||
<span>اسپرینت ۱۰: <strong style="color:var(--success);">${m.s10Done}</strong> از ${m.s10Total} Done</span>
|
||
</div>
|
||
|
||
<div class="growth-bars-box">
|
||
<div class="bar-label-row">
|
||
<span>توزیع تسکهای اسپرینت ۱۰:</span>
|
||
<span>${m.s10Done} انجامشده • ${m.s10InProgress} جریان • ${m.s10Rollover} تاخیری</span>
|
||
</div>
|
||
<div class="multi-progress-bar">
|
||
<div class="bar-segment" style="width: ${pDone}%; background: #10b981;" title="Done: ${pDone}%"></div>
|
||
<div class="bar-segment" style="width: ${pInProg}%; background: #0284c7;" title="In Progress: ${pInProg}%"></div>
|
||
<div class="bar-segment" style="width: ${pTodo}%; background: #cbd5e1;" title="To Do: ${pTodo}%"></div>
|
||
</div>
|
||
</div>
|
||
`;
|
||
grid.appendChild(card);
|
||
});
|
||
}
|
||
|
||
/* 6. Time Tracking Scorecard Table */
|
||
function renderTimeTrackingTable() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const tbody = document.getElementById("timeTrackingTbody");
|
||
tbody.innerHTML = "";
|
||
|
||
const members = data.memberComparison || [];
|
||
|
||
members.forEach(m => {
|
||
if (m.s10Total === 0) return;
|
||
|
||
const withTime = m.s10TimeLoggedCount;
|
||
const withoutTime = m.s10MissingTimeCount;
|
||
const missingPct = Math.round((withoutTime / m.s10Total) * 100);
|
||
|
||
let badge = '<span style="color:#15803d; font-weight:700;">🟢 انضباط عالی (زماندار)</span>';
|
||
if (missingPct === 100) {
|
||
badge = '<span style="color:#b91c1c; font-weight:700;">🔴 صفر لاگ زمان (نیازمند اخطار)</span>';
|
||
} else if (missingPct > 50) {
|
||
badge = '<span style="color:#b45309; font-weight:700;">🟡 ثبت ناقص زمان</span>';
|
||
}
|
||
|
||
const tr = document.createElement("tr");
|
||
tr.innerHTML = `
|
||
<td><strong>${m.avatar} ${m.name}</strong></td>
|
||
<td style="color:#64748b; font-size:12px;">${m.role}</td>
|
||
<td><strong>${m.s10Total}</strong></td>
|
||
<td><span style="color:#10b981; font-weight:700;">${withTime}</span></td>
|
||
<td><span style="color:#ef4444; font-weight:700;">${withoutTime}</span></td>
|
||
<td><strong>${missingPct}٪</strong></td>
|
||
<td>${badge}</td>
|
||
`;
|
||
tbody.appendChild(tr);
|
||
});
|
||
}
|
||
|
||
/* 7. Marketing Analytics View */
|
||
function renderMarketingAnalytics() {
|
||
const data = window.__COCKPIT_DATA__;
|
||
const emo = data.stats.emo;
|
||
const container = document.getElementById("mktDonutContainer");
|
||
|
||
const total = emo.total || 100;
|
||
const elaheCount = 80;
|
||
const ghazaleCount = 18;
|
||
const saraCount = 2;
|
||
|
||
container.innerHTML = `
|
||
<div class="donut-svg-container">
|
||
<svg width="180" height="180" viewBox="0 0 100 100" style="transform: rotate(-90deg);">
|
||
<circle cx="50" cy="50" r="40" fill="transparent" stroke="#10b981" stroke-width="12"
|
||
stroke-dasharray="201 251.32" stroke-dashoffset="0" />
|
||
<circle cx="50" cy="50" r="40" fill="transparent" stroke="#f59e0b" stroke-width="12"
|
||
stroke-dasharray="45 251.32" stroke-dashoffset="-201" />
|
||
<circle cx="50" cy="50" r="40" fill="transparent" stroke="#ec4899" stroke-width="12"
|
||
stroke-dasharray="5 251.32" stroke-dashoffset="-246" />
|
||
</svg>
|
||
<div class="donut-center-label">
|
||
<div class="donut-center-pct">${total}</div>
|
||
<div class="donut-center-sub">کل تیکتها</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="donut-legend">
|
||
<div class="legend-item">
|
||
<span class="legend-name"><span class="legend-bullet" style="background:#10b981;"></span>کمپین و مالی (الهه)</span>
|
||
<span class="legend-val">۸۰ (۸۰٪)</span>
|
||
</div>
|
||
<div class="legend-item">
|
||
<span class="legend-name"><span class="legend-bullet" style="background:#f59e0b;"></span>لاین تفریحات/تجربه (غزاله)</span>
|
||
<span class="legend-val">۱۸ (۱۸٪)</span>
|
||
</div>
|
||
<div class="legend-item">
|
||
<span class="legend-name"><span class="legend-bullet" style="background:#ec4899;"></span>مدیریت محصول (سارا)</span>
|
||
<span class="legend-val">۲ (۲٪)</span>
|
||
</div>
|
||
</div>
|
||
`;
|
||
}
|
||
|
||
/* ========================================== */
|
||
/* PRD REPOSITORY RENDERING */
|
||
/* ========================================== */
|
||
function renderPRDs() {
|
||
const prds = window.__PRDS_DATA__ || [];
|
||
const grid = document.getElementById("prdsGrid");
|
||
grid.innerHTML = "";
|
||
|
||
const filtered = prds.filter(p => {
|
||
if (currentPrdCategory === "all") return true;
|
||
if (currentPrdCategory === "backend" && p.category === "backend") return true;
|
||
if (currentPrdCategory === "frontend" && p.category === "frontend") return true;
|
||
if (currentPrdCategory === "fullstack" && p.category === "fullstack") return true;
|
||
if (currentPrdCategory === "implemented" && p.status === "implemented") return true;
|
||
if (currentPrdCategory === "backlog" && p.status === "backlog") return true;
|
||
return false;
|
||
});
|
||
|
||
filtered.forEach(p => {
|
||
const card = document.createElement("div");
|
||
card.className = "prd-card";
|
||
card.innerHTML = `
|
||
<div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
|
||
<span class="task-key-tag">${p.jiraKey}</span>
|
||
<span style="font-size: 11px; background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 4px; font-weight: 700;">${p.version}</span>
|
||
</div>
|
||
<h3 style="font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.4; margin-bottom: 6px;">${p.title}</h3>
|
||
<p style="font-size: 12px; color: var(--text-muted); line-height: 1.5;">${p.summary}</p>
|
||
</div>
|
||
|
||
<div style="display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 12px; margin-top: 6px;">
|
||
<span style="font-size: 11px; color: var(--text-muted);">تخمین: ${p.estimateDaysBE || p.estimateDays || 0} روز BE + ${p.estimateDaysFE || 0} روز FE</span>
|
||
<div style="display: flex; gap: 6px;">
|
||
<button class="btn-action" onclick="downloadPRDDirect('${p.id}')">⬇️</button>
|
||
<button class="btn-action primary" onclick="openPRDModalById('${p.id}')">مشاهده سند</button>
|
||
</div>
|
||
</div>
|
||
`;
|
||
grid.appendChild(card);
|
||
});
|
||
}
|
||
|
||
function filterPRDsCategory(cat, btn) {
|
||
currentPrdCategory = cat;
|
||
document.querySelectorAll(".prd-cat-btn").forEach(b => b.classList.remove("active"));
|
||
if (btn) btn.classList.add("active");
|
||
renderPRDs();
|
||
}
|
||
|
||
function openPRDByTaskKey(jiraKey) {
|
||
const prds = window.__PRDS_DATA__ || [];
|
||
const prd = prds.find(p => p.jiraKey === jiraKey);
|
||
if (prd) openPRDModal(prd);
|
||
else showToast("سند PRD برای این تسک یافت نشد.");
|
||
}
|
||
|
||
function openPRDModalById(id) {
|
||
const prds = window.__PRDS_DATA__ || [];
|
||
const prd = prds.find(p => p.id === id);
|
||
if (prd) openPRDModal(prd);
|
||
}
|
||
|
||
function openPRDModal(prd) {
|
||
currentActiveModalPrd = prd;
|
||
document.getElementById("modalPrdCategory").innerText = prd.categoryLabel || prd.category;
|
||
document.getElementById("modalPrdTitle").innerText = `${prd.jiraKey}: ${prd.title}`;
|
||
document.getElementById("modalPrdVersionInfo").innerText = `نسخه سند: ${prd.version} • مسیر: ${prd.filePath}`;
|
||
|
||
const body = document.getElementById("modalPrdBody");
|
||
const cleanContent = escapeHtml(prd.rawContent || "");
|
||
body.innerHTML = `<pre><code>${cleanContent}</code></pre>`;
|
||
|
||
document.getElementById("prdModalOverlay").classList.add("open");
|
||
}
|
||
|
||
function closeModal() {
|
||
document.getElementById("prdModalOverlay").classList.remove("open");
|
||
currentActiveModalPrd = null;
|
||
}
|
||
|
||
function copyModalContent() {
|
||
if (!currentActiveModalPrd || !currentActiveModalPrd.rawContent) return;
|
||
navigator.clipboard.writeText(currentActiveModalPrd.rawContent).then(() => {
|
||
showToast("✅ متن سند PRD در کلیپبورد کپی شد.");
|
||
});
|
||
}
|
||
|
||
function handleModalDownload() {
|
||
if (!currentActiveModalPrd) return;
|
||
downloadPRDDirect(currentActiveModalPrd.id);
|
||
}
|
||
|
||
function downloadPRDDirect(id) {
|
||
const prd = (window.__PRDS_DATA__ || []).find(p => p.id === id);
|
||
if (!prd || !prd.rawContent) return;
|
||
|
||
const blob = new Blob(["\ufeff" + prd.rawContent], { type: "text/markdown;charset=utf-8" });
|
||
const url = URL.createObjectURL(blob);
|
||
const a = document.createElement("a");
|
||
a.href = url;
|
||
a.download = `${prd.id}.md`;
|
||
document.body.appendChild(a);
|
||
a.click();
|
||
document.body.removeChild(a);
|
||
URL.revokeObjectURL(url);
|
||
showToast(`📥 فایل ${prd.id}.md دانلود شد.`);
|
||
}
|
||
|
||
function copyAllPRDsSummary() {
|
||
const prds = window.__PRDS_DATA__ || [];
|
||
let text = "📋 خلاصه تمام اسناد نیازمندی محصول (PRD) اکیپا:\n\n";
|
||
prds.forEach((p, idx) => {
|
||
text += `${idx + 1}. [${p.jiraKey}] ${p.title} (${p.version})\n`;
|
||
text += ` مسیر: ${p.filePath}\n`;
|
||
text += ` خلاصه: ${p.summary}\n\n`;
|
||
});
|
||
navigator.clipboard.writeText(text).then(() => {
|
||
showToast("✅ فهرست کلیه PRDها کپی شد.");
|
||
});
|
||
}
|
||
|
||
function showToast(msg) {
|
||
const toast = document.getElementById("toast");
|
||
toast.innerText = msg;
|
||
toast.style.display = "flex";
|
||
setTimeout(() => {
|
||
toast.style.display = "none";
|
||
}, 3000);
|
||
}
|
||
|
||
function escapeHtml(str) {
|
||
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|
||
'''
|
||
|
||
with open(OUTPUT_PATH, "w", encoding="utf-8") as f:
|
||
f.write(HTML_CONTENT)
|
||
|
||
print(f"✅ Generated comprehensive {OUTPUT_PATH} ({len(HTML_CONTENT)} bytes)")
|