From 944009936d8ba3b64078e216b2265b9e9b1b1c50 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Fri, 13 Mar 2015 13:54:37 +0100 Subject: [PATCH] * IValueProvider.cs: * TemplateException.cs: * Login.aspx: * Profile.aspx: * WebApiConfig.cs: * MyProfile.aspx: * IValueProvider.cs: * BlogsController.cs: * BasketController.cs: * ModuleController.cs: * AccountController.cs: * TemplateException.cs: * WorkFlowController.cs: * BlogsApiController.cs: * PaypalApiController.cs: * BasketController.cs: * BlogsApiController.cs: * WorkFlowController.cs: * PaypalApiController.cs: * FrontOfficeApiController.cs: * FrontOfficeApiController.cs: refactoring * jquery-ui.js: may be usefull at taking a date * Web.csproj: * WebApiConfig.cs: * App.master: added a spacer for a better rendering * style.css: better style * DateQuery.aspx: may use the jQuery "full calendar" * FreeDate.cs: refactoring --- .../BasketController.cs | 0 .../BlogsApiController.cs | 0 .../FrontOfficeApiController.cs | 0 .../PaypalApiController.cs | 0 .../WorkFlowController.cs | 0 web/Controllers/AccountController.cs | 32 +- web/Controllers/BlogsController.cs | 4 +- web/Controllers/ModuleController.cs | 72 +- web/{Controllers => }/IValueProvider.cs | 0 web/Models/App.master | 14 +- web/Scripts/jquery-ui.js | 16582 ++++++++++++++++ web/{Controllers => }/TemplateException.cs | 0 web/Theme/style.css | 40 +- web/Views/Account/Login.aspx | 2 +- .../Account/{MyProfile.aspx => Profile.aspx} | 62 +- web/Views/Google/DateQuery.aspx | 5 +- web/Web.csproj | 20 +- web/{Controllers => }/WebApiConfig.cs | 0 yavscModel/Google/FreeDate.cs | 7 +- 19 files changed, 16721 insertions(+), 119 deletions(-) rename web/{Controllers => ApiControllers}/BasketController.cs (100%) rename web/{Controllers => ApiControllers}/BlogsApiController.cs (100%) rename web/{Controllers => ApiControllers}/FrontOfficeApiController.cs (100%) rename web/{Controllers => ApiControllers}/PaypalApiController.cs (100%) rename web/{Controllers => ApiControllers}/WorkFlowController.cs (100%) rename web/{Controllers => }/IValueProvider.cs (100%) create mode 100644 web/Scripts/jquery-ui.js rename web/{Controllers => }/TemplateException.cs (100%) rename web/Views/Account/{MyProfile.aspx => Profile.aspx} (89%) rename web/{Controllers => }/WebApiConfig.cs (100%) diff --git a/web/Controllers/BasketController.cs b/web/ApiControllers/BasketController.cs similarity index 100% rename from web/Controllers/BasketController.cs rename to web/ApiControllers/BasketController.cs diff --git a/web/Controllers/BlogsApiController.cs b/web/ApiControllers/BlogsApiController.cs similarity index 100% rename from web/Controllers/BlogsApiController.cs rename to web/ApiControllers/BlogsApiController.cs diff --git a/web/Controllers/FrontOfficeApiController.cs b/web/ApiControllers/FrontOfficeApiController.cs similarity index 100% rename from web/Controllers/FrontOfficeApiController.cs rename to web/ApiControllers/FrontOfficeApiController.cs diff --git a/web/Controllers/PaypalApiController.cs b/web/ApiControllers/PaypalApiController.cs similarity index 100% rename from web/Controllers/PaypalApiController.cs rename to web/ApiControllers/PaypalApiController.cs diff --git a/web/Controllers/WorkFlowController.cs b/web/ApiControllers/WorkFlowController.cs similarity index 100% rename from web/Controllers/WorkFlowController.cs rename to web/ApiControllers/WorkFlowController.cs diff --git a/web/Controllers/AccountController.cs b/web/Controllers/AccountController.cs index 5d0bdfed..923f2e1b 100644 --- a/web/Controllers/AccountController.cs +++ b/web/Controllers/AccountController.cs @@ -43,35 +43,15 @@ namespace Yavsc.Controllers { return View (); } - /// - /// Login the specified returnUrl. - /// - /// Return URL. - public ActionResult Login (string returnUrl) - { - ViewData ["returnUrl"] = returnUrl; - return View (); - } - - /// - /// Gets the profile. - /// - /// The profile. - /// User. - public static Profile GetProfile (string user) - { - return new Profile (ProfileBase.Create (user)); - } - // TODO [ValidateAntiForgeryToken] /// - /// Dos the login. + /// Does login. /// /// The login. /// Model. /// Return URL. - public ActionResult DoLogin (LoginModel model, string returnUrl) + public ActionResult Login (LoginModel model, string returnUrl) { if (ModelState.IsValid) { if (Membership.ValidateUser (model.UserName, model.Password)) { @@ -88,7 +68,7 @@ namespace Yavsc.Controllers ViewData ["returnUrl"] = returnUrl; // If we got this far, something failed, redisplay form - return View ("Login", model); + return View (model); } /// /// Register the specified model and returnUrl. @@ -255,11 +235,11 @@ namespace Yavsc.Controllers /// Model. [Authorize] [HttpGet] - public ActionResult MyProfile (Profile model) + public ActionResult Profile (Profile model) { string username = Membership.GetUser ().UserName; ViewData ["UserName"] = username; - model = GetProfile (username); + model = new Profile (ProfileBase.Create (username)); model.RememberMe = FormsAuthentication.GetAuthCookie (username, true) == null; return View (model); } @@ -272,7 +252,7 @@ namespace Yavsc.Controllers [Authorize] [HttpPost] // ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash" - public ActionResult MyProfile (Profile model, HttpPostedFileBase AvatarFile) + public ActionResult Profile (Profile model, HttpPostedFileBase AvatarFile) { string username = Membership.GetUser ().UserName; ViewData ["UserName"] = username; diff --git a/web/Controllers/BlogsController.cs b/web/Controllers/BlogsController.cs index 92c6c375..63d69fd0 100644 --- a/web/Controllers/BlogsController.cs +++ b/web/Controllers/BlogsController.cs @@ -121,7 +121,7 @@ namespace Yavsc.Controllers // find entries BlogEntryCollection c = BlogManager.FindPost (user, sf, pageIndex, pageSize, out tr); // Get author's meta data - Profile bupr = AccountController.GetProfile (user); + Profile bupr = new Profile (ProfileBase.Create (user)); ViewData ["BlogUserProfile"] = bupr; // Inform of listing meta data ViewData ["BlogTitle"] = bupr.BlogTitle; @@ -155,7 +155,7 @@ namespace Yavsc.Controllers { if (e == null) return View ("TitleNotFound"); - Profile pr = AccountController.GetProfile (e.UserName); + Profile pr = new Profile (ProfileBase.Create (e.UserName)); if (pr==null) return View ("TitleNotFound"); ViewData ["BlogUserProfile"] = pr; diff --git a/web/Controllers/ModuleController.cs b/web/Controllers/ModuleController.cs index 79c75063..4aae72c1 100644 --- a/web/Controllers/ModuleController.cs +++ b/web/Controllers/ModuleController.cs @@ -1,36 +1,36 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using Yavsc.Model; -using System.Configuration; - -namespace Yavsc.Controllers -{ - /// - /// Module controller. - /// - public class ModuleController : Controller - { - /// - /// Initialize the specified requestContext. - /// - /// Request context. - protected override void Initialize (System.Web.Routing.RequestContext requestContext) - { - base.Initialize (requestContext); - ConfigurationManager.GetSection ("ymodules"); - - } - - // List modules = new List (); - /// - /// Index this instance. - /// - public ActionResult Index() - { - return View (); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Yavsc.Model; +using System.Configuration; + +namespace Yavsc.Controllers +{ + /// + /// Module controller. + /// + public class ModuleController : Controller + { + /// + /// Initialize the specified requestContext. + /// + /// Request context. + protected override void Initialize (System.Web.Routing.RequestContext requestContext) + { + base.Initialize (requestContext); + ConfigurationManager.GetSection ("ymodules"); + + } + + // List modules = new List (); + /// + /// Index this instance. + /// + public ActionResult Index() + { + return View (); + } + } +} diff --git a/web/Controllers/IValueProvider.cs b/web/IValueProvider.cs similarity index 100% rename from web/Controllers/IValueProvider.cs rename to web/IValueProvider.cs diff --git a/web/Models/App.master b/web/Models/App.master index 5d3dde4d..249a99b1 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -48,12 +48,11 @@ - -