File size: 2,281 Bytes
0a40ab8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{% extends "base.html" %}

{% block title %}View Analysis #{{ analysis.id }} - PoliSage{% endblock %}

{% block content %}
<div class="container mt-4">
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="{{ url_for("index") }}">Dashboard</a></li>
            <li class="breadcrumb-item"><a href="{{ url_for("analysis.list_analyses") }}">Impact Analyses</a></li>
            <li class="breadcrumb-item active" aria-current="page">Analysis #{{ analysis.id }}</li>
        </ol>
    </nav>

    <h2>{{ analysis.analysis_type }} Impact Analysis for: {{ document_title }}</h2>
    <p class="text-muted">Generated: {{ analysis.generated_at.strftime("%Y-%m-%d %H:%M") }} by {{ analysis.generator.username if analysis.generator else "System" }}</p>

    <div class="card mb-4">
        <div class="card-header">
            Analysis Summary
        </div>
        <div class="card-body">
            <dl class="row">
                <dt class="col-sm-3">Document Analyzed</dt>
                <dd class="col-sm-9">{{ analysis.document_type }} ID {{ analysis.document_id }}</dd>

                <dt class="col-sm-3">Analysis Type</dt>
                <dd class="col-sm-9">{{ analysis.analysis_type }}</dd>

                <dt class="col-sm-3">Confidence Score</dt>
                <dd class="col-sm-9">{{ "%.1f"|format(analysis.confidence_score * 100) ~ "%" if analysis.confidence_score is not none else "N/A" }}</dd>
            </dl>
        </div>
    </div>

    <div class="card mb-4">
        <div class="card-header">
            Predicted Impact
        </div>
        <div class="card-body">
            <p>{{ analysis.predicted_impact | nl2br }}</p>
        </div>
    </div>

    <div class="card">
        <div class="card-header">
            Rationale / Explanation
        </div>
        <div class="card-body">
            <p>{{ analysis.rationale | nl2br if analysis.rationale else "No rationale provided." }}</p>
        </div>
        <div class="card-footer">
            <!-- Add buttons for actions like re-running, exporting etc. later -->
            <a href="{{ url_for("analysis.run_analysis") }}" class="btn btn-secondary">Run Another Analysis</a>
        </div>
    </div>

</div>
{% endblock %}