Skip to content
Snippets Groups Projects
Commit 0da0a1cb authored by Alexander Schoch's avatar Alexander Schoch
Browse files

Statically load all board images. Should fix the error for real now.

parent bef43778
No related branches found
No related tags found
No related merge requests found
FROM eu.gcr.io/vseth-public/base:foxtrott
RUN apt install -y curl
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN echo "Package: nodejs" >> /etc/apt/preferences.d/preferences \
&& echo "Pin: origin deb.nodesource.com" >> /etc/apt/preferences.d/preferences \
&& echo "Pin-Priority: 1001" >> /etc/apt/preferences.d/preferences
RUN apt install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt update
RUN apt install -y nodejs
RUN mkdir -p /website
......
......@@ -4,7 +4,6 @@ const OfficeMap = dynamic(() => import("../components/map"), {
ssr: false,
});
import Image from "next/image";
import { useRouter } from "next/router";
import { useTranslation } from "next-i18next";
......
......@@ -7,7 +7,10 @@ import { Avatar, Button, Card, Text, useMantineTheme } from "@mantine/core";
import { Icon, ICONS } from "vseth-canine-ui";
import { getAccentColor } from "../utilities/colors";
import { getApiUrl } from '../utilities/deployment';
import imageLoader from "../content/imageLoader";
import thealt_logo from "../public/images/thealt_signet.svg";
import thealt_logo_inv from "../public/images/thealt_signet_inv.svg";
export default function BoardMemberCard({ entry }) {
const theme = useMantineTheme();
......@@ -17,6 +20,11 @@ export default function BoardMemberCard({ entry }) {
push("mailto:" + address);
};
const images = imageLoader();
const image =
images[entry.name] ||
(theme.colorScheme === "dark" ? thealt_logo_inv : thealt_logo);
return (
<Card
radius="md"
......@@ -40,14 +48,16 @@ export default function BoardMemberCard({ entry }) {
overflow: "hidden",
}}
>
{getApiUrl() && <Image
src={getApiUrl() + entry.image}
width={0}
height={0}
sizes="100vw"
style={{ width: "30rem", maxWidth: "100%", height: "auto" }}
alt={entry.name}
/>}
{image && (
<Image
src={image}
width={0}
height={0}
sizes="100vw"
style={{ width: "30rem", maxWidth: "100%", height: "auto" }}
alt={entry.name}
/>
)}
</div>
<Text ta="center" fz="lg" weight={500} mt="md">
{entry.name}
......
......@@ -5,7 +5,6 @@
"de": "Präsident",
"en": "President"
},
"image": "/images/board/placeholder.png",
"mail": "praesidium@thealternative.ch"
},
{
......@@ -14,7 +13,6 @@
"de": "Vizepräsidentin / Stammtische",
"en": "Vice President / Stammtisch"
},
"image": "/images/board/placeholder_girl.png",
"mail": "praesidium@thealternative.ch"
},
{
......@@ -23,7 +21,6 @@
"de": "Events",
"en": "Events"
},
"image": "/images/board/alex.png",
"mail": "alexander.schoch@vseth.ethz.ch"
},
{
......@@ -32,7 +29,6 @@
"de": "Kommunikation",
"en": "Communication"
},
"image": "/images/board/jeanclaude.jpg",
"mail": "kommunikation@thealternative.ch"
},
{
......@@ -41,7 +37,6 @@
"de": "Kommunikation: Design",
"en": "Communication: Design"
},
"image": "/images/board/sophie.png",
"mail": "kommunikation@thealternative.ch"
},
{
......@@ -49,8 +44,7 @@
"role": {
"de": "GNU/Linux Enjoyer",
"en": "GNU/Linux Enjoyer"
},
"image": "/images/board/jindra.png"
}
},
{
"name": "Corinne Furrer",
......@@ -58,16 +52,14 @@
"de": "Infrastruktur",
"en": "Infrastructure"
},
"image": "/images/board/placeholder_girl.png",
"mail": "server@thealternative.ch"
},
{
"name": " Fadri Lardon",
"name": "Fadri Lardon",
"role": {
"de": "Install Event / Support",
"en": "Install Event / Support"
},
"image": "/images/board/fadri.jpg",
"mail": "fadri.lardon@thealternative.ch"
},
{
......@@ -76,7 +68,6 @@
"de": "Aktives Mitglied",
"en": "Active Member"
},
"image": "/images/board/nicolas.jpg",
"mail": "nicolas.koenig@thealternative.ch"
},
{
......@@ -85,7 +76,6 @@
"de": "Aktives Mitglied",
"en": "Active Member"
},
"image": "/images/board/placeholder.png",
"mail": "gianni.gugolz@thealternative.ch"
}
]
import noah from "./images/board/placeholder.png";
import johanna from "./images/board/placeholder_girl.png";
import alex from "./images/board/alex.png";
import jeanclaude from "./images/board/jeanclaude.jpg";
import sophie from "./images/board/sophie.png";
import jindra from "./images/board/jindra.png";
import corinne from "./images/board/placeholder_girl.png";
import fadri from "./images/board/fadri.jpg";
import nico from "./images/board/nicolas.jpg";
import gianni from "./images/board/placeholder.png";
export default function imageLoader() {
return {
"Noah Marti": noah,
"Johanna Polzin": johanna,
"Alexander Schoch": alex,
"Jean-Claude Graf": jeanclaude,
"Sophie Eisenring": sophie,
"Jindřich Dušek": jindra,
"Corinne Furrer": corinne,
"Fadri Lardon": fadri,
"Nicolas König": nico,
"Gianni Gugolz": gianni
};
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.771408mm"
height="16.77194mm"
viewBox="0 0 16.771408 16.77194"
version="1.1"
id="svg1"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="thealt_signet.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="0.67972082"
inkscape:cx="92.685112"
inkscape:cy="19.861095"
inkscape:window-width="1920"
inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-80.433333,-143.13959)">
<path
fill="#ffffff"
d="m 83.489535,143.13985 c -1.693069,0 -3.056202,1.36314 -3.056202,3.0562 v 10.65954 c 0,1.6928 1.362868,3.05594 3.056202,3.05594 h 10.659268 c 1.692804,0 3.055938,-1.36287 3.055938,-3.05594 v -10.6598 c 0,-1.6928 -1.362869,-3.0562 -3.055938,-3.0562 z m 0.312737,1.0115 h 9.61099 c 1.540139,0 2.779977,1.23984 2.779977,2.77998 v 9.61099 c 0,1.53988 -1.239838,2.77998 -2.779977,2.77998 h -9.61099 c -1.540404,0 -2.779977,-1.2401 -2.779977,-2.77998 v -9.61072 c 0,-1.54041 1.239573,-2.78025 2.779977,-2.78025 z"
id="path19"
style="fill:#244471;fill-opacity:1;stroke-width:0.264583" />
<g
id="g22"
style="fill:#244471;fill-opacity:1"
transform="matrix(0.26458333,0,0,0.26458333,63.551064,126.36818)">
<path
fill="#ffffff"
d="m 85.647,96.678 h -3.663 l 8.174,-19.256 h 3.837 l 8.35,19.256 h -3.838 l -2.194,-5.251 h -6.396 l 1.226,-3.097 h 3.878 l -3.03,-7.231 z"
id="path20"
style="fill:#244471;fill-opacity:1" />
<path
fill="#ffffff"
d="m 107.933,77.422 v 19.256 h -3.568 V 77.422 Z"
id="path21"
style="fill:#244471;fill-opacity:1" />
<path
fill="#ffffff"
d="m 111.097,80.251 h 2.639 l 0.539,2.289 h 3.555 v 2.828 h -3.164 v 6.504 c 0,1.318 0.57,1.979 1.71,1.979 h 1.454 v 2.828 h -3.178 c -2.37,0 -3.555,-1.27 -3.555,-3.811 z"
id="path22"
style="fill:#244471;fill-opacity:1" />
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.771408mm"
height="16.77194mm"
viewBox="0 0 16.771408 16.77194"
version="1.1"
id="svg1"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="thealt_signet_inv.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="0.67972082"
inkscape:cx="195.66857"
inkscape:cy="197.87536"
inkscape:window-width="1920"
inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-53.445833,-96.04375)">
<path
fill="#ffffff"
d="m 56.502035,96.044015 c -1.693069,0 -3.056202,1.363133 -3.056202,3.056202 v 10.659533 c 0,1.6928 1.362868,3.05594 3.056202,3.05594 h 10.659268 c 1.692804,0 3.055938,-1.36287 3.055938,-3.05594 V 99.099952 c 0,-1.692804 -1.362869,-3.056202 -3.055938,-3.056202 z m 0.312737,1.011502 h 9.61099 c 1.540139,0 2.779977,1.239837 2.779977,2.779977 v 9.610986 c 0,1.53988 -1.239838,2.77998 -2.779977,2.77998 h -9.61099 c -1.540404,0 -2.779977,-1.2401 -2.779977,-2.77998 v -9.610722 c 0,-1.540404 1.239573,-2.780241 2.779977,-2.780241 z"
id="path19"
style="fill:#f9f9f9;fill-opacity:1;stroke-width:0.264583" />
<g
id="g22"
style="fill:#f9f9f9;fill-opacity:1"
transform="matrix(0.26458333,0,0,0.26458333,36.563564,79.272342)">
<path
fill="#ffffff"
d="m 85.647,96.678 h -3.663 l 8.174,-19.256 h 3.837 l 8.35,19.256 h -3.838 l -2.194,-5.251 h -6.396 l 1.226,-3.097 h 3.878 l -3.03,-7.231 z"
id="path20"
style="fill:#f9f9f9;fill-opacity:1" />
<path
fill="#ffffff"
d="m 107.933,77.422 v 19.256 h -3.568 V 77.422 Z"
id="path21"
style="fill:#f9f9f9;fill-opacity:1" />
<path
fill="#ffffff"
d="m 111.097,80.251 h 2.639 l 0.539,2.289 h 3.555 v 2.828 h -3.164 v 6.504 c 0,1.318 0.57,1.979 1.71,1.979 h 1.454 v 2.828 h -3.178 c -2.37,0 -3.555,-1.27 -3.555,-3.811 z"
id="path22"
style="fill:#f9f9f9;fill-opacity:1" />
</g>
</g>
</svg>
export function getApiUrl() {
if(process.env.NEXT_PUBLIC_DEPLOYMENT == 'local') return 'http://localhost:3000';
if(process.env.NEXT_PUBLIC_DEPLOYMENT == 'dev') return 'https://www.thealt.staging-sip.ethz.ch';
return 'https://thealternative.ethz.ch';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment