Add registration page
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
@using ClientDependency.Core.Mvc
|
||||
@using LeafWeb.WebCms.Controllers
|
||||
@using Umbraco.Web
|
||||
@model LeafInputCreate
|
||||
@{
|
||||
Html.RequiresCss("~/backload/blueimp/bootstrap/BasicPlusUI/css");
|
||||
@@ -9,15 +10,17 @@
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.custom.js", 2);
|
||||
Html.RequiresJs("~/scripts/LeafInputCreate.js", 3);
|
||||
|
||||
var user = Membership.GetUser();
|
||||
}
|
||||
|
||||
<div class="container-lg">
|
||||
<div class="row">
|
||||
<div class="col-md-12 card card-body bg-light">
|
||||
<div class="col-md-8 card card-body bg-light">
|
||||
@Html.Partial("_ValidationSummary")
|
||||
|
||||
<form id="fileupload" action="/Backload/FileHandler" method="POST" enctype="multipart/form-data">
|
||||
|
||||
|
||||
<h4 class="card-title">Files</h4>
|
||||
<div class="container-fluid fileupload-buttonbar">
|
||||
<div class="row">
|
||||
@@ -60,18 +63,30 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@using (Html.BeginUmbracoForm<LeafInputController>("Submit", null, new {id = "create"}))
|
||||
@using (Html.BeginUmbracoForm<LeafInputController>("Submit", null, new { id = "create" }))
|
||||
{
|
||||
@Html.EditorFor(m => m.PhotosynthesisType)
|
||||
@Html.EditorFor(m => m.Identifier)
|
||||
@Html.EditorFor(m => m.SiteId)
|
||||
@Html.EditorFor(m => m.Name)
|
||||
@Html.EditorFor(m => m.Email)
|
||||
@Html.EditorFor(m => m.EmailConfirm)
|
||||
if (user == null)
|
||||
{
|
||||
@Html.EditorFor(m => m.Name)
|
||||
@Html.EditorFor(m => m.Email)
|
||||
@Html.EditorFor(m => m.EmailConfirm)
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.HiddenFor(m => m.Name)
|
||||
@Html.HiddenFor(m => m.Email)
|
||||
@Html.HiddenFor(m => m.EmailConfirm)
|
||||
}
|
||||
@Html.EditorFor(m => m.TermsOfService)
|
||||
<input type="submit" id="submit-form" class="d-none"/>
|
||||
<input type="submit" id="submit-form" class="d-none" />
|
||||
}
|
||||
<label for="submit-form" class="btn btn-primary pull-right">Submit...</label>
|
||||
<div class="container"><div class="row">
|
||||
<label for="submit-form" class="btn btn-primary col-6 offset-6 col-sm-5 offset-sm-7 col-md-4 offset-md-8">Submit...</label>
|
||||
</div></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,34 +1,27 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using System.Web.Mvc.Html
|
||||
@using ClientDependency.Core.Mvc
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Models
|
||||
@using Umbraco.Web.Controllers
|
||||
@{
|
||||
var loginModel = new LoginModel { RedirectUrl = "/leaf-data/manage-queue/" };
|
||||
|
||||
Html.EnableClientValidation();
|
||||
Html.EnableUnobtrusiveJavaScript();
|
||||
Html.RequiresJs("~/scripts/jquery.validate.min.js");
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js");
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.min.js");
|
||||
}
|
||||
|
||||
<div class="container top-buffer">
|
||||
<div class="row">
|
||||
<div class="col-md-7 card card-body bg-light">
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-4 card card-body bg-light">
|
||||
@using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
|
||||
{
|
||||
<fieldset>
|
||||
@Html.ValidationSummary("loginModel", true)
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => loginModel.Username)
|
||||
@Html.TextBoxFor(m => loginModel.Username)
|
||||
@Html.TextBoxFor(m => loginModel.Username, new {@class = "form-control" })
|
||||
@Html.ValidationMessageFor(m => loginModel.Username)
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => loginModel.Password)
|
||||
@Html.PasswordFor(m => loginModel.Password)
|
||||
@Html.PasswordFor(m => loginModel.Password, new {@class = "form-control" })
|
||||
@Html.ValidationMessageFor(m => loginModel.Password)
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using ClientDependency.Core.Mvc
|
||||
@using Umbraco.Web.Controllers
|
||||
<!-- https://24days.in/umbraco-cms/2015/membership-apis-investigation/ -->
|
||||
<!-- https://our.umbraco.com/forum/templates-partial-views-and-macros/93133-membership-provider-registration-form -->
|
||||
@{
|
||||
var membershipHelper = new Umbraco.Web.Security.MembershipHelper(UmbracoContext.Current);
|
||||
var registerModel = membershipHelper.CreateRegistrationModel();
|
||||
|
||||
var success = TempData["FormSuccess"] != null;
|
||||
|
||||
Html.EnableClientValidation();
|
||||
Html.RequiresJs("~/scripts/jquery.validate.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2);
|
||||
|
||||
Html.RequiresJs("~/scripts/Register.js");
|
||||
}
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-6 card card-body bg-light">
|
||||
@if (success)
|
||||
{
|
||||
<p>Registration succeeded.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
using (Html.BeginUmbracoForm<UmbRegisterController>(
|
||||
"HandleRegisterMember",
|
||||
null,
|
||||
new {id="register-member"}))
|
||||
{
|
||||
<div class="form-group">
|
||||
@Html.ValidationSummary("registerModel", true)
|
||||
|
||||
@Html.LabelFor(m => registerModel.Name)
|
||||
@Html.TextBoxFor(m => registerModel.Name, new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(m => registerModel.Name)
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => registerModel.Email)
|
||||
@Html.TextBoxFor(m => registerModel.Email, new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(m => registerModel.Email)
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => registerModel.Password)
|
||||
@Html.PasswordFor(m => registerModel.Password, new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(m => registerModel.Password)
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.Label("VerifyPassword")
|
||||
@Html.Password("VerifyPassword", null, new { @class = "form-control" })
|
||||
@Html.ValidationMessage("VerifyPassword")
|
||||
</div>
|
||||
|
||||
if (registerModel.MemberProperties != null)
|
||||
{
|
||||
for (var i = 0; i < registerModel.MemberProperties.Count; i++)
|
||||
{
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name)
|
||||
@Html.EditorFor(m => registerModel.MemberProperties[i].Value, new { @class = "form-control" })
|
||||
@Html.HiddenFor(m => registerModel.MemberProperties[i].Alias)
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@Html.HiddenFor(m => registerModel.MemberTypeAlias)
|
||||
@Html.HiddenFor(m => registerModel.RedirectUrl)
|
||||
@Html.HiddenFor(m => registerModel.UsernameIsEmail)
|
||||
|
||||
<button type="submit" class="btn btn-primary pull-right">Register</button>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
else if (TempData.ContainsKey("LogoutSuccess") && (bool)TempData["LogoutSuccess"])
|
||||
{
|
||||
TempData["StatusMessage"] = "Logout sucessful";
|
||||
TempData["StatusMessage"] = "Logout successful";
|
||||
TempData["StatusMessage-Type"] = "alert-success";
|
||||
}
|
||||
Html.RequiresCss("~/Content/bootstrap_leafweb.css");
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
@inherits UmbracoTemplatePage
|
||||
@using System.Web.Mvc.Html
|
||||
@using ClientDependency.Core.Mvc
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Models
|
||||
@using Umbraco.Web.Controllers
|
||||
@{
|
||||
var loginStatusModel = Members.GetCurrentLoginStatus();
|
||||
|
||||
Html.RequiresJs("~/scripts/jquery.validate.min.js");
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js");
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.min.js");
|
||||
|
||||
var logoutModel = new PostRedirectModel { RedirectUrl = "/" };
|
||||
}
|
||||
<div class="container">
|
||||
|
||||
+55
-47
@@ -1,63 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
|
||||
<sectionGroup name="system.web.webPages.razor"
|
||||
type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host"
|
||||
type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
requirePermission="false" />
|
||||
<section name="pages"
|
||||
type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
|
||||
|
||||
|
||||
<add namespace="System.Web.WebPages" />
|
||||
<add namespace="System.Web.Optimization" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<add namespace="System.Web.Optimization" />
|
||||
<add namespace="WebGridBootstrapPager" />
|
||||
<add namespace="LeafWeb.Core.Utility" />
|
||||
<add namespace="LeafWeb.WebCms.Models" />
|
||||
|
||||
<add namespace="System.Web.Mvc" /><add namespace="System.Web.Mvc.Ajax" /><add namespace="System.Web.Mvc.Html" /><add namespace="System.Web.Routing" /><add namespace="Umbraco.Web" /><add namespace="Umbraco.Core" /><add namespace="Umbraco.Core.Models" /><add namespace="Umbraco.Web.Mvc" /><add namespace="umbraco" /><add namespace="Examine" /><add namespace="Umbraco.Web.PublishedContentModels" /></namespaces>
|
||||
<add namespace="LeafWeb.Core.Utility" />
|
||||
<add namespace="LeafWeb.WebCms.Models" />
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Routing" />
|
||||
<add namespace="Umbraco.Web" />
|
||||
<add namespace="Umbraco.Core" />
|
||||
<add namespace="Umbraco.Core.Models" />
|
||||
<add namespace="Umbraco.Web.Mvc" />
|
||||
<add namespace="umbraco" />
|
||||
<add namespace="Examine" />
|
||||
<add namespace="Umbraco.Web.PublishedContentModels" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /></system.web.webPages.razor>
|
||||
|
||||
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings><system.web>
|
||||
<httpHandlers>
|
||||
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />
|
||||
</httpHandlers>
|
||||
<host
|
||||
factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</system.web.webPages.razor>
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />
|
||||
</httpHandlers>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
Enabling request validation in view pages would cause validation to occur
|
||||
after the input has already been processed by the controller. By default
|
||||
MVC performs request validation before a controller processes the input.
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web><system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler" />
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer></configuration>
|
||||
<pages validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler" />
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode"
|
||||
type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user