Skip to content

Commit

Permalink
Issue 1019 - Deeplink to NuGet Package Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmuehsig committed Apr 18, 2014
1 parent 41e087c commit 5335a5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/NuGetGallery/UrlExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ public static string PackageDownload(this UrlHelper url, int feedVersion, string
return version == null ? EnsureTrailingSlash(result) : result;
}

public static string ExplorerDeepLink(this UrlHelper url, int feedVersion, string id, string version)
{
string routeName = "v" + feedVersion + RouteName.DownloadPackage;
string protocol = url.RequestContext.HttpContext.Request.IsSecureConnection ? "https" : "http";
string urlResult = url.RouteUrl(routeName, new { Id = id }, protocol: protocol);

urlResult = EnsureTrailingSlash(urlResult);

string explorerDeepLink = @"https://npe.codeplex.com/releases/clickonce/NuGetPackageExplorer.application?url={0}&id={1}&version={2}";

return string.Format(explorerDeepLink, urlResult, id, version);
}

public static string LogOn(this UrlHelper url)
{
return url.RouteUrl(RouteName.Authentication, new { action = "LogOn" });
Expand Down
1 change: 1 addition & 0 deletions src/NuGetGallery/Views/Packages/DisplayPackage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
@if (User.Identity.IsAuthenticated)
{
<li><a href="@Url.PackageDownload(2, Model.Id, Model.Version)" title="Download the raw nupkg file.">Download</a></li>
<li><a href="@Url.ExplorerDeepLink(2, Model.Id, Model.Version)" title="Explore the nupkg with the NuGet Package Explorer (IE only)">Package Explorer</a></li>
}
else
{
Expand Down

0 comments on commit 5335a5d

Please sign in to comment.