Skip to content

Commit 1df6ed4

Browse files
committed
change an interface of the about me page
1 parent 06bc568 commit 1df6ed4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1602
-166
lines changed

Blog/Blog/Views/AboutMe/AboutMeForm.cshtml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ else
3131
</div>
3232
<div class="form-group">
3333
<label asp-for="@Model.Description" class="control-label"></label>
34-
<textarea asp-for="@Model.Description" class="form-control"></textarea>
34+
<textarea asp-for="@Model.Description" class="form-control" id="description"></textarea>
3535
<span asp-validation-for="@Model.Description" class="text-danger"></span>
3636
</div>
3737

3838
<h3>Contacts</h3>
39+
<hr />
3940
<div class="form-group">
4041
<label asp-for="@Model.Contacts.Phone" class="control-label"></label>
4142
<input asp-for="@Model.Contacts.Phone" class="form-control" />
@@ -64,6 +65,7 @@ else
6465
</div>
6566

6667
<h3>Websites</h3>
68+
<hr />
6769
<div class="form-group">
6870
<label asp-for="@Model.Websites.Website" class="control-label"></label>
6971
<input asp-for="@Model.Websites.Website" class="form-control" />
@@ -106,6 +108,7 @@ else
106108
</div>
107109

108110
<h3>Image</h3>
111+
<hr />
109112
<div class="form-group">
110113
<label asp-for="ImagePath" class="control-label"></label>
111114
<input type="file" id="image" name="image" class="form-control-file" />
@@ -114,19 +117,25 @@ else
114117

115118
<input type="hidden" asp-for="Id" />
116119
<div class="form-group">
117-
<input type="submit" value="Save" class="btn btn-primary" />
120+
<input type="submit" value="Save" class="btn btn-primary btn-block" />
118121
</div>
119122
</form>
120123
</div>
121124
</div>
122125

123126
<div>
124-
<a asp-action="Index"><i class="fas fa-arrow-left"></i> Back to List</a>
127+
<a asp-action="Index" class="btn btn-primary"><i class="fas fa-arrow-left"></i> Back</a>
125128
</div>
126129

127130

128-
129131
@section Scripts {
130132
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
133+
134+
<script src="~/lib/trumbowyg/trumbowyg.min.js"></script>
135+
<link rel="stylesheet" href="~/lib/trumbowyg/ui/trumbowyg.min.css">
136+
137+
<script>
138+
$('#description').trumbowyg();
139+
</script>
131140
}
132141

Blog/Blog/Views/AboutMe/Details.cshtml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,4 @@
157157
<div>
158158
<a asp-action="Index" class="btn btn-primary"><i class="fas fa-arrow-left"></i> Back</a>
159159
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-warning"><i class="fas fa-edit"></i> Edit</a>
160-
<a asp-action="Delete" asp-route-id="@Model.Id" class="btn btn-danger"
161-
onclick="return confirm('Are you sure to delete this?');">
162-
<i class="fas fa-edit"></i> Delete
163-
</a>
164160
</div>

Blog/Blog/Views/AboutMe/Index.cshtml

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,60 @@
44
ViewData["Title"] = "Index";
55
}
66

