Ignore:
Timestamp:
09/22/14 20:34:24 (6 years ago)
Author:
plg
Message:

adapt the new core search.tpl to Simple (copied and modified)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/simple_themes/simple/template/search.tpl

    r13556 r29751  
     1{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'} 
     2{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"} 
     3 
     4{footer_script} 
     5jQuery(document).ready(function() { 
     6  jQuery("#authors, #tags, #categories").each(function() { 
     7    jQuery(this).selectize({ 
     8      plugins: ['remove_button'], 
     9      maxOptions:jQuery(this).find("option").length 
     10    }); 
     11  }) 
     12}); 
     13{/footer_script} 
     14 
    115{assign var='pagetitle' value='Search'} 
    216{include file='pagetitle.tpl'} 
     
    1327  </div> 
    1428  {/if} 
    15   <form class="filter" method="post" name="search" action="{$F_SEARCH_ACTION}"> 
    16   <fieldset> 
    17     <legend>{'Filter'|@translate}</legend> 
    18     <label>{'Search for words'|@translate} 
    19       <input type="text" style="width: 300px" name="search_allwords" size="30"  /> 
    20     </label> 
    21     <ul> 
    22       <li><label> 
    23         <input type="radio" name="mode" value="AND" checked="checked" />{'Search for all terms'|@translate} 
    24       </label></li> 
    25       <li><label> 
    26         <input type="radio" name="mode" value="OR" />{'Search for any terms'|@translate} 
    27       </label></li> 
    28     </ul> 
    29     <label>{'Search for Author'|@translate} 
    30       <input type="text" style="width: 300px" name="search_author" size="30"  /> 
    31     </label> 
    32   </fieldset> 
    33   {if isset($TAG_SELECTION)} 
    34   <fieldset> 
    35     <legend>{'Search tags'|@translate}</legend> 
    36     {$TAG_SELECTION} 
    37     <label><span><input type="radio" name="tag_mode" value="AND" checked="checked" /> {'All tags'|@translate}</span></label> 
    38     <label><span><input type="radio" name="tag_mode" value="OR" /> {'Any tag'|@translate}</span></label> 
    39   </fieldset> 
    40   {/if} 
    41   <fieldset> 
    42     <legend>{'Search by Date'|@translate}</legend> 
    43     <ul> 
    44       <li><label>{'Kind of date'|@translate}</label></li> 
    45       <li><label> 
    46         <input type="radio" name="date_type" value="date_creation" checked="checked" />{'Creation date'|@translate} 
    47       </label></li> 
    48       <li><label> 
    49         <input type="radio" name="date_type" value="date_available" />{'Post date'|@translate} 
    50       </label></li> 
    51     </ul> 
    52     <ul> 
     29 
     30<form class="filter" method="post" name="search" action="{$F_SEARCH_ACTION}"> 
     31<fieldset> 
     32  <legend>{'Search for words'|@translate}</legend> 
     33  <p> 
     34    <input type="text" name="search_allwords"> 
     35    <br> 
     36    <label><input type="radio" name="mode" value="AND" checked="checked"> {'Search for all terms'|@translate}</label> 
     37    <label><input type="radio" name="mode" value="OR"> {'Search for any term'|@translate}</label> 
     38  </p> 
     39 
     40  <p> 
     41    <strong>{'Apply on properties'|translate}</strong><br> 
     42    <label><input type="checkbox" name="fields[]" value="name" checked="checked"> {'Photo title'|translate}</label> 
     43    <label><input type="checkbox" name="fields[]" value="comment" checked="checked"> {'Photo description'|translate}</label> 
     44    <label><input type="checkbox" name="fields[]" value="file" checked="checked"> {'File name'|translate}</label> 
     45  </p> 
     46 
     47</fieldset> 
     48 
     49{if count($AUTHORS)>=1} 
     50<fieldset> 
     51  <legend>{'Search for Author'|@translate}</legend> 
     52  <p> 
     53    <select id="authors" placeholder="{'Type in a search term'|translate}" name="authors[]" multiple> 
     54{foreach from=$AUTHORS item=author} 
     55      <option value="{$author.author|strip_tags:false|escape:html}">{$author.author|strip_tags:false} ({$author.counter|translate_dec:'%d photo':'%d photos'})</option> 
     56{/foreach} 
     57    </select> 
     58  </p> 
     59</fieldset> 
     60{/if} 
     61 
     62{if isset($TAGS)} 
     63<fieldset> 
     64  <legend>{'Search tags'|@translate}</legend> 
     65  <p> 
     66  <select id="tags" placeholder="{'Type in a search term'|translate}" name="tags[]" multiple> 
     67{foreach from=$TAGS item=tag} 
     68    <option value="{$tag.id}">{$tag.name} ({$tag.counter|translate_dec:'%d photo':'%d photos'})</option> 
     69{/foreach} 
     70  </select> 
     71  <label><span><input type="radio" name="tag_mode" value="AND" checked="checked"> {'All tags'|@translate}</span></label> 
     72  <label><span><input type="radio" name="tag_mode" value="OR"> {'Any tag'|@translate}</span></label> 
     73  </p> 
     74</fieldset> 
     75{/if} 
     76 
     77<fieldset> 
     78  <legend>{'Search by date'|@translate}</legend> 
     79  <ul> 
     80    <li><label>{'Kind of date'|@translate}</label></li> 
     81    <li><label> 
     82      <input type="radio" name="date_type" value="date_creation" checked="checked"> {'Creation date'|@translate} 
     83    </label></li> 
     84    <li><label> 
     85      <input type="radio" name="date_type" value="date_available"> {'Post date'|@translate} 
     86    </label></li> 
     87  </ul> 
     88  <ul> 
    5389    <li><label>{'Date'|@translate}</label></li> 
    54       <li> 
     90    <li> 
    5591      <select id="start_day" name="start_day"> 
    5692          <option value="0">--</option> 
    57           {section name=day start=1 loop=32} 
     93        {section name=day start=1 loop=32} 
    5894          <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$START_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option> 
    59           {/section} 
    60         </select> 
     95        {/section} 
     96      </select> 
    6197      <select id="start_month" name="start_month"> 
    62           {html_options options=$month_list selected=$START_MONTH_SELECTED} 
    63         </select> 
     98        {html_options options=$month_list selected=$START_MONTH_SELECTED} 
     99      </select> 
    64100      <input id="start_year" name="start_year" type="text" size="4" maxlength="4" > 
    65101      <input id="start_linked_date" name="start_linked_date" type="hidden" size="10" disabled="disabled"> 
     
    67103    <li> 
    68104      <a class="date_today" href="#" onClick="document.search.start_day.value={$smarty.now|date_format:"%d"};document.search.start_month.value={$smarty.now|date_format:"%m"};document.search.start_year.value={$smarty.now|date_format:"%Y"};return false;">{'today'|@translate}</a> 
    69       </li> 
    70     </ul> 
    71     <ul> 
     105    </li> 
     106  </ul> 
     107  <ul> 
    72108    <li><label>{'End-Date'|@translate}</label></li> 
    73       <li> 
     109    <li> 
    74110      <select id="end_day" name="end_day"> 
    75             <option value="0">--</option> 
    76           {section name=day start=1 loop=32} 
    77             <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$END_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option> 
    78           {/section} 
    79         </select> 
     111          <option value="0">--</option> 
     112        {section name=day start=1 loop=32} 
     113          <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$END_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option> 
     114        {/section} 
     115      </select> 
    80116      <select id="end_month" name="end_month"> 
    81           {html_options options=$month_list selected=$END_MONTH_SELECTED} 
    82         </select> 
     117        {html_options options=$month_list selected=$END_MONTH_SELECTED} 
     118      </select> 
    83119      <input id="end_year" name="end_year" type="text" size="4" maxlength="4" > 
    84120      <input id="end_linked_date" name="end_linked_date" type="hidden" size="10" disabled="disabled"> 
     
    86122    <li> 
    87123      <a class="date_today" href="#" onClick="document.search.end_day.value={$smarty.now|date_format:"%d"};document.search.end_month.value={$smarty.now|date_format:"%m"};document.search.end_year.value={$smarty.now|date_format:"%Y"};return false;">{'today'|@translate}</a> 
    88       </li> 
    89     </ul> 
    90   </fieldset> 
    91   <fieldset> 
    92     <legend>{'Search Options'|@translate}</legend> 
    93   <label>{'Search in albums'|@translate} 
    94       <select class="categoryList" name="cat[]" multiple="multiple" > 
    95         {html_options options=$category_options selected=$category_options_selected} 
    96       </select> 
    97     </label> 
    98     <ul> 
    99       <li><label>{'Search in sub-albums'|@translate}</label></li> 
    100       <li><label> 
    101         <input type="radio" name="subcats-included" value="1" checked="checked" />{'Yes'|@translate} 
    102       </label></li> 
    103       <li><label> 
    104         <input type="radio" name="subcats-included" value="0" />{'No'|@translate} 
    105       </label></li> 
    106     </ul> 
    107   </fieldset> 
     124    </li> 
     125  </ul> 
     126</fieldset> 
     127 
     128<fieldset> 
     129  <legend>{'Search in albums'|@translate}</legend> 
    108130  <p> 
    109     <input class="submit" type="submit" name="submit" value="{'Submit'|@translate}" /> 
    110     <input class="submit" type="reset" value="{'Reset'|@translate}" /> 
     131    <select id="categories" name="cat[]" multiple> 
     132      {html_options options=$category_options selected=$category_options_selected} 
     133    </select> 
     134    <label><input type="checkbox" name="subcats-included" value="1" checked="checked"> {'Search in sub-albums'|@translate}</label> 
    111135  </p> 
    112   </form> 
    113   <script type="text/javascript"><!-- 
    114   document.search.search_allwords.focus(); 
    115   //--></script> 
     136</fieldset> 
     137<p> 
     138  <input type="submit" name="submit" value="{'Submit'|@translate}"> 
     139  <input type="reset" value="{'Reset'|@translate}"> 
     140</p> 
     141</form> 
     142 
     143<script type="text/javascript"><!-- 
     144document.search.search_allwords.focus(); 
     145//--></script> 
     146 
    116147</div> <!-- content --> 
Note: See TracChangeset for help on using the changeset viewer.