source: PostgreSqlDotnetCore/Views/Blog/Index.cshtml@ 72b1da2

main
Last change on this file since 72b1da2 was 72b1da2, checked in by ElenaMoskova <elena.moskova99@…>, 3 months ago

Providing access

Providing access to various functionalities

  • Property mode set to 100644
File size: 1.9 KB
Line 
1@model IEnumerable<PostgreSqlDotnetCore.Models.BlogPostConsultation>
2
3@{
4 ViewBag.Title = "BlogPostConsultation";
5}
6
7<h2>Blog post for consultations.</h2>
8
9<p>
10 @Html.ActionLink("Ask for Advice", "Create")
11</p>
12<table class="table">
13 <tr>
14
15 <th>
16 @Html.DisplayNameFor(model => model.date_askes)
17 </th>
18 <th>
19 @Html.DisplayNameFor(model => model.title)
20 </th>
21 <th>
22 @Html.DisplayNameFor(model => model.description)
23 </th>
24 <th>
25 @Html.DisplayNameFor(model => model.users_id)
26 </th>
27 <th></th>
28
29 </tr>
30
31@foreach (var item in Model) {
32 <tr>
33 <td>
34 @Html.DisplayFor(modelItem => item.date_askes)
35 </td>
36 <td>
37 @Html.DisplayFor(modelItem => item.title)
38 </td>
39
40 <td>
41 @Html.DisplayFor(modelItem => item.description)
42 </td>
43 <th>
44 @Html.DisplayFor(model => item.users_id)
45 </th>
46
47 @*<td>
48 @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
49 @Html.ActionLink("Answers", "Details", new { id = item.id }) |
50 @Html.ActionLink("Delete", "Delete", new { id = item.id })
51 </td>
52 *@
53
54
55
56
57 @if (item.users_id == ViewBag.CurrentUserId)
58 {
59 <td>
60 @Html.ActionLink("Edit", "Edit", new { id = item.id })
61 @Html.ActionLink("Delete", "Delete", new { id = item.id })
62
63 </td>
64 }
65
66
67
68 @if (item.users_id == ViewBag.CurrentUserId || item.users_id != ViewBag.CurrentUserId)
69 {
70 <td>
71
72 @Html.ActionLink("Answers", "Details", new { id = item.id })
73
74
75 </td>
76 }
77
78
79
80
81
82
83 </tr>
84}
85
86</table>
Note: See TracBrowser for help on using the repository browser.