7-
<h1>Index</h1>
7+
<section id="about-me">
8+
<div class="container col-md-12">
9+
<div class="text-center">
10+
@if (!string.IsNullOrEmpty(@Model.ImagePath))
11+
{
12+
<div class="about-me-img" style="background-image:url('/content/img/@Model.ImagePath');"></div>
13+
}
14+
<div class="row col-md-5 mx-auto justify-content-between">
15+
@if (!string.IsNullOrEmpty(Model.Websites.Website))
16+
{
17+
<a class="social-link text-dark" href="@Model.Websites.Website"><i class="fas fa-newspaper"></i></a>
18+
}
19+
@if (!string.IsNullOrEmpty(Model.Websites.Github))
20+
{
21+
<a class="social-link text-dark" href="@Model.Websites.Github"><i class="fab fa-github"></i></a>
22+
}
23+
@if (!string.IsNullOrEmpty(Model.Websites.Youtube))
24+
{
25+
<a class="social-link text-dark" href="@Model.Websites.Youtube"><i class="fab fa-youtube"></i></a>
26+
}
27+
@if (!string.IsNullOrEmpty(Model.Websites.Instagram))
28+
{
29+
<a class="social-link text-dark" href="@Model.Websites.Instagram"><i class="fab fa-instagram"></i></a>
30+
}
31+
@if (!string.IsNullOrEmpty(Model.Websites.LinkedIn))
32+
{
33+
<a class="social-link text-dark" href="@Model.Websites.LinkedIn"><i class="fab fa-linkedin"></i></a>
34+
}
35+
@if (!string.IsNullOrEmpty(Model.Websites.Facebook))
36+
{
37+
<a class="social-link text-dark" href="@Model.Websites.Facebook"><i class="fab fa-facebook"></i></a>
38+
}
39+
@if (!string.IsNullOrEmpty(Model.Websites.Vkontakte))
40+
{
41+
<a class="social-link text-dark" href="@Model.Websites.Vkontakte"><i class="fab fa-vk"></i></a>
42+
}
43+
@if (!string.IsNullOrEmpty(Model.Websites.Twitter))
44+
{
45+
<a class="social-link text-dark" href="@Model.Websites.Twitter"><i class="fab fa-twitter"></i></a>
46+
}
47+
</div>
48+
<h3>@Model.Title</h3>
49+
</div>
50+
<p>@Html.Raw(@Model.Description)</p>
51+
</div>
52+
</section>
853

9-
<a asp-action="Create" class="btn btn-primary"><i class="fas fa-edit"></i> Create</a>
1054

1155

1256

13-
@if (Model != null)
14-
{
15-
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-primary"><i class="fas fa-eye"></i> Details</a>
16-
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-warning"><i class="fas fa-edit"></i> Edit</a>
17-
<a asp-action="Delete" asp-route-id="@Model.Id" class="btn btn-danger"
18-
onclick="return confirm('Are you sure to delete this?');">
19-
<i class="fas fa-edit"></i> Delete
20-
</a>
21-
22-
}
57+
<div class="float-right">
58+
@if (Model != null)
59+
{
60+
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-primary"><i class="fas fa-eye"></i> Details</a>
61+
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-warning"><i class="fas fa-edit"></i> Edit</a>
62+
}
63+
</div>
Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,46 @@
11
@model Blog.Models.Post
22

33
@{
4-
ViewData["Title"] = "Details";
4+
ViewBag.Title = Model.Title;
5+
ViewBag.Description = Model.Excerpt;
6+
ViewBag.Keywords = Model.Tags;
57
}
68

79
<section class="post">
8-
<h1>@Model.Title</h1>
9-
<p class="content">
10-
@Html.Raw(Model.Content)
10+
<div class="container my-3">
11+
<div class="card col-md-12 border-0 py-3 mb-3">
12+
@if (!string.IsNullOrEmpty(@Model.ImagePath))
13+
{
14+
<div class="g-item-news-details" style="background-image:url('/content/img/@Model.ImagePath');"></div>
15+
}
16+
<div class="card-body">
17+
<h2 class="card-title">@Model.Title</h2>
18+
<p class="card-text">@Html.Raw(Model.Content)</p>
1119

