Skip to content

Commit b327f7a

Browse files
committed
added stat for top threads
1 parent 3146fba commit b327f7a

File tree

6 files changed

+35
-45
lines changed

6 files changed

+35
-45
lines changed

VinePlus.Web/Pages/Stats/Index.cshtml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,26 @@
88
ViewData[Keys.Headings] = "General statistics";
99
ViewData[Keys.Highlight] = MainHighlight.Stats;
1010
}
11-
12-
stats
11+
<div class="mini-heading">Top 10 threads by posts</div>
12+
<div class="userpost-container" >
13+
<span class="thread-odd thread-item thread-header thread-item-title">Title</span>
14+
<span class="thread-odd thread-item thread-header thread-item-posts"># Posts</span>
15+
@foreach (var (index, threadPosted) in Model.top10_threads.Select((t, i) => (i,t))) {
16+
<span class="@Url.Content($"{Helpers.getThreadRow(index)} thread-item thread-item-title")">
17+
<span class="thread-tooltip">
18+
@Html.Raw(threadPosted.thread_name)
19+
</span>
20+
<a href="@Url.Content($"/archives/thread/{threadPosted.thread_id}?p=1")">
21+
@Html.Raw(threadPosted.thread_name)
22+
</a>
23+
</span>
24+
<span class="@Url.Content($"{Helpers.getThreadRow(index)} thread-item thread-item-posts")">
25+
@threadPosted.last_post_no
26+
</span>
27+
}
28+
</div>
29+
<div class="mini-heading">Top 10 users by posts</div>
30+
<div class="mini-heading">number of threads for each board</div>
31+
<div class="mini-heading">total number of posts</div>
32+
<div class="mini-heading">total number of threads</div>
33+
<div class="mini-heading">link to user stats</div>
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using Microsoft.AspNetCore.Mvc.RazorPages;
2+
using VinePlus.Database;
23

34
namespace VinePlus.Web.Pages.Stats;
45

5-
public class Index : PageModel
6+
public class Index(ComicvineContext context) : PageModel
67
{
8+
public IEnumerable<ThreadView> top10_threads;
79
public void OnGet() {
10+
top10_threads = Queries.getArchivedThreads(context, 1, SortForumBy.NoPosts).Take(10);
811
}
912
}

VinePlus.Web/Pages/Stats/VisitedThread.cshtml

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

VinePlus.Web/VinePlus.Web.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24+
<Folder Include="Pages\Stats\User\" />
2425
<Folder Include="wwwrooot\images" />
2526
</ItemGroup>
2627

VinePlus.Web/wwwroot/css/main.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,4 +895,10 @@ figure[data-size="small"] {
895895
font-weight: bold;
896896
color: gray;
897897
padding: 0 0.2rem;
898-
}
898+
}
899+
.mini-heading {
900+
font-size: 1.7rem;
901+
font-weight: 600;
902+
color: #105e10;
903+
text-align: center;
904+
}

0 commit comments

Comments
 (0)