Skip to content

Commit 3146fba

Browse files
committed
improvements for stats of user posts
1 parent 4d38a48 commit 3146fba

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

VinePlus.Web/Pages/Queries.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,18 @@ public static IEnumerable<ThreadsSummary> getThreadsPosted(ComicvineContext cont
129129
)
130130
.GroupBy(x => new { x.Thread.Id, x.Thread.Thread.Text })
131131
.Select(x =>
132-
new ThreadsSummary(
132+
new
133+
{
133134
x.Key.Id,
134135
x.Key.Text,
135-
x.Count()
136-
)
137-
);
138-
//.OrderByDescending(x => x.no_posts)
139-
//.Skip(PostsPerPage * (page-1))
140-
//.Take(PostsPerPage);
136+
Count = x.Count()
137+
138+
}
139+
)
140+
.OrderByDescending(x => x.Count)
141+
.Skip(Util.PostsPerPage * (page-1))
142+
.Take(Util.PostsPerPage)
143+
.Select(e => new ThreadsSummary(e.Id, e.Text, e.Count));
141144
}
142145

143146
public static IEnumerable<ThreadView> getArchivedThreads(ComicvineContext context, int page, SortForumBy sort_by = SortForumBy.DateCreated) {

VinePlus.Web/Pages/Stats/Posts.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@page "{user}/{p=1}"
1+
@page "{user}"
22
@using VinePlus.Web.Pages
33
@model VinePlus.Web.Pages.Stats.Posts
44

@@ -18,7 +18,7 @@
1818
<span class="thread-tooltip">
1919
@Html.Raw(threadPosted.thread_text)
2020
</span>
21-
<a href="@Url.Content($"/archives/thread/{threadPosted.thread_id}")">
21+
<a href="@Url.Content($"/archives/thread/{threadPosted.thread_id}?p=1")">
2222
@Html.Raw(threadPosted.thread_text)
2323
</a>
2424
</span>

VinePlus.Web/Pages/Stats/Posts.cshtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ namespace VinePlus.Web.Pages.Stats;
66

77
public class Posts(ComicvineContext context): Pagination<ThreadsSummary>
88
{
9-
public void OnGet(string user, int p) {
9+
public void OnGet(string user, int p=1) {
1010
Entities = Queries.getThreadsPosted(context, user, p);
1111
NavRecord = new(p, 1000, user);
1212
}
1313

1414
public override Func<string, int, string> PageDelegate() {
15-
return (user, page) => $"/profile/threads/{user}/{page}";
15+
return (user, page) => $"/stats/posts/{user}?p={page}";
1616
}
1717
}

VinePlus.Web/wwwroot/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ figure[data-size="small"] {
854854
}
855855
.userpost-container {
856856
min-height: 30rem;
857-
margin: auto calc(2*var(--side-width));
857+
margin: auto calc(2.5*var(--side-width));
858858
display: grid;
859859
grid-template-columns: 1fr auto;
860860
align-content: start;

0 commit comments

Comments
 (0)