Skip to content

Commit

Permalink
Dev (#5)
Browse files Browse the repository at this point in the history
* Update PhoneBookContext.db

* Update Create.cshtml

* Update Delete.cshtml

* Update Details.cshtml

Co-Authored-By: akinin <[email protected]>

* Update Edit.cshtml

Co-Authored-By: akinin <[email protected]>

* Update Index.cshtml

Co-Authored-By: akinin <[email protected]>

* Update _Layout.cshtml

Co-Authored-By: akinin <[email protected]>

* Update site.css

Co-Authored-By: akinin <[email protected]>

---------

Co-authored-by: akinin <[email protected]>
  • Loading branch information
shashinma and akinin authored Nov 28, 2023
1 parent ea90f55 commit 7b211c4
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 93 deletions.
Binary file modified PhoneBookContext.db
Binary file not shown.
5 changes: 3 additions & 2 deletions Views/PhoneBook/Create.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@
<input asp-for="Room" class="form-control" />
<span asp-validation-for="Room" class="text-danger"></span>
</div>
<br/>
<div class="form-group">
<input type="submit" value="Добавить" class="btn btn-primary" />
<a asp-action="Index" class="btn btn-secondary">Назад</a >
</div>
</form>
</div>
</div>

<br/>
<div>
<a asp-action="Index">Назад</a>
</div>

@section Scripts {
Expand Down
6 changes: 3 additions & 3 deletions Views/PhoneBook/Delete.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
@Html.DisplayFor(model => model.Room)
</dd>
</dl>

<br/>
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Удалить" class="btn btn-danger" /> |
<a asp-action="Index">Назад</a>
<input type="submit" value="Удалить" class="btn btn-danger" />
<a asp-action="Index" class="btn btn-secondary">Назад</a>
</form>
</div>
5 changes: 3 additions & 2 deletions Views/PhoneBook/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
</dd>
</dl>
</div>
<br/>
<div>
<a asp-action="Edit" asp-route-id="@Model.Id">Редактировать</a> |
<a asp-action="Index">Назад</a>
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary">Редактировать</a>
<a asp-action="Index" class="btn btn-secondary">Назад</a>
</div>
5 changes: 3 additions & 2 deletions Views/PhoneBook/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@
<input asp-for="Room" class="form-control" />
<span asp-validation-for="Room" class="text-danger"></span>
</div>
<br/>
<div class="form-group">
<input type="submit" value="Сохранить" class="btn btn-primary" />
<a asp-action="Index" class="btn btn-secondary">Назад</a>
</div>
</form>
</div>
</div>

<br/>
<div>
<a asp-action="Index">Назад</a>
</div>

@section Scripts {
Expand Down
46 changes: 24 additions & 22 deletions Views/PhoneBook/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,38 @@

@model X.PagedList.IPagedList<PhoneEdit.Models.BookEntry>


@{
ViewData["Title"] = "Справочник";
}




<h1>Телефонный справочник</h1>
<br />
<div class="container-fluid p-0">
<div class="row">
<div class="col-3" align="left">
<form asp-action="Index" method="get" class="form-inline">
<div class="form-group">
<div class="mr-2">
<input name="SearchString" value="@(ViewBag.CurrentFilter as string)" class="form-control" />
<div class="row">
<div class="col-auto">
<div class="mr-4">
<input name="SearchString" value="@(ViewBag.CurrentFilter as string)" class="form-control" />
</div>
</div>
<div class="col">
<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i></button>
@if (ViewBag.CurrentFilter != null)
{
<a asp-action="Index" class="m-2">Назад</a>
}

</div>
<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i></button>
@if (ViewBag.CurrentFilter != null)
{
<a asp-action="Index" class="m-2">Назад</a>
}
</div>
</form>

</div>
<div class="col" align="right">
@if (User.Identity.IsAuthenticated)

Check warning on line 37 in Views/PhoneBook/Index.cshtml

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.
{
<a class="btn btn-success" asp-action="Create">Добавить запись </a>
<a class="btn btn-primary" asp-action="Create">Добавить запись </a>
}
</div>
</div>
Expand All @@ -55,10 +56,8 @@
})
</nav>



<table class="table table-striped table-hover table-sm">
<thead class="thead-light">
<thead class="table-light">
<tr>
<th>
@Html.DisplayNameFor(model => model[0].PersonnelNumber)
Expand Down Expand Up @@ -103,9 +102,11 @@
{
<tr>
<td class="PersonalNumberTable">
<div class="badge badge-info">
@Html.DisplayFor(modelItem => item.PersonnelNumber)
</div>
<h5>
<div class="badge rounded-pill bg-info text-dark">
@Html.DisplayFor(modelItem => item.PersonnelNumber)
</div>
</h5>
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
Expand All @@ -131,13 +132,14 @@
@if (User.Identity.IsAuthenticated)
{
<td>
<a asp-action="Edit" asp-route-id="@item.Id"><i class="fa fa-edit"></i></a>
<a class="btn btn-warning" asp-action="Edit" asp-route-id="@item.Id"><i class="fa fa-edit"></i></a>

</td>
<td>
<a asp-action="Details" asp-route-id="@item.Id"><i class="fa fa-info-circle"></i></a>
<a class="btn btn-secondary" asp-action="Details" asp-route-id="@item.Id"><i class="fa fa-info-circle"></i></a>
</td>
<td>
<a asp-action="Delete" asp-route-id="@item.Id"><i class="fa fa-user-times"></i></a>
<a class="btn btn-danger" asp-action="Delete" asp-route-id="@item.Id"><i class="fa fa-user-times"></i></a>
</td>
}
</tr>
Expand Down
84 changes: 25 additions & 59 deletions Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,85 +1,51 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>@ViewData["Title"] - PhoneEdit</title>

<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link href="~/lib/font-awesome/css/font-awesome.css" rel="stylesheet"/>
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
crossorigin="anonymous"
integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
asp-fallback-href="~/font-awesome/css/font-awesome.min.css"
asp-fallback-test-class="sr-only" asp-fallback-property="position" asp-fallback-test-value="absolute"/>
</environment>
<link rel="stylesheet" href="~/css/site.css" />
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="~/lib/font-awesome/css/font-awesome.min.css"/>
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true"/>
<link rel="stylesheet" href="~/WebApplication1.styles.css" asp-append-version="true"/>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid w-75">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="PhoneBook" asp-action="Index">PhoneEdit</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<partial name="_LoginPartial" />
@*<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="PhoneBook" asp-action="Index">Справочник</a>
</li>
</ul>*@
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
@* <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a> *@
</li>
<li class="nav-item">
@* <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a> *@
</li>
</ul>
<partial name="_LoginPartial"/>
</div>
</div>
</nav>
</header>
<div class="container-fluid w-75">
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>

<footer class="border-top footer text-muted">
<div class="container">
&copy; 2019 - PhoneEdit - rumCode
&copy; 2023 - PhoneEdit - rumkit & shashinma & akininav
</div>
</footer>

<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
</environment>
<environment exclude="Development">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
crossorigin="anonymous"
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
</script>
</environment>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
</body>
</html>

@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
60 changes: 57 additions & 3 deletions wwwroot/css/site.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,76 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
font-size: 14px;
}

@media (min-width: 768px) {
html {
font-size: 16px;
}
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
font-size: 1rem;
line-height: inherit;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}

body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px; /* Vertically center the text there */
}

.form-group.required .control-label:after {
content:"*";
color:red;
}

/* Table column classes */
.PersonalNumberTable,
.LocalPhoneNumberTable,
.CityPhoneNumberTable,
.RoomTable {
text-align: center;
}

.table th,
.table td {
padding: 0.75rem;
vertical-align: middle !important;
border: 1px solid #dee2e6 !important;
}

0 comments on commit 7b211c4

Please sign in to comment.