Commit 2f30b4d9 authored by dihokon's avatar dihokon
Browse files

change markdown input to list

parent 30111705
......@@ -436,84 +436,39 @@ if (element !== null) {
{ category: "type", id: "thesis", label: "Thesis", isChecked: true},
{ category: "type", id: "intern", label: "Internship", isChecked: true},
{ category: "type", id: "grl", label: "Games Research Lab", isChecked: true},
{ category: "type", id: "coop", label: "Industry Cooperation", isChecked: true}
]
{ category: "type", id: "ind", label: "Industry Cooperation", isChecked: true}
],
};
// this.handleChange = this.handleChange.bind(this);
this.handleChange = this.handleChange.bind(this);
this.handleAllChange = this.handleAllChange.bind(this);
}
//TODO
updateTopics() {
// if (this.topic.isChecked == true) {
// this.topic.forEach(
// element => $(".topic." + element.id).show()
// if (this.state.topic.isChecked == true) {
// this.state.topic.id.forEach(
// element => $(".topic." + element).show()
// );
// }
// let topics = "";
// if(this.topic.isChecked == false){
// topics += "." + this.topic.id[this.topic.isChecked == false];
// $(".topic:not(." + this.topicFocus[this.topic.isChecked == false] + ")").hide();
// }
// if (this.topic.isChecked == true) {
// $(".topic." + this.topic.id).show();
// }
// if (this.topic.isChecked == false) {
// $(".topic." + this.topic.id).hide();
// }
// if (this.topic.isSelected == true) {
// $(".topic." + this.topic.id[this.topic.selected == true]).show();
// }
// let topics = "";
// if (this.state.selectedFocus !== 0) {
// topics += "." + this.topicFocus[this.state.selectedFocus - 1];
// $(".topic:not(." + this.topicFocus[this.state.selectedFocus - 1] + ")").hide();
// }
// if (this.state.selectedLevel !== 0) {
// topics += "." + this.topicLevel[this.state.selectedLevel - 1];
// $(".topic:not(." + this.topicLevel[this.state.selectedLevel - 1] + ")").hide();
// }
// if (this.state.selectedType !== 0) {
// topics += "."+ this.topicType[this.state.selectedType - 1];
// $(".topic:not(." + this.topicType[this.state.selectedType - 1] + ")").hide();
// if (this.state.topic.isChecked == false) {
// topics += "." + this.state.topic.id;
// $(".topic:not(." + this.state.topic.id + ")").hide();
// }
// $(".topic" + topics).show();
}
handleChange (e) {
let itemLabel = e.target.label;
let checked = e.target.checked;
this.setState(prevState => {
let { topic, allChecked } = prevState;
if (itemLabel === "checkAll") {
allChecked = checked;
topic = topic.map(item => ({ ...item, isChecked: checked }));
} else {
topic = topic.map(item =>
item.label === itemLabel ? { ...item, isChecked: checked } : item
);
allChecked = topic.every(item => item.isChecked);
}
return { topic, allChecked };
});
}
handleAllChange (e) {
//TODO
}
// handleChange(e){
// let items = this.topic
// items.forEach(item => {
// if (item.id === event.target.id) {
// item.isChecked = event.target.isChecked
// }
// })
// this.setState({isChecked: this.topic.isChecked}, this.updateTopics);
// }
handleChange(e){
this.setState({isChecked: !this.state.topic.isChecked}, this.updateTopics);
}
renderFullList() {
return this.state.topic.map(item => (
......@@ -532,15 +487,15 @@ if (element !== null) {
}
renderFocusList() {
return this.state.topic.filter(unfiltered => (unfiltered.category === "focus")).map(focusOnly => (
return this.state.topic.filter(unfiltered => (unfiltered.category === "focus")).map((focusOnly) => (
<div>
<input
key={focusOnly.id}
type="checkbox"
label={focusOnly.label}
value={focusOnly.label}
checked={focusOnly.isChecked}
onChange={this.handleChange.bind(this)}
defaultChecked={focusOnly.isChecked}
onChange={this.handleChange}
/>
<label>{focusOnly.label}</label>
</div>
......@@ -555,8 +510,8 @@ if (element !== null) {
type="checkbox"
label={levelOnly.label}
value={levelOnly.label}
checked={levelOnly.isChecked}
onChange={this.handleChange.bind(this)}
defaultChecked={levelOnly.isChecked}
onChange={this.handleChange}
/>
<label>{levelOnly.label}</label>
</div>
......@@ -571,8 +526,8 @@ if (element !== null) {
type="checkbox"
label={typeOnly.label}
value={typeOnly.label}
checked={typeOnly.isChecked}
onChange={this.handleChange.bind(this)}
defaultChecked={typeOnly.isChecked}
onChange={this.handleChange}
/>
<label>{typeOnly.label}</label>
</div>
......
......@@ -51,45 +51,151 @@ layout: base
{% assign counter = 0 %}
{% for topic in topics %}
<!-- focus -->
{% for t in topic.topic-category %}
{% assign typeClasses = "topic " %}
{% if topic.focus == "hci" %}
{% assign typeClasses = typeClasses | append: " " | append: "hci" %}
<!-- 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 topic.focus == "cs" %}
{% assign typeClasses = typeClasses | append: " " | append: "cs" %}
{% 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 topic.focus == "ge" %}
{% assign typeClasses = typeClasses | append: " " | append: "type-ge" %}
{% 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 %}
<!-- level -->
{% if topic.level == "ba" %}
{% assign typeClasses = typeClasses | append: " " | append: "ba" %}
{% 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 topic.level == "ma" %}
{% assign typeClasses = typeClasses | append: " " | append: "type-ma" %}
{% 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 topic.level == "phd" %}
{% assign typeClasses = typeClasses | append: " " | append: "type-phd" %}
{% 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 %}
<!-- type -->
{% if topic.type-project == "project" %}
{% assign typeClasses = typeClasses | append: " " | append: "type-project" %}
{% 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 topic.type == "thesis" %}
{% assign typeClasses = typeClasses | append: " " | append: "thesis" %}
{% 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 topic.type == "intern" %}
{% assign typeClasses = typeClasses | append: " " | append: "type-intern" %}
{% 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 topic.type == "grl" %}
{% assign typeClasses = typeClasses | append: " " | append: "type-grl" %}
{% 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 topic.type == "coop" %}
{% assign typeClasses = typeClasses | append: " " | append: "type-coop" %}
{% 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 %}
{% assign title = topic.title %}
{% if topic.put-on-top-of-the-list == true %}
{% 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 %}
{% endfor %}
{% assign title = topic.title %}
{% if t.put-on-top-of-the-list == true %}
{% assign title = title | append: " &#9733;" %}
{% endif %}
......
Markdown is supported
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