source: trunk/themes/default/template/search.tpl @ 29614

Last change on this file since 29614 was 29614, checked in by plg, 10 years ago

bug fixed: adapt the maxOptions to each listbox to display all items

  • Property svn:eol-style set to LF
File size: 6.1 KB
Line 
1{* Example of resizeable *}
2{*
3{include file='include/resize.inc.tpl'}
4*}
5
6{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
7{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
8
9{footer_script}
10jQuery(document).ready(function() {
11  jQuery("#authors, #tags, #categories").each(function() {
12    jQuery(this).selectize({
13      plugins: ['remove_button'],
14      maxOptions:jQuery(this).find("option").length
15    });
16  })
17});
18{/footer_script}
19
20{if isset($MENUBAR)}{$MENUBAR}{/if}
21<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
22
23        <div class="titrePage">
24                <ul class="categoryActions">
25                        {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
26                        <li><a href="{$U_HELP}" onclick="popuphelp(this.href); return false;" title="{'Help'|@translate}" class="pwg-state-default pwg-button">
27                                <span class="pwg-icon pwg-icon-help"></span><span class="pwg-button-text">{'Help'|@translate}</span>
28                        </a></li>
29                </ul>
30                <h2><a href="{$U_HOME}">{'Home'|@translate}</a>{$LEVEL_SEPARATOR}{'Search'|@translate}</h2>
31        </div>
32
33{include file='infos_errors.tpl'}
34
35<form class="filter" method="post" name="search" action="{$F_SEARCH_ACTION}">
36<fieldset>
37  <legend>{'Search for words'|@translate}</legend>
38  <p>
39    <input type="text" name="search_allwords">
40    <br>
41    <label><input type="radio" name="mode" value="AND" checked="checked"> {'Search for all terms'|@translate}</label>
42    <label><input type="radio" name="mode" value="OR"> {'Search for any term'|@translate}</label>
43  </p>
44
45  <p>
46    <strong>{'Apply on properties'|translate}</strong><br>
47    <label><input type="checkbox" name="fields[]" value="name" checked="checked"> {'Photo title'|translate}</label>
48    <label><input type="checkbox" name="fields[]" value="comment" checked="checked"> {'Photo description'|translate}</label>
49    <label><input type="checkbox" name="fields[]" value="file" checked="checked"> {'File name'|translate}</label>
50  </p>
51
52</fieldset>
53
54{if count($AUTHORS)>=1}
55<fieldset>
56  <legend>{'Search for Author'|@translate}</legend>
57  <p>
58    <select id="authors" placeholder="{'Type in a search term'|translate}" name="authors[]" multiple>
59{foreach from=$AUTHORS item=author}
60      <option value="{$author.author|strip_tags:false|escape:html}">{$author.author|strip_tags:false} ({$author.counter|translate_dec:'%d photo':'%d photos'})</option>
61{/foreach}
62    </select>
63  </p>
64</fieldset>
65{/if}
66
67{if isset($TAGS)}
68<fieldset>
69  <legend>{'Search tags'|@translate}</legend>
70  <p>
71  <select id="tags" placeholder="{'Type in a search term'|translate}" name="tags[]" multiple>
72{foreach from=$TAGS item=tag}
73    <option value="{$tag.id}">{$tag.name} ({$tag.counter|translate_dec:'%d photo':'%d photos'})</option>
74{/foreach}
75  </select>
76  <label><span><input type="radio" name="tag_mode" value="AND" checked="checked"> {'All tags'|@translate}</span></label>
77  <label><span><input type="radio" name="tag_mode" value="OR"> {'Any tag'|@translate}</span></label>
78  </p>
79</fieldset>
80{/if}
81
82<fieldset>
83  <legend>{'Search by date'|@translate}</legend>
84  <ul>
85    <li><label>{'Kind of date'|@translate}</label></li>
86    <li><label>
87      <input type="radio" name="date_type" value="date_creation" checked="checked"> {'Creation date'|@translate}
88    </label></li>
89    <li><label>
90      <input type="radio" name="date_type" value="date_available"> {'Post date'|@translate}
91    </label></li>
92  </ul>
93  <ul>
94    <li><label>{'Date'|@translate}</label></li>
95    <li>
96      <select id="start_day" name="start_day">
97          <option value="0">--</option>
98        {section name=day start=1 loop=32}
99          <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$START_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option>
100        {/section}
101      </select>
102      <select id="start_month" name="start_month">
103        {html_options options=$month_list selected=$START_MONTH_SELECTED}
104      </select>
105      <input id="start_year" name="start_year" type="text" size="4" maxlength="4" >
106      <input id="start_linked_date" name="start_linked_date" type="hidden" size="10" disabled="disabled">
107    </li>
108    <li>
109      <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>
110    </li>
111  </ul>
112  <ul>
113    <li><label>{'End-Date'|@translate}</label></li>
114    <li>
115      <select id="end_day" name="end_day">
116          <option value="0">--</option>
117        {section name=day start=1 loop=32}
118          <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$END_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option>
119        {/section}
120      </select>
121      <select id="end_month" name="end_month">
122        {html_options options=$month_list selected=$END_MONTH_SELECTED}
123      </select>
124      <input id="end_year" name="end_year" type="text" size="4" maxlength="4" >
125      <input id="end_linked_date" name="end_linked_date" type="hidden" size="10" disabled="disabled">
126    </li>
127    <li>
128      <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>
129    </li>
130  </ul>
131</fieldset>
132
133<fieldset>
134  <legend>{'Search in albums'|@translate}</legend>
135  <p>
136    <select id="categories" name="cat[]" multiple>
137      {html_options options=$category_options selected=$category_options_selected}
138    </select>
139    <label><input type="checkbox" name="subcats-included" value="1" checked="checked"> {'Search in sub-albums'|@translate}</label>
140  </p>
141</fieldset>
142<p>
143  <input type="submit" name="submit" value="{'Submit'|@translate}">
144  <input type="reset" value="{'Reset'|@translate}">
145</p>
146</form>
147
148<script type="text/javascript"><!--
149document.search.search_allwords.focus();
150//--></script>
151
152</div> <!-- content -->
Note: See TracBrowser for help on using the repository browser.