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

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

Use of views

  1. Use of views in VetCenters.
  2. Ability to provide a response to a given response.
  • 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 {
33 <tr>
34 <td>
35 @Html.DisplayFor(modelItem => item.date_askes)
36 </td>
37 <td>
38 @Html.DisplayFor(modelItem => item.title)
39 </td>
40
41 <td>
42 @Html.DisplayFor(modelItem => item.description)
43 </td>
44 <th>
45 @Html.DisplayFor(model => item.users_id)
46 </th>
47
48 @*<td>
49 @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
50 @Html.ActionLink("Answers", "Details", new { id = item.id }) |
51 @Html.ActionLink("Delete", "Delete", new { id = item.id })
52 </td>
53 *@
54
55
56
57
58 @if (item.users_id == ViewBag.CurrentUserId)
59
60 {
61 <td>
62 @Html.ActionLink("Edit", "Edit", new { id = item.id })
63 @Html.ActionLink("Delete", "Delete", new { id = item.id })
64
65 </td>
66 }
67
68
69
70 @if (item.users_id == ViewBag.CurrentUserId || item.users_id != ViewBag.CurrentUserId)
71 {
72 <td>
73
74 @Html.ActionLink("Answers", "Details", new { id = item.id })
75
76
77 </td>
78 }
79
80
81
82
83
84
85 </tr>
86 }
87
88</table>
Note: See TracBrowser for help on using the repository browser.