12-
</p>
13-
<a href="/" class="btn btn-primary">Back</a>
20+
<div class="col-md-3 col-lg-8 text-right ml-auto">
21+
<p class="m-0 align-bottom">Posted: @Model.Created.ToShortDateString()</p>
22+
<p class="m-0 align-bottom">Updated: @Model.Updated.ToShortDateString()</p>
23+
</div>
24+
</div>
25+
</div>
26+
<hr />
27+
<div class="col-md-4">
28+
<h4>Share</h4>
29+
<partial name="_PostShareButtons" model="@Model" />
30+
</div>
31+
</div>
32+
<div class="col-sm-12 col-md-4 ml-auto">
33+
<a asp-controller="Posts" asp-action="Details" asp-route-id="@Model.Id" class="btn btn-primary my-1"><i class="fas fa-eye"></i> Details</a>
34+
<a asp-controller="Posts" asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-warning my-1"><i class="fas fa-edit"></i> Edit</a>
35+
<a asp-controller="Posts" asp-action="Delete" asp-route-id="@Model.Id" class="btn btn-danger my-1"
36+
onclick="return confirm('Are you sure to delete this?');">
37+
<i class="fas fa-trash"></i> Delete
38+
</a>
39+
</div>
1440
</section>
1541

16-
<section id="admin">
17-
<a asp-controller="Posts" asp-action="Details" asp-route-id="@Model.Id" class="btn btn-primary my-1"><i class="fas fa-eye"></i> Details</a>
18-
<a asp-controller="Posts" asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-warning my-1"><i class="fas fa-edit"></i> Edit</a>
19-
<a asp-controller="Posts" asp-action="Delete" asp-route-id="@Model.Id" class="btn btn-danger my-1"
20-
onclick="return confirm('Are you sure to delete this?');">
21-
<i class="fas fa-trash"></i> Delete
22-
</a>
23-
</section>
42+
43+
@section Scripts {
44+
<link rel="stylesheet" href="~/lib/rrssb/css/rrssb.css" />
45+
<script src="~/lib/rrssb/js/rrssb.min.js"></script>
46+
}

Blog/Blog/Views/Home/Index.cshtml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,51 @@
1111
<div class="row">
1212
<form class="form-inline w-100" asp-controller="Home" asp-action="Index" method="get" role="form" enctype="multipart/form-data">
1313
<div class="col-md-10 p-0">
14-
<input type="text" class="form-control rounded-0 w-100" id="title" name="title" placeholder="Поиск по названию...">
14+
<input type="text" class="form-control rounded-0 w-100" id="title" name="title" placeholder="Search by title...">
1515
</div>
1616
<div class="col-md-2 p-0">
17-
<input type="submit" class="btn btn-primary w-100" value="Искать" />
17+
<button type="submit" class="btn btn-dark w-100" value="Search"><i class="fas fa-search"></i></button>
1818
</div>
1919
</form>
2020
</div>
2121
</div>
2222
</section>
2323

24+
25+
2426
<section id="posts">
2527
<div class="container">
2628
<div class="row">
2729
<!-- TAGS CLOUD -->
28-
<div class="col-md-4 d-none d-lg-block order-2">
30+
<div class="col-md-3 d-none d-lg-block order-2 ml-auto">
2931
@await Component.InvokeAsync("TagCloud")
32+
33+
<p>
34+
<a asp-controller="Posts" asp-action="Create" class="btn btn-primary btn-block">New Post</a>
35+
</p>
3036
</div>
3137

