-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search issue or PR by its id / index number #4109
Comments
@Charliekenney23, I'm just curious: do you have any open PR regarding this issue? |
@alexanderadam Ah sorry, totally forgot about this. I got really busy after saying I'd take this. Anyone else is welcome to pick it up. |
Hello Could try the script to search issue #ID or PR #ID Below code please paste to custom/templates/custom/footer.tmpl <script>
!function(){var e,t;if("/milestones"!=location.pathname&&(e=document.querySelector(".search"))&&(t=e.querySelector("button"))){var n,o,i,r=document.querySelector("input[name=q]"),c=document.querySelector(".form");t.type="button",c.addEventListener("submit",(function(e){""!=c.q.value&&e.preventDefault()})),r.addEventListener("keydown",(function(e){var t=r.value.trim(),n=t.match(/([\w/]+)#(\d+)/);if(13==e.keyCode&&t){if(""==t.replace(/[#0-9]/g,"")&&!i.disabled||-1!=t.indexOf("#"))return i.click();c.submit()}else n&&(i.disabled=!1)})),t.addEventListener("click",(function(){c.submit()})),((n=document.querySelector(".filter .blue.button.repo"))||document.querySelector(".page-content.repository"))&&(o=location.pathname,n&&(o=n.title+location.pathname),i=t.cloneNode(),n&&!n.title&&(i.disabled=!0),i.type="button",i.textContent="#",i.title="#ID search",i.style.padding="10px",i.addEventListener("click",(function(){var e,t=r.value.trim(),n=t.match(/([\w/]+)#(\d+)/);return""==t.replace(/[#0-9]/g,"")?location=o+(t?"/"+t.replace("#",""):""):n&&n.length&&(e=document.querySelector("[title*='"+n[1]+"']",document.querySelector(".filter")))?location=e.title+location.pathname+(n[2]?"/"+n[2]:""):void c.submit()})),e.appendChild(i))}}();
</script> |
Demo Videos: hashtagsearch-2022-05-30_11.07.46.mp4 |
Looks interesting. |
That's great, and it works perfectly... till the function will be implemented in Gitea 😉 |
There are other options for this, but it's still a draft #19646 |
I think what we need in issue/pr list page is @tyroneyeh's idea looks good to me. Can you create a PR ? |
We should follow GH to have a domain search language like |
for #4109 (comment) Supports format: `#1234` `Org/Repo#1234` --------- Co-authored-by: techknowlogick <techknowlogick@gitea.io>
[x]
):Description
I have often the Problem that i want to search by the ID. Is there a way to add a search like this, "#"?
The text was updated successfully, but these errors were encountered: