UsersController returns! Design updates
This commit is contained in:
79
RentACar/WebApp/Views/Users/Create.cshtml
Normal file
79
RentACar/WebApp/Views/Users/Create.cshtml
Normal file
@@ -0,0 +1,79 @@
|
||||
@model Data.Entities.User
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h1>Create user</h1>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="FirstName" class="control-label"></label>
|
||||
<input asp-for="FirstName" class="form-control" />
|
||||
<span asp-validation-for="FirstName" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="LastName" class="control-label"></label>
|
||||
<input asp-for="LastName" class="form-control" />
|
||||
<span asp-validation-for="LastName" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PersonalNumber" class="control-label"></label>
|
||||
<input asp-for="PersonalNumber" class="form-control" />
|
||||
<span asp-validation-for="PersonalNumber" class="text-danger"></span>
|
||||
</div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="UserName" class="control-label"></label>
|
||||
<input asp-for="UserName" class="form-control" />
|
||||
<span asp-validation-for="UserName" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Email" class="control-label"></label>
|
||||
<input asp-for="Email" class="form-control" />
|
||||
<span asp-validation-for="Email" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" asp-for="EmailConfirmed" /> @Html.DisplayNameFor(model => model.EmailConfirmed)
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PasswordHash" class="control-label"></label>
|
||||
<input asp-for="PasswordHash" class="form-control" />
|
||||
<span asp-validation-for="PasswordHash" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PhoneNumber" class="control-label"></label>
|
||||
<input asp-for="PhoneNumber" class="form-control" />
|
||||
<span asp-validation-for="PhoneNumber" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" asp-for="PhoneNumberConfirmed" /> @Html.DisplayNameFor(model => model.PhoneNumberConfirmed)
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="LockoutEnd" class="control-label"></label>
|
||||
<input asp-for="LockoutEnd" class="form-control" />
|
||||
<span asp-validation-for="LockoutEnd" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" asp-for="LockoutEnabled" /> @Html.DisplayNameFor(model => model.LockoutEnabled)
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Save" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
@@ -4,11 +4,10 @@
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h1>Delete</h1>
|
||||
<h1>Delete user</h1>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>User</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@@ -117,7 +116,7 @@
|
||||
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="submit" value="Delete" class="btn btn-danger" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
<input type="submit" value="Delete" class="btn btn-danger" />
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h1>Edit</h1>
|
||||
|
||||
<h4>User</h4>
|
||||
<h1>Edit user</h1>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@@ -33,21 +31,11 @@
|
||||
<input asp-for="UserName" class="form-control" />
|
||||
<span asp-validation-for="UserName" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="NormalizedUserName" class="control-label"></label>
|
||||
<input asp-for="NormalizedUserName" class="form-control" />
|
||||
<span asp-validation-for="NormalizedUserName" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Email" class="control-label"></label>
|
||||
<input asp-for="Email" class="form-control" />
|
||||
<span asp-validation-for="Email" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="NormalizedEmail" class="control-label"></label>
|
||||
<input asp-for="NormalizedEmail" class="form-control" />
|
||||
<span asp-validation-for="NormalizedEmail" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" asp-for="EmailConfirmed" /> @Html.DisplayNameFor(model => model.EmailConfirmed)
|
||||
@@ -58,16 +46,6 @@
|
||||
<input asp-for="PasswordHash" class="form-control" />
|
||||
<span asp-validation-for="PasswordHash" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="SecurityStamp" class="control-label"></label>
|
||||
<input asp-for="SecurityStamp" class="form-control" />
|
||||
<span asp-validation-for="SecurityStamp" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ConcurrencyStamp" class="control-label"></label>
|
||||
<input asp-for="ConcurrencyStamp" class="form-control" />
|
||||
<span asp-validation-for="ConcurrencyStamp" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PhoneNumber" class="control-label"></label>
|
||||
<input asp-for="PhoneNumber" class="form-control" />
|
||||
@@ -78,11 +56,6 @@
|
||||
<input class="form-check-input" asp-for="PhoneNumberConfirmed" /> @Html.DisplayNameFor(model => model.PhoneNumberConfirmed)
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" asp-for="TwoFactorEnabled" /> @Html.DisplayNameFor(model => model.TwoFactorEnabled)
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="LockoutEnd" class="control-label"></label>
|
||||
<input asp-for="LockoutEnd" class="form-control" />
|
||||
@@ -94,21 +67,13 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="AccessFailedCount" class="control-label"></label>
|
||||
<input asp-for="AccessFailedCount" class="form-control" />
|
||||
<span asp-validation-for="AccessFailedCount" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Save" class="btn btn-primary" />
|
||||
<input class="btn btn-primary" type="submit" value="Save" />
|
||||
<a type="button" class="btn btn-secondary" asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
|
||||
@@ -1,62 +1,68 @@
|
||||
@model IEnumerable<Data.Entities.User>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
ViewData["Title"] = "Users";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
<h1>Users</h1>
|
||||
<p>
|
||||
<a type="button" class="btn btn-primary" asp-action="Create">Create user</a>
|
||||
</p>
|
||||
|
||||
<table class="table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstName)
|
||||
First name
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.LastName)
|
||||
Last name
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.PersonalNumber)
|
||||
ID number
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.UserName)
|
||||
Username
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Email)
|
||||
E-mail
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.PhoneNumber)
|
||||
Phone number
|
||||
</th>
|
||||
<th>
|
||||
Actions
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.FirstName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.LastName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.PersonalNumber)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.UserName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Email)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.PhoneNumber)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.FirstName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.LastName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.PersonalNumber)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.UserName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Email)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.PhoneNumber)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user