Advertisement
Guest User

Untitled

a guest
May 26th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.87 KB | None | 0 0
  1. {% extends "base.html" %}
  2. {% block title %}Categories{% endblock %}
  3. {% block main %}
  4.  
  5. <div class="d-flex flex-row justify-content-center mt-4">
  6. <div class="w-75">
  7. <h1 class="text-center">Kundvagn</h1>
  8. <div id="cartView">
  9. {% if cart %}
  10. <table class="table border mb-4">
  11. <thead>
  12. <tr>
  13. <th scope="col" class="border-bottom-0">Tillverkare</th>
  14. <th scope="col" class="border-bottom-0">Namn</th>
  15. <th scope="col" class="border-bottom-0">Storlek</th>
  16. <th scope="col" class="border-bottom-0">Pris</th>
  17. <th scope="col" class="border-bottom-0">F&auml;rg</th>
  18. <th scope="col" class="border-bottom-0">Antal</th>
  19. <th scope="col" class="border-bottom-0"></th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. {% for item in cart %}
  24. <tr class="bg-light" id="item_{{ item.id }}">
  25. <td>{{ item.brand }}</td>
  26. <td>{{ item.type }} {{ item.subtype }}</td>
  27. <td>{{ item.size }}</td>
  28. <td>{{ item.price }}</td>
  29. <td>{{ item.color }}</td>
  30. <td>
  31. <button class="cartButtons" onclick="removeFromCart({{ item.id }})" type="button" name="button"> <i class="fas fa-minus"></i></button>
  32. <span id="item_count_{{item.id}}">{{ 1 if item.count != None else item.count }}</span>
  33. <button class="cartButtons" onclick="addToCart({{ item.id }})" type="button" name="button"> <i class="fas fa-plus"></i></button>
  34. </td>
  35. <td>
  36. <button class="removeButton" onclick="removeAllFromCart({{ item.id }})" type="button" name="button"> <i class="fas fa-times">Remove</i> </button>
  37. </td>
  38. </tr>
  39. {% endfor %}
  40. </tbody>
  41. </table>
  42.  
  43. <table class="table w-25 border border-top-0">
  44. <thead>
  45. <tr class="text-center font-weight-bold">
  46. <th colspan="2">Best&auml;llningsinformation</th>
  47. </tr>
  48. </thead>
  49. <tbody>
  50. <tr>
  51. <th>Antal Produkter:</th>
  52. <td class="cart_size">{{ cart|length }}</td>
  53. </tr>
  54. <tr>
  55. <th>Summa:</th>
  56. <td>{{ price }}</td>
  57. </tr>
  58. </tbody>
  59. </table>
  60. <form id='placeOrder' class='w-50' method='post' action="?action=checkout">
  61. <input type="hidden" id="order_items" name="items" value="" />
  62. <fieldset>
  63. <legend>Kund</legend>
  64. {% macro input(title, name, value='', type='text') -%}
  65. <p class='cf-desc'></p><p>
  66. <label for='form-element-{{name}}'>{{ title }}</label><br>
  67. <input id='form-element-{{name}}' type='{{ type }}' class='form-control' name='{{ name }}'/>
  68. </p>
  69. {% endmacro %}
  70.  
  71. {{ input("Namn", "name")}}
  72. {{ input("E-post", "email")}}
  73. {{ input("Adress", "address")}}
  74. {{ input("Postnummer", "zipcode")}}
  75. {{ input("Ort", "town")}}
  76. <p class='cf-desc'></p><p class='buttonbar'>
  77. <span>
  78. <input id='form-element-submit' type='submit' class='btn btn-lg btn-primary w-10' name='submit' value='Best&auml;ll' />
  79. <button class="btn btn-danger btn-lg w-10 " onclick=emptyCart() type="button" name="button">T&ouml;m kundvagn</button>
  80. </span>&nbsp;
  81. {#</p><p class='buttonbar'>
  82. <span>#}
  83. </p>
  84. </fieldset>
  85. </form>
  86. {% else %}
  87. <p>Din kundvagn inneh&aring;ller f&ouml;r tillf&auml;llet inga produkter.</p>
  88. {% endif %}
  89. </div>
  90. </div>
  91. </div>
  92. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement