{% extends "layout.html" %} {% block title %}{% endblock %} {% block content %}

🦐 LaksyaShrimp {{ current_product_name }}


Chain History (Total Blocks: {{ full_chain_history | length }})

{% if dashboard_batch_id %} Dashboard → {% endif %}
{% if full_chain_history %}
{% for block_data in full_chain_history %} {% set stage_name = (block_data.block.stage or '') | string %} {% set clean_stage = stage_name.split('-', 1)[-1].strip().lower().replace('/', '-').replace('–', '-') %} {% set data_payload = block_data.block.transactions[0].data if block_data.block.transactions and block_data.block.transactions[0] and block_data.block.transactions[0].data else {} %}

{% if block_data.block_sub_label %} Block #{{ block_data.block_sub_label }} - {{ block_data.block.stage }} {% else %} {{ block_data.block.stage }} {% endif %}

Mined at: {{ block_data.block.timestamp }}

Hash: {{ block_data.block.hash }}

{% if block_data.block_sub_label %}Block #{{ block_data.block_sub_label }} - {% endif %}{{ block_data.block.stage }} {{ block_data.block.stage }} QR
Feedback QR Feedback QR
{% if block_data.avg_rating_text %} {% set avg = block_data.avg_rating_value %} {% set count = (block_data.avg_rating_text.split('(')[1].rstrip(')')) if '(' in block_data.avg_rating_text else '0' %}
{% set full = avg | float | int %} {% for i in range(1, 6) %} {% if i <= full %} {% else %} {% endif %} {% endfor %}
{{ avg | round(1) }}/5
({{ count }} ratings)
{% else %}
No ratings yet
{% endif %}

Transaction Data:

{% for key, value in data_payload.items() %}

{{ key | replace('_', ' ') }}: {{ value }}

{% endfor %} {% if not data_payload %}

No transaction data found for this block.

{% endif %}
{% set upload_fields = { 'broodstock facility': ['DoF approval', 'Health status', 'SPF status'], 'hatchery-nursery': ['CAA approval', 'Health status', 'Antibiotic free status'], 'grow-out system-1': ['CAA approval', 'Health status', 'Antibiotic free status'], 'grow-out system-2': ['CAA approval', 'Health status', 'Antibiotic free status'], 'grow-out system-3': ['CAA approval', 'Health status', 'Antibiotic free status'], 'production of feed & inputs-1': ['Licence', 'CAA approval', 'QC report of feed'], 'production of feed & inputs-2': ['Licence', 'CAA approval', 'QC report of feed'], 'production of feed & inputs-3': ['Licence', 'CAA approval', 'QC report of feed'], 'harvesting-1': ['Licence'], 'harvesting-2': ['Licence'], 'harvesting-3': ['Licence'], 'aggregation/trading at farm gate-1': ['Licence'], 'aggregation/trading at farm gate-2': ['Licence'], 'aggregation/trading at farm gate-3': ['Licence'], 'transportation-1': ['Licence'], 'transportation-2': ['Licence'], 'transportation-3': ['Licence'], 'marketing-1': ['Licence'], 'marketing-2': ['Licence'], 'marketing-3': ['Licence'], 'processing (direct from farms)-1': ['Licence', 'HACCP certificate'], 'processing (direct from farms)-2': ['Licence', 'HACCP certificate'], 'processing (direct from farms)-3': ['Licence', 'HACCP certificate'], 'exporting-1': ['Export Licence', 'Health certificate', 'Phytosanitary certificate', 'Antibiotic Free Certificate'], 'exporting-2': ['Export Licence', 'Health certificate', 'Phytosanitary certificate', 'Antibiotic Free Certificate'], 'exporting-3': ['Export Licence', 'Health certificate', 'Phytosanitary certificate', 'Antibiotic Free Certificate'], 'retailing-1': ['Retail Licence'], 'retailing-2': ['Retail Licence'], 'retailing-3': ['Retail Licence'] } %} {% if clean_stage in upload_fields %}

Upload Certificates (PDF/JPG)

{% for cert in upload_fields[clean_stage] %}
{% endfor %}
{% endif %}
View Full JSON Data (Debug)
{{ block_data.block | tojson(indent=2) }}
      
{% endfor %}
{% else %}

The blockchain is empty, only the Genesis Block exists.

{% endif %} {% if selected_product_id == 'vannamei_2025' %}

🔗 Full Lineage Traces

Scan a QR below to view the complete supply chain lineage for each batch (Broodstock → Hatchery → Grow-out → Feed)

{% set lineage_defs = [ ('a', 'Lineage A', '1a → 2a(N/A) → 3a → 4a'), ('b', 'Lineage B', '1b → 2b(N/A) → 3b → 4b'), ('c', 'Lineage C', '1c → 2c(N/A) → 3c → 4c'), ('d', 'Lineage D', '1d → 2d(N/A) → 3d → 4d'), ('e', 'Lineage E', '1e → 2e → 3e → 4e'), ] %} {% for lid, title, flow in lineage_defs %} {% endfor %}
{% endif %} {% endblock %}