Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model Tuple<PagedList.IPagedList<MVCProject.Models.Item>,MVCProject.Models.Category>
- @using PagedList.Mvc;
- @{
- ViewBag.Title = "Index";
- }
- <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
- <script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
- <script src="@Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")" type="text/javascript"></script>
- <div>
- </div>
- <div class="content">
- <div class="content_box">
- @{
- if (User.IsInRole("admin"))
- {
- <p>
- @Html.ActionLink("Добавить категорию растений", "Create", "Categories")
- </p>
- }
- }
- <ul class="grid_2">
- @foreach (var item in Model.Item1)
- {
- <li>
- <img href="@Url.Action("Details", "Items", new { id = item.Id })" src="@Url.Content(item.ImageFilePath)" height="350" width="350" class="img-responsive" alt="" />
- <span class="btn5"><a class="price" href="@Url.Action("Details", "Items", new { id = item.Id })"> @Html.DisplayFor(modelItem => item.Price) руб. | <img src="@Url.Content("~/Content/Images/cart.png")" height="26" width="26" class="img-responsive" alt="" style="margin: 0px 0px"> </a></span>
- <p>@Html.DisplayFor(modelItem => item.Name)</p>
- @{
- if (User.IsInRole("admin"))
- {
- <p>
- @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
- @Html.ActionLink("Details", "Details", new { id = item.Id }) |
- @Html.ActionLink("Delete", "Delete", new { id = item.Id })
- </p>
- }
- }
- </li>
- }
- <div class="clearfix"> </div>
- </ul>
- Страница @(Model.Item1.PageCount < Model.Item1.PageNumber ? 0 : Model.Item1.PageNumber) из @Model.Item1.PageCount
- @Html.PagedListPager(Model.Item1, page => Url.Action("Index", new { page }))
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement