show.blade.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container-fluid">
  4. <h1 class="mt-4">{!! $recipe->name !!}</h1>
  5. <ol class="breadcrumb mb-4">
  6. <li class="breadcrumb-item"><a href="{!! env('APP_URL') !!}dashboard">Dashboard</a></li>
  7. <li class="breadcrumb-item active">{!! $recipe->name !!}</li>
  8. </ol>
  9. <div class="row">
  10. <div class="col-xl-12">
  11. <div class="card mb-4">
  12. <div class="card-body">
  13. <div class="table-responsive">
  14. <table class="table table-bordered">
  15. <tr>
  16. <th width="20%">Name:</th>
  17. <td>{!! $recipe->name !!}</td>
  18. </tr>
  19. <tr>
  20. <th width="20%">Categories:</th>
  21. <td>{!! $categories !!}</td>
  22. </tr>
  23. <tr>
  24. <th width="20%">Price:</th>
  25. <td>{!! number_format($recipe->price) !!}</td>
  26. </tr>
  27. <tr>
  28. <th width="20%">Status:</th>
  29. <td>@if($recipe->status=="1")<span class="badge badge-success">active</span> @else <span class="badge badge-danger">disabled</span> @endif</td>
  30. </tr>
  31. <tr>
  32. <th width="20%">Customizeable?:</th>
  33. <td>@if($recipe->is_customized=="1")<span class="badge badge-success">Yes</span> @else <span class="badge badge-danger">No</span> @endif</td>
  34. </tr>
  35. <tr>
  36. <th width="20%">Description:</th>
  37. <td>{!! $recipe->short_description !!}</td>
  38. </tr>
  39. <tr>
  40. <th width="20%">Main Image:</th>
  41. <td>
  42. @if(isset($recipe) && isset($recipe->main_images))
  43. <div class="col-1">
  44. <img src="{!! $recipe->main_images->file_name !!}" class="img-fluid mb-2" alt="{!! $recipe->name !!}">
  45. </div>
  46. @endif
  47. </td>
  48. </tr>
  49. <tr>
  50. <th width="20%">Gallery Images:</th>
  51. <td>
  52. @if(isset($recipe) && isset($recipe->galleries))
  53. <div class="row mb-2">
  54. @foreach($recipe->galleries as $gallery)
  55. <div class="col-sm-1">
  56. <div class="mb-1">
  57. <img style="max-height: 110px" src="{!! $gallery->file_name !!}" class="img-fluid mb-2" alt="{!! $recipe->name !!}">
  58. </div>
  59. </div>
  60. @endforeach
  61. </div>
  62. @endif
  63. </td>
  64. </tr>
  65. @if(\Illuminate\Support\Facades\Auth::user()->role=="restaurant")
  66. <tr>
  67. <td colspan="2">
  68. <a href="{!! env('APP_URL') !!}recipe/edit/{!! $recipe->id !!}" class="btn btn-primary">Edit</a>
  69. </td>
  70. </tr>
  71. @endif
  72. </table>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. @endsection
  80. @section('js')
  81. <script>
  82. $(function () {
  83. $("body").on('click','.save',function () {
  84. $(".alert").hide();
  85. if($("#password-form").valid()){
  86. $("#password-form").ajaxForm(function (response) {
  87. response = $.parseJSON(response);
  88. if(response){
  89. if(response.type=="success"){
  90. $('#password-form .alert.success').html(response.message);
  91. $('#password-form .alert.success').show();
  92. setTimeout(function(){
  93. location.reload();
  94. },2000)
  95. }else{
  96. $('#password-form .alert.error').html(response.message);
  97. $('#password-form .alert.error').show();
  98. }
  99. }
  100. }).submit();
  101. }
  102. })
  103. })
  104. </script>
  105. @endsection