#190 signup page

This commit is contained in:
Hamid Reza Mohammadi 2021-08-17 18:07:29 +04:30
parent 6cb36c4786
commit 8b505de7e0
2 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,68 @@
@page
@model GanjooRazor.Pages.SignUpModel
@{
Layout = null;
ViewData["Title"] = "ثبت نام";
}
<!DOCTYPE html>
<html lang="fa-IR" dir="rtl">
<head>
<meta charset="utf-8" />
<title>@ViewData["Title"]</title>
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link href="/css/p6.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="login">
<div id="login-container">
@if (Model.LoggedIn)
{
<div>
<p>شما پیشتر ثبت نام کرده‌اید!</p>
</div>
}
else
{
<form method="post">
<table>
<tr>
<td>
<span class="inputlabel">پست الکترونیکی: </span>
</td>
<td>
<input type="email" asp-for="SignUpViewModel.Email" placeholder="پست الکترونیکی" />
</td>
</tr>
<tr>
<td>
<span class="inputlabel">تصویر امنیتی:</span>
</td>
<td>
<input type="password" asp-for="SignUpViewModel.CaptchaValue" id="password" placeholder="عدد تصویر امنیتی" />
</td>
</tr>
<tr>
<td>
<span class="inputlabel">عدد تصویر امنیتی: </span>
</td>
<td>
<input type="password" asp-for="SignUpViewModel.CaptchaValue" id="password" placeholder="عدد تصویر امنیتی" />
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" id="submit" value="ادامه" /></td>
</tr>
</table>
<div>@Model.LastError</div>
</form>
}
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using RSecurityBackend.Models.Auth.ViewModels;
namespace GanjooRazor.Pages
{
[IgnoreAntiforgeryToken(Order = 1001)]
public class SignUpModel : PageModel
{
public bool LoggedIn { get; set; }
public string LastError { get; set; }
[BindProperty]
public UnverifiedSignUpViewModel SignUpViewModel { get; set; }
public void OnGet()
{
LoggedIn = !string.IsNullOrEmpty(Request.Cookies["Name"]);
LastError = Request.Query["error"];
}
}
}