{% extends 'oscar/catalogue/detail.html' %}

{% block title %}{% spaceless %}{% if product.seo_title %}{{ product.seo_title }}{% else %}{{ block.super }}{% endif %}{% endspaceless %}{% endblock %}

{% block description %}{% spaceless %}{% if product.seo_description %}{{ product.seo_description }}{% else %}{{ block.super }}{% endif %}{% endspaceless %}{% endblock %}

{# Add media from the forms in the catalogue app #}
{% block extrahead %}
{% if  product.seo_keywords %}<meta name="keywords" content="{{ product.seo_keywords }}" />{% endif %}

{% if product.seo_title %}
    <meta name="twitter:title" content="{{ product.seo_title }} — {{ request.site.site_name }}" />
    <meta property="og:title" content="{{ product.seo_title }} - {{ request.site.site_name }}" />
{% endif %}

{% if product.seo_description %}
    <meta name="twitter:description" content="{{ product.seo_description }}" />
    <meta property="og:description" content="{{ product.seo_description }}" />
{% endif %}

<meta property="og:type" content="Product detail" />

{% if request.build_absolute_uri %}<meta property="og:url" content="{{request.build_absolute_uri}}" />{% endif %}

{% if request.site.site_name %}<meta property="og:site_name" content="{{ request.site.site_name }}" />{% endif %}

{% if product.primary_image %}
    <meta name="twitter:image" content="{{ request.scheme }}://{{ request.get_host }}{{ product.primary_image.original.url }}" />
    <meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{{ product.primary_image.original.url }}" />
{% endif %}

{{ block.super }}
{% endblock %}

{% block extrascripts %}
{{ block.super }}
{% for js_tag in media.render_js %}{{ js_tag|safe }}{% endfor %}
{% endblock %}

{% block extrastyles %}
{{ block.super }}
{% for css_tag in media.render_css %}{{ css_tag|safe }}{% endfor %}
{% endblock %}