fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0ce1f45
)
slugs in search
author
Radek Czajka
<rczajka@rczajka.pl>
Wed, 6 Aug 2025 12:55:14 +0000
(14:55 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Wed, 6 Aug 2025 12:55:14 +0000
(14:55 +0200)
src/search/views.py
patch
|
blob
|
history
diff --git
a/src/search/views.py
b/src/search/views.py
index
4f9a256
..
f797d9f
100644
(file)
--- a/
src/search/views.py
+++ b/
src/search/views.py
@@
-36,6
+36,7
@@
def get_hints(prefix, user=None, limit=10):
'label': author.name,
'url': author.get_absolute_url(),
'img': get_thumbnail(author.photo, '72x72', crop='top').url if author.photo else '',
'label': author.name,
'url': author.get_absolute_url(),
'img': get_thumbnail(author.photo, '72x72', crop='top').url if author.photo else '',
+ 'slug': author.slug,
}
for author in authors[:limit - len(data)]
])
}
for author in authors[:limit - len(data)]
])
@@
-48,6
+49,7
@@
def get_hints(prefix, user=None, limit=10):
'type': 'userlist',
'label': tag.name,
'url': tag.get_absolute_url(),
'type': 'userlist',
'label': tag.name,
'url': tag.get_absolute_url(),
+ 'slug': tag.slug,
}
for tag in tags[:limit - len(data)]
])
}
for tag in tags[:limit - len(data)]
])
@@
-59,6
+61,7
@@
def get_hints(prefix, user=None, limit=10):
'type': tag.category,
'label': tag.name,
'url': tag.get_absolute_url(),
'type': tag.category,
'label': tag.name,
'url': tag.get_absolute_url(),
+ 'slug': tag.slug,
}
for tag in tags[:limit - len(data)]
])
}
for tag in tags[:limit - len(data)]
])
@@
-70,6
+73,7
@@
def get_hints(prefix, user=None, limit=10):
'type': 'collection',
'label': collection.title,
'url': collection.get_absolute_url(),
'type': 'collection',
'label': collection.title,
'url': collection.get_absolute_url(),
+ 'slug': collection.slug,
}
for collection in collections[:limit - len(data)]
])
}
for collection in collections[:limit - len(data)]
])
@@
-86,6
+90,7
@@
def get_hints(prefix, user=None, limit=10):
'author': author_str,
'url': b.get_absolute_url(),
'img': get_thumbnail(b.cover_clean, '72x72').url if b.cover_clean else '',
'author': author_str,
'url': b.get_absolute_url(),
'img': get_thumbnail(b.cover_clean, '72x72').url if b.cover_clean else '',
+ 'slug': book.slug,
}
)
if len(data) < limit:
}
)
if len(data) < limit:
@@
-98,6
+103,7
@@
def get_hints(prefix, user=None, limit=10):
'type': 'info',
'label': info.title,
'url': info.get_absolute_url(),
'type': 'info',
'label': info.title,
'url': info.get_absolute_url(),
+ 'slug': info.slug,
}
for info in infos[:limit - len(data)]
])
}
for info in infos[:limit - len(data)]
])