Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add separate imprint page with content from acdh imprint server #164

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/assets/images/backgrounds/imprint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/components/common/Prose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ import css from '@/components/common/Prose.module.css'

export interface ProseProps {
children?: ReactNode
html?: string
}

export function Prose(props: ProseProps): JSX.Element {
if (props.html != null) {
return <div className={css['container']} dangerouslySetInnerHTML={{ __html: props.html }} />
}

return <div className={css['container']}>{props.children}</div>
}
9 changes: 9 additions & 0 deletions src/components/imprint/BackgroundImage.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.container {
position: relative;
z-index: var(--z-index-background-image);
grid-row: 1 / -2;
grid-column: 2 / -2;
align-self: stretch;
max-width: none;
margin-inline: calc(var(--column-gap) * -1);
}
12 changes: 12 additions & 0 deletions src/components/imprint/BackgroundImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Image from 'next/image'

import css from '@/components/imprint/BackgroundImage.module.css'
import Clouds from '~/public/assets/images/backgrounds/[email protected]'

export function BackgroundImage(): JSX.Element {
return (
<div className={css['container']}>
<Image src={Clouds} alt="" layout="fill" objectFit="contain" objectPosition="top" priority />
</div>
)
}
7 changes: 7 additions & 0 deletions src/components/imprint/Content.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.container {
display: grid;
grid-area: content;
row-gap: var(--space-8);
max-width: var(--size-192);
padding-block-end: var(--space-16);
}
11 changes: 11 additions & 0 deletions src/components/imprint/Content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ReactNode } from 'react'

import css from '@/components/imprint/Content.module.css'

export interface ContentProps {
children?: ReactNode
}

export function Content(props: ContentProps): JSX.Element {
return <div className={css['container']}>{props.children}</div>
}
32 changes: 32 additions & 0 deletions src/components/imprint/ImprintScreenLayout.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.layout {
--column-count: 12;
--column-gap: var(--size-6);
--max-width: var(--size-max-content-width);
--max-column-width: calc(
(var(--max-width) - (var(--column-count) - 1) * var(--column-gap)) / var(--column-count)
);

position: relative;
display: grid;
grid-template-areas:
'. header header header header header header header header header header header header .'
'. content content content content content content content content content content content content .'
'. funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice .';
grid-template-rows: auto 1fr auto;
grid-template-columns:
minmax(0, 1fr)
repeat(var(--column-count), minmax(0, var(--max-column-width)))
minmax(0, 1fr);
align-items: start;
min-height: 100%;
column-gap: var(--column-gap);

@media (/* --screen-xs */ min-width: 30rem) {
--column-gap: var(--size-8);

grid-template-areas:
'. . header header header header header header header header header header . .'
'. . content content content content content content content content content content . .'
'. . funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice funding-notice . . . .';
}
}
11 changes: 11 additions & 0 deletions src/components/imprint/ImprintScreenLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ReactNode } from 'react'

import css from '@/components/imprint/ImprintScreenLayout.module.css'

export interface ImprintScreenLayoutProps {
children?: ReactNode
}

export function ImprintScreenLayout(props: ImprintScreenLayoutProps): JSX.Element {
return <div className={css['layout']}>{props.children}</div>
}
62 changes: 0 additions & 62 deletions src/components/privacy-policy/PrivacyPolicy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,61 +32,6 @@ We will not sell, distribute or lease your personal information to third parties
is required by law. If you feel that this site is not following its stated privacy policy, please
contact us. We will be sure to address your concerns.

## Legal notice

The SSH Open Marketplace runs on Austrian servers at the Austrian Academy of Sciences.

### Legal disclosure according to §§ 24, 25 Austrian media law and § 5 E-Commerce law

#### Media owner, publisher, responsible for content and editorial office, service provider

