{% load sekizai_tags %}

{% if testimonials %}

    {% addtoblock "js" %}
        <script type="text/javascript" src="{{ STATIC_URL }}vticker/vticker.js"></script>
    {% endaddtoblock %}

    {% addtoblock "js" %}
        <script>
            $(function(){
                $('#testimonial_{{ instance.pk }}').vTicker({
                    height:250,
                    showItems: 1,
                    pause: 12000,
                    speed: 1500,
                    margin: 0,
                    padding: 0,
                    offset: 0
                });
                $('.testimonial_wrapper ul').css({marginTop:'0', paddingLeft:'20px', paddingRight:'20px'});
            });
        </script>
    {% endaddtoblock %}
    <div class="testimonial_wrapper">
    {%  if testimonials.count > 0 %}
        {% spaceless %}
            <div class="test_head">{{ instance.block }}</div>
            <div class="quotes"  id="testimonial_{{ instance.pk }}">
                <ul>
                    {% for testimonial in testimonials %}
                        <li>
                            <p><span class="hanginquote">"</span>{{ testimonial.testimony }}"</p>
                            <div class="quoteauthor">
                                {{ testimonial.author }}
                            </div>
                        </li>
                    {% endfor %}
                </ul>
                <div class="fader">&nbsp;</div>
            </div>
        {% endspaceless %}
    {% endif %}
    </div>

{% endif %}
