product_overview.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. {% extends "base_generic.html" %}
  2. {% load tags %}
  3. {% load countries %}
  4. {% load static %}
  5. {% load crispy_forms_tags %}
  6. {% block script %}
  7. <script>
  8. $(document).ready(function(){
  9. $("#how").fadeOut(0);
  10. $("#how").click(function(){
  11. $("#how").fadeOut(200);
  12. });
  13. $("button#show").click(function(){
  14. $(".card").show();
  15. $("button").removeClass("mark");
  16. $("#how").fadeOut(40);
  17. });
  18. /*
  19. $("button#vote").click(function(){
  20. $(".card").show();
  21. $("button").removeClass("mark");
  22. $(".card").not(".notvote").hide();
  23. $("button#vote").addClass("mark");
  24. if($(".card").filter(":visible").length < 1){
  25. $("#how").fadeIn(200)
  26. } else{
  27. $("#how").fadeOut(10)
  28. }
  29. });
  30. */
  31. {% for country in count_list %}
  32. {% if country %}
  33. /*
  34. $("[id='{{country.code}}']").click(function(){
  35. $(".card").show();
  36. $("button").removeClass("mark");
  37. $(".card").not(".{{country.code}}").hide();
  38. $("[id='{{country.code}}']").addClass("mark");
  39. if($(".card").filter(":visible").length < 1){
  40. $("#how").fadeIn(200)
  41. } else{
  42. $("#how").fadeOut(10)
  43. }
  44. });
  45. */
  46. {% endif %}
  47. {% endfor %}
  48. {% for year in year_list %}
  49. /*
  50. $("[id='{{year}}']").click(function(){
  51. $(".card").show();
  52. $("button").removeClass("mark");
  53. $(".card").not(".{{year}}").hide();
  54. $("[id='{{year}}']").addClass("mark");
  55. if($(".card").filter(":visible").length < 1){
  56. $("#how").fadeIn(200)
  57. } else{
  58. $("#how").fadeOut(10)
  59. }
  60. });
  61. */
  62. {% endfor %}
  63. {% for key, value in ort_dict.items %}
  64. /*
  65. $(".{{ key }}").click(function(){
  66. $(".card").show();
  67. $("button").removeClass("mark");
  68. $(".card").not(".{{ key }}").hide();
  69. $("button .{{ key }}").addClass("mark");
  70. if($(".card").filter(":visible").length < 1){
  71. $("#how").fadeIn(200)
  72. } else{
  73. $("#how").fadeOut(10)
  74. }
  75. });
  76. */
  77. {% endfor %}
  78. $(".btn-toggle").click (function(elem){
  79. let toggler = this.getAttribute("toggler");
  80. console.log(toggler);
  81. $(".card").show();
  82. $("button").removeClass("mark");
  83. $(".card").not("." + toggler).hide();
  84. $("button ." + toggler).addClass("mark");
  85. if($(".card").filter(":visible").length < 1){
  86. $("#how").fadeIn(200)
  87. } else{
  88. $("#how").fadeOut(10)
  89. }
  90. });
  91. });
  92. </script>
  93. <style media="screen">
  94. .card-columns .mab-card{
  95. width: 97%;
  96. height: 95%;
  97. display: inline-block;
  98. margin-top:4px;
  99. max-width: 100%;
  100. }
  101. .mab-card-body{
  102. padding: 5px;
  103. padding-left: 5px;
  104. }
  105. .mab-Product-title {
  106. position: absolute;
  107. bottom: 8px;
  108. left: 16px;
  109. color: white;
  110. font-size: large;
  111. font-weight: bold;
  112. text-align: left;
  113. background-color: rgba(0, 0, 0, 0);
  114. text-shadow: 0 0 6px #444, 0 0 20px #888;
  115. }
  116. .mab-Product-vote {
  117. position: absolute;
  118. top: 8px;
  119. right: 16px;
  120. color: white;
  121. font-size: large
  122. }
  123. .mab-card-text {
  124. color: black;
  125. margin-top: 0px;
  126. }
  127. .mab-card-highlight {
  128. background-color: #f0faf0;
  129. }
  130. </style>
  131. {% endblock %}
  132. {% block content %}
  133. <nav class="navbar-expand-sm tag" style="margin-left: 0px">
  134. <button class="navbar-toggler border-thin mybtn rounded-0 tag navbar-expand-sm " type="button" data-toggle="collapse" data-target="#tags" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle tags" style="font-size: 15px">
  135. <span class="mybtn"></span> Show All Tags ⋁
  136. </button>
  137. <div class="row border-dark collapse navbar-collapse" id="tags">
  138. <div class="container-fluid">
  139. <button id='show' class="border-thin mybtn " style="margin-right: 2px;margin-bottom: 2px">#Show All</button>
  140. {% for elem in frei_list %}
  141. <button id='{{elem.0}}' toggler='{{elem.0}}' class="border-thin mybtn btn-toggle elem.0" style="margin-right: 2px;margin-bottom: 2px">#{{elem.1}}</button>
  142. {% endfor %}
  143. {% for key, value in ort_dict.items %}
  144. <button class="border-thin mybtn btn-toggle {{key}}" toggler='{{key}}' style="margin-right: 2px;margin-bottom: 2px">#{{value}}</button>
  145. {% endfor %}
  146. {% for elem in altneu_list %}
  147. <button class="border-thin mybtn btn-toggle {{elem.0}}" toggler='{{elem.0}}' style="margin-right: 2px;margin-bottom: 2px">#{{elem.1}}</button>
  148. {% endfor %}
  149. </div>
  150. </div>
  151. <div class="">
  152. &nbsp;
  153. </div>
  154. <div class="row border-dark " id="search_bar">
  155. <div class="container-fluid">
  156. <div class="row">
  157. <div class="col-sm-6">
  158. <form method="post" action="{% url 'search-products' %}" >
  159. {% csrf_token %}
  160. <!-- Left here in case we need to debug -->
  161. {% if signup_errors %}
  162. <div class='invalid-feedback' style="display: none;">{{ signup_errors }}</div>
  163. {% endif %}
  164. {% if contact_errors %}
  165. <div class='invalid-feedback' style="display: none;">{{ contact_errors }}</div>
  166. {% endif %}
  167. <!-- end of debug -->
  168. {% crispy textSearchForm %}
  169. </form>
  170. </div>
  171. <div class="col-sm-6">
  172. {% include "marktplatz/modal-sa.html" %}
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </nav>
  178. <div id="how" style="margin-top: 5px;text-align: center;vertical-align: middle; max-height: 40px;" class="container-fluid">
  179. <p style="color: black"> There are no Products matching your selection, as you have selected multiple tags.
  180. Click <nobr><button id='show' class="border-thin mybtn" style="margin-right: 2px;margin-top: 15px">#Show All</button></nobr> to deselect all tags.
  181. </p>
  182. </div>
  183. <! -- Start Cards --><div class="card-columns" style="margin-top: 7px; orphans: 1; windows:1;">
  184. {{main_card|safe}}
  185. {% for product in wohnprojekt_list %}
  186. <div class="mab-card {{product.ort}} {{product.status}} {{product.frei}} {{product.altneu}} {% if product.frei == 'JAJA' %} mab-card-highlight {% endif %} card rounded-0 border-0 " style="">
  187. <a href="{% url 'product-detail' product.pk %}">
  188. <div style="position: relative;text-align: center;">
  189. <img class="{% if user.is_authenticated %}{% get_vote_class product user %} {% endif %} {% for category in product.category.all %} {{category.short_name}} {% endfor %} card-img-top rounded-0" src="{{product.media_set.first.image_norm.url}}" alt="image">
  190. <div class="mab-product-title" style="">{{product.name|upper }}</div>
  191. {% if user.is_authenticated %}
  192. <div class="mab-product-vote" style="">{% get_vote product user %}</div>
  193. {% endif %}
  194. </div>
  195. </a>
  196. <div class="card-body mab-card-body" style="">
  197. <!--<div class="border-0 d-flex justify-content">
  198. <p class="card-title" style="margin-bottom: 3px"><a href="{% url 'product-detail' product.pk %}"> {{product.header }} </a></p>
  199. </div>-->
  200. <p class="mab-card-text card-text" style="">
  201. <button id='product_{{product.pk}}_{{product.frei}}' toggler='{{product.frei}}' class="border-thin mybtn btn-toggle {{product.frei}}" style="">#{{product.get_frei_display}}</button>
  202. <button id='product_{{product.pk}}_{{product.status}}' toggler='{{product.status}}' class="border-thin mybtn btn-toggle {{product.status}}" style="">#{{product.get_status_display}}</button>
  203. <button id='product_{{product.pk}}_{{product.ort}}' toggler='{{product.ort}}' class="border-thin mybtn btn-toggle {{product.ort}}" style="">#{{product.get_ort_display}}</button>
  204. <button id='product_{{product.pk}}_{{product.altneu}}' toggler='{{product.altneu}}' class="border-thin mybtn btn-toggle {{product.altneu}}" style="">#{{product.get_altneu_display}}</button>
  205. </p>
  206. </div>
  207. </div>
  208. {% endfor %}
  209. {{sponsor_cards|safe}}
  210. <! -- End Cards --></div>
  211. {% endblock %}