No Description

tiendaPrincipal.html 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {% extends 'header.html' %}
  2. {% block css %}
  3. <link rel ='stylesheet' href ='/static/css/tienda.css'>
  4. {% endblock %}
  5. {% block body %}
  6. <nav class="navbar navbar-expand-lg navbar-dark text-center sticky-top" id ='navbar' >
  7. <a class="navbar-brand mx-auto active" style='color: #000000' href="/home" onclick ='saveCart()'>Inicio</a>
  8. <button class="navbar-toggler custom-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
  9. <span class="navbar-toggler-icon"></span>
  10. </button>
  11. <div class="collapse navbar-collapse" id="navbarNav">
  12. <ul class="navbar-nav mx-auto">
  13. <li class="nav-item">
  14. <a class="nav-link" href="/verBotella" onclick ='saveCart()' style = 'color: #2671B6;'><strong>Botella</strong></a>
  15. </li>
  16. <li class="nav-item">
  17. <a class="nav-link" style = 'color: #2671B6;' href="/verCamisa" onclick ='saveCart()'><strong>Camisas</strong></a>
  18. </li>
  19. </ul>
  20. <ul class="nvbar-nav pull-sm-right">
  21. <!-- <li class="nav-item dropdown">
  22. <a class="nav-link dropdown-toggle" style = 'color: #2671B6;' href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  23. <strong>Dropdown link</strong>
  24. </a>
  25. <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
  26. <a class="dropdown-item" href="#">Action</a>
  27. <a class="dropdown-item" href="#">Another action</a>
  28. <a class="dropdown-item" href="#">Something else here</a>
  29. </div>
  30. </li>-->
  31. <button type='button' class= 'btn btn-success' data-toggle="modal" data-target="Tiendita">Check out</button>
  32. </ul>
  33. </div>
  34. </nav>
  35. <div class="jumbotron jumbotron-fluid text-center" style = 'height: 12rem;'>
  36. <div class="container">
  37. <h1 class="display-4">NUEVOS PRODUCTOS</h1>
  38. </div>
  39. </div>
  40. <div class= 'container-fluid'>
  41. <div class='row'>
  42. <br>
  43. </div>
  44. <div class ='row'>
  45. {% set count = namespace(value=0) %}
  46. {% for item in items %}
  47. <div class = 'col-auto'>
  48. <div class="card">
  49. <img class="card-img-top" style='height: 18rem;' src="/static/{{item.path_to_pic}}" alt="Card image">
  50. <div class="card-body">
  51. <h6 class="card-title">{{item.Nombre}}<span class="badge badge-secondary">NUEVO</span></h6>
  52. <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#Modal{{count.value}}">
  53. Descripción
  54. </button>
  55. <p class="card-text"> <strong> Disponibles: {{item.cantidadMax}}</strong></p>
  56. <div class="input-group mb-2 mr-sm-2">
  57. <div class="input-group-append">
  58. <div class="input-group-text"><strong>1 x ${{item.precio}}</strong> <br></div>
  59. </div>
  60. <input type="text" class="form-control" id="{{item.id}}" name ='Cantidad[{{count.value}}]' onchange ='buyitem("item","Cantidad[{{count.value}}]","{{item.id}}")' placeholder="Precio">
  61. </div></div>
  62. </div>
  63. <!-- onclick ='saveCart()' href="#" class="btn btn-primary">See Profile</a>-->
  64. </div>
  65. <div class="modal fade" id="Modal{{count.value}}" >
  66. <div class="modal-dialog" role="document">
  67. <div class="modal-content">
  68. <div class="modal-header">
  69. <h5 class="modal-title" >Detalles de {{item.Nombre}}</h5>
  70. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  71. <span aria-hidden="true">&times;</span>
  72. </button>
  73. </div>
  74. <div class="modal-body">
  75. {{item.descripcion}}
  76. </div>
  77. <div class="modal-footer">
  78. <button type="button" class="btn btn-primary" data-dismiss="modal">Cerrar</button>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. {% set count.value = count.value + 1 %}
  84. {% endfor %}
  85. </div>
  86. </div>
  87. <script>
  88. // When the user scrolls the page, execute myFunction
  89. </script>
  90. {% endblock %}