{% extends "base.html" %} {% block banner_subtitle %}Finished Decks{% endblock %} {% block content %}

Finished Deck

{% if display_name %}
{{ display_name }}
{% endif %} {% set hover_tags_source = deck_theme_tags if deck_theme_tags else (tags if tags else commander_combined_tags) %} {% set hover_tags_joined = hover_tags_source|join(', ') %}
Commander: {{ commander }} {% if tags and tags|length %} • Themes: {{ tags|join(', ') }}{% endif %}
This view mirrors the end-of-build summary. Use the buttons to download the CSV/TXT exports.
{% if summary %} {% if owned_set %} {% set ns = namespace(owned=0, total=0) %} {% set tb = summary.type_breakdown %} {% if tb and tb.cards %} {% for t, clist in tb.cards.items() %} {% for c in clist %} {% set cnt = c.count if c.count else 1 %} {% set ns.total = ns.total + cnt %} {% if c.name and (c.name|lower in owned_set) %} {% set ns.owned = ns.owned + cnt %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% set not_owned = (ns.total - ns.owned) %} {% set pct = ( (ns.owned * 100.0 / (ns.total or 1)) | round(1) ) %}
Ownership
Owned: {{ ns.owned }} • Not owned: {{ not_owned }} • Total: {{ ns.total }} ({{ pct }}%)
{% endif %} {{ render_cached('partials/deck_summary.html', name, request=request, summary=summary, game_changers=game_changers, owned_set=owned_set, combos=combos, synergies=synergies, versions=versions) | safe }} {# M8: Price charts accordion — placed in main area, only available on the saved deck view #} {% if (price_category_chart and price_category_chart.total > 0) or price_histogram_chart %}
Price Breakdown spend by category & distribution
{% if price_category_chart and price_category_chart.total > 0 %}
Spend by Category — ${{ '%.2f'|format(price_category_chart.total) }} total
{% for cat in price_category_chart.order %} {% set cat_total = price_category_chart.totals.get(cat, 0) %} {% if cat_total > 0 %} {% set pct = (cat_total * 100 / price_category_chart.total) | round(1) %}
{% endif %} {% endfor %}
{% for cat in price_category_chart.order %} {% set cat_total = price_category_chart.totals.get(cat, 0) %} {% if cat_total > 0 %} {{ cat }} ${{ '%.2f'|format(cat_total) }} {% endif %} {% endfor %}
{% endif %} {% if price_histogram_chart %}
Price Distribution
{% for bin in price_histogram_chart %}
{% endfor %}
{% for bin in price_histogram_chart %}
{{ bin.x_label }}
{% endfor %}
{% endif %}
{% endif %} {% else %}
No summary available.
{% endif %}
{% endblock %}