Commit 8771ddad authored by Fabien Morin's avatar Fabien Morin

Write "Search" in the bottom right search.

It was reported that in some web_site (like km), some people think that this field was used to login. Writing "Search" inside make not possible to think this now. (And when the field get the focus, the field make him empty to be able to receive the search text).

I try this without javascript support, and the search is usable, the only thing is that the user have to remove the default text manualy (it's the behaviour of most of the popular websites).

reviewed and approved by jm

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31539 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b5c051e8
...@@ -52,10 +52,13 @@ ...@@ -52,10 +52,13 @@
<tal:block tal:define="current_web_section python:request.get(\'current_web_section\', here);\n <tal:block tal:define="current_web_section python:request.get(\'current_web_section\', here);\n
search_area_section_id python:current_web_section.getLayoutProperty(\'layout_search_area_section_id\', \'\')">\n search_area_section_id python:current_web_section.getLayoutProperty(\'layout_search_area_section_id\', \'\')">\n
<div class="searchform">\n <div class="searchform">\n
<fieldset>\n <fieldset tal:define="search_default_text python:current_web_section.Base_translateString(\'Search\')">\n
<input name="field_your_search_text" class="field" value=""\n <input name="field_your_search_text" class="field" value=""\n
onkeyup="submitFormOnEnter(event, this.form, \'search_area/ERP5Site_viewQuickSearchResultList\');"\n value="Search" tal:attributes="value string:${search_default_text};\n
tal:attributes="onkeyup string:submitFormOnEnter(event, this.form, \'${search_area_section_id}/ERP5Site_viewQuickSearchResultList\');" />\n onfocus string:if (this.value==\'${search_default_text}\') this.value=\'\';\n
onkeyup string:submitFormOnEnter(event, this.form, \'${search_area_section_id}/ERP5Site_viewQuickSearchResultList\');"\n
onfocus="this.value=\'\';"\n
onkeyup="submitFormOnEnter(event, this.form, \'search_area/ERP5Site_viewQuickSearchResultList\');"/>\n
<input type="submit" class="button" value="Search" name="search_area/ERP5Site_viewQuickSearchResultList:method"\n <input type="submit" class="button" value="Search" name="search_area/ERP5Site_viewQuickSearchResultList:method"\n
tal:attributes="name string:${search_area_section_id}/ERP5Site_viewQuickSearchResultList:method"\n tal:attributes="name string:${search_area_section_id}/ERP5Site_viewQuickSearchResultList:method"\n
i18n:attributes="value" i18n:domain="ui" />\n i18n:attributes="value" i18n:domain="ui" />\n
......
149 151
\ No newline at end of file \ No newline at end of file
...@@ -43,8 +43,12 @@ ...@@ -43,8 +43,12 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"\n xmlns:i18n="http://xml.zope.org/namespaces/i18n"\n
tal:define="dummy python: request.RESPONSE.setHeader(\'Content-Type\', \n tal:define="dummy python: request.RESPONSE.setHeader(\'Content-Type\', \n
\'text/html;; charset=utf-8\');">\n \'text/html;; charset=utf-8\');">\n
<div>\n <div tal:define="search_default_text python:here.Base_translateString(\'Search\')">\n
<input type="text" onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_processAdvancedSearch\');" class="input-text" name="top_your_search_text" size="40" accesskey="4"/>\n <input type="text" onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_processAdvancedSearch\');"\n
value="Search" tal:attributes="value string:${search_default_text};\n
onfocus string:if (this.value==\'${search_default_text}\') this.value=\'\';"\n
onfocus="this.value=\'\';"\n
class="input-text" name="top_your_search_text" size="40" accesskey="4"/>\n
<select size="1" class="input" name="top_your_search_portal_type">\n <select size="1" class="input" name="top_your_search_portal_type">\n
<option value="" selected="selected" i18n:translate="" i18n:domain="ui">Everything</option>\n <option value="" selected="selected" i18n:translate="" i18n:domain="ui">Everything</option>\n
<option value="all" i18n:translate="" i18n:domain="ui">All Documents</option>\n <option value="all" i18n:translate="" i18n:domain="ui">All Documents</option>\n
......
...@@ -73,11 +73,15 @@ ...@@ -73,11 +73,15 @@
<div class="search result">\n <div class="search result">\n
\n \n
<!-- Advanced Search header -->\n <!-- Advanced Search header -->\n
<div class="centeredInner searchBar" \n <div class="centeredInner searchBar"\n
tal:define="search_default_text python:context.getContext().Base_translateString(\'Search\')"\n
tal:condition="python:not is_gadget_mode and show_search_line">\n tal:condition="python:not is_gadget_mode and show_search_line">\n
<input name="top_your_search_text" size="40" value="" type="text"\n <input name="top_your_search_text" size="40" value="" type="text"\n
onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_processAdvancedSearch\');"\n value="Search" tal:attributes="value your_search_text | search_default_text;\n
tal:attributes="value your_search_text" />\n onfocus string:if (this.value==\'${search_default_text}\') this.value=\'\';"\n
\n
onfocus="this.value=\'\';"\n
onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_processAdvancedSearch\');"/>\n
<input class="button" i18n:domain="ui" i18n:attributes="value"\n <input class="button" i18n:domain="ui" i18n:attributes="value"\n
value="Search" name="ERP5Site_processAdvancedSearch:method" type="submit" />\n value="Search" name="ERP5Site_processAdvancedSearch:method" type="submit" />\n
</div>\n </div>\n
......
...@@ -124,9 +124,12 @@ ...@@ -124,9 +124,12 @@
</button>\n </button>\n
</span>\n </span>\n
<span class="separator"><!--separator--></span>\n <span class="separator"><!--separator--></span>\n
<span id="search">\n <span id="search" tal:define="search_default_text python:here.Base_translateString(\'Search\')">\n
<input type="hidden" name="all_languages" value="1" />\n <input type="hidden" name="all_languages" value="1" />\n
<input accesskey="4" type="text" name="field_your_search_text" \n <input accesskey="4" type="text" name="field_your_search_text"\n
value="Search" tal:attributes="value string:${search_default_text};\n
onfocus string:if (this.value==\'${search_default_text}\') this.value=\'\';"\n
onfocus="this.value=\'\';"\n
onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_viewQuickSearchResultList\');" />\n onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_viewQuickSearchResultList\');" />\n
<button type="submit" name="ERP5Site_viewQuickSearchResultList:method" title="Search"\n <button type="submit" name="ERP5Site_viewQuickSearchResultList:method" title="Search"\n
i18n:attributes="title" i18n:domain="ui">\n i18n:attributes="title" i18n:domain="ui">\n
......
855 856
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment