{% extends "campaign_monitor/base.html" %}
{% load pagination_tags %}
{% load base_tags %}
{% load perm_tags %}
{% load campaign_monitor_tags %}
{% load i18n %}

{% block title %}{{ block.super }} {% trans "Index" %}{% endblock %}

{% block extra_head %}
    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/campaign_monitor.css">
{% endblock %}

{% block body %}
<div class="t">
    {% template_nav request.user %}
    
    <h1>{% trans "Campaign Monitor Templates" %}</h1>
    {% autopaginate templates 5 %}
	
	<div class="templates-wrap">
    {% for template in templates %}
        <div class="template-wrap">
            <div class="options options-search">
                <div class="quick-options">
					{% template_options request.user template %}
                </div>
			</div>
            <h2><a href="{{ template.get_absolute_url }}">{{ template.name }}</a></h2>
            {% if template.cm_screenshot_url %}
                <div class="screenshot">
                    <p><b>{% trans "Screenshot:" %}</b></p>
                    <a href="{{ template.cm_preview_url }}">
                        <img src="{{ template.cm_screenshot_url }}">
                    </a>
                </div>
            {% else %}
                <p><b>{% trans "Screenshot:" %}</b>{% trans " Not Available" %}</p>
            {% endif %}
            <p><a href="{{ template.cm_preview_url }}">{% trans "Preview" %}</a></p>
        </div>
	{% empty %}
		<div>{% trans "0 Templates Found" %}</div>
    {% endfor %}
	</div>
    
    {% paginate %}
</div>
{% endblock %}

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