{combine_css path=$SMART_PATH|@cat:"template/style.css"} {include file='include/datepicker.inc.tpl'} {combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} {footer_script require='jquery.tokeninput'} var lang = new Array(); lang['tags filter'] = "{'tags filter'|@translate}"; lang['date filter'] = "{'date filter'|@translate}"; lang['limit filter'] = "{'limit filter'|@translate}"; lang['remove this filter'] = "{'remove this filter'|@translate}"; var options = new Array(); {capture assign="options_tags"}{html_options options=$options.tags}{/capture} {capture assign="options_date"}{html_options options=$options.date}{/capture} {capture assign="options_limit"}{html_options options=$options.limit}{/capture} options['tags'] = "{$options_tags|escape:javascript}"; options['date'] = "{$options_date|escape:javascript}"; options['limit'] = "{$options_limit|escape:javascript}"; {literal} jQuery(document).ready(function() { $('#addFilter').change(function() { add_filter($(this).attr('value')); $(this).attr('value', '-1'); }); $('#removeFilters').click(function() { $('#filterList li').each(function() { $(this).remove(); }); return false; }); $('input[name="is_smart"]').change(function() { $('#SmartAlbum_options').toggle(); $('input[name="countImages"]').toggle(); $('.count_images_display').toggle(); }); $('input[name="countImages"]').click(function() { countImages($(this).closest('form')); return false; }); function add_filter(type) { // add line $('
  • ').appendTo('#filterList'); //set content content = '[x]'+ ' '+ lang[type +' filter'] + ' '; if (type == 'tags') { content += ' '; } else { content += ' '; } $('#filter_'+ i).html(content); // reinit handlers init_jquery_handlers(); i++; } function init_jquery_handlers() { $('.removeFilter').click(function() { $(this).parent('li').remove(); return false; }); $('.filter_date input[type="text"]').each(function() { $(this).datepicker({dateFormat:'yy-mm-dd', firstDay:1}); }); jQuery(".tagSelect").tokenInput( {/literal} [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], {ldelim} hintText: '{'Type in a search term'|@translate}', noResultsText: '{'No results'|@translate}', searchingText: '{'Searching...'|@translate}', animateDropdown: false, preventDuplicates: true, allowCreation: false {literal} } ); } function countImages(form) { {/literal} jQuery.post("{$COUNT_SCRIPT_URL}", 'cat_id={$CAT_ID}&'+form.serialize(), {literal} function success(data) { jQuery('.count_images_display').html(data); } ); } init_jquery_handlers(); }); {/literal} {/footer_script}
    {'SmartAlbums'|@translate}
      {counter start=0 assign=i} {foreach from=$filters item=filter}
    • [x] {$filter.TYPE|cat:' filter'|@translate} {if $filter.TYPE == 'tags'} {else} {/if}
    • {counter} {/foreach} {footer_script}var i={$i};{/footer_script}

    {'Remove all filters'|@translate}

    {$IMAGE_COUNT}