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

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

fix issues

fix bugs with nested tables
fix delete nested fk items

  • Property mode set to 100644
File size: 2.5 KB
Line 
1@model PostgreSqlDotnetCore.Models.BlogPostConsultation
2
3@{
4 ViewBag.Title = "Details";
5}
6
7@*<h2>Одговори</h2>*@
8@*
9<div>
10 <h4>Blog post for consultations</h4>
11 <hr />
12 <dl class="dl-horizontal">
13 <dt>
14 @Html.DisplayNameFor(model => model.date_askes)
15 </dt>
16
17 <dd>
18 @Html.DisplayFor(model => model.date_askes)
19 </dd>
20
21 <dt>
22 @Html.DisplayNameFor(model => model.title)
23 </dt>
24 <dd>
25 @Html.DisplayFor(model => model.title)
26 </dd>
27
28 <dt>
29 @Html.DisplayNameFor(model => model.description)
30 </dt>
31
32 <dd>
33 @Html.DisplayFor(model => model.description)
34 </dd>
35
36 <dt>
37 @Html.DisplayNameFor(model => model.users_id)
38 </dt>
39
40 <dd>
41 @Html.DisplayFor(model => model.users_id)
42 </dd>
43
44
45 </dl>
46</div>
47*@
48
49<hr/>
50<div>
51 <h2>Answers</h2>
52 <hr />
53
54 <table class="table">
55 <tr>
56
57 <th>
58 Reply
59 </th>
60 <th>
61 UsersId
62 </th>
63 <th></th>
64
65 </tr>
66
67 @foreach (var item in Model.BlogPostAnswers)
68 {
69 <tr>
70 <td>
71 @Html.DisplayFor(modelItem => item.reply)
72 </td>
73
74 <th>
75 @Html.DisplayFor(model => item.usersid)
76 </th>
77
78 <td>
79
80 @Html.ActionLink("Details", "Details", "BlogPostAnswers", new { id = item.id })
81 @Html.ActionLink("Create an Answer", "Create", "BlogPostAnswers", new { id = item.BlogPostConsultationid, parentId = item.id })
82 </td>
83
84 @if (item.usersid == ViewBag.CurrentUserId)
85
86 {
87 <td>
88
89 @Html.ActionLink("Edit", "Edit", "BlogPostAnswers", new { id = item.id })
90 @Html.ActionLink("Delete", "Delete", "BlogPostAnswers", new { id = item.id })
91
92
93 </td>
94 }
95
96
97 </tr>
98 }
99
100 </table>
101</div>
102<p>
103 @Html.ActionLink("Create an Answer", "Create", "BlogPostAnswers", new { id = Model.id, parentId = Model.id })
104 @Html.ActionLink("Back to List", "Index")
105</p>
106
107
108@if (Model.users_id == ViewBag.CurrentUserId)
109
110{
111 <p>
112 @Html.ActionLink("Edit", "Edit", new { id = Model.id })
113
114
115 </p>
116}
Note: See TracBrowser for help on using the repository browser.