Emapic/emapic

View on GitHub
views/tag-surveys-list.hjs

Summary

Maintainability
Test Coverage
{{#setTitleI18n}}surveys_title{{/setTitleI18n}}

<div class="container content" id="galery">

    <div class="col-xs-12 list-complex-header">
        <h2 class="col-xs-12">{{#__}}tagged_surveys{{/__}} <small>/ {{tag}}</small></h2>
        <div class="col-xs-12 text-right order-div">
            <label>{{#__}}order_by{{/__}}</label>
            <select name="order" style="visibility: hidden;">
                <option value="default">{{#__}}order_creation_date{{/__}}</option>
                <option value="votes">{{#__}}order_nr_votes{{/__}}</option>
                <option value="popular">{{#__}}order_popularity{{/__}}</option>
            </select>
        </div>
    </div>

    {{> surveys_list}}

</div> <!-- /content -->

{{#addThisId}}
    {{> more_sharing_options_modal}}
{{/addThisId}}

{{#yield-scripts}}
{{#addThisId}}
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{addThisId}}"></script>
{{#twitterVia}}
<script type="text/javascript">
    var addthis_share = addthis_share || {};
    addthis_share = {
        passthrough : {
            twitter: {
                via: "{{twitterVia}}"
            }
        }
    };
</script>
{{/twitterVia}}
{{/addThisId}}
<script type="text/javascript">
$(function() {
    var order = emapic.utils.getURLParameter('order');
    if (order) {
        $('select[name="order"]').val(order);
    }
    $('select[name="order"]').show();
    $('select[name="order"]').selectmenu({
        classes: {
            'ui-selectmenu-menu': 'order-selectmenu-menu'
        },
        change: function() {
            window.location = emapic.utils.changeURLParameter('order', $('select[name="order"]').val());
        }
    });
});
</script>
{{/yield-scripts}}