3238
<!-- POSTS -->
33-
<div class="row col-md-8 order-1">
39+
<div class="row col-sm-12 col-md-9 mx-auto order-1">
3440
@if (Model.Posts != null && Model.Posts.Count() > 0)
3541
{
3642
@foreach (var post in Model.Posts)
3743
{
44+
3845
<div class="card col-md-12 mb-3 p-0">
39-
<div class="card-header">
40-
<h3>@post.Title</h3>
41-
</div>
42-
<div class="card-body">
43-
<p>@post.Excerpt</p>
44-
<hr />
45-
<a asp-controller="Home" asp-action="Details" asp-route-id="@post.Id">Show More &#x2192;</a>
46-
</div>
47-
<div class="card-footer small">
48-
<div class="row">
49-
<p class="ml-2"><i class="fas fa-eye"></i> Views: @post.Views</p>
50-
<div class="ml-auto mr-2">
51-
<p>Posted: @post.Created.ToShortDateString()</p>
52-
</div>
46+
@if (!string.IsNullOrEmpty(post.ImagePath))
47+
{
48+
<div class="g-item-news" style="background-image:url('/content/img/@post.ImagePath');"></div>
49+
}
50+
<div class="card-body py-2">
51+
<p class="card-text mb-2"><small>@post.Tags</small></p>
52+
<hr class="my-2" />
53+
<a asp-controller="Home" asp-action="Details" asp-route-id="@post.Id" class="text-dark"><h4 class="card-title">@post.Title</h4></a>
54+
<p class="card-text mb-4">@post.Excerpt</p>
55+
<div class="row col-12">
56+
<p class="card-text"><small class="text-muted">Posted: @post.Created.ToShortDateString()</small></p>
57+
<p class="card-text ml-2"><small class="text-muted"><i class="fas fa-eye"></i> @post.Views</small></p>
58+
<a asp-controller="Home" asp-action="Details" asp-route-id="@post.Id" class="ml-auto text-dark float-right">Show more &#x2192;</a>
5359
</div>
5460
</div>
5561
</div>
@@ -69,3 +75,4 @@
6975
</div>
7076
</section>
7177

78+

Blog/Blog/Views/Posts/Index.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
</div>
2727
</section>
2828

29+
<p>
30+
<a asp-action="Create" class="btn btn-primary ">New Post</a>
31+
</p>
32+
2933
<!-- TAGS CLOUD -->
3034
<div class="col-md-12 d-none d-lg-block">
3135
@await Component.InvokeAsync("TagCloud")
3236
</div>
3337

3438
<!-- POSTS TABLE -->
3539
<section id="post-table">
36-
<p>
37-
<a asp-action="Create" class="btn btn-primary btn-block m-auto">New Post</a>
38-
</p>
39-
4040
<table class="table table-striped">
4141
<thead class="thead-dark">
4242
<tr>

Blog/Blog/Views/Posts/PostForm.cshtml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,25 @@ else
6363

6464
<input type="hidden" asp-for="Id" />
6565
<div class="form-group">
66-
<input type="submit" value="Save" class="btn btn-primary" />
66+
<input type="submit" value="Save" class="btn btn-primary btn-block" />
6767
</div>
6868
</form>
6969
</div>
7070
</div>
7171

7272
<div>
73-
<a asp-action="Index"><i class="fas fa-arrow-left"></i> Back to List</a>
73+
<a asp-action="Index" class="btn btn-primary"><i class="fas fa-arrow-left"></i> Back to List</a>
7474
</div>
7575

7676
@section Scripts {
7777
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
7878

79-
<script src="~/lib/trumbowyg/trumbowyg.min.js"></script>
79+
<link rel="stylesheet" href="~/lib/jquery-ui/jquery-ui-1.12.1/jquery-ui.min.css">
8080
<link rel="stylesheet" href="~/lib/trumbowyg/ui/trumbowyg.min.css">
8181

8282
<script src="~/lib/jquery-ui/jquery-ui-1.12.1/jquery-ui.min.js"></script>
83-
<link rel="stylesheet" href="~/lib/jquery-ui/jquery-ui-1.12.1/jquery-ui.min.css">
83+
<script src="~/lib/trumbowyg/trumbowyg.min.js"></script>
84+
8485

8586
<script>
8687
$('#content').trumbowyg();

Blog/Blog/Views/Shared/Components/TagCloud/Default.cshtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
@model IEnumerable<Blog.Models.Tag>
22

3-
<div class="card tagcloud my-4">
3+
<div class="card tagcloud mt-0 mb-3">
44
<h5 class="text-center py-3">Tags Cloud</h5>
55
<div class="container">
6-
76
<ul>
87
<li>
98
<a asp-action="Index" asp-route-tag=""><span>Show All</span></a>

0 commit comments

Comments
 (0)