Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #512 from NuGet/tab-completion

Packages tab completion info API
  • Loading branch information...
commit 764a1f2c9ac43f3cf8ae7b37b0be59d9951ca02f 2 parents 3064088 + 2ac072b
@half-ogre half-ogre authored
Showing with 465 additions and 414 deletions.
  1. +3 −3 Facts/Controllers/CuratedPackagesControllerFacts.cs
  2. +26 −0 Website/ApiController.generated.cs
  3. +6 −0 Website/App_Start/ContainerBindings.cs
  4. +15 −5 Website/App_Start/Routes.cs
  5. +0 −2  Website/Constants.cs
  6. +26 −5 Website/Controllers/ApiController.cs
  7. +1 −1  Website/Controllers/AppController.cs
  8. +3 −3 Website/Controllers/CuratedFeedsController.cs
  9. +6 −6 Website/Controllers/CuratedPackagesController.cs
  10. +82 −0 Website/CuratedFeedsController.generated.cs
  11. +122 −0 Website/CuratedPackagesController.generated.cs
  12. +0 −48 Website/HelpersController.generated.cs
  13. +32 −0 Website/Infrastructure/JsonNetResult.cs
  14. +0 −16 Website/JsonApiController.generated.cs
  15. +1 −143 Website/PackagesController.generated.cs
  16. +1 −30 Website/PagesController.generated.cs
  17. +49 −0 Website/Queries/PackageIdsQuery.cs
  18. +5 −0 Website/Queries/PackageRegistrationByIdQuery.cs
  19. +43 −0 Website/Queries/PackageVersionsQuery.cs
  20. +5 −16 Website/SharedController.generated.cs
  21. +6 −1 Website/T4MVC.cs
  22. +1 −114 Website/UsersController.generated.cs
  23. +1 −1  Website/Views/CuratedPackages/CreateCuratedPackageForm.cshtml
  24. +30 −20 Website/Website.csproj
  25. +1 −0  Website/packages.config
View
6 Facts/Controllers/CuratedPackagesControllerFacts.cs
@@ -101,7 +101,7 @@ public void WillPushTheCuratedFeedNameIntoTheViewBagAndShowTheCreateCuratedPacka
{
var controller = new TestableCuratedPackagesController();
controller.StubCuratedFeed.Name = "theCuratedFeedName";
- controller.StubPackageRegistrationByIdQry.Setup(stub => stub.Execute(It.IsAny<string>(), It.IsAny<bool>())).Returns((PackageRegistration)null);
+ controller.StubPackageRegistrationByIdQry.Setup(stub => stub.Execute(It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<bool>())).Returns((PackageRegistration)null);
var result = controller.PostCuratedPackages("aFeedName", new CreateCuratedPackageRequest()) as ViewResult;
@@ -150,7 +150,7 @@ public void WillShowAnErrorWhenThePackageHasAlreadyBeenCurated()
var controller = new TestableCuratedPackagesController();
controller.StubCuratedFeed.Name = "theCuratedFeedName";
controller.StubCuratedFeed.Packages.Add(new CuratedPackage{ PackageRegistration = new PackageRegistration{ Key = 42 } });
- controller.StubPackageRegistrationByIdQry.Setup(stub => stub.Execute(It.IsAny<string>(), It.IsAny<bool>())).Returns((new PackageRegistration{ Key = 42 }));
+ controller.StubPackageRegistrationByIdQry.Setup(stub => stub.Execute(It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<bool>())).Returns((new PackageRegistration { Key = 42 }));
var result = controller.PostCuratedPackages("theCuratedFeedName", new CreateCuratedPackageRequest()) as ViewResult;
@@ -168,7 +168,7 @@ public TestableCuratedPackagesController()
.Setup(stub => stub.Execute(It.IsAny<string>(), It.IsAny<bool>()))
.Returns(StubCuratedFeed);
StubPackageRegistrationByIdQry
- .Setup(stub => stub.Execute(It.IsAny<string>(), It.IsAny<bool>()))
+ .Setup(stub => stub.Execute(It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<bool>()))
.Returns(StubPackageRegistration);
}
}
View
26 Website/ApiController.generated.cs
@@ -61,6 +61,16 @@ public partial class ApiController {
public System.Web.Mvc.ActionResult PublishPackage() {
return new T4MVC_ActionResult(Area, Name, ActionNames.PublishPackage);
}
+ [NonAction]
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public System.Web.Mvc.ActionResult GetPackageIds() {
+ return new T4MVC_ActionResult(Area, Name, ActionNames.GetPackageIds);
+ }
+ [NonAction]
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public System.Web.Mvc.ActionResult GetPackageVersions() {
+ return new T4MVC_ActionResult(Area, Name, ActionNames.GetPackageVersions);
+ }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ApiController Actions { get { return MVC.Api; } }
@@ -81,6 +91,8 @@ public class ActionNamesClass {
public readonly string CreatePackagePost = "PushPackageApi";
public readonly string DeletePackage = "DeletePackageApi";
public readonly string PublishPackage = "PublishPackageApi";
+ public readonly string GetPackageIds = "PackageIDs";
+ public readonly string GetPackageVersions = "PackageVersions";
}
@@ -144,6 +156,20 @@ public class T4MVC_ApiController: NuGetGallery.ApiController {
return callInfo;
}
+ public override System.Web.Mvc.ActionResult GetPackageIds(string partialId, bool? includePrerelease) {
+ var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.GetPackageIds);
+ callInfo.RouteValueDictionary.Add("partialId", partialId);
+ callInfo.RouteValueDictionary.Add("includePrerelease", includePrerelease);
+ return callInfo;
+ }
+
+ public override System.Web.Mvc.ActionResult GetPackageVersions(string id, bool? includePrerelease) {
+ var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.GetPackageVersions);
+ callInfo.RouteValueDictionary.Add("id", id);
+ callInfo.RouteValueDictionary.Add("includePrerelease", includePrerelease);
+ return callInfo;
+ }
+
}
}
View
6 Website/App_Start/ContainerBindings.cs
@@ -207,6 +207,12 @@ public override void Load()
Bind<IUserByUsernameQuery>()
.To<UserByUsernameQuery>()
.InRequestScope();
+ Bind<IPackageIdsQuery>()
+ .To<PackageIdsQuery>()
+ .InRequestScope();
+ Bind<IPackageVersionsQuery>()
+ .To<PackageVersionsQuery>()
+ .InRequestScope();
}
}
}
View
20 Website/App_Start/Routes.cs
@@ -100,22 +100,22 @@ public static void RegisterRoutes(RouteCollection routes)
routes.MapRoute(
RouteName.CuratedFeed,
"curated-feeds/{name}",
- new { controller = CuratedFeedsController.Name, action = "CuratedFeed" });
+ new { controller = CuratedFeedsController.ControllerName, action = "CuratedFeed" });
routes.MapRoute(
RouteName.CreateCuratedPackageForm,
"forms/add-package-to-curated-feed",
- new { controller = CuratedPackagesController.Name, action = "CreateCuratedPackageForm" });
+ new { controller = CuratedPackagesController.ControllerName, action = "CreateCuratedPackageForm" });
routes.MapRoute(
RouteName.CuratedPackage,
"curated-feeds/{curatedFeedName}/curated-packages/{curatedPackageId}",
- new { controller = CuratedPackagesController.Name, action = "CuratedPackage" });
+ new { controller = CuratedPackagesController.ControllerName, action = "CuratedPackage" });
routes.MapRoute(
RouteName.CuratedPackages,
"curated-feeds/{curatedFeedName}/curated-packages",
- new { controller = CuratedPackagesController.Name, action = "CuratedPackages" });
+ new { controller = CuratedPackagesController.ControllerName, action = "CuratedPackages" });
// TODO : Most of the routes are essentially of the format api/v{x}/*. We should refactor the code to vary them by the version.
// V1 Routes
@@ -198,6 +198,16 @@ public static void RegisterRoutes(RouteCollection routes)
defaults: null,
constraints: new { httpMethod = new HttpMethodConstraint("DELETE") });
+ routes.MapRoute(
+ "v2PackageIds",
+ "api/v2/package-ids",
+ MVC.Api.GetPackageIds());
+
+ routes.MapRoute(
+ "v2PackageVersions",
+ "api/v2/package-versions/{id}",
+ MVC.Api.GetPackageVersions());
+
routes.MapServiceRoute(
RouteName.V2ApiCuratedFeed,
"api/v2/curated-feed",
@@ -239,7 +249,7 @@ public static void RegisterRoutes(RouteCollection routes)
// r => r.MapRoute(
// "EditPackage",
// "Package/Edit/{id}/{version}",
- // new { controller = PackagesController.Name, action = "EditPackage" }),
+ // new { controller = PackagesController.ControllerName, action = "EditPackage" }),
// permanent: true).To(packageVersionActionRoute);
routes.Redirect(
View
2  Website/Constants.cs
@@ -28,8 +28,6 @@ public static class Constants
public const string UploadFileNameTemplate = "{0}{1}";
public const string UploadsFolderName = "uploads";
-
public const string NuGetCommandLinePackageId = "NuGet.CommandLine";
-
}
}
View
31 Website/Controllers/ApiController.cs
@@ -1,15 +1,18 @@
using System;
+using System.Collections.Generic;
+using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
+using System.Runtime.Serialization;
using System.Web.Mvc;
using System.Web.UI;
using NuGet;
namespace NuGetGallery
{
- public partial class ApiController : Controller
+ public partial class ApiController : AppController
{
private readonly IPackageService packageSvc;
private readonly IUserService userSvc;
@@ -30,8 +33,8 @@ public partial class ApiController : Controller
[ActionName("GetPackageApi"), HttpGet]
public virtual ActionResult GetPackage(string id, string version)
{
- // if the version is null, the user is asking for the latest version. Presumably they don't want pre release versions.
- // The allow prerelease flag is ignored if both id and version are specified.
+ // if the version is null, the user is asking for the latest version. Presumably they don't want includePrerelease release versions.
+ // The allow prerelease flag is ignored if both partialId and version are specified.
var package = packageSvc.FindPackageByIdAndVersion(id, version, allowPrerelease: false);
if (package == null)
@@ -72,7 +75,7 @@ public virtual ActionResult VerifyPackageKey(string apiKey, string id, string ve
if (!String.IsNullOrEmpty(id))
{
- // If the id is present, then verify that the user has permission to push for the specific Id \ version combination.
+ // If the partialId is present, then verify that the user has permission to push for the specific Id \ version combination.
var package = packageSvc.FindPackageByIdAndVersion(id, version);
if (package == null)
return new HttpStatusCodeWithBodyResult(HttpStatusCode.NotFound, string.Format(CultureInfo.CurrentCulture, Strings.PackageWithIdAndVersionNotFound, id, version));
@@ -110,7 +113,7 @@ private ActionResult CreatePackageInternal(string apiKey)
var packageToPush = ReadPackageFromRequest();
- // Ensure that the user can push packages for this id.
+ // Ensure that the user can push packages for this partialId.
var packageRegistration = packageSvc.FindPackageRegistrationById(packageToPush.Id);
if (packageRegistration != null)
{
@@ -189,5 +192,23 @@ protected internal virtual IPackage ReadPackageFromRequest()
return new ZipPackage(stream);
}
+
+ [ActionName("PackageIDs"), HttpGet]
+ public virtual ActionResult GetPackageIds(
+ string partialId,
+ bool? includePrerelease)
+ {
+ var qry = GetService<IPackageIdsQuery>();
+ return new JsonNetResult(qry.Execute(partialId, includePrerelease).ToArray());
+ }
+
+ [ActionName("PackageVersions"), HttpGet]
+ public virtual ActionResult GetPackageVersions(
+ string id,
+ bool? includePrerelease)
+ {
+ var qry = GetService<IPackageVersionsQuery>();
+ return new JsonNetResult(qry.Execute(id, includePrerelease).ToArray());
+ }
}
}
View
2  Website/Controllers/AppController.cs
@@ -3,7 +3,7 @@
namespace NuGetGallery
{
- public class AppController : Controller
+ public abstract class AppController : Controller
{
protected virtual IIdentity Identity
{
View
6 Website/Controllers/CuratedFeedsController.cs
@@ -4,12 +4,12 @@
namespace NuGetGallery
{
[Authorize]
- public class CuratedFeedsController : AppController
+ public partial class CuratedFeedsController : AppController
{
- public const string Name = "CuratedFeeds";
+ public const string ControllerName = "CuratedFeeds";
[HttpGet]
- public ActionResult CuratedFeed(string name)
+ public virtual ActionResult CuratedFeed(string name)
{
var curatedFeed = GetService<ICuratedFeedByNameQuery>().Execute(name, includePackages: true);
if (curatedFeed == null)
View
12 Website/Controllers/CuratedPackagesController.cs
@@ -4,12 +4,12 @@
namespace NuGetGallery
{
[Authorize]
- public class CuratedPackagesController : AppController
+ public partial class CuratedPackagesController : AppController
{
- public const string Name = "CuratedPackages";
+ public const string ControllerName = "CuratedPackages";
[ActionName("CreateCuratedPackageForm"), HttpGet]
- public ActionResult GetCreateCuratedPackageForm(string curatedFeedName)
+ public virtual ActionResult GetCreateCuratedPackageForm(string curatedFeedName)
{
var curatedFeed = GetService<ICuratedFeedByNameQuery>().Execute(curatedFeedName);
if (curatedFeed == null)
@@ -23,7 +23,7 @@ public ActionResult GetCreateCuratedPackageForm(string curatedFeedName)
}
[ActionName("CuratedPackage"), HttpDelete]
- public ActionResult DeleteCuratedPackage(
+ public virtual ActionResult DeleteCuratedPackage(
string curatedFeedName,
string curatedPackageId)
{
@@ -46,7 +46,7 @@ public ActionResult GetCreateCuratedPackageForm(string curatedFeedName)
}
[ActionName("CuratedPackage"), AcceptVerbs("patch")]
- public ActionResult PatchCuratedPackage(
+ public virtual ActionResult PatchCuratedPackage(
string curatedFeedName,
string curatedPackageId,
ModifyCuratedPackageRequest request)
@@ -74,7 +74,7 @@ public ActionResult GetCreateCuratedPackageForm(string curatedFeedName)
}
[ActionName("CuratedPackages"), HttpPost]
- public ActionResult PostCuratedPackages(
+ public virtual ActionResult PostCuratedPackages(
string curatedFeedName,
CreateCuratedPackageRequest request)
{
View
82 Website/CuratedFeedsController.generated.cs
@@ -0,0 +1,82 @@
+// <auto-generated />
+// This file was generated by a T4 template.
+// Don't change it directly as your change would get overwritten. Instead, make changes
+// to the .tt file (i.e. the T4 template) and save it to regenerate this file.
+
+// Make sure the compiler doesn't complain about missing Xml comments
+#pragma warning disable 1591
+#region T4MVC
+
+using System;
+using System.Diagnostics;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Web;
+using System.Web.Hosting;
+using System.Web.Mvc;
+using System.Web.Mvc.Ajax;
+using System.Web.Mvc.Html;
+using System.Web.Routing;
+using T4MVC;
+namespace NuGetGallery {
+ public partial class CuratedFeedsController {
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public CuratedFeedsController() { }
+
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ protected CuratedFeedsController(Dummy d) { }
+
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ protected RedirectToRouteResult RedirectToAction(ActionResult result) {
+ var callInfo = result.GetT4MVCResult();
+ return RedirectToRoute(callInfo.RouteValueDictionary);
+ }
+
+ [NonAction]
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public System.Web.Mvc.ActionResult CuratedFeed() {
+ return new T4MVC_ActionResult(Area, Name, ActionNames.CuratedFeed);
+ }
+
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public CuratedFeedsController Actions { get { return MVC.CuratedFeeds; } }
+ [GeneratedCode("T4MVC", "2.0")]
+ public readonly string Area = "";
+ [GeneratedCode("T4MVC", "2.0")]
+ public readonly string Name = "CuratedFeeds";
+
+ static readonly ActionNamesClass s_actions = new ActionNamesClass();
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public ActionNamesClass ActionNames { get { return s_actions; } }
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public class ActionNamesClass {
+ public readonly string CuratedFeed = "CuratedFeed";
+ }
+
+
+ static readonly ViewNames s_views = new ViewNames();
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public ViewNames Views { get { return s_views; } }
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public class ViewNames {
+ public readonly string CuratedFeed = "~/Views/CuratedFeeds/CuratedFeed.cshtml";
+ }
+ }
+
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public class T4MVC_CuratedFeedsController: NuGetGallery.CuratedFeedsController {
+ public T4MVC_CuratedFeedsController() : base(Dummy.Instance) { }
+
+ public override System.Web.Mvc.ActionResult CuratedFeed(string name) {
+ var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.CuratedFeed);
+ callInfo.RouteValueDictionary.Add("name", name);
+ return callInfo;
+ }
+
+ }
+}
+
+#endregion T4MVC
+#pragma warning restore 1591
View
122 Website/CuratedPackagesController.generated.cs
@@ -0,0 +1,122 @@
+// <auto-generated />
+// This file was generated by a T4 template.
+// Don't change it directly as your change would get overwritten. Instead, make changes
+// to the .tt file (i.e. the T4 template) and save it to regenerate this file.
+
+// Make sure the compiler doesn't complain about missing Xml comments
+#pragma warning disable 1591
+#region T4MVC
+
+using System;
+using System.Diagnostics;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Web;
+using System.Web.Hosting;
+using System.Web.Mvc;
+using System.Web.Mvc.Ajax;
+using System.Web.Mvc.Html;
+using System.Web.Routing;
+using T4MVC;
+namespace NuGetGallery {
+ public partial class CuratedPackagesController {
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public CuratedPackagesController() { }
+
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ protected CuratedPackagesController(Dummy d) { }
+
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ protected RedirectToRouteResult RedirectToAction(ActionResult result) {
+ var callInfo = result.GetT4MVCResult();
+ return RedirectToRoute(callInfo.RouteValueDictionary);
+ }
+
+ [NonAction]
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public System.Web.Mvc.ActionResult GetCreateCuratedPackageForm() {
+ return new T4MVC_ActionResult(Area, Name, ActionNames.GetCreateCuratedPackageForm);
+ }
+ [NonAction]
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public System.Web.Mvc.ActionResult DeleteCuratedPackage() {
+ return new T4MVC_ActionResult(Area, Name, ActionNames.DeleteCuratedPackage);
+ }
+ [NonAction]
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public System.Web.Mvc.ActionResult PatchCuratedPackage() {
+ return new T4MVC_ActionResult(Area, Name, ActionNames.PatchCuratedPackage);
+ }
+ [NonAction]
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public System.Web.Mvc.ActionResult PostCuratedPackages() {
+ return new T4MVC_ActionResult(Area, Name, ActionNames.PostCuratedPackages);
+ }
+
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public CuratedPackagesController Actions { get { return MVC.CuratedPackages; } }
+ [GeneratedCode("T4MVC", "2.0")]
+ public readonly string Area = "";
+ [GeneratedCode("T4MVC", "2.0")]
+ public readonly string Name = "CuratedPackages";
+
+ static readonly ActionNamesClass s_actions = new ActionNamesClass();
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public ActionNamesClass ActionNames { get { return s_actions; } }
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public class ActionNamesClass {
+ public readonly string GetCreateCuratedPackageForm = "CreateCuratedPackageForm";
+ public readonly string DeleteCuratedPackage = "CuratedPackage";
+ public readonly string PatchCuratedPackage = "CuratedPackage";
+ public readonly string PostCuratedPackages = "CuratedPackages";
+ }
+
+
+ static readonly ViewNames s_views = new ViewNames();
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public ViewNames Views { get { return s_views; } }
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public class ViewNames {
+ public readonly string CreateCuratedPackageForm = "~/Views/CuratedPackages/CreateCuratedPackageForm.cshtml";
+ }
+ }
+
+ [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
+ public class T4MVC_CuratedPackagesController: NuGetGallery.CuratedPackagesController {
+ public T4MVC_CuratedPackagesController() : base(Dummy.Instance) { }
+
+ public override System.Web.Mvc.ActionResult GetCreateCuratedPackageForm(string curatedFeedName) {
+ var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.GetCreateCuratedPackageForm);
+ callInfo.RouteValueDictionary.Add("curatedFeedName", curatedFeedName);
+ return callInfo;
+ }
+
+ public override System.Web.Mvc.ActionResult DeleteCuratedPackage(string curatedFeedName, string curatedPackageId) {
+ var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.DeleteCuratedPackage);
+ callInfo.RouteValueDictionary.Add("curatedFeedName", curatedFeedName);
+ callInfo.RouteValueDictionary.Add("curatedPackageId", curatedPackageId);
+ return callInfo;
+ }
+
+ public override System.Web.Mvc.ActionResult PatchCuratedPackage(string curatedFeedName, string curatedPackageId, NuGetGallery.ModifyCuratedPackageRequest request) {
+ var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.PatchCuratedPackage);
+ callInfo.RouteValueDictionary.Add("curatedFeedName", curatedFeedName);
+ callInfo.RouteValueDictionary.Add("curatedPackageId", curatedPackageId);
+ callInfo.RouteValueDictionary.Add("request", request);
+ return callInfo;
+ }
+
+ public override System.Web.Mvc.ActionResult PostCuratedPackages(string curatedFeedName, NuGetGallery.CreateCuratedPackageRequest request) {
+ var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.PostCuratedPackages);
+ callInfo.RouteValueDictionary.Add("curatedFeedName", curatedFeedName);
+ callInfo.RouteValueDictionary.Add("request", request);
+ return callInfo;
+ }
+
+ }
+}
+
+#endregion T4MVC
+#pragma warning restore 1591
View
48 Website/HelpersController.generated.cs
@@ -1,48 +0,0 @@
-// <auto-generated />
-// This file was generated by a T4 template.
-// Don't change it directly as your change would get overwritten. Instead, make changes
-// to the .tt file (i.e. the T4 template) and save it to regenerate this file.
-
-// Make sure the compiler doesn't complain about missing Xml comments
-#pragma warning disable 1591
-#region T4MVC
-
-using System;
-using System.Diagnostics;
-using System.CodeDom.Compiler;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Web;
-using System.Web.Hosting;
-using System.Web.Mvc;
-using System.Web.Mvc.Ajax;
-using System.Web.Mvc.Html;
-using System.Web.Routing;
-using T4MVC;
-
-
-
-namespace T4MVC {
-
- public class HelpersController {
-
-
- static readonly ViewNames s_views = new ViewNames();
- [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
- public ViewNames Views { get { return s_views; } }
- [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
- public class ViewNames {
-public readonly string ViewHelpers = "~/Views/Helpers/ViewHelpers.cshtml";
-
- }
- }
-
-
-
-}
-
-
-
-#endregion T4MVC
-#pragma warning restore 1591
View
32 Website/Infrastructure/JsonNetResult.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Web.Mvc;
+using Newtonsoft.Json;
+
+namespace NuGetGallery
+{
+ public class JsonNetResult : ActionResult
+ {
+ private readonly object _data;
+
+ public JsonNetResult(object data)
+ {
+ if (data == null)
+ throw new ArgumentNullException("data");
+
+ _data = data;
+ }
+
+ public override void ExecuteResult(ControllerContext context)
+ {
+ if (context == null)
+ throw new ArgumentNullException("context");
+
+ var response = context.HttpContext.Response;
+ response.ContentType = "application/json";
+ var writer = new JsonTextWriter(response.Output);
+ var serializer = JsonSerializer.Create(new JsonSerializerSettings());
+ serializer.Serialize(writer, _data);
+ writer.Flush();
+ }
+ }
+}
View
16 Website/JsonApiController.generated.cs
@@ -20,14 +20,8 @@
using System.Web.Mvc.Html;
using System.Web.Routing;
using T4MVC;
-
-
-
namespace NuGetGallery {
-
public partial class JsonApiController {
-
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
protected JsonApiController(Dummy d) { }
@@ -38,7 +32,6 @@ public partial class JsonApiController {
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public JsonApiController Actions { get { return MVC.JsonApi; } }
[GeneratedCode("T4MVC", "2.0")]
@@ -51,32 +44,23 @@ public partial class JsonApiController {
public ActionNamesClass ActionNames { get { return s_actions; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionNamesClass {
-
}
-
static readonly ViewNames s_views = new ViewNames();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewNames Views { get { return s_views; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ViewNames {
-
}
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class T4MVC_JsonApiController: NuGetGallery.JsonApiController {
public T4MVC_JsonApiController() : base(Dummy.Instance) { }
-
}
-
-
}
-
-
#endregion T4MVC
#pragma warning restore 1591
View
144 Website/PackagesController.generated.cs
@@ -20,14 +20,8 @@
using System.Web.Mvc.Html;
using System.Web.Routing;
using T4MVC;
-
-
-
namespace NuGetGallery {
-
public partial class PackagesController {
-
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
protected PackagesController(Dummy d) { }
@@ -37,56 +31,47 @@ public partial class PackagesController {
return RedirectToRoute(callInfo.RouteValueDictionary);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult DisplayPackage() {
return new T4MVC_ActionResult(Area, Name, ActionNames.DisplayPackage);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult ListPackages() {
return new T4MVC_ActionResult(Area, Name, ActionNames.ListPackages);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult ReportAbuse() {
return new T4MVC_ActionResult(Area, Name, ActionNames.ReportAbuse);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult ContactOwners() {
return new T4MVC_ActionResult(Area, Name, ActionNames.ContactOwners);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult ManagePackageOwners() {
return new T4MVC_ActionResult(Area, Name, ActionNames.ManagePackageOwners);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult Delete() {
return new T4MVC_ActionResult(Area, Name, ActionNames.Delete);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult Edit() {
return new T4MVC_ActionResult(Area, Name, ActionNames.Edit);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult ConfirmOwner() {
return new T4MVC_ActionResult(Area, Name, ActionNames.ConfirmOwner);
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public PackagesController Actions { get { return MVC.Packages; } }
[GeneratedCode("T4MVC", "2.0")]
@@ -99,53 +84,27 @@ public partial class PackagesController {
public ActionNamesClass ActionNames { get { return s_actions; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionNamesClass {
-
-
public readonly string UploadPackage = "UploadPackage";
-
-
public readonly string DisplayPackage = "DisplayPackage";
-
-
public readonly string ListPackages = "ListPackages";
-
-
public readonly string ReportAbuse = "ReportAbuse";
-
-
public readonly string ContactOwners = "ContactOwners";
-
-
public readonly string Download = "Download";
-
-
public readonly string ManagePackageOwners = "ManagePackageOwners";
-
-
public readonly string Delete = "Delete";
-
-
public readonly string Edit = "Edit";
-
-
public readonly string ConfirmOwner = "ConfirmOwner";
-
-
public readonly string VerifyPackage = "VerifyPackage";
-
-
public readonly string CancelUpload = "CancelUpload";
-
}
-
static readonly ViewNames s_views = new ViewNames();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewNames Views { get { return s_views; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ViewNames {
-public readonly string _ListPackage = "~/Views/Packages/_ListPackage.cshtml";
+ public readonly string _ListPackage = "~/Views/Packages/_ListPackage.cshtml";
public readonly string ConfirmOwner = "~/Views/Packages/ConfirmOwner.cshtml";
public readonly string ContactOwners = "~/Views/Packages/ContactOwners.cshtml";
public readonly string Delete = "~/Views/Packages/Delete.cshtml";
@@ -157,236 +116,135 @@ public class ViewNames {
public readonly string ReportAbuse = "~/Views/Packages/ReportAbuse.cshtml";
public readonly string UploadPackage = "~/Views/Packages/UploadPackage.cshtml";
public readonly string VerifyPackage = "~/Views/Packages/VerifyPackage.cshtml";
-
}
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class T4MVC_PackagesController: NuGetGallery.PackagesController {
public T4MVC_PackagesController() : base(Dummy.Instance) { }
-
public override System.Web.Mvc.ActionResult UploadPackage() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.UploadPackage);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult UploadPackage(System.Web.HttpPostedFileBase uploadFile) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.UploadPackage);
-
-
callInfo.RouteValueDictionary.Add("uploadFile", uploadFile);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult DisplayPackage(string id, string version) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.DisplayPackage);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("version", version);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ListPackages(string q, string sortOrder, int page) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ListPackages);
-
-
callInfo.RouteValueDictionary.Add("q", q);
-
callInfo.RouteValueDictionary.Add("sortOrder", sortOrder);
-
callInfo.RouteValueDictionary.Add("page", page);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ReportAbuse(string id, string version) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ReportAbuse);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("version", version);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ReportAbuse(string id, string version, NuGetGallery.ReportAbuseViewModel reportForm) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ReportAbuse);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("version", version);
-
callInfo.RouteValueDictionary.Add("reportForm", reportForm);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ContactOwners(string id) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ContactOwners);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ContactOwners(string id, NuGetGallery.ContactOwnersViewModel contactForm) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ContactOwners);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("contactForm", contactForm);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Download() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Download);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ManagePackageOwners(string id, string version) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ManagePackageOwners);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("version", version);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Delete(string id, string version) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Delete);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("version", version);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Delete(string id, string version, bool? listed) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Delete);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("version", version);
-
callInfo.RouteValueDictionary.Add("listed", listed);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Edit(string id, string version) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Edit);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("version", version);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Edit(string id, string version, bool? listed) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Edit);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("version", version);
-
callInfo.RouteValueDictionary.Add("listed", listed);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ConfirmOwner(string id, string username, string token) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ConfirmOwner);
-
-
callInfo.RouteValueDictionary.Add("id", id);
-
callInfo.RouteValueDictionary.Add("username", username);
-
callInfo.RouteValueDictionary.Add("token", token);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult VerifyPackage() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.VerifyPackage);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult VerifyPackage(bool? listed) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.VerifyPackage);
-
-
callInfo.RouteValueDictionary.Add("listed", listed);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult CancelUpload() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.CancelUpload);
-
return callInfo;
}
-
}
-
-
}
-
-
#endregion T4MVC
#pragma warning restore 1591
View
31 Website/PagesController.generated.cs
@@ -20,18 +20,11 @@
using System.Web.Mvc.Html;
using System.Web.Routing;
using T4MVC;
-
-
-
namespace NuGetGallery {
-
public partial class PagesController {
-
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public PagesController() { }
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
protected PagesController(Dummy d) { }
@@ -42,7 +35,6 @@ public partial class PagesController {
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public PagesController Actions { get { return MVC.Pages; } }
[GeneratedCode("T4MVC", "2.0")]
@@ -55,65 +47,44 @@ public partial class PagesController {
public ActionNamesClass ActionNames { get { return s_actions; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionNamesClass {
-
-
public readonly string Home = "Home";
-
-
public readonly string Terms = "Terms";
-
-
public readonly string Privacy = "Privacy";
-
}
-
static readonly ViewNames s_views = new ViewNames();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewNames Views { get { return s_views; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ViewNames {
-public readonly string Home = "~/Views/Pages/Home.cshtml";
+ public readonly string Home = "~/Views/Pages/Home.cshtml";
public readonly string Privacy = "~/Views/Pages/Privacy.cshtml";
public readonly string Terms = "~/Views/Pages/Terms.cshtml";
-
}
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class T4MVC_PagesController: NuGetGallery.PagesController {
public T4MVC_PagesController() : base(Dummy.Instance) { }
-
public override System.Web.Mvc.ActionResult Home() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Home);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Terms() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Terms);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Privacy() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Privacy);
-
return callInfo;
}
-
}
-
-
}
-
-
#endregion T4MVC
#pragma warning restore 1591
View
49 Website/Queries/PackageIdsQuery.cs
@@ -0,0 +1,49 @@
+using System.Collections.Generic;
+using System.Data.Entity;
+
+namespace NuGetGallery
+{
+ public interface IPackageIdsQuery
+ {
+ IEnumerable<string> Execute(
+ string partialId,
+ bool? includePrerelease = false);
+ }
+
+ public class PackageIdsQuery : IPackageIdsQuery
+ {
+ const string _partialIdSqlFormat = @"SELECT TOP 30 pr.ID
+FROM Packages p
+ JOIN PackageRegistrations pr on pr.[Key] = p.PackageRegistrationKey
+WHERE pr.ID LIKE {{0}}
+ {0}
+GROUP BY pr.ID
+ORDER BY pr.ID";
+ private const string _noPartialIdSql = @"SELECT TOP 30 pr.ID
+FROM Packages p
+ JOIN PackageRegistrations pr on pr.[Key] = p.PackageRegistrationKey
+GROUP BY pr.ID
+ORDER BY MAX(pr.DownloadCount) DESC";
+ private readonly IEntitiesContext _entities;
+
+ public PackageIdsQuery(IEntitiesContext entities)
+ {
+ _entities = entities;
+ }
+
+ public IEnumerable<string> Execute(
+ string partialId,
+ bool? includePrerelease = false)
+ {
+ var dbContext = (DbContext)_entities;
+
+ if (string.IsNullOrWhiteSpace(partialId))
+ return dbContext.Database.SqlQuery<string>(_noPartialIdSql);
+
+ var prereleaseFilter = string.Empty;
+ if (!includePrerelease.HasValue || !includePrerelease.Value)
+ prereleaseFilter = "AND p.IsPrerelease = {1}";
+ return dbContext.Database.SqlQuery<string>(string.Format(_partialIdSqlFormat, prereleaseFilter), partialId + "%", includePrerelease ?? false);
+ }
+ }
+}
View
5 Website/Queries/PackageRegistrationByIdQuery.cs
@@ -7,6 +7,7 @@ public interface IPackageRegistrationByIdQuery
{
PackageRegistration Execute(
string id,
+ bool includePackages = false,
bool includeOwners = true);
}
@@ -21,10 +22,14 @@ public PackageRegistrationByIdQuery(IEntitiesContext entities)
public PackageRegistration Execute(
string id,
+ bool includePackages = false,
bool includeOwners = true)
{
var qry = _entities.PackageRegistrations.AsQueryable();
+ if (includePackages)
+ qry = qry.Include(packageRegistration => packageRegistration.Packages);
+
if (includeOwners)
qry = qry.Include(packageRegistration => packageRegistration.Owners);
View
43 Website/Queries/PackageVersionsQuery.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity;
+
+namespace NuGetGallery
+{
+ public interface IPackageVersionsQuery
+ {
+ IEnumerable<string> Execute(
+ string id,
+ bool? includePrerelease = false);
+ }
+
+ public class PackageVersionsQuery : IPackageVersionsQuery
+ {
+ const string _sqlFormat = @"SELECT p.[Version]
+FROM Packages p
+ JOIN PackageRegistrations pr on pr.[Key] = p.PackageRegistrationKey
+WHERE pr.ID = {{0}}
+ {0}";
+ private readonly IEntitiesContext _entities;
+
+ public PackageVersionsQuery(IEntitiesContext entities)
+ {
+ _entities = entities;
+ }
+
+ public IEnumerable<string> Execute(
+ string id,
+ bool? includePrerelease = false)
+ {
+ if (string.IsNullOrWhiteSpace(id))
+ throw new ArgumentNullException("id");
+
+ var dbContext = (DbContext)_entities;
+
+ var prereleaseFilter = string.Empty;
+ if (!includePrerelease.HasValue || !includePrerelease.Value)
+ prereleaseFilter = "AND p.IsPrerelease = 0";
+ return dbContext.Database.SqlQuery<string>(string.Format(_sqlFormat, prereleaseFilter), id);
+ }
+ }
+}
View
21 Website/SharedController.generated.cs
@@ -20,38 +20,27 @@
using System.Web.Mvc.Html;
using System.Web.Routing;
using T4MVC;
-
-
-
namespace T4MVC {
-
public class SharedController {
-
static readonly ViewNames s_views = new ViewNames();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewNames Views { get { return s_views; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ViewNames {
-public readonly string Error = "~/Views/Shared/Error.cshtml";
+ public readonly string Error = "~/Views/Shared/Error.cshtml";
public readonly string Layout = "~/Views/Shared/Layout.cshtml";
public readonly string TwoColumnLayout = "~/Views/Shared/TwoColumnLayout.cshtml";
public readonly string UserDisplay = "~/Views/Shared/UserDisplay.cshtml";
-
-static readonly _EditorTemplates s_EditorTemplates = new _EditorTemplates();
-public _EditorTemplates EditorTemplates { get { return s_EditorTemplates; } }
-public partial class _EditorTemplates{
-public readonly string Object = "Object";
+ static readonly _EditorTemplates s_EditorTemplates = new _EditorTemplates();
+ public _EditorTemplates EditorTemplates { get { return s_EditorTemplates; } }
+ public partial class _EditorTemplates{
+ public readonly string Object = "Object";
}
-
}
}
-
-
}
-
-
#endregion T4MVC
#pragma warning restore 1591
View
7 Website/T4MVC.cs
@@ -25,11 +25,12 @@
public static class MVC {
public static NuGetGallery.ApiController Api = new NuGetGallery.T4MVC_ApiController();
public static NuGetGallery.AuthenticationController Authentication = new NuGetGallery.T4MVC_AuthenticationController();
+ public static NuGetGallery.CuratedFeedsController CuratedFeeds = new NuGetGallery.T4MVC_CuratedFeedsController();
+ public static NuGetGallery.CuratedPackagesController CuratedPackages = new NuGetGallery.T4MVC_CuratedPackagesController();
public static NuGetGallery.JsonApiController JsonApi = new NuGetGallery.T4MVC_JsonApiController();
public static NuGetGallery.PackagesController Packages = new NuGetGallery.T4MVC_PackagesController();
public static NuGetGallery.PagesController Pages = new NuGetGallery.T4MVC_PagesController();
public static NuGetGallery.UsersController Users = new NuGetGallery.T4MVC_UsersController();
- public static T4MVC.HelpersController Helpers = new T4MVC.HelpersController();
public static T4MVC.SharedController Shared = new T4MVC.SharedController();
}
@@ -325,6 +326,9 @@ public static class Scripts {
public static readonly string modernizr_2_0_6_development_only_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/modernizr-2.0.6-development-only.min.js") ? Url("modernizr-2.0.6-development-only.min.js") : Url("modernizr-2.0.6-development-only.js");
+ public static readonly string ZeroClipboard_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/ZeroClipboard.min.js") ? Url("ZeroClipboard.min.js") : Url("ZeroClipboard.js");
+
+ public static readonly string ZeroClipboard_swf = Url("ZeroClipboard.swf");
}
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
@@ -338,6 +342,7 @@ public static class Images {
public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); }
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); }
public static readonly string changePassword_png = Url("changePassword.png");
+ public static readonly string copy_png = Url("copy.png");
public static readonly string download_png = Url("download.png");
public static readonly string editIcon_png = Url("editIcon.png");
public static readonly string editProfile_png = Url("editProfile.png");
View
115 Website/UsersController.generated.cs
@@ -20,14 +20,8 @@
using System.Web.Mvc.Html;
using System.Web.Routing;
using T4MVC;
-
-
-
namespace NuGetGallery {
-
public partial class UsersController {
-
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
protected UsersController(Dummy d) { }
@@ -37,20 +31,17 @@ public partial class UsersController {
return RedirectToRoute(callInfo.RouteValueDictionary);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult Confirm() {
return new T4MVC_ActionResult(Area, Name, ActionNames.Confirm);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult Profiles() {
return new T4MVC_ActionResult(Area, Name, ActionNames.Profiles);
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public UsersController Actions { get { return MVC.Users; } }
[GeneratedCode("T4MVC", "2.0")]
@@ -63,59 +54,29 @@ public partial class UsersController {
public ActionNamesClass ActionNames { get { return s_actions; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionNamesClass {
-
-
public readonly string Account = "Account";
-
-
public readonly string Edit = "Edit";
-
-
public readonly string Register = "Register";
-
-
public readonly string Thanks = "Thanks";
-
-
public readonly string Packages = "Packages";
-
-
public readonly string GenerateApiKey = "GenerateApiKey";
-
-
public readonly string ForgotPassword = "ForgotPassword";
-
-
public readonly string ResendConfirmation = "ResendConfirmation";
-
-
public readonly string PasswordSent = "PasswordSent";
-
-
public readonly string ResetPassword = "ResetPassword";
-
-
public readonly string Confirm = "Confirm";
-
-
public readonly string Profiles = "Profiles";
-
-
public readonly string ChangePassword = "ChangePassword";
-
-
public readonly string PasswordChanged = "PasswordChanged";
-
}
-
static readonly ViewNames s_views = new ViewNames();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewNames Views { get { return s_views; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ViewNames {
-public readonly string Account = "~/Views/Users/Account.cshtml";
+ public readonly string Account = "~/Views/Users/Account.cshtml";
public readonly string ChangePassword = "~/Views/Users/ChangePassword.cshtml";
public readonly string Confirm = "~/Views/Users/Confirm.cshtml";
public readonly string Edit = "~/Views/Users/Edit.cshtml";
@@ -128,200 +89,126 @@ public class ViewNames {
public readonly string ResendConfirmation = "~/Views/Users/ResendConfirmation.cshtml";
public readonly string ResetPassword = "~/Views/Users/ResetPassword.cshtml";
public readonly string Thanks = "~/Views/Users/Thanks.cshtml";
-
}
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class T4MVC_UsersController: NuGetGallery.UsersController {
public T4MVC_UsersController() : base(Dummy.Instance) { }
-
public override System.Web.Mvc.ActionResult Account() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Account);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Edit() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Edit);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Edit(NuGetGallery.EditProfileViewModel profile) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Edit);
-
-
callInfo.RouteValueDictionary.Add("profile", profile);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Register() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Register);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Register(NuGetGallery.RegisterRequest request) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Register);
-
-
callInfo.RouteValueDictionary.Add("request", request);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Thanks() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Thanks);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Packages() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Packages);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult GenerateApiKey() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.GenerateApiKey);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ForgotPassword() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ForgotPassword);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ForgotPassword(NuGetGallery.ForgotPasswordViewModel model) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ForgotPassword);
-
-
callInfo.RouteValueDictionary.Add("model", model);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ResendConfirmation() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ResendConfirmation);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ResendConfirmation(NuGetGallery.ResendConfirmationEmailViewModel model) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ResendConfirmation);
-
-
callInfo.RouteValueDictionary.Add("model", model);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult PasswordSent() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.PasswordSent);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ResetPassword() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ResetPassword);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ResetPassword(string username, string token, NuGetGallery.PasswordResetViewModel model) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ResetPassword);
-
-
callInfo.RouteValueDictionary.Add("username", username);
-
callInfo.RouteValueDictionary.Add("token", token);
-
callInfo.RouteValueDictionary.Add("model", model);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Confirm(string username, string token) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Confirm);
-
-
callInfo.RouteValueDictionary.Add("username", username);
-
callInfo.RouteValueDictionary.Add("token", token);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult Profiles(string username) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.Profiles);
-
-
callInfo.RouteValueDictionary.Add("username", username);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ChangePassword() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ChangePassword);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult ChangePassword(NuGetGallery.PasswordChangeViewModel model) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.ChangePassword);
-
-
callInfo.RouteValueDictionary.Add("model", model);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult PasswordChanged() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.PasswordChanged);
-
return callInfo;
}
-
}
-
-
}
-
-
#endregion T4MVC
#pragma warning restore 1591
View
2  Website/Views/CuratedPackages/CreateCuratedPackageForm.cshtml
@@ -6,7 +6,7 @@
<p><strong>Note: </strong>Packages might also be automatically included in your curated feed based on pre-defined rules. This form is to manually include a package in the curated feed, which will override any pre-defined rules.</p>
}
<h1>Include Package in <i>@ViewBag.CuratedFeedName</i></h1>
-@using (Html.BeginForm("CuratedPackages", CuratedPackagesController.Name, new { curatedFeedName = ViewBag.CuratedFeedName }))
+@using (Html.BeginForm("CuratedPackages", CuratedPackagesController.ControllerName, new { curatedFeedName = ViewBag.CuratedFeedName }))
{
<fieldset class="form">
@Html.AntiForgeryToken()
View
50 Website/Website.csproj
@@ -92,6 +92,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MvcHaack.Ajax.1.1\lib\net40\MvcHaack.Ajax.dll</HintPath>
</Reference>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.5.6\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="Ninject">
<HintPath>..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll</HintPath>
</Reference>
@@ -120,6 +123,7 @@
<Reference Include="System.Data.Entity" />
<Reference Include="System.Data.Services" />
<Reference Include="System.Data.Services.Client" />
+ <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Activation" />
<Reference Include="System.ServiceModel.Web" />
@@ -183,6 +187,9 @@
<DependentUpon>T4MVC.tt</DependentUpon>
</Compile>
<Compile Include="App_Start\PackageStoreType.cs" />
+ <Compile Include="AuthenticationController.generated.cs">
+ <DependentUpon>T4MVC.tt</DependentUpon>
+ </Compile>
<Compile Include="Commands\AppCommand.cs" />
<Compile Include="Commands\DeleteCuratedPackageCommand.cs" />
<Compile Include="Commands\ModifyCuratedPackageCommand.cs" />
@@ -191,6 +198,12 @@
<Compile Include="Controllers\AppController.cs" />
<Compile Include="Controllers\CuratedFeedsController.cs" />
<Compile Include="Controllers\CuratedPackagesController.cs" />
+ <Compile Include="CuratedFeedsController.generated.cs">
+ <DependentUpon>T4MVC.tt</DependentUpon>
+ </Compile>
+ <Compile Include="CuratedPackagesController.generated.cs">
+ <DependentUpon>T4MVC.tt</DependentUpon>
+ </Compile>
<Compile Include="DataServices\V2CuratedFeed.svc.cs">
<DependentUpon>V2CuratedFeed.svc</DependentUpon>
</Compile>
@@ -219,13 +232,11 @@
<Compile Include="Entities\CuratedPackage.cs" />
<Compile Include="Entities\GallerySetting.cs" />
<Compile Include="Entities\PackageFramework.cs" />
- <Compile Include="HelpersController.generated.cs">
- <DependentUpon>T4MVC.tt</DependentUpon>
- </Compile>
<Compile Include="Infrastructure\HintAttribute.cs" />
<Compile Include="Infrastructure\HttpHeaderValueProvider.cs" />
<Compile Include="Infrastructure\HttpHeaderValueProviderFactory.cs" />
<Compile Include="Infrastructure\HttpStatusCodeWithBodyResult.cs" />
+ <Compile Include="Infrastructure\JsonNetResult.cs" />
<Compile Include="Infrastructure\Lucene\LuceneFileSystem.cs" />
<Compile Include="Infrastructure\Lucene\LuceneCommon.cs" />
<Compile Include="Infrastructure\Lucene\LuceneIndexingJob.cs" />
@@ -331,6 +342,11 @@
<Compile Include="PackagesController.generated.cs">
<DependentUpon>T4MVC.tt</DependentUpon>
</Compile>
+ <Compile Include="PagesController.generated.cs">
+ <DependentUpon>T4MVC.tt</DependentUpon>
+ </Compile>
+ <Compile Include="Queries\PackageVersionsQuery.cs" />
+ <Compile Include="Queries\PackageIdsQuery.cs" />
<Compile Include="Queries\PackageRegistrationByIdQuery.cs" />
<Compile Include="Queries\CuratedFeedByKeyQuery.cs" />
<Compile Include="Queries\CuratedFeedByNameQuery.cs" />
@@ -358,6 +374,17 @@
<Compile Include="Services\PackageSearchResults.cs" />
<Compile Include="Services\TestableStorageClientException.cs" />
<Compile Include="Services\UploadFileService.cs" />
+ <Compile Include="SharedController.generated.cs">
+ <DependentUpon>T4MVC.tt</DependentUpon>
+ </Compile>
+ <Compile Include="T4MVC.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>T4MVC.tt</DependentUpon>
+ </Compile>
+ <Compile Include="UsersController.generated.cs">
+ <DependentUpon>T4MVC.tt</DependentUpon>
+ </Compile>
<Compile Include="ViewModels\AccountViewModel.cs" />
<Compile Include="ViewModels\CuratedFeedViewModel.cs" />
<Compile Include="ViewModels\EditProfileViewModel.cs" />
@@ -366,9 +393,6 @@
<Compile Include="ViewModels\ResendConfirmationEmailViewModel.cs" />
<Compile Include="App_Start\AuthenticationModule.cs" />
<Compile Include="App_Start\AppActivator.cs" />
- <Compile Include="AuthenticationController.generated.cs">
- <DependentUpon>T4MVC.tt</DependentUpon>
- </Compile>
<Compile Include="Controllers\ApiController.cs" />
<Compile Include="Controllers\JsonApiController.cs" />
<Compile Include="Controllers\PagesController.cs" />
@@ -605,23 +629,9 @@
<Compile Include="Entities\Role.cs" />
<Compile Include="Infrastructure\CookieTempDataProvider.cs" />
<Compile Include="Infrastructure\NuGetControllerFactory.cs" />
- <Compile Include="PagesController.generated.cs">
- <DependentUpon>T4MVC.tt</DependentUpon>
- </Compile>
<Compile Include="Services\Extensions.cs" />
<Compile Include="Services\IMessageService.cs" />
<Compile Include="Services\MessageService.cs" />
- <Compile Include="SharedController.generated.cs">
- <DependentUpon>T4MVC.tt</DependentUpon>
- </Compile>
- <Compile Include="T4MVC.cs">
- <AutoGen>True</AutoGen>
- <DesignTime>True</DesignTime>
- <DependentUpon>T4MVC.tt</DependentUpon>
- </Compile>
- <Compile Include="UsersController.generated.cs">
- <DependentUpon>T4MVC.tt</DependentUpon>
- </Compile>
<Compile Include="ViewModels\PasswordChangeViewModel.cs" />
<Compile Include="ViewModels\ContactOwnersViewModel.cs" />
<Compile Include="ViewModels\PasswordResetViewModel.cs" />
View
1  Website/packages.config
@@ -22,6 +22,7 @@
<package id="MiniProfiler.MVC3" version="1.9.1" />
<package id="Modernizr" version="2.0.6" />
<package id="MvcHaack.Ajax" version="1.1" />
+ <package id="Newtonsoft.Json" version="4.5.6" />
<package id="Ninject" version="2.2.1.4" />
<package id="Ninject.MVC3" version="2.2.2.0" />
<package id="NuGet.Core" version="1.6.1" />
Please sign in to comment.
Something went wrong with that request. Please try again.