Commit 7008bdd7 authored by Sandro Lutz's avatar Sandro Lutz Committed by Sandro Lutz
Browse files

Add "Student for a day" page

* Move studydocuments/ to studies/documents
* Add permanent redirects from studydocuments to /studies/documents
parent ad2900f4
......@@ -28,7 +28,7 @@ import {
loadQuickFilterSummary,
setQueryFromFilterValues,
} from '~store/studydocuments/actions'
import { setFilterValues } from '../../store/common/actions'
import { setFilterValues } from '~store/common/actions'
const useStyles = makeStyles(
theme => ({
......
......@@ -110,7 +110,6 @@ const StudydocumentSummary = ({ studydocumentId, ...props }) => {
const intl = useIntl()
if (!studydocument || !studydocument.data) {
// TODO: ....
return (
<div className={classes.root} {...props}>
<div className={classes.content}>
......
# Student for a Day
Du bist dir noch nicht sicher, was du studieren möchtest? Willst du wissen, wie ein typischer Tag für einen Studierenden an der ETH verläuft?
Dann bist du bei uns genau richtig! Wir bieten dir die Möglichkeit, für einen Tag in das Elektrotechnik- und/oder Maschinenbaustudium zu schnuppern. Dabei wirst du einen Studierenden in die Vorlesungen und Übungen begleiten und kannst dir all deine Fragen zum Studium beantworten lassen.
So kannst du dich für einen Tag bereits wie eine Studentin oder ein Student fühlen und bekommst einen Eindruck, was dich in Studium an der ETH erwartet.
## Anmeldung
Wenn du Lust auf den "Student for a Day" Schnuppertag hast, dann melde dich unverbindlich an. Je nach deinen Vorlesungsinteressen werden wir dann gemeinsam einen Termin ausmachen.
Bitte hab Verständnis, falls wir uns nicht sofort bei dir melden. Manchmal ist es im Studium etwas stressig.
<a href="https://docs.google.com/forms/d/e/1FAIpQLSeD_cOIEbFj7EXiENcgw7vxUl05AwbKdneyBV-Pf9xM1kz8VQ/viewform" target="_blank">Zum Anmeldeformular</a>
......@@ -50,7 +50,10 @@
"mainMenu.about.minutes": "Protokolle",
"mainMenu.about.gv": "Generalversammlungen",
"mainMenu.events": "Events",
"mainMenu.studydocuments": "Studienunterlagen",
"mainMenu.studies.label": "Studium",
"mainMenu.studies.studydocuments": "Studienunterlagen",
"mainMenu.studies.studentForADay": "Schnuppertag an der ETH",
"mainMenu.studies.howToErsti": "How to Ersti",
"mainMenu.jobs.label": "Jobs",
"mainMenu.jobs.jobs": "Jobs",
"mainMenu.jobs.companies": "Firmenprofile",
......
......@@ -50,7 +50,10 @@
"mainMenu.about.minutes": "Minutes",
"mainMenu.about.gv": "General Assemblies",
"mainMenu.events": "Events",
"mainMenu.studydocuments": "Study Documents",
"mainMenu.studies.label": "Studies",
"mainMenu.studies.studydocuments": "Study Documents",
"mainMenu.studies.studentForADay": "Student for a Day",
"mainMenu.studies.howToErsti": "How to Ersti",
"mainMenu.jobs.label": "Jobs",
"mainMenu.jobs.jobs": "Jobs",
"mainMenu.jobs.companies": "Companies",
......
......@@ -4,12 +4,12 @@ import { Typography } from '@material-ui/core'
import { makeStyles } from '@material-ui/styles'
import { FormattedMessage } from 'gatsby-plugin-intl'
import Layout from '../../components/layout'
import StudydocumentForm from '../../components/studydocuments/form'
import TranslatedContent from '../../components/general/translatedContent'
import Layout from '../../../components/layout'
import StudydocumentForm from '../../../components/studies/documents/form'
import TranslatedContent from '../../../components/general/translatedContent'
import rules_en from '../../content/studydocuments-rules.en.md'
import rules_de from '../../content/studydocuments-rules.de.md'
import rules_en from '../../../content/studies/documents/rules.en.md'
import rules_de from '../../../content/studies/documents/rules.de.md'
const useStyles = makeStyles(
theme => ({
......
......@@ -4,20 +4,19 @@ import { useDispatch, useSelector } from 'react-redux'
import { FormattedMessage } from 'gatsby-plugin-intl'
import { makeStyles } from '@material-ui/core/styles'
import { listLoadNextPage } from '~store/common/actions'
import { STUDYDOCUMENTS } from '../../store/studydocuments/constants'
import Layout from '../../components/layout'
import StudydocumentsFilter from '../../components/studydocuments/filter'
import FilteredListLayout from '../../components/filteredListPage/layout'
import FilteredList from '../../components/filteredListPage/list'
import FilteredListItem from '../../components/filteredListPage/listItem'
import StudydocumentSummary from '../../components/studydocuments/summary'
import StudydocumentDetails from '../../components/studydocuments/details'
import StudydocumentsQuickFilter from '../../components/studydocuments/quickFilter'
import StudydocumentsOralExamsDialog from '../../components/studydocuments/oralExamsDialog'
import StudydocumentsUploadHint from '../../components/studydocuments/documentUploadHint'
import useFilteredList from '../../hooks/useFilteredList'
import { STUDYDOCUMENTS } from '~store/studydocuments/constants'
import Layout from '../../../components/layout'
import StudydocumentsFilter from '../../../components/studies/documents/filter'
import FilteredListLayout from '../../../components/filteredListPage/layout'
import FilteredList from '../../../components/filteredListPage/list'
import FilteredListItem from '../../../components/filteredListPage/listItem'
import StudydocumentSummary from '../../../components/studies/documents/summary'
import StudydocumentDetails from '../../../components/studies/documents/details'
import StudydocumentsQuickFilter from '../../../components/studies/documents/quickFilter'
import StudydocumentsOralExamsDialog from '../../../components/studies/documents/oralExamsDialog'
import StudydocumentsUploadHint from '../../../components/studies/documents/documentUploadHint'
import useFilteredList from '../../../hooks/useFilteredList'
import { listLoadNextPage } from '../../../store/common/actions'
const useStyles = makeStyles(
{
......@@ -40,7 +39,7 @@ const StudydocumentsPage = ({ studydocumentId: studydocumentIdProp }) => {
const itemsReady = auth.isLoggedIn && defaultList.totalPages > 0
const [ref, pinnedId, studydocumentId, itemExpandHandler] = useFilteredList(
STUDYDOCUMENTS,
'studydocuments',
'studies/documents',
[defaultList],
studydocuments,
studydocumentIdProp,
......@@ -58,32 +57,6 @@ const StudydocumentsPage = ({ studydocumentId: studydocumentIdProp }) => {
}
}, [defaultList, auth.isLoggedIn])
// Handle set of pinned item on initial load.
// useEffect(() => {
// if (!studydocumentId || !auth.isLoggedIn) return
// // Load studydocument if not already loaded.
// if (!studydocuments[studydocumentId]) {
// dispatch(loadItem(STUDYDOCUMENTS, { id: studydocumentId }))
// }
// // Check if item already part of a list. If not, make it pinned at the top of the page.
// if (!defaultList.items.includes(studydocumentId)) {
// setPinnedId(studydocumentId)
// }
// }, [studydocumentId, auth.isLoggedIn])
// Handle initial scroll to active element
// useEffect(() => {
// if (ref.current && shouldScroll) {
// setShouldScroll(false)
// animateScrollTo(ref.current, {
// verticalOffset: -theme.shape.headerHeight,
// speed: 125,
// })
// }
// }, [ref.current, shouldScroll])
// Helper functions for shown lists and list items
const isActive = item => item === studydocumentId
const hasMorePagesToLoad = list => list.lastPageLoaded < list.totalPages
......@@ -92,19 +65,6 @@ const StudydocumentsPage = ({ studydocumentId: studydocumentIdProp }) => {
dispatch(listLoadNextPage(STUDYDOCUMENTS, { listName: list }))
}
// const itemExpandHandler = ({ id, expanded }) => {
// let path = null
// if (expanded) {
// path = `/studydocuments/${id}`
// } else {
// path = `/studydocuments`
// }
// if (window.location.pathname !== path) {
// navigate(path)
// }
// }
const placeholder = (
<React.Fragment>
{Array.from(Array(3)).map((_, i) => (
......
......@@ -3,7 +3,7 @@ import { Router } from '@reach/router'
import StudydocumentsListPage from './_list'
import StudydocumentsEditPage from './_edit'
import NotFound from '../404'
import NotFound from '../../404'
/**
* Studydocuments Index Page
......@@ -18,10 +18,10 @@ import NotFound from '../404'
const StudydocumentsIndexPage = () => {
return (
<Router>
<StudydocumentsEditPage path="/:language/studydocuments/new" />
<StudydocumentsEditPage path="/:language/studydocuments/:studydocumentId/edit" />
<StudydocumentsListPage path="/:language/studydocuments/:studydocumentId" />
<StudydocumentsListPage path="/:language/studydocuments" />
<StudydocumentsEditPage path="/:language/studies/documents/new" />
<StudydocumentsEditPage path="/:language/studies/documents/:studydocumentId/edit" />
<StudydocumentsListPage path="/:language/studies/documents/:studydocumentId" />
<StudydocumentsListPage path="/:language/studies/documents" />
<NotFound default />
</Router>
)
......
import React from 'react'
import Layout from '../../components/layout'
import TranslatedContent from '../../components/general/translatedContent'
import content_en from '../../content/about.en.md'
import content_de from '../../content/about.de.md'
const HowToErstiPage = () => {
return (
<Layout seoProps={{ title: 'mainMenu.studies.howToErsti' }}>
<TranslatedContent
content={{ en: content_en, de: content_de }}
noEscape
/>
</Layout>
)
}
export default HowToErstiPage
import React from 'react'
import { useIntl } from 'gatsby-plugin-intl'
import { Image } from 'amiv-react-components'
import { makeStyles } from '@material-ui/styles'
import Layout from '../../components/layout'
import TranslatedContent from '../../components/general/translatedContent'
import featuredImage from '../../images/student-for-a-day.jpg'
import content_de from '../../content/studies/student-for-a-day.de.md'
const useStyles = makeStyles(
theme => ({
image: {
marginBottom: '2em',
height: 225,
backgroundColor: theme.palette.common.grey,
'& img': {
width: '100%',
},
},
}),
{ name: 'studentForADay' }
)
const StudentForADayPage = () => {
const intl = useIntl()
const classes = useStyles()
return (
<Layout seoProps={{ title: 'mainMenu.studies.studentForADay' }}>
<TranslatedContent content={{ de: content_de }} noEscape />
<Image
className={classes.image}
type="fluid"
src={featuredImage}
alt={intl.formatMessage({ id: 'mainMenu.studies.studentForADay' })}
ratioX={10}
ratioY={3}
/>
</Layout>
)
}
export default StudentForADayPage
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