source: PostgreSqlDotnetCore/Views/Blog/Index.cshtml@ e90ba32

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

fix issues

fix bugs with nested tables
fix delete nested fk items

  • Property mode set to 100644
File size: 2.3 KB
Line 
1@model IEnumerable<PostgreSqlDotnetCore.Models.BlogUsers>
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.id)
17 </th>
18 <th>
19 @Html.DisplayNameFor(model => model.user_name)
20 </th>
21 <th>
22 @Html.DisplayNameFor(model => model.user_email)
23 </th>
24 <th>
25 @Html.DisplayNameFor(model => model.consultation_title)
26 </th>
27 <th>
28 @Html.DisplayNameFor(model => model.consultation_description)
29 </th>
30 <th>
31 @Html.DisplayNameFor(model => model.consultation_date)
32 </th>
33 <th></th>
34
35 </tr>
36
37 @foreach (var item in Model)
38 {
39 <tr>
40 <td>
41 @Html.DisplayFor(modelItem => item.id)
42 </td>
43 <td>
44 @Html.DisplayFor(modelItem => item.user_name)
45 </td>
46 <td>
47 @Html.DisplayFor(model => item.user_email)
48 </td>
49 <td>
50 @Html.DisplayFor(modelItem => item.consultation_title)
51 </td>
52 <td>
53 @Html.DisplayFor(modelItem => item.consultation_description)
54 </td>
55 <td>
56 @Html.DisplayFor(modelItem => item.consultation_date)
57 </td>
58
59 @*<td>
60 @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
61 @Html.ActionLink("Answers", "Details", new { id = item.id }) |
62 @Html.ActionLink("Delete", "Delete", new { id = item.id })
63 </td>
64 *@
65
66
67
68
69 @if (item.users_id == ViewBag.CurrentUserId)
70
71 {
72 <td>
73 @Html.ActionLink("Edit", "Edit", new { id = item.id })
74 @Html.ActionLink("Delete", "Delete", new { id = item.id })
75
76 </td>
77 }
78
79
80
81 @if (item.users_id == ViewBag.CurrentUserId || item.users_id != ViewBag.CurrentUserId)
82 {
83 <td>
84
85 @Html.ActionLink("Answers", "Details", new { id = item.id })
86
87
88 </td>
89 }
90
91
92
93
94
95
96 </tr>
97 }
98
99</table>
Note: See TracBrowser for help on using the repository browser.