From a2f414c460493314cd7ab6c1992d9bb463aa3fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Wed, 17 May 2023 10:42:34 +0300 Subject: [PATCH] refactoring --- .../Blogging/Localization/Resources/en.json | 5 +- .../Pages/Blogs/Posts/Detail.cshtml | 5 +- .../Pages/Members/Index.cshtml | 223 +++++++++++------- 3 files changed, 147 insertions(+), 86 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json index 989926f760..a5499b77a5 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json @@ -73,6 +73,9 @@ "FullURL": "Full URL", "JobTitle": "Job Title", "PersonalWebsite": "PERSONAL WEBSITE", - "EditProfile": "Edit Profile" + "EditProfile": "Edit Profile", + "MoreFromBlog": "More From Blog", + "MoreFromUser": "More From {0}", + "BlogPosts": "Posts" } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml index 0cb5ceeef0..383b7b12af 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml @@ -172,7 +172,7 @@ @if (Model.LatestPosts.Count > 1) {
-

More from Blog

+

@L["MoreFromBlog"]

@for (var index = 0; index < Model.LatestPosts.Count && index < 5; index++) { if (Model.LatestPosts[index].Id != Model.Post.Id) @@ -440,7 +440,8 @@ else
@if (Model.PostsList.Count > 1) { -

More from @CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.Post.Writer.UserName)

+ var userName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.Post.Writer.UserName); +

@L["MoreFromUser", userName]

for (var index = 0; index < Model.PostsList.Count; index++) { if (Model.PostsList[index].Id != Model.Post.Id) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml index 12ed3cc854..47b92f65d3 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml @@ -99,99 +99,156 @@
- - @if (Model.Posts is not null && Model.Posts.Any()) - { - -
- @foreach (var post in Model.Posts) - { -
-
- - - - - - - @L["Blog"].Value.ToUpper() - -
-
- -

- - @post.Title - -

-

- - @post.Description.TruncateWithPostfix(150) - - @L["ReadMore"] -

-
-
-
- -
-
-
- } -
-
- } - else - { -
-
-

@L["MemberNotPublishedPostYet"]

-
-
- } - @if (CurrentUser.UserName == Model.User.UserName) - { - -
-
- - - + @if (CurrentUser.UserName == Model.User.UserName) + { + + @if (Model.Posts is not null && Model.Posts.Any()) + { + +
+ @foreach (var post in Model.Posts) + { +
+
+ + + + + + + @L["Blog"].Value.ToUpper() + +
+
+ +

+ + @post.Title + +

+

+ + @post.Description.TruncateWithPostfix(150) + + @L["ReadMore"] +

+
+
+
+ +
+
+
+ } +
+
+ } + else + { +
+
+

@L["MemberNotPublishedPostYet"]

+
+
+ } + +
+ + + + - + - + - + - + - + - + - + -
- - -
-
-
-
- +
+ +
- + + +
+
- - } - + +
+ + + } + else + { + if (Model.Posts is not null && Model.Posts.Any()) + { +

@L["BlogPosts"]

+
+ @foreach (var post in Model.Posts) + { +
+
+ + + + + + + @L["Blog"].Value.ToUpper() + +
+
+ +

+ + @post.Title + +

+

+ + @post.Description.TruncateWithPostfix(150) + + @L["ReadMore"] +

+
+
+
+ +
+
+
+ } +
+ } + else + { +
+
+

@L["MemberNotPublishedPostYet"]

+
+
+ } + }