|
|
@@ -21,6 +21,7 @@ $(document).ready(function(){
|
|
|
|
|
|
});
|
|
|
|
|
|
+/*
|
|
|
$("button#vote").click(function(){
|
|
|
$(".card").show();
|
|
|
$("button").removeClass("mark");
|
|
|
@@ -34,34 +35,13 @@ $(document).ready(function(){
|
|
|
$("#how").fadeOut(10)
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- {% for category in cat_list %}
|
|
|
-
|
|
|
- {% if category %}
|
|
|
-
|
|
|
- $("[id='{{category.short_name|cut:" "}}']").click(function(){
|
|
|
- $(".card").show();
|
|
|
- $("button").removeClass("mark");
|
|
|
-
|
|
|
- $(".card").not(".{{category.short_name|cut:" "}}").hide();
|
|
|
- $("[id='{{category.short_name|cut:" "}}']").addClass("mark");
|
|
|
-
|
|
|
- if($(".card").filter(":visible").length < 1){
|
|
|
- $("#how").fadeIn(200)
|
|
|
- } else{
|
|
|
- $("#how").fadeOut(10)
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- {% endif %}
|
|
|
-
|
|
|
- {% endfor %}
|
|
|
+*/
|
|
|
|
|
|
|
|
|
{% for country in count_list %}
|
|
|
|
|
|
{% if country %}
|
|
|
-
|
|
|
+/*
|
|
|
$("[id='{{country.code}}']").click(function(){
|
|
|
$(".card").show();
|
|
|
$("button").removeClass("mark");
|
|
|
@@ -76,13 +56,13 @@ $(document).ready(function(){
|
|
|
}
|
|
|
|
|
|
});
|
|
|
-
|
|
|
+*/
|
|
|
{% endif %}
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
{% for year in year_list %}
|
|
|
-
|
|
|
+/*
|
|
|
$("[id='{{year}}']").click(function(){
|
|
|
$(".card").show();
|
|
|
$("button").removeClass("mark");
|
|
|
@@ -97,9 +77,49 @@ $(document).ready(function(){
|
|
|
}
|
|
|
|
|
|
});
|
|
|
+*/
|
|
|
+ {% endfor %}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {% for key, value in ort_dict.items %}
|
|
|
+ /*
|
|
|
+ $(".{{ key }}").click(function(){
|
|
|
+ $(".card").show();
|
|
|
+ $("button").removeClass("mark");
|
|
|
+
|
|
|
+ $(".card").not(".{{ key }}").hide();
|
|
|
+ $("button .{{ key }}").addClass("mark");
|
|
|
+
|
|
|
+ if($(".card").filter(":visible").length < 1){
|
|
|
+ $("#how").fadeIn(200)
|
|
|
+ } else{
|
|
|
+ $("#how").fadeOut(10)
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ */
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
+ $(".btn-toggle").click (function(elem){
|
|
|
+
|
|
|
+ let toggler = this.getAttribute("toggler");
|
|
|
+ console.log(toggler);
|
|
|
+ $(".card").show();
|
|
|
+ $("button").removeClass("mark");
|
|
|
+
|
|
|
+ $(".card").not("." + toggler).hide();
|
|
|
+ $("button ." + toggler).addClass("mark");
|
|
|
+
|
|
|
+ if($(".card").filter(":visible").length < 1){
|
|
|
+ $("#how").fadeIn(200)
|
|
|
+ } else{
|
|
|
+ $("#how").fadeOut(10)
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
});
|
|
|
</script>
|
|
|
@@ -148,8 +168,14 @@ $(document).ready(function(){
|
|
|
|
|
|
color: black;
|
|
|
margin-top: 0px;
|
|
|
+}
|
|
|
+ .mab-card-highlight {
|
|
|
+
|
|
|
+ background-color: #f0faf0;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- }
|
|
|
|
|
|
</style>
|
|
|
|
|
|
@@ -172,17 +198,23 @@ $(document).ready(function(){
|
|
|
{% if user.is_authenticated %}
|
|
|
<button id='vote' class="border-thin mybtn " style="margin-right: 2px;margin-bottom: 2px">#Not Voted</button>
|
|
|
{% endif %}
|
|
|
- {% for category in cat_list %}
|
|
|
- <button id='{{category.short_name}}' class="border-thin mybtn " style="margin-right: 2px;margin-bottom: 2px">#{{category.name}}</button>
|
|
|
- {% endfor %}
|
|
|
|
|
|
- {% for year in year_list %}
|
|
|
- <button id='{{year}}' class="border-thin mybtn " style="margin-right: 2px;margin-bottom: 2px">#{{year}}</button>
|
|
|
- {% endfor %}
|
|
|
|
|
|
- {% for country in count_list %}
|
|
|
- <button id='{{country.code}}' class="border-thin mybtn " style="margin-right: 2px;margin-bottom: 2px" >#{{country.name}}</button>
|
|
|
- {% endfor %}
|
|
|
+ {% for elem in frei_list %}
|
|
|
+ <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>
|
|
|
+ {% endfor %}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {% for key, value in ort_dict.items %}
|
|
|
+ <button class="border-thin mybtn btn-toggle {{key}}" toggler='{{key}}' style="margin-right: 2px;margin-bottom: 2px" >#{{value}}</button>
|
|
|
+ {% endfor %}
|
|
|
+
|
|
|
+ {% for elem in altneu_list %}
|
|
|
+ <button class="border-thin mybtn btn-toggle {{elem.0}}" toggler='{{elem.0}}' style="margin-right: 2px;margin-bottom: 2px" >#{{elem.1}}</button>
|
|
|
+ {% endfor %}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -201,10 +233,11 @@ $(document).ready(function(){
|
|
|
|
|
|
{{main_card|safe}}
|
|
|
|
|
|
+ {% for product in wohnprojekt_list %}
|
|
|
|
|
|
- {% for product in product_list %}
|
|
|
+ {{ product.wohnprojekt }}
|
|
|
|
|
|
- <div class="mab-card {% for name in product.country %} {{name.code}} {% endfor %} {{product.year}} {% for category in product.category.all %} {{category.short_name}} {% endfor %} card rounded-0 border-0 {% if user.is_authenticated %} {% get_vote_class product user %} {% endif %}" style="">
|
|
|
+ <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="">
|
|
|
<a href="{% url 'product-detail' product.pk %}">
|
|
|
<div style="position: relative;text-align: center;">
|
|
|
<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">
|
|
|
@@ -221,15 +254,12 @@ $(document).ready(function(){
|
|
|
</div>-->
|
|
|
|
|
|
<p class="mab-card-text card-text" style="">
|
|
|
- {% for name in product.country %}
|
|
|
- <button id='{{name.code}}' class="border-thin mybtn" style="">#{{name.name}}</button>
|
|
|
- {% endfor %}
|
|
|
|
|
|
- <button id='{{product.year}}' class="border-thin mybtn" style="">#{{product.year}}</button>
|
|
|
+ <button id='product_{{product.pk}}_{{product.frei}}' toggler='{{product.frei}}' class="border-thin mybtn btn-toggle {{product.frei}}" style="">#{{product.get_frei_display}}</button>
|
|
|
+ <button id='product_{{product.pk}}_{{product.status}}' toggler='{{product.status}}' class="border-thin mybtn btn-toggle {{product.status}}" style="">#{{product.get_status_display}}</button>
|
|
|
+ <button id='product_{{product.pk}}_{{product.ort}}' toggler='{{product.ort}}' class="border-thin mybtn btn-toggle {{product.ort}}" style="">#{{product.get_ort_display}}</button>
|
|
|
+ <button id='product_{{product.pk}}_{{product.altneu}}' toggler='{{product.altneu}}' class="border-thin mybtn btn-toggle {{product.altneu}}" style="">#{{product.get_altneu_display}}</button>
|
|
|
|
|
|
- {% for category in product.category.all %}
|
|
|
- <button id='{{category.short_name}}' class="border-thin mybtn" style="">#{{category.name}}</button>
|
|
|
- {% endfor %}
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|