forked from Icycoide/searxng
[simple theme] replace Image_layout.js with flexbox CS impl.
* drop image_layout.js from simple theme * move image_layout.js to oscar theme and delete common js dir (since its empty now) * align top position of image detail modal with bottom position of search header * use flexbox to display images; row height can be set via @results-image-row-height in defenitions.less * display span title underneath each image with a max width of 12rem * increase margin and padding around image article on desktop and tablet * make article height smaller on phone layout (height of 6rem) to display more content on current view * remove content from result, if the title and content matches * use a group that cotains the flex image article, if images are mixed with other categories * fix pylint issues in webapp.py * use the default.html result template in unit tests (thanks @return42)
This commit is contained in:
parent
3408d061aa
commit
21e3c40516
12 changed files with 91 additions and 51 deletions
|
@ -726,6 +726,9 @@ def search():
|
|||
# Server-Timing header
|
||||
request.timings = result_container.get_timings() # pylint: disable=assigning-non-slot
|
||||
|
||||
current_template = None
|
||||
previous_result = None
|
||||
|
||||
# output
|
||||
for result in results:
|
||||
if output_format == 'html':
|
||||
|
@ -762,6 +765,18 @@ def search():
|
|||
else:
|
||||
result['publishedDate'] = format_date(result['publishedDate'])
|
||||
|
||||
# set result['open_group'] = True when the template changes from the previous result
|
||||
# set result['close_group'] = True when the template changes on the next result
|
||||
if current_template != result.get('template'):
|
||||
result['open_group'] = True
|
||||
if previous_result:
|
||||
previous_result['close_group'] = True # pylint: disable=unsupported-assignment-operation
|
||||
current_template = result.get('template')
|
||||
previous_result = result
|
||||
|
||||
if previous_result:
|
||||
previous_result['close_group'] = True
|
||||
|
||||
if output_format == 'json':
|
||||
x = {
|
||||
'query': search_query.query,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue