Changeset 31391


Ignore:
Timestamp:
Mar 2, 2016, 8:59:28 PM (8 years ago)
Author:
plg
Message:

make search compatible with Piwigo 2.8 (and 2.7, it had not been done yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/stripped/template/search.tpl

    r21518 r31391  
    2121        <div id="content_cell">
    2222                <div class="content_block">
    23                         {include file='infos_errors.tpl'}
    24                         <form class="filter" method="post" name="search" action="{$F_SEARCH_ACTION}">
    25                                 <fieldset>
    26                                         <legend>{'Filter'|@translate}</legend>
    27                                         <label>{'Search for words'|@translate}
    28                                                 <input type="text" style="width: 300px" name="search_allwords" size="30"  />
    29                                         </label>
    30                                         <ul>
    31                                                 <li><label>
    32                                                         <input type="radio" name="mode" value="AND" checked="checked" />{'Search for all terms'|@translate}
    33                                                 </label></li>
    34                                                 <li><label>
    35                                                         <input type="radio" name="mode" value="OR" />{'Search for any terms'|@translate}
    36                                                 </label></li>
    37                                         </ul>
    38                                         <label>{'Search for Author'|@translate}
    39                                                 <input type="text" style="width: 300px" name="search_author" size="30"  />
    40                                         </label>
    41                                 </fieldset>
    42                                 {if isset($TAG_SELECTION)}
    43                                         <fieldset>
    44                                                 <legend>{'Search tags'|@translate}</legend>
    45                                                 {$TAG_SELECTION}
    46                                                 <label><span><input type="radio" name="tag_mode" value="AND" checked="checked" /> {'All tags'|@translate}</span></label>
    47                                                 <label><span><input type="radio" name="tag_mode" value="OR" /> {'Any tag'|@translate}</span></label>
    48                                         </fieldset>
    49                                 {/if}
    50                                 <fieldset>
    51                                         <legend>{'Search by date'|@translate}</legend>
    52                                         <ul>
    53                                                 <li><label>{'Kind of date'|@translate}</label></li>
    54                                                 <li><label>
    55                                                         <input type="radio" name="date_type" value="date_creation" checked="checked" />{'Creation date'|@translate}
    56                                                 </label></li>
    57                                                 <li><label>
    58                                                         <input type="radio" name="date_type" value="date_available" />{'Post date'|@translate}
    59                                                 </label></li>
    60                                         </ul>
    61                                         <ul>
    62                                                 <li><label>{'Date'|@translate}</label></li>
    63                                                 <li>
    64                                                         <select id="start_day" name="start_day">
    65                                                                 <option value="0">--</option>
    66                                                                 {section name=day start=1 loop=32}
    67                                                                         <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$START_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option>
    68                                                                 {/section}
    69                                                         </select>
    70                                                         <select id="start_month" name="start_month">
    71                                                                 {html_options options=$month_list selected=$START_MONTH_SELECTED}
    72                                                         </select>
    73                                                         <input id="start_year" name="start_year" type="text" size="4" maxlength="4" >
    74                                                         <input id="start_linked_date" name="start_linked_date" type="hidden" size="10" disabled="disabled">
    75                                                 </li>
    76                                                 <li>
    77                                                         <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>
    78                                                 </li>
    79                                         </ul>
    80                                         <ul>
    81                                                 <li><label>{'End-Date'|@translate}</label></li>
    82                                                 <li>
    83                                                         <select id="end_day" name="end_day">
    84                                                                 <option value="0">--</option>
    85                                                                 {section name=day start=1 loop=32}
    86                                                                         <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$END_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option>
    87                                                                 {/section}
    88                                                         </select>
    89                                                         <select id="end_month" name="end_month">
    90                                                                 {html_options options=$month_list selected=$END_MONTH_SELECTED}
    91                                                         </select>
    92                                                         <input id="end_year" name="end_year" type="text" size="4" maxlength="4" >
    93                                                         <input id="end_linked_date" name="end_linked_date" type="hidden" size="10" disabled="disabled">
    94                                                 </li>
    95                                                 <li>
    96                                                         <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>
    97                                                 </li>
    98                                         </ul>
    99                                 </fieldset>
    100                                 <fieldset>
    101                                         <legend>{'Search in albums'|@translate}</legend>
    102                                         <label>
    103                                                 <select class="categoryList" name="cat[]" multiple="multiple" >
    104                                                         {html_options options=$category_options selected=$category_options_selected}
    105                                                 </select>
    106                                         </label>
    107                                         <ul>
    108                                                 <li><label>{'Search in sub-albums'|@translate}</label></li>
    109                                                 <li><label>
    110                                                         <input type="radio" name="subcats-included" value="1" checked="checked" />{'Yes'|@translate}
    111                                                 </label></li>
    112                                                 <li><label>
    113                                                         <input type="radio" name="subcats-included" value="0" />{'No'|@translate}
    114                                                 </label></li>
    115                                         </ul>
    116                                 </fieldset>
    117                                 <p>
    118                                         <input class="submit" type="submit" name="submit" value="{'Submit'|@translate}" />
    119                                         <input class="submit" type="reset" value="{'Reset'|@translate}" />
    120                                 </p>
    121                         </form>
    122                         <script type="text/javascript">
    123                                 <!--
    124                                 document.search.search_allwords.focus();
    125                                 //-->
    126                         </script>
     23{* copied and modified from themes/default/template.search.tpl, starts here *}
     24{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
     25{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
     26
     27{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
     28
     29{footer_script}
     30jQuery(document).ready(function() {
     31  jQuery("#authors, #tags, #categories").each(function() {
     32    jQuery(this).selectize({
     33      plugins: ['remove_button'],
     34      maxOptions:jQuery(this).find("option").length
     35    });
     36  })
     37});
     38{/footer_script}
     39
     40{include file='infos_errors.tpl'}
     41
     42<form class="filter" method="post" name="search" action="{$F_SEARCH_ACTION}">
     43<fieldset>
     44  <legend>{'Search for words'|@translate}</legend>
     45  <p>
     46    <input type="text" name="search_allwords">
     47    <br>
     48    <label><input type="radio" name="mode" value="AND" checked="checked"> {'Search for all terms'|@translate}</label>
     49    <label><input type="radio" name="mode" value="OR"> {'Search for any term'|@translate}</label>
     50  </p>
     51
     52  <p>
     53    <strong>{'Apply on properties'|translate}</strong><br>
     54    <label><input type="checkbox" name="fields[]" value="name" checked="checked"> {'Photo title'|translate}</label>
     55    <label><input type="checkbox" name="fields[]" value="comment" checked="checked"> {'Photo description'|translate}</label>
     56    <label><input type="checkbox" name="fields[]" value="file" checked="checked"> {'File name'|translate}</label>
     57{if isset($TAGS)}
     58    <label><input type="checkbox" name="search_in_tags" value="tags"> {'Tags'|translate}</label>
     59{/if}
     60  </p>
     61
     62</fieldset>
     63
     64{if count($AUTHORS)>=1}
     65<fieldset>
     66  <legend>{'Search for Author'|@translate}</legend>
     67  <p>
     68    <select id="authors" placeholder="{'Type in a search term'|translate}" name="authors[]" multiple>
     69{foreach from=$AUTHORS item=author}
     70      <option value="{$author.author|strip_tags:false|escape:html}">{$author.author|strip_tags:false} ({$author.counter|translate_dec:'%d photo':'%d photos'})</option>
     71{/foreach}
     72    </select>
     73  </p>
     74</fieldset>
     75{/if}
     76
     77{if isset($TAGS)}
     78<fieldset>
     79  <legend>{'Search tags'|@translate}</legend>
     80  <p>
     81  <select id="tags" placeholder="{'Type in a search term'|translate}" name="tags[]" multiple>
     82{foreach from=$TAGS item=tag}
     83    <option value="{$tag.id}">{$tag.name} ({$tag.counter|translate_dec:'%d photo':'%d photos'})</option>
     84{/foreach}
     85  </select>
     86  <label><span><input type="radio" name="tag_mode" value="AND" checked="checked"> {'All tags'|@translate}</span></label>
     87  <label><span><input type="radio" name="tag_mode" value="OR"> {'Any tag'|@translate}</span></label>
     88  </p>
     89</fieldset>
     90{/if}
     91
     92<fieldset>
     93  <legend>{'Search by date'|@translate}</legend>
     94  <ul>
     95    <li><label>{'Kind of date'|@translate}</label></li>
     96    <li><label>
     97      <input type="radio" name="date_type" value="date_creation" checked="checked"> {'Creation date'|@translate}
     98    </label></li>
     99    <li><label>
     100      <input type="radio" name="date_type" value="date_available"> {'Post date'|@translate}
     101    </label></li>
     102  </ul>
     103  <ul>
     104    <li><label>{'Date'|@translate}</label></li>
     105    <li>
     106      <select id="start_day" name="start_day">
     107          <option value="0">--</option>
     108        {section name=day start=1 loop=32}
     109          <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$START_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option>
     110        {/section}
     111      </select>
     112      <select id="start_month" name="start_month">
     113        {html_options options=$month_list selected=$START_MONTH_SELECTED}
     114      </select>
     115      <input id="start_year" name="start_year" type="text" size="4" maxlength="4" >
     116      <input id="start_linked_date" name="start_linked_date" type="hidden" size="10" disabled="disabled">
     117    </li>
     118    <li>
     119      <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>
     120    </li>
     121  </ul>
     122  <ul>
     123    <li><label>{'End-Date'|@translate}</label></li>
     124    <li>
     125      <select id="end_day" name="end_day">
     126          <option value="0">--</option>
     127        {section name=day start=1 loop=32}
     128          <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$END_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option>
     129        {/section}
     130      </select>
     131      <select id="end_month" name="end_month">
     132        {html_options options=$month_list selected=$END_MONTH_SELECTED}
     133      </select>
     134      <input id="end_year" name="end_year" type="text" size="4" maxlength="4" >
     135      <input id="end_linked_date" name="end_linked_date" type="hidden" size="10" disabled="disabled">
     136    </li>
     137    <li>
     138      <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>
     139    </li>
     140  </ul>
     141</fieldset>
     142
     143<fieldset>
     144  <legend>{'Search in albums'|@translate}</legend>
     145  <p>
     146    <select id="categories" name="cat[]" multiple>
     147      {html_options options=$category_options selected=$category_options_selected}
     148    </select>
     149    <label><input type="checkbox" name="subcats-included" value="1" checked="checked"> {'Search in sub-albums'|@translate}</label>
     150  </p>
     151</fieldset>
     152<p>
     153  <input type="submit" name="submit" value="{'Submit'|@translate}">
     154  <input type="reset" value="{'Reset'|@translate}">
     155</p>
     156</form>
     157
     158<script type="text/javascript"><!--
     159document.search.search_allwords.focus();
     160//--></script>
     161
     162{* copied and modified from themes/default/template.search.tpl, stops here *}
    127163                </div>
    128164        </div>
Note: See TracChangeset for help on using the changeset viewer.