File size: 6,191 Bytes
38f9c15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b838816
18b092e
38f9c15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="it">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Review Queue - Rooting Future</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <nav class="navbar">
        <div class="nav-brand">
            <span class="brand-icon">🌱</span>
            <span class="brand-text">Rooting Future</span>
        </div>
        <div class="nav-links">
            <a href="{{ url_for('index') }}">Dashboard</a>
            <a href="{{ url_for('plans_list') }}">Piani</a>
            <a href="{{ url_for('new_plan') }}">Nuovo Piano</a>
            <a href="{{ url_for('review_queue') }}" class="active">Review Queue</a>
            <a href="{{ url_for('club_profile') }}">🏟️ Profilo Club</a>
            <a href="#" title="Impostazioni">⚙️</a>
        </div>
    </nav>

    <main class="container">
        <header class="page-header">
            <h1>Coda di Review</h1>
            <p class="subtitle">Sezioni prioritizzate per revisione</p>
        </header>

        <!-- Workload Summary -->
        <section class="workload-summary">
            <div class="workload-cards">
                <div class="workload-card">
                    <div class="wl-icon">📋</div>
                    <div class="wl-content">
                        <div class="wl-value">{{ workload.sections_needing_review }}</div>
                        <div class="wl-label">Sezioni da revisionare</div>
                    </div>
                </div>

                <div class="workload-card">
                    <div class="wl-icon">⏱️</div>
                    <div class="wl-content">
                        <div class="wl-value">{{ workload.estimated_review_hours }}h</div>
                        <div class="wl-label">Tempo stimato</div>
                    </div>
                </div>

                <div class="workload-card">
                    <div class="wl-icon">📊</div>
                    <div class="wl-content">
                        <div class="wl-value">{{ workload.average_credibility }}%</div>
                        <div class="wl-label">Credibilità media</div>
                    </div>
                </div>

                <div class="workload-card">
                    <div class="wl-icon">📅</div>
                    <div class="wl-content">
                        <div class="wl-value">{{ workload.suggested_daily_quota }}</div>
                        <div class="wl-label">Quota giornaliera suggerita</div>
                    </div>
                </div>
            </div>

            <div class="workload-actions">
                <button onclick="bulkApprove()" class="btn btn-success">
                    ⚡ Auto-Approva (credibilità ≥80%)
                </button>
            </div>
        </section>

        <!-- Priority Queue -->
        <section class="section">
            <h2>Sezioni Prioritarie</h2>

            {% if queue %}
            <div class="queue-list">
                {% for item in queue %}
                <div class="queue-item priority-{{ 'high' if item.priority > 80 else 'medium' if item.priority > 50 else 'low' }}">
                    <div class="queue-priority">
                        <span class="priority-badge">{{ item.priority|round(0)|int }}</span>
                    </div>

                    <div class="queue-content">
                        <div class="queue-title">
                            <strong>{{ item.club_name }}</strong>
                            <span class="queue-section">{{ item.section_title }}</span>
                        </div>
                        <div class="queue-meta">
                            <span class="credibility {% if item.credibility >= 70 %}high{% elif item.credibility >= 50 %}medium{% else %}low{% endif %}">
                                📊 {{ item.credibility|round(1) }}%
                            </span>
                            <span class="unverified">
                                ⚠️ {{ item.unverified_count }} non verificati
                            </span>
                        </div>
                    </div>

                    <div class="queue-actions">
                        <a href="{{ url_for('plan_detail', plan_id=item.plan_id) }}#section-{{ item.section_id }}"
                           class="btn btn-sm btn-primary">
                            Revisiona
                        </a>
                    </div>
                </div>
                {% endfor %}
            </div>
            {% else %}
            <div class="empty-state success">
                <div class="empty-icon">🎉</div>
                <h3>Tutto revisionato!</h3>
                <p>Non ci sono sezioni in attesa di revisione.</p>
            </div>
            {% endif %}
        </section>

        <!-- Quick Stats by Status -->
        <section class="section">
            <h2>Riepilogo per Status</h2>
            <div class="status-grid">
                {% for status, count in workload.by_status.items() %}
                <div class="status-card">
                    <div class="status-count">{{ count }}</div>
                    <div class="status-label">{{ status }}</div>
                </div>
                {% endfor %}
            </div>
        </section>
    </main>

    <script>
        async function bulkApprove() {
            if (!confirm('Auto-approvare tutte le sezioni con credibilità ≥80%?')) return;

            try {
                const resp = await fetch('/api/bulk-approve', {
                    method: 'POST',
                    headers: {'Content-Type': 'application/json'},
                    body: JSON.stringify({min_credibility: 80})
                });
                const data = await resp.json();
                if (data.success) {
                    alert(`Approvate ${data.approved_count} sezioni`);
                    location.reload();
                }
            } catch (e) {
                alert('Errore: ' + e.message);
            }
        }
    </script>
</body>
</html>