Commit 0f4e03c9 authored by dihokon's avatar dihokon
Browse files

add filter (not functioning)

parent 5eeb6369
......@@ -447,11 +447,24 @@ if (element !== null) {
//TODO
updateTopics() {
let tempLabel = "";
this.state.topic.forEach(function(element){
if (element.isChecked == true) {
tempLabel += " ." + element.label;
}
});
// this.state.topic.forEach( element => (
// if (element.isChecked == true) {
// tempLabel += " ." + element.label
// }
// ));
$(".topic" + tempLabel).show();
$(".topic:not(" + tempLabel + ")").hide();
// if (selectedCheckboxes.includes("1")) {
// $(".topic." + this.state.topic.label[this.state.topic.id]).show();
if (this.state.topic.isChecked == false) {
console.log("unchecked")
}
// }
// $(".topic:not(." + this.topic.id[this.topic.selected == false] + ")").hide();
// if (this.state.topic.isChecked == true) {
// this.state.topic.id.forEach(
// element => $(".topic." + element).show()
......@@ -472,21 +485,18 @@ if (element !== null) {
}
handleChange (id) {
const selectedCheckboxes = this.state.selectedCheckboxes;
this.state.selectedCheckboxes[selectedCheckboxes.indexOf(id)].isChecked = !this.state.selectedCheckboxes[selectedCheckboxes.indexOf(id)].isChecked;
// Find index
const findIdx = selectedCheckboxes.indexOf(id);
// const findIdx = selectedCheckboxes.indexOf(id);
// Index > -1 means that the item exists and that the checkbox is checked
// and in that case we want to remove it from the array and uncheck it
if (findIdx > -1) {
selectedCheckboxes.splice(findIdx, 1);
} else {
selectedCheckboxes.push(id);
}
// if (findIdx > -1) {
// selectedCheckboxes.splice(findIdx, 1);
// } else {
// selectedCheckboxes.push(id);
// }
this.setState({selectedCheckboxes: selectedCheckboxes});
console.log("Checkbox: ", selectedCheckboxes)
// this.setState({selectedCheckboxes: selectedCheckboxes}, this.updateTopics);
// console.log("Checkbox: ", selectedCheckboxes)
}
renderFullList() {
......
......@@ -53,147 +53,8 @@ layout: base
{% for topic in topics %}
{% for t in topic.topic-category %}
{% assign typeClasses = "topic " %}
<!-- hci -->
{% if t.focus == 'hci' and t.level == 'ba' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ma' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'phd' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ba' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ba' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ma' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ma' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'phd' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'phd' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ba' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ma' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'phd' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ba' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "GRL"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'ma' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "GRL"%}
{% endif %}
{% if t.focus == 'hci' and t.level == 'phd' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "GRL"%}
{% endif %}
<!-- cs -->
{% if t.focus == 'cs' and t.level == 'ba' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ma' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'phd' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ba' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ba' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "cs" | append: " " | append: "ba" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ma' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ma' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "cs" | append: " " | append: "ma" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'phd' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'phd' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "cs" | append: " " | append: "phd" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ba' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ma' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'phd' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ba' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "GRL"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'ma' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "GRL"%}
{% endif %}
{% if t.focus == 'cs' and t.level == 'phd' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "GRL"%}
{% endif %}
<!-- ge -->
{% if t.focus == 'cs' and t.level == 'ba' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ma' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'phd' and t.type == 'thesis'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "thesis"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ba' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ba' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "ge" | append: " " | append: "ba" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ma' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ma' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "ma" | append: " " | append: "ba" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'phd' and t.type == 'project'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "project"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'phd' and t.type == 'project' and t.coop == 'ind'%}
{% assign typeClasses = typeClasses | append: " " | append: "phd" | append: " " | append: "ba" | append: " " | append: "project" | append: " " | append: "ind"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ba' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ma' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'phd' and t.type == 'internship'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "internship"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ba' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ba" | append: " " | append: "GRL"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'ma' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "ma" | append: " " | append: "GRL"%}
{% endif %}
{% if t.focus == 'ge' and t.level == 'phd' and t.type == 'GRL'%}
{% assign typeClasses = typeClasses | append: " " | append: "hci" | append: " " | append: "phd" | append: " " | append: "GRL"%}
{% endif %}
{% assign typeClasses = typeClasses | append: " " | append: t.focus | append: " " | append: t.level | append: " " | append: t.type %}
{% endfor %}
{% assign title = topic.title %}
{% if t.put-on-top-of-the-list == true %}
{% assign title = title | append: " &#9733;" %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment