Fixes: https://pagure.io/koji/issue/1130
Please double-check escaping if I'm not introducing some html injection.
:thumbsup:
Metadata Update from @tkopecek: - Pull-request tagged with: testing-ready
rebased onto b35d3a9b7afe067a08b54888d8a3e8a2f1c6a433
Metadata Update from @jcupova: - Pull-request tagged with: testing-done
@mikem - It is marked as testing-done, ready for merge?
Ah, I had envisioned including the search form in the results page, but this is helpful too. Perhaps not obvious where to look if you used the full search form instead of the top bar.
This doesn't propagate the search type. If you search for tags matching k*, the resulting page is prefilled with a search for packages instead.
k*
If I search for <, the box on the results page is prefilled with <. Suspicious.
<
<
rebased onto 6f89906afb09e115a106e759536cc4e58c8ddcd7
I've addded support to search page directly and fixed search type. Html escaping is problem, as all templates go through XHTMLFilter, so '<' is converted to '<' and it is then escaped by cgi.escape back to '<', which is displayed as '<' in browser. (see html source of final page). So raw query is already lost inside the template - I don't think it is worthy to rewrite XHTMLFilter usage just because of this usecase.
XHTMLFilter
cgi.escape
Metadata Update from @tkopecek: - Pull-request untagged with: testing-done
I've added support to search page directly and fixed search type.
I see the changes in search.chtml, but they don't do anything because a different template is used for search results.
search.chtml
Combining the two templates seems to make things work.
https://github.com/mikem23/koji-playground/commits/pagure/pr/1258
Tests well with devtools/fakeweb
devtools/fakeweb
example screenshot of above attached to #1130
I think I've convinced myself that the XHTMLFilter business is safe
Yes, this works better. There were more combinations which I've not investigated enough (find exactly one result, find more results, wrong query).
Does it make sense now to put whole search form search.html in one row now? It is less scrolling if there are more results.
search.html
Does it make sense now to put whole search form search.html in one row now?
Sure, seems to look ok that way. I've updated my branch
Cases that appear to work fine for me (via fakeweb at least):
Commit 2cf37f6c fixes this pull-request
Pull-Request has been merged by mikem
Fixes: https://pagure.io/koji/issue/1130
Please double-check escaping if I'm not introducing some html injection.