mirror of
https://github.com/searxng/searxng.git
synced 2025-09-03 16:58:34 +02:00
[mod] in the preference page, show !bang of subgrouping categories
The names of the subgrouping categories in the preference page are translated, to use this categories the user needs to know by which !bang the category can be selected. Related to "Make 'non tab category' bangs discoverable" in [#690]. Related: - [#690] https://github.com/searxng/searxng/issues/690 - https://github.com/searxng/searxng/issues/1604 - https://github.com/searxng/searxng/pull/1545 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
bbb2af7d94
commit
f117f969d8
6 changed files with 63 additions and 26 deletions
|
@ -242,4 +242,9 @@ def group_engines_in_tab(engines: Iterable[Engine]) -> List[Tuple[str, Iterable[
|
|||
subgroups = itertools.groupby(sorted(engines, key=get_subgroup), get_subgroup)
|
||||
sorted_groups = sorted(((name, list(engines)) for name, engines in subgroups), key=group_sort_key)
|
||||
|
||||
return [(groupname, sorted(engines, key=engine_sort_key)) for groupname, engines in sorted_groups]
|
||||
ret_val = []
|
||||
for groupname, engines in sorted_groups:
|
||||
group_bang = '!' + groupname.replace(' ', '_') if groupname != NO_SUBGROUPING else ''
|
||||
ret_val.append((groupname, group_bang, sorted(engines, key=engine_sort_key)))
|
||||
|
||||
return ret_val
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue