From 0bd7d35d81e3fd384b9aaaa419a08e892d99444f Mon Sep 17 00:00:00 2001 From: anurse Date: Fri, 22 Nov 2013 09:52:07 -0800 Subject: [PATCH 1/2] UI updates on auth --- src/NuGetGallery/Content/Site.css | 1 + src/NuGetGallery/Views/Users/Account.cshtml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NuGetGallery/Content/Site.css b/src/NuGetGallery/Content/Site.css index bcb87f5400..cada2b583e 100644 --- a/src/NuGetGallery/Content/Site.css +++ b/src/NuGetGallery/Content/Site.css @@ -1045,6 +1045,7 @@ a.btn { color: white; text-decoration: none; padding: 1px 6px; + margin: 0px 6px; display: block; /* This won't work in IE7, but it will only produce a minor layout quirk */ -moz-box-sizing: border-box; diff --git a/src/NuGetGallery/Views/Users/Account.cshtml b/src/NuGetGallery/Views/Users/Account.cshtml index 16995b55b4..47ebcb9782 100644 --- a/src/NuGetGallery/Views/Users/Account.cshtml +++ b/src/NuGetGallery/Views/Users/Account.cshtml @@ -280,7 +280,7 @@ @if (hasPassword && credGroups.ContainsKey(CredentialKind.External) && credGroups[CredentialKind.External].Any()) {

- Because you have a third-party account registered you can remove your password below and use + Because you have a Microsoft account registered you can remove your password below and use that account to sign in to NuGet.org. No more passwords to forget!

} From e8a5fdff9d80cb75eb8650fad8483651eb02f0ec Mon Sep 17 00:00:00 2001 From: anurse Date: Fri, 22 Nov 2013 10:05:37 -0800 Subject: [PATCH 2/2] Fix error pages broken in PR #1700 --- src/NuGetGallery/App_Start/Routes.cs | 10 ++++++++++ .../Areas/Admin/Controllers/AdminControllerBase.cs | 2 +- src/NuGetGallery/Controllers/ErrorsController.cs | 2 +- src/NuGetGallery/Controllers/StatisticsController.cs | 2 +- src/NuGetGallery/RouteNames.cs | 2 ++ src/NuGetGallery/Views/NuGetViewBase.cs | 2 +- src/NuGetGallery/Web.config | 1 + 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/NuGetGallery/App_Start/Routes.cs b/src/NuGetGallery/App_Start/Routes.cs index d3d950846f..eac7f4da9c 100644 --- a/src/NuGetGallery/App_Start/Routes.cs +++ b/src/NuGetGallery/App_Start/Routes.cs @@ -14,6 +14,16 @@ public static void RegisterRoutes(RouteCollection routes) "", new { controller = MVC.Pages.Name, action = "Home" }); // T4MVC doesn't work with Async Action + routes.MapRoute( + RouteName.Error500, + "errors/500", + MVC.Errors.InternalError()); + + routes.MapRoute( + RouteName.Error404, + "errors/404", + MVC.Errors.NotFound()); + routes.MapRoute( RouteName.StatisticsHome, "stats", diff --git a/src/NuGetGallery/Areas/Admin/Controllers/AdminControllerBase.cs b/src/NuGetGallery/Areas/Admin/Controllers/AdminControllerBase.cs index d680477660..6114b3032e 100644 --- a/src/NuGetGallery/Areas/Admin/Controllers/AdminControllerBase.cs +++ b/src/NuGetGallery/Areas/Admin/Controllers/AdminControllerBase.cs @@ -3,7 +3,7 @@ namespace NuGetGallery.Areas.Admin.Controllers { [Authorize(Roles="Admins")] - public class AdminControllerBase : Controller + public class AdminControllerBase : AppController { } } \ No newline at end of file diff --git a/src/NuGetGallery/Controllers/ErrorsController.cs b/src/NuGetGallery/Controllers/ErrorsController.cs index 0afca74ec7..c0a8148ae0 100644 --- a/src/NuGetGallery/Controllers/ErrorsController.cs +++ b/src/NuGetGallery/Controllers/ErrorsController.cs @@ -2,7 +2,7 @@ namespace NuGetGallery { - public partial class ErrorsController : Controller + public partial class ErrorsController : AppController { public virtual ActionResult NotFound() { diff --git a/src/NuGetGallery/Controllers/StatisticsController.cs b/src/NuGetGallery/Controllers/StatisticsController.cs index 06fc2e2a91..ba3c0ecbed 100644 --- a/src/NuGetGallery/Controllers/StatisticsController.cs +++ b/src/NuGetGallery/Controllers/StatisticsController.cs @@ -9,7 +9,7 @@ namespace NuGetGallery { - public partial class StatisticsController : Controller + public partial class StatisticsController : AppController { private readonly IStatisticsService _statisticsService; private readonly IAggregateStatsService _aggregateStatsService; diff --git a/src/NuGetGallery/RouteNames.cs b/src/NuGetGallery/RouteNames.cs index c6df7600cd..572fabccea 100644 --- a/src/NuGetGallery/RouteNames.cs +++ b/src/NuGetGallery/RouteNames.cs @@ -58,5 +58,7 @@ public static class RouteName public const string ConfirmAccount = "ConfirmAccount"; public const string SubscribeToEmails = "SubscribeToEmails"; public const string UnsubscribeFromEmails = "UnsubscribeFromEmails"; + public const string Error500 = "Error500"; + public const string Error404 = "Error404"; } } diff --git a/src/NuGetGallery/Views/NuGetViewBase.cs b/src/NuGetGallery/Views/NuGetViewBase.cs index b2737380d2..ffd7f20868 100644 --- a/src/NuGetGallery/Views/NuGetViewBase.cs +++ b/src/NuGetGallery/Views/NuGetViewBase.cs @@ -39,7 +39,7 @@ internal static Func GetNuGetContextThunk(WebViewPage self) var ctrl = self.ViewContext.Controller as AppController; if (ctrl == null) { - return null; + throw new InvalidOperationException("NuGetViewBase should only be used on views for actions on AppControllers"); } return ctrl.NuGetContext; }; diff --git a/src/NuGetGallery/Web.config b/src/NuGetGallery/Web.config index 97715eecf9..aade88f76a 100644 --- a/src/NuGetGallery/Web.config +++ b/src/NuGetGallery/Web.config @@ -250,6 +250,7 @@ +