GeezerVison is showing github.com — 首页 · ISmallCode/SmallCode.Web@be153cf
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/SmallCode.Web/Controllers/HomeController.cs +5-2Lines changed: 5 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -47,7 +47,8 @@ public IActionResult Index() |
47 | 47 | homeInfo.Description = item.Description.SubString(100, "......"); |
48 | 48 | homeInfo.CreateDate = item.CreateDate; |
49 | 49 | homeInfo.Category = "原创文章"; |
50 | | - |
| 50 | + homeInfo.Browses = item.Browses; |
| 51 | + homeInfo.Url = "/Article/Show/" + item.Id; |
51 | 52 | homeInfoes.Add(homeInfo); |
52 | 53 | } |
53 | 54 | foreach (var item in materialses) |
@@ -66,6 +67,8 @@ public IActionResult Index() |
66 | 67 | homeInfo.Description = item.Description.SubString(100, "......"); |
67 | 68 | homeInfo.CreateDate = item.CreateDate; |
68 | 69 | homeInfo.Category = "学习资料"; |
| 70 | + homeInfo.Browses = item.Browses; |
| 71 | + homeInfo.Url = "/Materials/Show/" + item.Id; |
69 | 72 | } |
70 | 73 |
|
71 | 74 | //动态用户信息 |
@@ -82,7 +85,7 @@ public IActionResult Index() |
82 | 85 |
|
83 | 86 | ViewBag.Infoes = infoes; |
84 | 87 | ViewBag.Users = userList; |
85 | | - ViewBag.HomeInfoes = homeInfoes.OrderByDescending(x=>x.CreateDate).ToList(); |
| 88 | + ViewBag.HomeInfoes = homeInfoes.OrderByDescending(x => x.CreateDate).ToList(); |
86 | 89 |
|
87 | 90 |
|
88 | 91 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/SmallCode.Web/DataModels/HomeInfoModel.cs +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,5 +16,9 @@ public class HomeInfoModel |
16 | 16 | public DateTime CreateDate { set; get; } |
17 | 17 |
|
18 | 18 | public string Category { set; get; } |
| 19 | + |
| 20 | + public int Browses { set; get; } |
| 21 | + |
| 22 | + public string Url { set; get; } |
19 | 23 | } |
20 | 24 | } |
Collapse file
Copy file name to clipboardExpand all lines: src/SmallCode.Web/Views/Home/Index.cshtml +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
44 | 44 | { |
45 | 45 | <article class="excerpt excerpt-none excerpt-5 article53"> |
46 | 46 | <header> |
47 | | - <a class="cat label label-important" target="_blank" href="http://www.wscon.cn/category-1.html" data-original-title="" title="">@item.Category<i class="label-arrow"></i></a><h2><a href="http://www.wscon.cn/53.html" target="_blank" title="vsftpd 配置:chroot_local_user与chroot_list_enable详解 ">@item.Title</a></h2> |
| 47 | + <a class="cat label label-important" target="_blank" href="" data-original-title="" title="">@item.Category<i class="label-arrow"></i></a> |
| 48 | + <h2><a href="@item.Url" target="_blank" title="@item.Title">@item.Title</a></h2> |
48 | 49 | </header> |
49 | 50 | <div class="text-muted time"><span class="post-time nmpost"><i class="fa fa-clock-o"></i> 发布于 @item.CreateDate</span></div> |
50 | 51 | <span class="note">@item.Description</span> |
51 | 52 | <div class="text-muted views"> |
52 | | - <span class="post-views"><i class="fa fa-eye"></i> 阅读(31)</span> |
53 | | - <a href="javascript:;" class="post-like sf-praise-sdk pull-right" sfa="click" data-postid="53" data-value="1"><i class="fa fa-thumbs-o-up"></i>赞一个 (<span class="sf-praise-sdk" sfa="num" data-value="1" data-postid="53">0</span>)</a> |
54 | | - <span class="post-comments"><i class="fa fa-comments"></i> 评论(0)</span> |
| 53 | + <span class="post-views"><i class="fa fa-eye"></i> @item</span> |
| 54 | + @* <a href="javascript:;" class="post-like sf-praise-sdk pull-right" sfa="click" data-postid="53" data-value="1"> |
| 55 | + <i class="fa fa-thumbs-o-up"></i>赞一个 (<span class="sf-praise-sdk" sfa="num" data-value="1" data-postid="53">0</span>)</a>*@ |
| 56 | + <span class="post-comments"><i class="fa fa-comments"></i></span> |
55 | 57 | </div> |
56 | 58 | </article> |
57 | 59 | } |
|