Advertisement
Guest User

Untitled

a guest
Sep 12th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. <table id="records" class="table">
  2. <thead>
  3. <tr>
  4. <th>Habit</th>
  5. <th>
  6. @Html.DisplayNameFor(model => model.HabitLogs[0].Date)
  7. </th>
  8. <th>
  9. @Html.DisplayNameFor(model => model.HabitLogs[0].Quantity)
  10. </th>
  11. <th></th>
  12. </tr>
  13. </thead>
  14. <tbody>
  15. @foreach (var record in Model.HabitLogs)
  16. {
  17. string ImagePath = Model.HabitTypes.Where(x => x.Name == record.HabitTypeName).Select(x => x.ImagePath).First();
  18. string UnitOfMeasurement = Model.HabitTypes.Where(x => x.Name == record.HabitTypeName).Select(x => x.UnitOfMeasurement).First();
  19. string amount = record.Quantity + " " + UnitOfMeasurement;
  20. <tr class="list-row">
  21. <td>
  22. <img src="@Url.Content(ImagePath)" width="48px" height="48px">
  23. </td>
  24. <td>
  25. @Html.DisplayFor(modelItem => record.Date)
  26. </td>
  27. <td>
  28. @amount
  29. </td>
  30. <td>
  31. <a button type="button" class="btn btn-danger" asp-page="./Delete" asp-route-id="@record.Id">
  32. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
  33. <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
  34. <path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
  35. </svg>
  36. </a>
  37.  
  38. <a button type="button" class="btn btn-primary" asp-page="./Update" asp-route-id="@record.Id">
  39. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
  40. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pen" viewBox="0 0 16 16">
  41. <path d="m13.498.795.149-.149a1.207 1.207 0 1 1 1.707 1.708l-.149.148a1.5 1.5 0 0 1-.059 2.059L4.854 14.854a.5.5 0 0 1-.233.131l-4 1a.5.5 0 0 1-.606-.606l1-4a.5.5 0 0 1 .131-.232l9.642-9.642a.5.5 0 0 0-.642.056L6.854 4.854a.5.5 0 1 1-.708-.708L9.44.854A1.5 1.5 0 0 1 11.5.796a1.5 1.5 0 0 1 1.998-.001zm-.644.766a.5.5 0 0 0-.707 0L1.95 11.756l-.764 3.057 3.057-.764L14.44 3.854a.5.5 0 0 0 0-.708l-1.585-1.585z" />
  42. </svg>
  43. </svg>
  44. </a>
  45. </td>
  46. </tr>
  47. }
  48. </tbody>
  49. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement