diff options
author | lonix1 <40320097+lonix1@users.noreply.github.com> | 2025-01-01 12:07:10 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2025-01-05 14:46:19 +0100 |
commit | e7bc13a0bead7763ef10bdf6c6393148378e95fa (patch) | |
tree | be617ff3351a93115398a5194fa75f47228694a9 | |
parent | Use project's redirect url instead of composing url (#33058) (diff) | |
download | forgejo-e7bc13a0bead7763ef10bdf6c6393148378e95fa.tar.xz forgejo-e7bc13a0bead7763ef10bdf6c6393148378e95fa.zip |
feat: link to nuget dependencies (#26554)
Add links to dependencies and their versions, as done in nuget site.
Makes it easier to use.
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit d030cace1a6fc19874ab5a2ae20544c702fcb6c5)
-rw-r--r-- | options/locale/locale_en-US.ini | 1 | ||||
-rw-r--r-- | templates/package/content/nuget.tmpl | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 97d33f9e40..8e34e8c41e 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3642,6 +3642,7 @@ versions = Versions versions.view_all = View all dependency.id = ID dependency.version = Version +search_in_external_registry = Search in %s alpine.registry = Setup this registry by adding the url in your <code>/etc/apk/repositories</code> file: alpine.registry.key = Download the registry public RSA key into the <code>/etc/apk/keys/</code> folder to verify the index signature: alpine.registry.info = Choose $branch and $repository from the list below. diff --git a/templates/package/content/nuget.tmpl b/templates/package/content/nuget.tmpl index ea665c7bbc..c8568845f1 100644 --- a/templates/package/content/nuget.tmpl +++ b/templates/package/content/nuget.tmpl @@ -35,11 +35,12 @@ </tr> </thead> <tbody> + {{$tooltipSearchInNuget := ctx.Locale.Tr "packages.search_in_external_registry" "nuget.org"}} {{range $framework, $dependencies := .PackageDescriptor.Metadata.Dependencies}} {{range $dependencies}} <tr> - <td>{{.ID}}</td> - <td>{{.Version}}</td> + <td>{{.ID}} <a target="_blank" rel="noreferrer" href="https://www.nuget.org/packages/{{.ID}}" data-tooltip-content="{{$tooltipSearchInNuget}}">{{svg "octicon-link-external"}}</a></td> + <td>{{.Version}} <a target="_blank" rel="noreferrer" href="https://www.nuget.org/packages/{{.ID}}/{{.Version}}" data-tooltip-content="{{$tooltipSearchInNuget}}">{{svg "octicon-link-external"}}</a></td> <td>{{$framework}}</td> </tr> {{end}} |