To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

...
 
Commits (5)
FROM node:13.8
WORKDIR /app
# Copy dependency list
ADD ./package.json /app/
ADD ./package-lock.json /app/
# Install dependencies
RUN npm install -g gatsby-cli
RUN npm install
# Clean up app directory
RUN rm /app/package.json /app/package-lock.json
VOLUME [ "/app" ]
EXPOSE 8000
CMD [ "gatsby", "develop", "--host=0.0.0.0" ]
......@@ -18,7 +18,23 @@ This is the home of the amiv website.
You can visit the website now at http://localhost:8000
2. **Linting & Formatting**
2. **Development with Docker**
You can run the development server completely with docker.
Build local development image
```shell
docker build -t amiv-website-local-dev -f Dockerfile.development .
```
Run development server with
```shell
docker run --rm -it -p 8000:8000 -v ${PWD}:/app amiv-website-local-dev
```
3. **Linting & Formatting**
We use `eslint` and `prettier` for linting and formatting of the javascript code. You can use the following commands:
......@@ -27,7 +43,7 @@ This is the home of the amiv website.
npm run format
```
3. **Production Build**
4. **Production Build**
You can prepare a production build manually and serve it using gatsby's built-in webserver. This will run the server-side rendering part.
......
......@@ -179,6 +179,7 @@ const EventDetails = ({ eventId, ...props }) => {
let signupButtons = null
let additionalFields = null
let showTermsCheckbox = false
let emailField = null
let termsCheckbox = null
let termsDialog = null
......@@ -376,6 +377,7 @@ const EventDetails = ({ eventId, ...props }) => {
// ----------------------
// Prepare signup buttons
if (data.time_register_start === null || data.time_register_end === null) {
showTermsCheckbox = false
signupButtons = (
<Button disabled>
<FormattedMessage id="events.registration.none" />
......@@ -385,20 +387,24 @@ const EventDetails = ({ eventId, ...props }) => {
data.time_register_start &&
now < new Date(data.time_register_start)
) {
showTermsCheckbox = false
signupButtons = (
<Button disabled>
<FormattedMessage id="events.registration.notStarted" />
</Button>
)
} else if (data.time_register_end && now > new Date(data.time_register_end)) {
showTermsCheckbox = false
signupButtons = (
<Button disabled>
<FormattedMessage id="events.registration.over" />
</Button>
)
} else if (auth.isLoggedIn && !isSignupLoaded) {
showTermsCheckbox = false
signupButtons = <Spinner size={24} />
} else if (!auth.isLoggedIn && !data.allow_email_signup) {
showTermsCheckbox = false
signupButtons = (
<React.Fragment>
<Button onClick={() => dispatch(authLoginStart())}>
......@@ -480,6 +486,7 @@ const EventDetails = ({ eventId, ...props }) => {
}
}
showTermsCheckbox = true
signupButtons = (
<React.Fragment>
{(!signup || !signup.data || (signup.data && hasAdditionalFields)) && (
......@@ -531,8 +538,8 @@ const EventDetails = ({ eventId, ...props }) => {
>
{emailField}
{additionalFields}
{termsDialog}
{termsCheckbox}
{showTermsCheckbox && termsDialog}
{showTermsCheckbox && termsCheckbox}
</div>
<TranslatedContent
parseMarkdown
......
......@@ -5,7 +5,9 @@ import { FormControl, InputLabel, Select } from '@material-ui/core'
const DOCUMENT_TYPES = [
'exams',
'oral exams',
'cheat sheets',
'study guides',
'lecture documents',
'exercises',
]
......
......@@ -8,6 +8,13 @@
},
"url": "https://blitz.ethz.ch"
},
{
"icon": "instagram",
"label": {
"_": "Instagram: blitz_amiv"
},
"url": "https://www.instagram.com/blitz_amiv/"
},
{
"icon": "email",
"label": {
......
......@@ -180,11 +180,15 @@
"studydocuments.departments.other": "Andere",
"studydocuments.departments.otherLong": "Andere Departemente",
"studydocuments.type.cheat sheets": "Zusammenfassungen",
"studydocuments.type.study guides": "PVK-Unterlagen",
"studydocuments.type.oral exams": "Prüfungsprotokolle",
"studydocuments.type.exams": "Alte Prüfungen",
"studydocuments.type.lecture documents": "Unterrichtsmaterialien",
"studydocuments.type.exercises": "Übungen",
"studydocuments.name.default": "Nicht kategorisiert",
"studydocuments.name.cheat sheets": "Zusammenfassung",
"studydocuments.name.study guides": "PVK-Unterlagen",
"studydocuments.name.oral exams": "Prüfungsprotokoll",
"studydocuments.name.exams": "Prüfung",
"studydocuments.name.lecture documents": "Unterrichtsmaterialien",
"studydocuments.name.exercises": "Übungen",
......
......@@ -175,11 +175,15 @@
"studydocuments.departments.other": "Other",
"studydocuments.departments.otherLong": "Other Departments",
"studydocuments.type.cheat sheets": "Summaries",
"studydocuments.type.study guides": "PVK Materials",
"studydocuments.type.oral exams": "Exam Protocols",
"studydocuments.type.exams": "Old exams",
"studydocuments.type.lecture documents": "Lecture Documents",
"studydocuments.type.exercises": "Exercises",
"studydocuments.name.default": "Not categorized",
"studydocuments.name.cheat sheets": "Summary",
"studydocuments.name.study guides": "PVK Materials",
"studydocuments.name.oral exams": "Exam Protocol",
"studydocuments.name.exams": "Exam",
"studydocuments.name.lecture documents": "Lecture Documents",
"studydocuments.name.exercises": "Exercises",
......
......@@ -37,7 +37,7 @@ const loadOtherSessions = () => (dispatch, getState) => {
Array.from(new Array(totalPages - 1), (x, i) => i + 2).map(pageNum =>
dispatch({
types: [null, null, null],
resourcE: SESSIONS,
resource: SESSIONS,
method: 'GET',
query: Query.merge(query, { page: pageNum }),
}).then(response2 => {
......