---
type: "Source File"
title: "<section class=\"hero hero-compact\">"
description: "{% extends \"base.html\" %} {% block title %}{{ fig.name }} — Cope Profile{% endblock %} {% block meta_description %}{{ fig.share_paragraph }}{% endblock %} {% block og_title %}{{ fig.name }} Cope Score: {{."
resource: "https://uk.copecheck.com"
tags: ["copecheck", "uk", "source-file", "html"]
timestamp: "2026-08-01T14:47:49Z"
site: "uk"
source_path: "copecheck-uk/templates/figure.html"
---

# <section class="hero hero-compact">

Source path: `copecheck-uk/templates/figure.html`  
Index snapshot generated: `2026-11-24T13:42:54Z`  
File modified: `2026-08-01T14:47:49Z`

```html
{% extends "base.html" %}
{% block title %}{{ fig.name }} — Cope Profile{% endblock %}
{% block meta_description %}{{ fig.share_paragraph }}{% endblock %}
{% block og_title %}{{ fig.name }} Cope Score: {{ "%.0f"|format(fig.cope_score) }}/100{% endblock %}
{% block og_description %}{{ fig.share_paragraph }}{% endblock %}
{% block tw_title %}{{ fig.name }} Cope Score: {{ "%.0f"|format(fig.cope_score) }}/100{% endblock %}
{% block tw_description %}{{ fig.share_paragraph }}{% endblock %}
{% block canonical %}/figure/{{ fig.id }}{% endblock %}

{% block content %}
<section class="hero hero-compact">
    <div class="hero-inner">
        <p class="ai-content-label"><strong>AI-generated scores and analysis</strong> &middot; May contain errors &middot; <a href="/ai-disclosure">Disclosure and methodology</a></p>
        <h1 class="hero-title">{{ fig.name }}</h1>
        <p class="hero-subtitle">{{ fig.role }}{% if fig.party %} &mdash; {{ fig.party }}{% endif %}</p>
    </div>
</section>

<section class="figure-section">
    <div class="figure-profile">
        <div class="figure-profile-header">
            <div class="figure-profile-photo">
                {% if fig.photo_url %}
                <img src="{{ fig.photo_url }}" alt="{{ fig.name }}" class="profile-photo-img">
                {% else %}
                <div class="profile-avatar" style="background-color: {{ categories.get(fig.category, {"colour": "#6c757d", "label": "Uncategorised"}).colour }}20; border-color: {{ categories.get(fig.category, {"colour": "#6c757d", "label": "Uncategorised"}).colour }}">
                    {{ fig.name.split()[0][0] }}{{ fig.name.split()[-1][0] }}
                </div>
                {% endif %}
                <button class="btn btn-small btn-secondary" onclick="generatePortrait('{{ fig.id }}')">
                    <span class="btn-text">Generate Portrait</span>
                    <span class="btn-loading" style="display:none"><span class="spinner"></span></span>
                </button>
            </div>

            <div class="figure-profile-stats">
                <div class="profile-score-ring">
                    <svg viewBox="0 0 120 120">
                        <circle cx="60" cy="60" r="54" class="ring-bg"/>
                        <circle cx="60" cy="60" r="54" class="ring-fill" id="score-ring"
                                style="stroke-dasharray: {{ 339.292 }}; stroke-dashoffset: {{ 339.292 - (fig.cope_score / 100) * 339.292 }}; stroke: {% if fig.cope_score >= 90 %}#e63946{% elif fig.cope_score >= 75 %}#f4a261{% elif fig.cope_score >= 60 %}#e9c46a{% else %}#2a9d8f{% endif %}"/>
                    </svg>
                    <span class="ring-score">{{ "%.0f"|format(fig.cope_score) }}</span>
                </div>
                <span class="profile-score-label">{{ fig.cope_score|copelabel }}</span>

                <div class="profile-meta-tags">
                    <span class="category-badge" style="background: {{ categories.get(fig.category, {"colour": "#6c757d", "label": "Uncategorised"}).colour }}20; color: {{ categories.get(fig.category, {"colour": "#6c757d", "label": "Uncategorised"}).colour }}; border: 1px solid {{ categories.get(fig.category, {"colour": "#6c757d", "label": "Uncategorised"}).colour }}40">
                        {{ categories.get(fig.category, {"colour": "#6c757d", "label": "Uncategorised"}).label }}
                    </span>
                    <span class="scapegoat-tag">Scapegoat: {{ fig.scapegoat_of_choice }}</span>
                </div>
            </div>
        </div>

        <div class="figure-incident">
            <h3>Latest Incident</h3>
            <p>{{ fig.latest_incident }}</p>
        </div>

        <div class="share-copy-card">
            <h3>Why this is cope</h3>
            <p>{{ fig.share_paragraph }}</p>
            <div class="share-bar">
                <a class="share-btn share-whatsapp" href="https://wa.me/?text={{ fig.share_text | urlencode }}" target="_blank" rel="noopener">WhatsApp</a>
                <button class="share-btn share-copy" data-share-text="{{ fig.share_text | e }}" onclick="navigator.clipboard.writeText(this.dataset.shareText).then(()=>{this.textContent='Copied!'})">Copy paragraph</button>
                <button class="share-btn share-copy" onclick="navigator.clipboard.writeText('https://uk.copecheck.com/figure/{{ fig.id }}').then(()=>{this.textContent='Copied!'})">Copy link</button>
            </div>
        </div>
    </div>

    {% if score_history %}
    <div class="figure-chart-section">
        <h3>Score History</h3>
        <div class="chart-container">
            <canvas id="score-history-chart"></canvas>
        </div>
    </div>
    {% endif %}

    {% if entries %}
    <div class="figure-entries">
        <h3>Cope Entries ({{ entries|length }})</h3>
        {% for entry in entries %}
        <div class="entry-card">
            <p class="ai-item-label">AI-generated score</p>
            <div class="entry-card-header">
                <div class="entry-score-pip" style="background: {% if entry.cope_score >= 75 %}#e63946{% elif entry.cope_score >= 50 %}#f4a261{% else %}#2a9d8f{% endif %}">
                    {{ "%.0f"|format(entry.cope_score) }}
                </div>
                <button class="copy-btn" onclick="copyText(this, this.closest('.entry-card'))" style="flex-shrink:0;"><svg viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg> Copy</button>
                <div class="entry-card-meta">
                    {% if entry.source_url %}
                    <a href="{{ entry.source_url }}" target="_blank" rel="noopener" class="entry-source-link">{{ entry.source_title or 'Source' }}</a>
                    {% else %}
                    <span class="entry-source-title">{{ entry.source_title or 'Internal analysis' }}</span>
                    {% endif %}
                    <span class="entry-card-type">{{ entry.cope_type }}</span>
                    {% if entry.scored_at %}
                    <span class="entry-card-date">{{ entry.scored_at }}</span>
                    {% endif %}
                </div>
            </div>
            {% if entry.quote %}
            <blockquote class="entry-quote">"{{ entry.quote }}"</blockquote>
            {% endif %}
            {% if entry.explanation %}
            <p class="entry-explanation">{{ entry.explanation|strip_md }}</p>
            {% endif %}
        </div>
        {% endfor %}
    </div>
    {% endif %}

    <div class="figure-back">
        <a href="/" class="btn btn-secondary">&larr; Back to The Table</a>
    </div>
</section>
{% endblock %}

{% block scripts %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.4/chart.umd.min.js"></script>
<script>
{% if score_history %}
const historyData = {{ score_history|tojson }};
if (historyData.length > 0) {
    new Chart(document.getElementById('score-history-chart'), {
        type: 'line',
        data: {
            labels: historyData.map(d => d.date || d.scored_at || ''),
            datasets: [{
                label: 'Cope Score',
                data: historyData.map(d => d.score || d.cope_score),
                borderColor: '#e63946',
                backgroundColor: 'rgba(230,57,70,0.1)',
                fill: true,
                tension: 0.3,
                pointRadius: 4
            }]
        },
        options: {
            responsive: true,
            maintainAspectRatio: false,
            plugins: {
                legend: { display: false }
            },
            scales: {
                x: { ticks: { color: '#8a8d96' }, grid: { color: '#1e2233' } },
                y: { min: 0, max: 100, ticks: { color: '#8a8d96' }, grid: { color: '#1e2233' } }
            }
        }
    });
}
{% endif %}

async function generatePortrait(figId) {
    const btn = event.target.closest('.btn');
    const btnText = btn.querySelector('.btn-text');
    const btnLoading = btn.querySelector('.btn-loading');
    btnText.style.display = 'none';
    btnLoading.style.display = 'inline-flex';
    btn.disabled = true;

    try {
        const resp = await fetch(`/api/generate-portrait/${figId}`, {method: 'POST'});
        const data = await resp.json();
        if (data.ok) {
            location.reload();
        } else {
            alert(data.error || 'Portrait generation failed');
        }
    } catch (e) {
        alert('Error: ' + e.message);
    } finally {
        btnText.style.display = 'inline';
        btnLoading.style.display = 'none';
        btn.disabled = false;
    }
}
</script>
{% endblock %}
```
