Delete.cshtml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. @model Recepie.Models.Recipe
  2. @{
  3. ViewData["Title"] = "Delete Recipe";
  4. }
  5. <div class="container mt-4">
  6. <div class="row">
  7. <div class="col-md-8 offset-md-2">
  8. <div class="card border-danger">
  9. <div class="card-header bg-danger text-white">
  10. <h2>Delete Recipe</h2>
  11. </div>
  12. <div class="card-body">
  13. <div class="alert alert-warning">
  14. <i class="fas fa-exclamation-triangle"></i>
  15. Are you sure you want to delete this recipe? This action cannot be undone.
  16. </div>
  17. <h3>@Model.Title</h3>
  18. <p class="lead">@Model.Description</p>
  19. @if (!string.IsNullOrEmpty(Model.Difficulty))
  20. {
  21. <p><strong>Difficulty:</strong> <span class="badge bg-info">@Model.Difficulty</span></p>
  22. }
  23. @if (!string.IsNullOrEmpty(Model.Time))
  24. {
  25. <p><strong>Time:</strong> @Model.Time</p>
  26. }
  27. @if (!string.IsNullOrEmpty(Model.Url))
  28. {
  29. <p><strong>Recipe URL:</strong> <a href="@Model.Url" target="_blank">@Model.Url</a></p>
  30. }
  31. <form asp-action="Delete" method="post" class="d-inline">
  32. <input type="hidden" asp-for="Id" />
  33. <div class="d-grid gap-2 d-md-flex justify-content-md-end mt-4">
  34. <a href="@Url.Action("Details", new { id = Model.Id })" class="btn btn-secondary">Cancel</a>
  35. <button type="submit" class="btn btn-danger">
  36. <i class="fas fa-trash"></i> Delete Recipe
  37. </button>
  38. </div>
  39. </form>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>