Commit 05b0b17d authored by tron's avatar tron
Browse files

fixes for feature-dev

parent ac904ca5
......@@ -51,5 +51,7 @@
{% include placeholderBlocks maxItems=maxItems itemListLength=listSize hiddenItems=hiddenItems %}
</div>
{% unless include.noToggle %}
<div id="react-placeholder-toggleVisibility"></div>
{% if include.maxItems < listSize %}
<div id="react-placeholder-toggleVisibility"></div>
{% endif %}
{% endunless %}
\ No newline at end of file
......@@ -28,6 +28,11 @@
{% assign hiddenItems = 0 %}
<div class="column-layout">
{% for topic in itemlist %}
{% assign visibility = "" %}
{% if counter > maxItems %}
{% assign visibility = "hide toggle-visibility-topics-" %}
{% assign hiddenItems = hiddenItems | plus: 1 %}
{% endif %}
{% assign typeClasses = "topic " %}
{% assign typeDescription = "unknown format" %}
{% if topic.type-mcs-bachelor-project == true %}
......@@ -77,15 +82,22 @@
{% assign title = title | append: " &#9733;" %}
{% endif %}
{% if include.status%}
{% include detailed-topic class=typeClasses image=topic.image title=title teaser=topic.teaser url=topic.url assigned-to=topic.assigned-to type=typeDescription%}
{% assign overallClasses = typeClasses | append: " " | append: visibility | append: include.status%}
{% include detailed-topic class=overallClasses image=topic.image title=title teaser=topic.teaser url=topic.url assigned-to=topic.assigned-to type=typeDescription%}
{% endif %}
{% assign counter = counter | plus: 1 %}
{% endfor %}
{% if include.status%}
{% include placeholderBlocks maxItems= include.maxItems itemListLength=itemlist.size hiddenItems=hiddenItems%}
{% endif %}
</div>
<!--{% unless include.noToggle %}
<div id="react-placeholder-toggleVisibility"></div>
{% endunless %}-->
{% unless include.noToggle %}
{% if include.maxItems < itemlist.size %}
{% assign toggleID = "react-placeholder-toggleVisibility-topics-" | append: include.status%}
<div id="{{toggleID}}"></div>
{% endif %}
{% endunless %}
{% endif %}
......@@ -6,12 +6,12 @@ layout: text
{{ content | markdownify }}
{% if page.tags %}
{% include news tags=page.tags maxItems=6 headline="<h2>News</h2>" noToggle=true %}
{% include news tags=page.tags maxItems=6 headline="<h2>News</h2>" %}
{% include topics tags=page.tags headline="<h2>Theses and projects</h2>" %}
{% include topics tags=page.tags status = "open" headline="<h3>Open</h3>" %}
{% include topics tags=page.tags status = "assigned" headline="<h3>Assigned</h3>" %}
{% include topics tags=page.tags status = "closed" headline="<h3>Closed</h3>" %}
{% include topics tags=page.tags maxItems=6 status = "open" headline="<h3>Open</h3>" %}
{% include topics tags=page.tags maxItems=6 status = "assigned" headline="<h3>Assigned</h3>" %}
{% include topics tags=page.tags maxItems=6 status = "closed" headline="<h3>Closed</h3>" %}
{% include jobs tags=page.tags maxItems=6 headline="<h2>Open positions</h2>"%}
......
......@@ -208,6 +208,127 @@ if (document.getElementById("react-placeholder-toggleVisibility") !== null) {
ReactDOM.render(<ToggleVisibility />, document.getElementById("react-placeholder-toggleVisibility"));
}
if (document.getElementById("react-placeholder-toggleVisibility-topics-open") !== null) {
const ToggleVisibilityTopicsOpen = class extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
language: document.getElementById("react-placeholder-toggleVisibility-topics-open").getAttribute("language") // null if not set
};
}
render() {
console.log(this.state.language);
const stringShowLess = this.state.language === "DE" ? "Weniger anzeigen" : "Show less";
const stringShowMore = this.state.language === "DE" ? "Mehr anzeigen" : "Show more";
const toggle = () => this.setState({ visible: !this.state.visible },
(this.state.visible) ? (
() => $(".toggle-visibility-topics-open").addClass("hide")
) : (
() => $(".toggle-visibility-topics-open").removeClass("hide")
)
);
return (
<div className="u-cursor-pointer" onClick={toggle}>
{
(this.state.visible) ? (
stringShowLess
) : (
stringShowMore
)
}
</div>
);
}
};
ReactDOM.render(<ToggleVisibilityTopicsOpen />, document.getElementById("react-placeholder-toggleVisibility-topics-open"));
}
if (document.getElementById("react-placeholder-toggleVisibility-topics-closed") !== null) {
const ToggleVisibilityTopicsClosed = class extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
language: document.getElementById("react-placeholder-toggleVisibility-topics-closed").getAttribute("language") // null if not set
};
}
render() {
console.log(this.state.language);
const stringShowLess = this.state.language === "DE" ? "Weniger anzeigen" : "Show less";
const stringShowMore = this.state.language === "DE" ? "Mehr anzeigen" : "Show more";
const toggle = () => this.setState({ visible: !this.state.visible },
(this.state.visible) ? (
() => $(".toggle-visibility-topics-closed").addClass("hide")
) : (
() => $(".toggle-visibility-topics-closed").removeClass("hide")
)
);
return (
<div className="u-cursor-pointer" onClick={toggle}>
{
(this.state.visible) ? (
stringShowLess
) : (
stringShowMore
)
}
</div>
);
}
};
ReactDOM.render(<ToggleVisibilityTopicsClosed />, document.getElementById("react-placeholder-toggleVisibility-topics-closed"));
}
if (document.getElementById("react-placeholder-toggleVisibility-topics-assigned") !== null) {
const ToggleVisibilityTopicsAssigned = class extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
language: document.getElementById("react-placeholder-toggleVisibility-topics-assigned").getAttribute("language") // null if not set
};
}
render() {
console.log(this.state.language);
const stringShowLess = this.state.language === "DE" ? "Weniger anzeigen" : "Show less";
const stringShowMore = this.state.language === "DE" ? "Mehr anzeigen" : "Show more";
const toggle = () => this.setState({ visible: !this.state.visible },
(this.state.visible) ? (
() => $(".toggle-visibility-topics-assigned").addClass("hide")
) : (
() => $(".toggle-visibility-topics-assigned").removeClass("hide")
)
);
return (
<div className="u-cursor-pointer" onClick={toggle}>
{
(this.state.visible) ? (
stringShowLess
) : (
stringShowMore
)
}
</div>
);
}
};
ReactDOM.render(<ToggleVisibilityTopicsAssigned />, document.getElementById("react-placeholder-toggleVisibility-topics-assigned"));
}
// ////////////////////////////////////////////////////////////////////////////
// Render filter input
// ////////////////////////////////////////////////////////////////////////////
......
......@@ -3,7 +3,7 @@
bundle
bundle update
bundle exec war&
jekyll serve --host=0.0.0.0 --port=4200 --trace --incremental&
bundle exec jekyll serve --host=0.0.0.0 --port=4200 --trace --incremental&
PIDS[0]=$!
trap "kill ${PIDS[*]}" SIGINT
wait
\ No newline at end of file
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