diff --git a/react/src/dashboard.js b/react/src/dashboard.js index f507fc595116a2f06b991957fa943ae24dc5a2c1..6d34f701c0223400a66253d1c7a37e84051fc9fc 100644 --- a/react/src/dashboard.js +++ b/react/src/dashboard.js @@ -152,10 +152,11 @@ class Dashboard extends React.Component { {/* CARDS */} <div className={"row"}> - <div className={"dashboard-cards"}> + {/*<div className={"dashboard-cards"}>*/} - {/* MY PLAN */} - {this.state.has_plan ? <div className="card"> + {/* MY PLAN */} + {this.state.has_plan ? <div className="col s12 m12 l6 xl4"> + <div className={"card"}> <div className="card-content"> {/* Show individualized title */} <span className="card-title"> @@ -210,40 +211,42 @@ class Dashboard extends React.Component { anzeigen </a> </div> - </div> : ""} - - {/* MY STATUS */} - {/*<div className="card">*/} - {/* <div className="card-content">*/} - {/* <span className="card-title">Mein Status</span>*/} - {/* <div className={"row"}>*/} - {/* <WithCheckCircleIcon>*/} - {/* {this.state.user_type_formatted}*/} - {/* </WithCheckCircleIcon>*/} - - {/* {this.state.user_type === 1 || this.state.user_type === 2 ? <WithCheckCircleIcon>*/} - {/* Meine Klassen: {this.state.classes.join(", ")}*/} - {/* </WithCheckCircleIcon> : ""}*/} - - {/* {this.state.user_type === 1 || this.state.user_type === 2 ? <WithCheckCircleIcon>*/} - {/* Meine Kurse: {this.state.courses.join(", ")}*/} - {/* </WithCheckCircleIcon> : ""}*/} - - {/* {this.state.user_type === 1 ? <WithCheckCircleIcon>*/} - {/* Meine Fächer: {this.state.subjects.join(", ")}*/} - {/* </WithCheckCircleIcon> : ""}*/} - {/* {this.state.user_type === 1 || this.state.has_wifi ?*/} - {/* <WithCheckCircleIcon>WLAN</WithCheckCircleIcon> : <div className={"col"}>*/} - {/* <i className={"material-icons left red-text"}>cancel</i>*/} - {/* Kein WLAN*/} - {/* </div>}*/} - {/* </div>*/} - {/* </div>*/} - {/*</div>*/} - - {/* CURRENT EVENTS*/} - {this.state.current_events && this.state.current_events.length > 0 ? - <div className="card"> + </div> + </div> : ""} + + {/* MY STATUS */} + {/*<div className="card">*/} + {/* <div className="card-content">*/} + {/* <span className="card-title">Mein Status</span>*/} + {/* <div className={"row"}>*/} + {/* <WithCheckCircleIcon>*/} + {/* {this.state.user_type_formatted}*/} + {/* </WithCheckCircleIcon>*/} + + {/* {this.state.user_type === 1 || this.state.user_type === 2 ? <WithCheckCircleIcon>*/} + {/* Meine Klassen: {this.state.classes.join(", ")}*/} + {/* </WithCheckCircleIcon> : ""}*/} + + {/* {this.state.user_type === 1 || this.state.user_type === 2 ? <WithCheckCircleIcon>*/} + {/* Meine Kurse: {this.state.courses.join(", ")}*/} + {/* </WithCheckCircleIcon> : ""}*/} + + {/* {this.state.user_type === 1 ? <WithCheckCircleIcon>*/} + {/* Meine Fächer: {this.state.subjects.join(", ")}*/} + {/* </WithCheckCircleIcon> : ""}*/} + {/* {this.state.user_type === 1 || this.state.has_wifi ?*/} + {/* <WithCheckCircleIcon>WLAN</WithCheckCircleIcon> : <div className={"col"}>*/} + {/* <i className={"material-icons left red-text"}>cancel</i>*/} + {/* Kein WLAN*/} + {/* </div>}*/} + {/* </div>*/} + {/* </div>*/} + {/*</div>*/} + + {/* CURRENT EVENTS*/} + {this.state.current_events && this.state.current_events.length > 0 ? + <div className={"col s12 m12 l6 xl4"}> + <div className="card "> <div className="card-content"> <span className="card-title">Aktuelle Termine</span> {this.state.current_events.map(function (event) { @@ -260,63 +263,67 @@ class Dashboard extends React.Component { </a> </div> </div> - : ""} - - {/* EXAMS */} - {/*<div className="card">*/} - {/* <div className="card-content">*/} - {/* <span className="card-title">Klausuren der <em>Eb</em></span>*/} - {/* <div className="card-panel event-card">*/} - {/* <span className={"title"}>Sextanereinschulung</span>*/} - {/* <br/>*/} - {/* 28.Aug. 2019 18:30 - 22:00*/} - {/* </div>*/} - {/* <div className="card-panel event-card">*/} - {/* <span className={"title"}>Sextanereinschulung</span>*/} - {/* <br/>*/} - {/* 28.Aug. 2019 18:30 - 22:00*/} - {/* </div>*/} - {/* </div>*/} - {/* <div className="card-action">*/} - {/* <a href="https://katharineum-zu-luebeck.de/aktuelles/termine/">Alle Klausuren</a>*/} - {/* </div>*/} - {/*</div>*/} - - {/* NEWEST ARTICLE FROM HOMEPAGE*/} - {this.state.newest_article ? - <div> - <div className="card"> - {/* Image with badge and title */} - <div className="card-image"> - <span className={"badge-image z-depth-2"}>Aktuelles von der Homepage</span> - <img src={this.state.newest_article.image_url} - alt={this.state.newest_article.title}/> - <span className="card-title" - dangerouslySetInnerHTML={{__html: this.state.newest_article.title}}/> - </div> - - {/* Short text */} - <div className="card-content"> - <p dangerouslySetInnerHTML={{__html: this.state.newest_article.short_text}}/> - </div> - - {/* Link to article */} - <div className="card-action"> - <a href={this.state.newest_article.link} target={"_blank"}>Mehr lesen</a> - </div> + </div> + : ""} + + {/* EXAMS */} + {/*<div className="card">*/} + {/* <div className="card-content">*/} + {/* <span className="card-title">Klausuren der <em>Eb</em></span>*/} + {/* <div className="card-panel event-card">*/} + {/* <span className={"title"}>Sextanereinschulung</span>*/} + {/* <br/>*/} + {/* 28.Aug. 2019 18:30 - 22:00*/} + {/* </div>*/} + {/* <div className="card-panel event-card">*/} + {/* <span className={"title"}>Sextanereinschulung</span>*/} + {/* <br/>*/} + {/* 28.Aug. 2019 18:30 - 22:00*/} + {/* </div>*/} + {/* </div>*/} + {/* <div className="card-action">*/} + {/* <a href="https://katharineum-zu-luebeck.de/aktuelles/termine/">Alle Klausuren</a>*/} + {/* </div>*/} + {/*</div>*/} + + {/* NEWEST ARTICLE FROM HOMEPAGE*/} + {this.state.newest_article ? + <div className={"col s12 m12 l6 xl4"}> + <div className="card"> + {/* Image with badge and title */} + <div className="card-image"> + <span className={"badge-image z-depth-2"}>Aktuelles von der Homepage</span> + <img src={this.state.newest_article.image_url} + alt={this.state.newest_article.title}/> + </div> - {/* Link to homepage */} - <a className={"btn hundred-percent primary-color"} - href={"https://katharineum-zu-luebeck.de/"} - target={"_blank"}> - Weitere Artikel - <i className={"material-icons right"}>arrow_forward</i> - </a> + + {/* Short text */} + <div className="card-content"> + <span className="card-title" + dangerouslySetInnerHTML={{__html: this.state.newest_article.title}}/> + + <p dangerouslySetInnerHTML={{__html: this.state.newest_article.short_text}}/> + </div> + + {/* Link to article */} + <div className="card-action"> + <a href={this.state.newest_article.link} target={"_blank"}>Mehr lesen</a> + </div> </div> - : ""} - </div> + + {/* Link to homepage */} + <a className={"btn hundred-percent primary-color"} + href={"https://katharineum-zu-luebeck.de/"} + target={"_blank"}> + Weitere Artikel + <i className={"material-icons right"}>arrow_forward</i> + </a> + </div> + : ""} </div> + {/*</div>*/} {/* ACITIVITIES */} <div className={"row"}> diff --git a/schoolapps/static/common/style.css b/schoolapps/static/common/style.css index f9c7b4bf71665ad3175efd40c5e5cc181adf6e5a..27506d18004514794e7a7471640541a89613d3ee 100644 --- a/schoolapps/static/common/style.css +++ b/schoolapps/static/common/style.css @@ -183,6 +183,7 @@ li.active > a > .sidenav-badge { margin: 0; display: flex; flex-grow: 1; + min-height: 65px; } .lesson-card .card-content { diff --git a/schoolapps/static/js/dashboard.js b/schoolapps/static/js/dashboard.js index 310a5e6a433954ccc57196ccc54e4e0ec354d385..0535124b870ba9567d050a0f039e91cce1133963 100644 --- a/schoolapps/static/js/dashboard.js +++ b/schoolapps/static/js/dashboard.js @@ -246,10 +246,10 @@ var Dashboard = function (_React$Component) { React.createElement( "div", { className: "row" }, - React.createElement( + this.state.has_plan ? React.createElement( "div", - { className: "dashboard-cards" }, - this.state.has_plan ? React.createElement( + {className: "col s12 m12 l6 xl4"}, + React.createElement( "div", { className: "card" }, React.createElement( @@ -344,10 +344,14 @@ var Dashboard = function (_React$Component) { "anzeigen" ) ) - ) : "", - this.state.current_events && this.state.current_events.length > 0 ? React.createElement( + ) + ) : "", + this.state.current_events && this.state.current_events.length > 0 ? React.createElement( + "div", + {className: "col s12 m12 l6 xl4"}, + React.createElement( "div", - { className: "card" }, + {className: "card "}, React.createElement( "div", { className: "card-content" }, @@ -379,55 +383,61 @@ var Dashboard = function (_React$Component) { "Weitere Termine" ) ) - ) : "", - this.state.newest_article ? React.createElement( + ) + ) : "", + this.state.newest_article ? React.createElement( + "div", + {className: "col s12 m12 l6 xl4"}, + React.createElement( "div", - null, + {className: "card"}, React.createElement( "div", - { className: "card" }, + {className: "card-image"}, React.createElement( - "div", - { className: "card-image" }, - React.createElement( - "span", - { className: "badge-image z-depth-2" }, - "Aktuelles von der Homepage" - ), - React.createElement("img", { src: this.state.newest_article.image_url, - alt: this.state.newest_article.title }), - React.createElement("span", { className: "card-title", - dangerouslySetInnerHTML: { __html: this.state.newest_article.title } }) - ), - React.createElement( - "div", - { className: "card-content" }, - React.createElement("p", { dangerouslySetInnerHTML: { __html: this.state.newest_article.short_text } }) + "span", + {className: "badge-image z-depth-2"}, + "Aktuelles von der Homepage" ), - React.createElement( - "div", - { className: "card-action" }, - React.createElement( - "a", - { href: this.state.newest_article.link, target: "_blank" }, - "Mehr lesen" - ) - ) + React.createElement("img", { + src: this.state.newest_article.image_url, + alt: this.state.newest_article.title + }) + ), + React.createElement( + "div", + {className: "card-content"}, + React.createElement("span", { + className: "card-title", + dangerouslySetInnerHTML: {__html: this.state.newest_article.title} + }), + React.createElement("p", {dangerouslySetInnerHTML: {__html: this.state.newest_article.short_text}}) ), React.createElement( - "a", - { className: "btn hundred-percent primary-color", - href: "https://katharineum-zu-luebeck.de/", - target: "_blank" }, - "Weitere Artikel", + "div", + {className: "card-action"}, React.createElement( - "i", - { className: "material-icons right" }, - "arrow_forward" + "a", + {href: this.state.newest_article.link, target: "_blank"}, + "Mehr lesen" ) ) - ) : "" - ) + ), + React.createElement( + "a", + { + className: "btn hundred-percent primary-color", + href: "https://katharineum-zu-luebeck.de/", + target: "_blank" + }, + "Weitere Artikel", + React.createElement( + "i", + {className: "material-icons right"}, + "arrow_forward" + ) + ) + ) : "" ), React.createElement( "div",