Commit f7ffbd2b authored by Ivan Tyagov's avatar Ivan Tyagov

When showing search results define other listbox modes and mark current one.

Follow CSS convention.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37314 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e8cde45
...@@ -62,10 +62,11 @@ ...@@ -62,10 +62,11 @@
show_search_line here/showSearchLine;\n show_search_line here/showSearchLine;\n
is_web_mode request/is_web_mode | nothing;\n is_web_mode request/is_web_mode | nothing;\n
is_dialog_mode request/dialog_mode | nothing;\n is_dialog_mode request/dialog_mode | nothing;\n
display_style_list here/getDisplayStyleList;\n
list_style python:request.get(\'list_style\', \n list_style python:request.get(\'list_style\', \n
selection.getParams().get(\'list_style\', is_web_mode and \'table\' or None));\n selection.getParams().get(\'list_style\', here.getDefaultDisplayStyle()));\n
dummy python: list_style == \'search\' and here.setDisplayedColumnIdList((\'getIconAsHTML\', \'getSummaryAsHTML\'))\n dummy python: list_style == \'search\' and here.setDisplayedColumnIdList((\'getIconAsHTML\', \'getSummaryAsHTML\'))\n
or list_style == \'thumb\' and here.setDisplayedColumnIdList((\'title\', \'thumbnail\'));\n or list_style == \'thumbnail\' and here.setDisplayedColumnIdList((\'title\', \'thumbnail\'));\n
line_list here/query;\n line_list here/query;\n
listbox_max_lines python: int(here.getMaxLineNumber());\n listbox_max_lines python: int(here.getMaxLineNumber());\n
total_line python: int(here.total_size);\n total_line python: int(here.total_size);\n
...@@ -73,10 +74,8 @@ ...@@ -73,10 +74,8 @@
current_page_max python: listbox_max_lines * current_page;\n current_page_max python: listbox_max_lines * current_page;\n
current_page_start python: (listbox_max_lines * (current_page - 1)) + 1;\n current_page_start python: (listbox_max_lines * (current_page - 1)) + 1;\n
current_page_stop python: (total_line < current_page_max) and total_line or current_page_max;\n current_page_stop python: (total_line < current_page_max) and total_line or current_page_max;\n
\n
listbox_id request/current_form_id | form_id ;\n listbox_id request/current_form_id | form_id ;\n
listbox_url string:${context_url}/${listbox_id};\n listbox_url string:${context_url}/${listbox_id};\n
\n
">\n ">\n
\n \n
<!-- Define hidden input. -->\n <!-- Define hidden input. -->\n
...@@ -438,19 +437,16 @@ ...@@ -438,19 +437,16 @@
</div>\n </div>\n
\n \n
<!-- Choose display mode -->\n <!-- Choose display mode -->\n
<!--TODO define show_display_selection-->\n <!--TODO define show_display_selection macro-->\n
<div tal:define="style_list here/getDisplayStyleList"\n <div tal:condition="python: len(display_style_list) > 0"\n
tal:condition="python: not is_gadget_mode and len(style_list) > 0"\n class="list-style-selection">\n
class="display_selection"\n <span i18n:translate="" i18n:domain="ui">Display :</span>\n
i18n:domain="ui">\n
<span i18n:translate="">Display :</span>\n
<ul>\n <ul>\n
<li tal:repeat="style style_list">\n <li tal:repeat="style display_style_list">\n
<a tal:attributes="href python: \'%s?list_style=%s\' % (listbox_url, style[0])"\n <a tal:attributes="href python: \'%s?list_style=%s\' % (listbox_url, style[0]);\n
class python: test(style[0]==list_style, \'selected\',\'\');"\n
tal:content="python: style[1]"\n tal:content="python: style[1]"\n
i18n:translate="">\n i18n:translate="" i18n:domain="ui"/>\n
Tabular\n
</a>\n
</li>\n </li>\n
</ul>\n </ul>\n
</div>\n </div>\n
......
...@@ -384,6 +384,10 @@ ...@@ -384,6 +384,10 @@
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>search</string> </value>
</item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <value>
...@@ -397,7 +401,20 @@ ...@@ -397,7 +401,20 @@
<item> <item>
<key> <string>display_style_list</string> </key> <key> <string>display_style_list</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>table</string>
<string>table</string>
</tuple>
<tuple>
<string>search</string>
<string>search</string>
</tuple>
<tuple>
<string>thumbnail</string>
<string>thumbnail</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -218,26 +218,28 @@ div.search_popup{\n ...@@ -218,26 +218,28 @@ div.search_popup{\n
float:left;\n float:left;\n
}\n }\n
\n \n
/*Display selection choice*/\n /* List style selection */\n
.display_selection {\n div.list-style-selection {\n
width:auto;\n width:auto;\n
float:left;\n float:left;\n
}\n }\n
.display_selection span{\n div.list-style-selection span{\n
font-weight:bold;\n font-weight:bold;\n
padding-left:10px;\n padding-left:10px;\n
vertical-align:-4px;\n vertical-align:-4px;\n
}\n }\n
.display_selection ul{\n div.list-style-selection ul{\n
display:inline;\n display:inline;\n
padding-left:0;\n padding-left:0;\n
margin: 0;\n margin: 0;\n
vertical-align: -4px;\n vertical-align: -4px;\n
}\n }\n
.display_selection li{\n div.list-style-selection li{\n
display: inline;\n display: inline;\n
}\n }\n
\n div.list-style-selection li a.selected{\n
font-weight: bold;\n
}\n
/* Search bar */\n /* Search bar */\n
div.extendedSearchBar {\n div.extendedSearchBar {\n
float:left;\n float:left;\n
......
1493 1494
\ 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