Skip to content
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

Change tags to have url in href instead of data attribute #16354

Closed
4 tasks
robe2 opened this issue Jul 6, 2021 · 4 comments · Fixed by #17796
Closed
4 tasks

Change tags to have url in href instead of data attribute #16354

robe2 opened this issue Jul 6, 2021 · 4 comments · Fixed by #17796
Labels
issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself topic/ui Change the appearance of the Gitea UI

Comments

@robe2
Copy link

robe2 commented Jul 6, 2021

  • Gitea version (or commit ref): 1.14.3
  • Git version:
  • Operating system: Debian
    Running Gitea using binary from https://dl.gitea.io/gitea/1.14.4
  • Database (use [x]):
    • [ x] PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • [x ] Yes (provide example URL)
    • No

Description

We recently upgraded to gitea 1.14.3 and this has caused issues with debian packaging upstream.
They would like the links to the tar.gz have the URL in the href attribute instead of using the data attribute as they do now. The href was used in older versions.

Their comment:
"Neither tags nor releases is usable currently. As is right clicking the tar.gz links on the tags page and using Save As (in Firefox ESR). Using Javascript for a download link is a little silly (and automation unfriendly)."

@jpraet
Copy link
Member

jpraet commented Jul 6, 2021

The Gitea web UI should not be used for automation tasks. There is a REST API for that.
https://try.gitea.io/api/swagger#/repository/repoGetReleaseByTag

@sebastic
Copy link

sebastic commented Jul 6, 2021

uscan doesn't support REST APIs, it looks for <a href="URL"> in web pages to detect newer version and the download URLs for their tarballs.

On the tags page the /<project>/<repo>/src/tag/<foo> and /<project>/<repo>/src/commit/<hash> <a> elements have href attribute and hence can be used by uscan and rightclicking works in Firefox.

The ZIP and TAR.GZ <a> elements on the tags page use the data-url attribute and an onclick event for the archives, these don't work in uscan (due to lack of href attribute) nor does rightclicking in Firefox work to use Save As for example. Mousing over the link also doesn't show the URL in the status bar. Using regular <a href> links for the archives would fix both the issue in uscan and Firefox.

@jpraet
Copy link
Member

jpraet commented Jul 8, 2021

The change was introduced as part of this PR: #11296

@noerw
Copy link
Member

noerw commented Jul 10, 2021

Hm, not sure this PR accomplished what it set out to do, because for me there is no loading indicator displayed via JS.

Nonetheless, we could just add the link to the href too, but make click events ignore the default link-following behaviour.

@noerw noerw added type/enhancement An improvement of existing functionality topic/ui Change the appearance of the Gitea UI issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself and removed type/enhancement An improvement of existing functionality labels Jul 10, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants