Source

cmsplugin-tabslider / cmsplugin_tabslider / templates / cmsplugin_tabslider / tabslider.html

Full commit
Konrad Rymczak 32940f4 
































































{% load i18n sekizai_tags %}
{% spaceless %}
<div id="cmsplugin_tabslider_{{ instance.id }}" class="tabbable tabs-left"
{% if instance.width or instance.height %}style="{% endif %}
    {% if instance.width %}width: {{ instance.width }}px;{% endif %}
    {% if instance.height %}height: {{ instance.height }}px;{% endif %}
{% if instance.width or instance.height %}"{% endif %}
>
{% endspaceless %}
    <ul class="nav nav-tabs">
        {% for tab in tabs %}
        <li><a {% if instance.tab_height %}style="height:{{instance.tab_height}}px"{% endif %} class="tab-button" href="#cmsplugin_tabslider_tab_{{ tab.id }}" data-toggle="tab">{{ tab.title }}</a></li>
        {% endfor %}
    </ul>
    <div class="tab-content">
        {% for tab in tabs %}
        <div class="tab-pane" id="cmsplugin_tabslider_tab_{{ tab.id }}">
            {% include "cmsplugin_tabslider/slider.html" %}
        </div>
        {% endfor %}
    </div>
</div>

{% addtoblock "css" %}
<link rel="stylesheet" href="{{ STATIC_URL }}cmsplugin_tabslider/css/nivo-slider.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ STATIC_URL }}cmsplugin_tabslider/css/themes/{{ tab.theme|default:"default" }}/{{ tab.theme|default:"default" }}.css" type="text/css" media="screen" />
{% endaddtoblock %}

{% addtoblock "js" %}
<script type="text/javascript" src="{{ STATIC_URL }}cmsplugin_tabslider/js/jquery.nivo.slider.pack.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}cmsplugin_tabslider/js/tabslider.js"></script>
<script type="text/javascript">
    jQuery(function(){
        var all_tabs = $('#cmsplugin_tabslider_{{ instance.id }} .tab-button');
        var current_index = 0;
        var current_tab = all_tabs.eq(current_index);
        current_tab.tab('show');
        setInterval(function(){
            current_index = all_tabs.index(current_tab) + 1;
            if (current_index > all_tabs.length){
                current_index = 0;
            }
            current_tab = all_tabs.eq(current_index);
            current_tab.tab('show');
        }, {{ instance.tab_switch_timeout }});
    });
</script>
<script type="text/javascript">
    $(function() {
        {% for object in tabs %}
        $('#nivoslider{{ object.pk }}').nivoSlider({
            effect: '{{ object.effect }}',
            animSpeed: {{ object.anim_speed }},
            pauseTime: {{ object.pause_time }},
            directionNav: {{ object.arrows|lower }},
            controlNavThumbs: {{ object.thumbnails|lower }},
            pauseOnHover: {{ object.pause_on_hover|lower }},
            manualAdvance: {{ object.manual_advance|lower }},
            prevText: '{% trans 'prev'|capfirst %}',
            nextText: '{% trans 'next'|capfirst %}',
            randomStart: {{ object.random_start|lower }}
        });
        {% endfor %}
    });
</script>
{% endaddtoblock %}