fix category,tag, news list

fix edit account details bug
This commit is contained in:
2024-08-06 16:34:13 +03:30
parent 936222ab07
commit 07ffa3303d
10 changed files with 199 additions and 82 deletions

View File

@ -11,9 +11,6 @@
<th>
@Html.DisplayNameFor(model => model.title)
</th>
<th>
@Html.DisplayNameFor(model => model.link)
</th>
<th>
@Html.DisplayNameFor(model => model.tag)
</th>
@ -29,9 +26,6 @@
<td>
@Html.DisplayFor(modelItem => item.title)
</td>
<td>
@Html.DisplayFor(modelItem => item.link)
</td>
<td>
@Html.DisplayFor(modelItem => item.tag)
</td>
@ -39,9 +33,14 @@
@Html.DisplayFor(modelItem => item.cat)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
@Html.ActionLink("Details", "Details", new { id = item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
@Html.ActionLink("Read", "../news/Details", new { id = item.ID })|
@if (ViewBag.role == 1 || ViewBag.uid == item.userID)
{
@Html.ActionLink("Edit", "../news/Edit", new { id = item.ID })
<span>|</span>
@Html.ActionLink("Delete", "../news/Delete", new { id = item.ID })
}
</td>
</tr>
}

View File

@ -29,9 +29,15 @@
@Html.DisplayFor(modelItem => item.title)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id=item.ID })
@Html.ActionLink("Details", "Details", new { id = item.ID }) |
@if (ViewBag.role == 1)
{
@Html.ActionLink("Edit", "Edit", new { id = item.ID })
<span>|</span>
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
}
</td>
</tr>
}

View File

@ -4,6 +4,7 @@
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
@ -56,9 +57,17 @@
@Html.DisplayFor(modelItem => item.views)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.NewsID }) |
@Html.ActionLink("Details", "Details", new { id = item.NewsID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.NewsID })
@Html.ActionLink("Read", "Details", new { id = item.NewsID })|
@if (ViewBag.role == 1 || ViewBag.uid == item.userID)
{
@Html.ActionLink("Edit", "Edit", new { id = item.NewsID })
<span>|</span>
@Html.ActionLink("Delete", "Delete", new { id = item.NewsID })
}
</td>
</tr>
}

View File

@ -11,9 +11,6 @@
<th>
@Html.DisplayNameFor(model => model.title)
</th>
<th>
@Html.DisplayNameFor(model => model.link)
</th>
<th>
@Html.DisplayNameFor(model => model.tag)
</th>
@ -29,9 +26,6 @@
<td>
@Html.DisplayFor(modelItem => item.title)
</td>
<td>
@Html.DisplayFor(modelItem => item.link)
</td>
<td>
@Html.DisplayFor(modelItem => item.tag)
</td>
@ -39,9 +33,15 @@
@Html.DisplayFor(modelItem => item.cat)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
@Html.ActionLink("Details", "Details", new { id = item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
@Html.ActionLink("Read", "../news/Details", new { id = item.ID })|
@if (ViewBag.role == 1 || ViewBag.uid == item.userID)
{
@Html.ActionLink("Edit", "../news/Edit", new { id = item.ID })
<span>|</span>
@Html.ActionLink("Delete", "../news/Delete", new { id = item.ID })
}
</td>
</tr>
}

View File

@ -29,9 +29,14 @@
@Html.DisplayFor(modelItem => item.title)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.code }) |
@Html.ActionLink("Details", "Details", new { id=item.code }) |
@Html.ActionLink("Delete", "Delete", new { id=item.code })
@Html.ActionLink("Details", "Details", new { id = item.code }) |
@if (ViewBag.role == 1)
{
@Html.ActionLink("Edit", "Edit", new { id = item.code })
<span>|</span>
@Html.ActionLink("Delete", "Delete", new { id = item.code })
}
</td>
</tr>
}