
{% block pagination %}

{% if pager.first != pager.last %}
<div class="pagination">
    <ul>
        <li {% if pager.first == pager.current %}class="disabled"{% endif %}>
            <a href="?page={{ pager.first }}{{ pager.append }}">«</a>
        </li>
        {% for pg in pager.pages %}
            <li {% if pg == pager.current %}class="active" {% endif %}>
                <a href="?page={{ pg }}{{ pager.append }}">{{ pg + 1 }}</a></li>
        {% endfor %}
        <li {% if pager.last == pager.current %}class="disabled"{% endif %}>
            <a href="?page={{ pager.last }}{{ pager.append }}">»</a>
        </li>
    </ul>
</div>
{% endif %}

{% endblock %}


{% block alert %}

    {% if alert %}
        <div class="alert alert-{{ alert.type }}" style="position: absolute;z-index: 100;left: 9%;right: 9%;">
            <a class="close" data-dismiss="alert" href="#">&times;</a>
            <div>{{ alert.message }}</div>
        </div>
    {% endif %}

{% endblock %}


{% block gallerythumb %}
<div class="span3 chart" data-id="{{ chart.id }}">
    <div data-id="{{ chart.id }}" data-bg="{{ chart.metadata.publish.background }}" data-w="{{ chart.metadata.publish['embed-width'] }}" data-h="{{ chart.metadata.publish['embed-height'] }}" class="thumbnail">
        <h3><a href="/gallery/#/{{ chart.id }}" style="color:{% if  chart.metadata.publish.text %}{{ chart.metadata.publish.text }}{% else %}#000{% endif %};text-shadow:1px 1px 3px {% if  chart.metadata.publish.background %}{{ chart.metadata.publish.background }}{% else %}#fff{% endif %};">{% if chart.title != '' %}{{ chart.title | replace({'<br/>': ' - '}) | striptags | raw }}{% else %}{{ chart.id }}{% endif %}</a></h3>

        <a href="{{ gallerythumb_url is defined ? gallerythumb_url : '/gallery' }}#/{{ chart.id }}">
            <img src="{% if chart.hasPreview %}//{{ DW_CHART_CACHE_DOMAIN }}/{{ chart.id }}/m.png{% else %}/static/plugins/gallery/nothumb.png{% endif %}" width="260" alt="" style="background:{{ chart.metadata.publish.background }}">
        </a>
    </div>
</div>
{% endblock %}


{% block teaserlogin %}
        {% if not user.isLoggedIn %}
                <a href="#login" class="btn btn-primary btn-login btn-large">
                    <i class="icon-user icon-white"></i> {% trans "Login / Sign Up" %}
                </a>
                <a href="/chart/create" class="btn btn-login btn-large">
                    <i class="icon-pencil"></i> {% trans "Try it now!" %}
                </a>
        {% else %}
                <a href="/chart/create" class="btn-primary btn btn-large"><i class="fa fa-plus"></i> {% trans "Create a Chart" %}</a>
                <a href="/mycharts" class="btn btn-large"><i class="fa fa-bar-chart-o"></i> {% trans "My Charts" %}</a>
        {% endif %}
{% endblock %}

{% block chart_head %}
    <h1 {% if not title %}class="hidden"{% endif %}>
        <span class="chart-title">{{ title|purify }}</span>
    </h1>
    <p class="chart-intro{% if not intro %} hidden{% endif %}">{{ intro|purify|raw }}</p>
{% endblock %}

