Changeset 1820
- Timestamp:
- 01/30/09 14:45:12 (14 months ago)
- Location:
- trunk/pylucid_project
- Files:
-
- 3 modified
-
media/PyLucid/internal_page/search/result_page.css (modified) (1 diff)
-
media/PyLucid/internal_page/search/result_page.html (modified) (1 diff)
-
PyLucid/plugins_internal/search/search.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid_project/media/PyLucid/internal_page/search/result_page.css
r1449 r1820 9 9 #search_result table tr:hover { 10 10 background-color: #fafafa; 11 cursor: pointer; 11 12 } 12 13 #search_result .cutouts { -
trunk/pylucid_project/media/PyLucid/internal_page/search/result_page.html
r1449 r1820 13 13 <table> 14 14 {% for entry in results %} 15 <tr >15 <tr onclick="JavaScript:window.location.href='{{ entry.page.get_absolute_url }}';" title="{{ entry.page.get_absolute_url }}"> 16 16 <td title="score">{{ entry.score }}</td> 17 17 <td> -
trunk/pylucid_project/PyLucid/plugins_internal/search/search.py
r1719 r1820 160 160 for result in results: 161 161 result["cutouts"] = [] 162 content = result["page"].content 162 page = result["page"] 163 content = page.content 163 164 164 165 for term in search_strings: 165 s tart = 0166 search_start = 0 166 167 for _ in xrange(text_cutout_lines): 167 168 try: 168 index = content.index(term, s tart)169 index = content.index(term, search_start) 169 170 except ValueError: 170 171 # No more hits in the page content 171 172 break 172 173 start = index+1 174 173 175 174 if index<text_cutout_len: 176 175 txt = content[:text_cutout_len] … … 179 178 end = index+text_cutout_len 180 179 txt = content[start:end] 180 181 # start the next search at the end position 182 search_start = end 181 183 182 184 txt = escape(txt)