{% extends "base.html" %} {% block title %}{{ product.name }} - Price Tracker{% endblock %} {% block content %}

{{ product.name }}

{% if product.description %}

{{ product.description }}

{% endif %}
Edit Back to Dashboard
Current Prices
{% if latest_prices %} {% set price_list = latest_prices.values() | list %} {% set min_price = price_list | min(attribute='price') %} {% set max_price = price_list | max(attribute='price') %} {% for site_name, price_data in latest_prices.items() %}
{{ site_name.title() }} {% if not price_data.availability %} Out of Stock {% endif %} {% if price_data.price == min_price.price %} Best Price {% endif %}
£{{ "%.2f"|format(price_data.price) }}
{{ price_data.timestamp[:10] }}
{% endfor %} {% if product.target_price %}
Target Price: £{{ "%.2f"|format(product.target_price) }}
{% if min_price.price <= product.target_price %}
Target Reached! Best price is at or below your target.
{% else %}
You could save £{{ "%.2f"|format(min_price.price - product.target_price) }} when price drops to target.
{% endif %} {% endif %} {% else %}


No price data available yet.

{% endif %}
Tracked URLs
{% for site_name, url in product.urls.items() %}
{{ site_name.title() }} View
{% endfor %}
Price History (Last 30 Days)
{% if price_history %}
{% else %}


No price history available yet. Price data will appear here after scraping.

{% endif %}
{% if price_stats %}
Price Statistics (Last 30 Days)
{% for site_name, stats in price_stats.items() %}
{{ site_name.title() }}
Min Price
£{{ "%.2f"|format(stats.min_price) }}
Max Price
£{{ "%.2f"|format(stats.max_price) }}
Avg Price
£{{ "%.2f"|format(stats.avg_price) }}
Data Points
{{ stats.data_points }}
{% endfor %}
{% endif %} {% if price_history %}
Recent Price Updates
{% for entry in price_history[:20] %} {% endfor %}
Site Price Available Date
{{ entry.site_name.title() }} £{{ "%.2f"|format(entry.price) }} {% if entry.availability %} Available {% else %} Out of Stock {% endif %} {{ entry.timestamp[:16] }}
{% if price_history|length > 20 %}

Showing 20 most recent entries of {{ price_history|length }} total.

{% endif %}
{% endif %}
{% endblock %} {% block scripts %} {% if chart_json %} {% endif %} {% endblock %}