Changeset 28708


Ignore:
Timestamp:
Jun 16, 2014, 4:17:53 PM (6 years ago)
Author:
plg
Message:

feature 2563: do not display all tags as checkboxes on search.php. Use jQuery Selectize instead.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/search.php

    r28707 r28708  
    205205  usort( $available_tags, 'tag_alpha_compare');
    206206
    207   $template->assign(
    208     'TAG_SELECTION',
    209     get_html_tag_selection(
    210         $available_tags,
    211         'tags',
    212         isset($_POST['tags']) ? $_POST['tags'] : array()
    213         )
    214     );
     207  $template->assign('TAGS', $available_tags);
    215208}
    216209
  • trunk/themes/default/template/search.tpl

    r28707 r28708  
    99{footer_script}
    1010jQuery(document).ready(function() {
    11   jQuery("#authors").selectize({
     11  jQuery("#authors, #tags").selectize({
    1212    plugins: ['remove_button']
    1313  });
     
    4747    <select id="authors" placeholder="{'Type in a search term'|translate}" name="authors[]" multiple style="width:500px;">
    4848{foreach from=$AUTHORS item=author}
    49       <option value="{$author.author|strip_tags:false|escape:html}">{$author.author|strip_tags:false} ({'%d photos'|translate:$author.counter})</option>
     49      <option value="{$author.author|strip_tags:false|escape:html}">{$author.author|strip_tags:false} ({$author.counter|translate_dec:'%d photo':'%d photos'})</option>
    5050{/foreach}
    5151    </select>
     
    5353</fieldset>
    5454
    55 {if isset($TAG_SELECTION)}
     55{if isset($TAGS)}
    5656<fieldset>
    5757  <legend>{'Search tags'|@translate}</legend>
    58   {$TAG_SELECTION}
     58
     59  <select id="tags" placeholder="{'Type in a search term'|translate}" name="tags[]" multiple style="width:500px;">
     60{foreach from=$TAGS item=tag}
     61    <option value="{$tag.id}">{$tag.name} ({$tag.counter|translate_dec:'%d photo':'%d photos'})</option>
     62{/foreach}
     63  </select>
     64
    5965  <label><span><input type="radio" name="tag_mode" value="AND" checked="checked"> {'All tags'|@translate}</span></label>
    6066  <label><span><input type="radio" name="tag_mode" value="OR"> {'Any tag'|@translate}</span></label>
Note: See TracChangeset for help on using the changeset viewer.