[Austrian Academy of Sciences](https://www.oeaw.ac.at/en/)

Corporate body organized under public law (BGBl 569/1921 idF BGBl I 130/2003)
[Austrian Centre for Digital Humanities and Cultural Heritage (ACDH-CH)](https://acdh.oeaw.ac.at/)

Dr. Ignaz Seipel-Platz 2, 1010 Vienna, Austria

E-Mail: [[email protected]](mailto:[email protected])

#### Nature and purpose of the business

The Austrian Academy of Sciences (OEAW) has the legal duty to support the sciences and humanities in
every respect. As a learned society, the OEAW fosters discourse and cooperation between science and
society, politics and economy.

The Austrian Centre for Digital Humanities and Cultural Heritage (ACDH-CH) is an OEAW institute
founded with the goal to support digital methods in arts and humanities disciplines. The ACDH-CH
supports digital research in manifold ways.

The ACDH-CH is a consortium member of [CLARIAH-AT](https://clariah.at/). In SSHOC, ACDH-CH is a
member of the SSHOC partner [DARIAH-EU](https://www.dariah.eu/).

#### Signing power

President: Univ.-Prof. Dr. phil. Heinz Faßmann

Vice President: Univ.-Prof. DI Dr. techn. Ulrike Diebold

Class President: Univ.-Prof. Dr. iur. Christiane Wendehorst LL.M. (CANTAB.)

Class President: Prof. Dr. Wolfgang Baumjohann

Supervisory body: Academy council. For more information, please visit
[https://www.oeaw.ac.at/en/oeaw/bodies/academy-council/](https://www.oeaw.ac.at/en/oeaw/bodies/academy-council/).

#### Main aim

This website provides an open marketplace as it is defined by the
[SSHOC grant agreement](https://cordis.europa.eu/project/id/823782/).

#### Disclaimer

The Austrian Academy of Sciences does not take responsibility for the nature, accuracy, entirety or
quality of the provided information. In the case of links to websites of other media owners, whose
content the OEAW is neither directly nor indirectly responsible for, the OEAW does not assume
liability for their content and excludes any liability in this case.

## Copyright notice

- **License for source code** – The license for the source code of the SSH Open Marketplace is
Expand All @@ -103,10 +48,3 @@ We are currently looking for the best licensing framework to support our model:
wide distribution and reuse of our data, and to avoid attribution stacking or license stacking, but
we do consider attribution to be an essential information to be provided by data aggregators. This
section of our website will be updated accordingly.

## Data privacy notice

Please find the OEAW's detailed data privacy statement
[here](https://www.oeaw.ac.at/en/oeaw/data-protection/). The contact data published in the context
of the imprint duty may not be used to send promotional or informational material not explicitly
requested. We explicitly disagree with this usage.
1 change: 1 addition & 0 deletions src/dictionaries/common/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const dictionary: Dictionary = {
about: 'About',
contribute: 'Contribute',
'privacy-policy': 'Privacy policy',
imprint: 'Imprint',
contact: 'Contact',
'page-not-found': 'Page not found',
'internal-server-error': 'Internal server error',
Expand Down
1 change: 1 addition & 0 deletions src/dictionaries/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export interface Dictionary {
about: string
contribute: string
'privacy-policy': string
imprint: string
contact: string
'page-not-found': string
'internal-server-error': string
Expand Down
1 change: 1 addition & 0 deletions src/lib/core/page/PageFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function PageFooter(): JSX.Element {
const links = [
{ label: t(['common', 'pages', 'about']), href: routes.AboutPage({ id: 'service' }) },
{ label: t(['common', 'pages', 'privacy-policy']), href: routes.PrivacyPolicyPage() },
{ label: t(['common', 'pages', 'imprint']), href: routes.ImprintPage() },
{ label: t(['common', 'pages', 'terms-of-use']), href: routes.TermsOfUsePage() },
{ label: t(['common', 'pages', 'contact']), href: routes.ContactPage() },
]
Expand Down
94 changes: 94 additions & 0 deletions src/pages/imprint/index.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import type { StringParams } from '@stefanprobst/next-route-manifest'
import type { GetStaticPropsContext, GetStaticPropsResult } from 'next'
import * as path from 'path'
import { Fragment } from 'react'
import { fileURLToPath } from 'url'

import { FundingNotice } from '@/components/common/FundingNotice'
import { ItemSearchBar } from '@/components/common/ItemSearchBar'
import { LastUpdatedTimestamp } from '@/components/common/LastUpdatedTimestamp'
import { Prose } from '@/components/common/Prose'
import { ScreenHeader } from '@/components/common/ScreenHeader'
import { ScreenTitle } from '@/components/common/ScreenTitle'
import { BackgroundImage } from '@/components/imprint/BackgroundImage'
import { Content } from '@/components/imprint/Content'
import { ImprintScreenLayout } from '@/components/imprint/ImprintScreenLayout'
import { getLastUpdatedTimestamp } from '@/data/git/get-last-updated-timestamp'
import type { PageComponent } from '@/lib/core/app/types'
import { getLocale } from '@/lib/core/i18n/getLocale'
import { load } from '@/lib/core/i18n/load'
import type { WithDictionaries } from '@/lib/core/i18n/types'
import { useI18n } from '@/lib/core/i18n/useI18n'
import { PageMetadata } from '@/lib/core/metadata/PageMetadata'
import { routes } from '@/lib/core/navigation/routes'
import { PageMainContent } from '@/lib/core/page/PageMainContent'
import type { IsoDateString } from '@/lib/core/types'
import { Breadcrumbs } from '@/lib/core/ui/Breadcrumbs/Breadcrumbs'

export namespace ImprintPage {
export type PathParamsInput = Record<string, never>
export type PathParams = StringParams<PathParamsInput>
export type SearchParamsInput = Record<string, never>
export interface Props extends WithDictionaries<'common'> {
lastUpdatedTimestamp: IsoDateString
}
}

export async function getStaticProps(
context: GetStaticPropsContext<ImprintPage.PathParams>,
): Promise<GetStaticPropsResult<ImprintPage.Props>> {
const locale = getLocale(context)
const dictionaries = await load(locale, ['common'])

const filePath = path.relative(process.cwd(), fileURLToPath(import.meta.url))
const lastUpdatedTimestamp = (await getLastUpdatedTimestamp(filePath)).toISOString()

const url = new URL('https://imprint.acdh.oeaw.ac.at')
// redmine id for production deployment
url.pathname = String('17467')
const imprint = await (await fetch(url)).text()

return {
props: {
dictionaries,
lastUpdatedTimestamp,
imprint,
},
}
}

export default function ImprintPage(props: ImprintPage.Props): JSX.Element {
const { t } = useI18n<'common'>()

const title = t(['common', 'pages', 'imprint'])

const breadcrumbs = [
{ href: routes.HomePage(), label: t(['common', 'pages', 'home']) },
{ href: routes.ImprintPage(), label: t(['common', 'pages', 'imprint']) },
]

return (
<Fragment>
<PageMetadata nofollow noindex title={title} openGraph={{}} twitter={{}} />
<PageMainContent>
<ImprintScreenLayout>
<BackgroundImage />
<ScreenHeader>
<ItemSearchBar />
<Breadcrumbs links={breadcrumbs} />
<ScreenTitle>{t(['common', 'pages', 'imprint'])}</ScreenTitle>
</ScreenHeader>
<Content>
<Prose html={props.imprint} />
<LastUpdatedTimestamp dateTime={props.lastUpdatedTimestamp} />
</Content>
<FundingNotice />
</ImprintScreenLayout>
</PageMainContent>
</Fragment>
)
}

const Page: PageComponent<ImprintPage.Props> = ImprintPage

Page.getLayout = undefined