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
RevLine 
[2aea0fd]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
[118e414]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 })
[2aea0fd]52 </td>
[118e414]53 *@
[2aea0fd]54
55
[72b1da2]56
57
[118e414]58 @if (item.users_id == ViewBag.CurrentUserId)
[e9bb9d1]59
[118e414]60 {
61 <td>
62 @Html.ActionLink("Edit", "Edit", new { id = item.id })
63 @Html.ActionLink("Delete", "Delete", new { id = item.id })
[72b1da2]64
[118e414]65 </td>
[72b1da2]66 }
[e9bb9d1]67
68
[72b1da2]69
70 @if (item.users_id == ViewBag.CurrentUserId || item.users_id != ViewBag.CurrentUserId)
71 {
72 <td>
[118e414]73
74 @Html.ActionLink("Answers", "Details", new { id = item.id })
75
[72b1da2]76
77 </td>
78 }
79
80
[118e414]81
82
83
84
85 </tr>
86 }
[2aea0fd]87
88</table>
Note: See TracBrowser for help on using the repository browser.