From f6d45f7b9374444ae1ab751a213d86827b64eb8f Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sun, 13 Aug 2023 20:12:53 +0100 Subject: Adds Scotsoun --- public/main.css | 5 + src/components/Scotsoun.astro | 65 +++++++++ src/components/ScotsounCdGallery.astro | 20 +++ src/data/scotsoun/index.ts | 158 ++++++++++----------- src/i18n/translations/components/breadcrumbs.ts | 4 + src/i18n/translations/components/scotsoun.ts | 24 ++++ src/i18n/translations/pages/scotsounGallery.ts | 11 ++ .../pages/scotsounPaymentSuccessConfirmation.ts | 27 ++++ src/pages/[locale]/furthsettins/index.astro | 8 ++ .../furthsettins/scotsoun/[scotsounId]/index.astro | 27 ++++ .../payment-success-confirmation.astro | 30 ++++ .../[locale]/furthsettins/scotsoun/index.astro | 22 +++ 12 files changed, 322 insertions(+), 79 deletions(-) create mode 100644 src/components/Scotsoun.astro create mode 100644 src/components/ScotsounCdGallery.astro create mode 100644 src/i18n/translations/components/scotsoun.ts create mode 100644 src/i18n/translations/pages/scotsounGallery.ts create mode 100644 src/i18n/translations/pages/scotsounPaymentSuccessConfirmation.ts create mode 100644 src/pages/[locale]/furthsettins/scotsoun/[scotsounId]/index.astro create mode 100644 src/pages/[locale]/furthsettins/scotsoun/[scotsounId]/payment-success-confirmation.astro create mode 100644 src/pages/[locale]/furthsettins/scotsoun/index.astro diff --git a/public/main.css b/public/main.css index 2a7be46..90c5c09 100644 --- a/public/main.css +++ b/public/main.css @@ -395,6 +395,11 @@ footer { --gallery-item-height: auto; } +.link-gallery--scotsoun { + --gallery-item-width: 8rem; + --gallery-item-height: 8rem; +} + .link-gallery__image { align-self: start; max-width: var(--gallery-item-width); diff --git a/src/components/Scotsoun.astro b/src/components/Scotsoun.astro new file mode 100644 index 0000000..13c6fa9 --- /dev/null +++ b/src/components/Scotsoun.astro @@ -0,0 +1,65 @@ +--- +import translate from '$i18n/translate'; +import tSite from '$i18n/translations/site'; +import tComponent from '$i18n/translations/components/scotsoun'; +import type Locale from '$types/Locale'; +import type Scotsoun from '$types/Scotsoun'; +import PayPalButtons from './PayPalButtons.astro'; + +interface Props { + locale: Locale; + scotsoun: Scotsoun; +} + +const { locale, scotsoun } = Astro.props; +const t = translate(locale); +--- + +
+
+
+

{scotsoun.title}

+ {scotsoun?.subtitle &&

{scotsoun.subtitle}

} + { + scotsoun?.author && ( +

+ {t(tSite, { key: 'by' })} {scotsoun.author} +

+ ) + } +
+
+ + +
+
+ +
+ {scotsoun?.description &&

{scotsoun.description[locale]}

} + + { + scotsoun?.coverArtist && ( +

{t(tComponent, { key: 'cover-artist', coverArtist: scotsoun.coverArtist })}

+ ) + } + + { + scotsoun?.releaseDate && ( +

{t(tComponent, { key: 'release-date', releaseDate: scotsoun.releaseDate })}

+ ) + } + + { + scotsoun?.trackList && scotsoun.trackList.length > 1 && ( + <> +

Track list

+
    + {scotsoun.trackList.map((track) => ( +
  1. {track}
  2. + ))} +
+ + ) + } +
+
diff --git a/src/components/ScotsounCdGallery.astro b/src/components/ScotsounCdGallery.astro new file mode 100644 index 0000000..12bafb0 --- /dev/null +++ b/src/components/ScotsounCdGallery.astro @@ -0,0 +1,20 @@ +--- +import { getAllScotsoun } from '$data/scotsoun'; + +const scotsoun = await getAllScotsoun(); +--- + + diff --git a/src/data/scotsoun/index.ts b/src/data/scotsoun/index.ts index 0140cf6..a7cc1d9 100644 --- a/src/data/scotsoun/index.ts +++ b/src/data/scotsoun/index.ts @@ -7,88 +7,88 @@ import type ScotsounId from '$types/ScotsounId'; * Lallans issue is accounted for. */ export const getScotsoun: ScotsounGetterTable = { - sscd001: async () => (await import('./sscd001')).default, - sscd003: async () => (await import('./sscd003')).default, - sscd008: async () => (await import('./sscd008')).default, - sscd012: async () => (await import('./sscd012')).default, - sscd014: async () => (await import('./sscd014')).default, - sscd015: async () => (await import('./sscd015')).default, - sscd017: async () => (await import('./sscd017')).default, - sscd018: async () => (await import('./sscd018')).default, - sscd020: async () => (await import('./sscd020')).default, - sscd021: async () => (await import('./sscd021')).default, - sscd022: async () => (await import('./sscd022')).default, - sscd024: async () => (await import('./sscd024')).default, - sscd028: async () => (await import('./sscd028')).default, - sscd034: async () => (await import('./sscd034')).default, - sscd035: async () => (await import('./sscd035')).default, - sscd039: async () => (await import('./sscd039')).default, - sscd042: async () => (await import('./sscd042')).default, - sscd043: async () => (await import('./sscd043')).default, - sscd046: async () => (await import('./sscd046')).default, - sscd047: async () => (await import('./sscd047')).default, - sscd048: async () => (await import('./sscd048')).default, - sscd050: async () => (await import('./sscd050')).default, - sscd051: async () => (await import('./sscd051')).default, - sscd056: async () => (await import('./sscd056')).default, - sscd057: async () => (await import('./sscd057')).default, - sscd061: async () => (await import('./sscd061')).default, - sscd063: async () => (await import('./sscd063')).default, - sscd065: async () => (await import('./sscd065')).default, - sscd067: async () => (await import('./sscd067')).default, - sscd069: async () => (await import('./sscd069')).default, - sscd070: async () => (await import('./sscd070')).default, - sscd071: async () => (await import('./sscd071')).default, - sscd072: async () => (await import('./sscd072')).default, - sscd079: async () => (await import('./sscd079')).default, - sscd080: async () => (await import('./sscd080')).default, - sscd081: async () => (await import('./sscd081')).default, - sscd083: async () => (await import('./sscd083')).default, - sscd084: async () => (await import('./sscd084')).default, - sscd087: async () => (await import('./sscd087')).default, - sscd089: async () => (await import('./sscd089')).default, - sscd092: async () => (await import('./sscd092')).default, - sscd094: async () => (await import('./sscd094')).default, - sscd095: async () => (await import('./sscd095')).default, - sscd099: async () => (await import('./sscd099')).default, - sscd105: async () => (await import('./sscd105')).default, - sscd110: async () => (await import('./sscd110')).default, - sscd111: async () => (await import('./sscd111')).default, - sscd112: async () => (await import('./sscd112')).default, - sscd115: async () => (await import('./sscd115')).default, - sscd117: async () => (await import('./sscd117')).default, - sscd118: async () => (await import('./sscd118')).default, - sscd120: async () => (await import('./sscd120')).default, - sscd121: async () => (await import('./sscd121')).default, - sscd122: async () => (await import('./sscd122')).default, - 'sscd137-8': async () => (await import('./sscd137-8')).default, - sscd146: async () => (await import('./sscd146')).default, - sscd147: async () => (await import('./sscd147')).default, - sscd504: async () => (await import('./sscd504')).default, - sscd518: async () => (await import('./sscd581')).default, - sscd800: async () => (await import('./sscd800')).default, - sscd801: async () => (await import('./sscd801')).default, - sscd802: async () => (await import('./sscd802')).default, - sscd803: async () => (await import('./sscd803')).default, - sscd804: async () => (await import('./sscd804')).default, - sscd805: async () => (await import('./sscd805')).default, - sscd806: async () => (await import('./sscd806')).default, - sscd807: async () => (await import('./sscd807')).default, - sscd808: async () => (await import('./sscd808')).default, - sscd809: async () => (await import('./sscd809')).default, - sscd810: async () => (await import('./sscd810')).default, - sscd811: async () => (await import('./sscd811')).default, - sscd812: async () => (await import('./sscd812')).default, - sscd813: async () => (await import('./sscd813')).default, - sscd814: async () => (await import('./sscd814')).default, - sscd815: async () => (await import('./sscd815')).default, - sscd816: async () => (await import('./sscd816')).default, - sscdM150: async () => (await import('./sscdM150')).default, - sscdU1: async () => (await import('./sscdU1')).default, + '001': async () => (await import('./sscd001')).default, + '003': async () => (await import('./sscd003')).default, + '008': async () => (await import('./sscd008')).default, + '012': async () => (await import('./sscd012')).default, + '014': async () => (await import('./sscd014')).default, + '015': async () => (await import('./sscd015')).default, + '017': async () => (await import('./sscd017')).default, + '018': async () => (await import('./sscd018')).default, + '020': async () => (await import('./sscd020')).default, + '021': async () => (await import('./sscd021')).default, + '022': async () => (await import('./sscd022')).default, + '024': async () => (await import('./sscd024')).default, + '028': async () => (await import('./sscd028')).default, + '034': async () => (await import('./sscd034')).default, + '035': async () => (await import('./sscd035')).default, + '039': async () => (await import('./sscd039')).default, + '042': async () => (await import('./sscd042')).default, + '043': async () => (await import('./sscd043')).default, + '046': async () => (await import('./sscd046')).default, + '047': async () => (await import('./sscd047')).default, + '048': async () => (await import('./sscd048')).default, + '050': async () => (await import('./sscd050')).default, + '051': async () => (await import('./sscd051')).default, + '056': async () => (await import('./sscd056')).default, + '057': async () => (await import('./sscd057')).default, + '061': async () => (await import('./sscd061')).default, + '063': async () => (await import('./sscd063')).default, + '065': async () => (await import('./sscd065')).default, + '067': async () => (await import('./sscd067')).default, + '069': async () => (await import('./sscd069')).default, + '070': async () => (await import('./sscd070')).default, + '071': async () => (await import('./sscd071')).default, + '072': async () => (await import('./sscd072')).default, + '079': async () => (await import('./sscd079')).default, + '080': async () => (await import('./sscd080')).default, + '081': async () => (await import('./sscd081')).default, + '083': async () => (await import('./sscd083')).default, + '084': async () => (await import('./sscd084')).default, + '087': async () => (await import('./sscd087')).default, + '089': async () => (await import('./sscd089')).default, + '092': async () => (await import('./sscd092')).default, + '094': async () => (await import('./sscd094')).default, + '095': async () => (await import('./sscd095')).default, + '099': async () => (await import('./sscd099')).default, + '105': async () => (await import('./sscd105')).default, + '110': async () => (await import('./sscd110')).default, + '111': async () => (await import('./sscd111')).default, + '112': async () => (await import('./sscd112')).default, + '115': async () => (await import('./sscd115')).default, + '117': async () => (await import('./sscd117')).default, + '118': async () => (await import('./sscd118')).default, + '120': async () => (await import('./sscd120')).default, + '121': async () => (await import('./sscd121')).default, + '122': async () => (await import('./sscd122')).default, + '137-8': async () => (await import('./sscd137-8')).default, + '146': async () => (await import('./sscd146')).default, + '147': async () => (await import('./sscd147')).default, + '504': async () => (await import('./sscd504')).default, + '581': async () => (await import('./sscd581')).default, + '800': async () => (await import('./sscd800')).default, + '801': async () => (await import('./sscd801')).default, + '802': async () => (await import('./sscd802')).default, + '803': async () => (await import('./sscd803')).default, + '804': async () => (await import('./sscd804')).default, + '805': async () => (await import('./sscd805')).default, + '806': async () => (await import('./sscd806')).default, + '807': async () => (await import('./sscd807')).default, + '808': async () => (await import('./sscd808')).default, + '809': async () => (await import('./sscd809')).default, + '810': async () => (await import('./sscd810')).default, + '811': async () => (await import('./sscd811')).default, + '812': async () => (await import('./sscd812')).default, + '813': async () => (await import('./sscd813')).default, + '814': async () => (await import('./sscd814')).default, + '815': async () => (await import('./sscd815')).default, + '816': async () => (await import('./sscd816')).default, + M150: async () => (await import('./sscdM150')).default, + U1: async () => (await import('./sscdU1')).default, }; export type ScotsounGetterTable = { [key in ScotsounId]: () => Promise }; -export async function getAllLallansIssues(): Promise { +export async function getAllScotsoun(): Promise { return Promise.all(Object.values(getScotsoun).map((f) => f())); } diff --git a/src/i18n/translations/components/breadcrumbs.ts b/src/i18n/translations/components/breadcrumbs.ts index 3db3f2f..8e7928f 100644 --- a/src/i18n/translations/components/breadcrumbs.ts +++ b/src/i18n/translations/components/breadcrumbs.ts @@ -18,6 +18,10 @@ const breadcrumbsTranslations = { sco: () => 'Lallans', 'en-GB': () => 'Lallans', }, + '/furthsettins/scotsoun/': { + sco: () => 'Scotsoun', + 'en-GB': () => 'Scotsoun', + }, ...Object.fromEntries( Object.keys(getLallansIssue).map((lallansIssueNumber) => [ `/furthsettins/lallans/${lallansIssueNumber}/`, diff --git a/src/i18n/translations/components/scotsoun.ts b/src/i18n/translations/components/scotsoun.ts new file mode 100644 index 0000000..51017a7 --- /dev/null +++ b/src/i18n/translations/components/scotsoun.ts @@ -0,0 +1,24 @@ +import tSite from '../site'; +import type { TranslationsDictionary } from '$types/TranslationsDictionary'; +import type Date from '$types/Date'; +import { defaultLocale } from '$i18n/locales'; + +const scotsounTranslations = { + 'cover-artist': { + sco: ({ coverArtist }: { coverArtist: string }) => `Cover airtist: ${coverArtist}.`, + 'en-GB': ({ coverArtist }: { coverArtist: string }) => `Cover airtist: ${coverArtist}.`, + }, + 'release-date': { + sco: ({ releaseDate }: { releaseDate: Date }) => { + const tDate = tSite['long-date']['sco']; + return `Releast: ${tDate({ date: releaseDate })}`; + }, + 'en-GB': ({ releaseDate }: { releaseDate: Date }) => { + const tDate = tSite['long-date']['en-GB'] ?? tSite['long-date'][defaultLocale]; + return `Released: ${tDate({ date: releaseDate })}`; + }, + }, +}; + +type Raw = typeof scotsounTranslations; +export default scotsounTranslations as TranslationsDictionary; diff --git a/src/i18n/translations/pages/scotsounGallery.ts b/src/i18n/translations/pages/scotsounGallery.ts new file mode 100644 index 0000000..58de8ef --- /dev/null +++ b/src/i18n/translations/pages/scotsounGallery.ts @@ -0,0 +1,11 @@ +import type { TranslationsDictionary } from '$types/TranslationsDictionary'; + +const scotsounGalleryTranslations = { + title: { + sco: () => 'Scotsoun', + 'en-GB': () => 'Scotsoun', + }, +}; + +type Raw = typeof scotsounGalleryTranslations; +export default scotsounGalleryTranslations as TranslationsDictionary; diff --git a/src/i18n/translations/pages/scotsounPaymentSuccessConfirmation.ts b/src/i18n/translations/pages/scotsounPaymentSuccessConfirmation.ts new file mode 100644 index 0000000..3089a4d --- /dev/null +++ b/src/i18n/translations/pages/scotsounPaymentSuccessConfirmation.ts @@ -0,0 +1,27 @@ +import type ScotsounId from '$types/ScotsounId'; +import type { TranslationsDictionary } from '$types/TranslationsDictionary'; + +const scotsounPaymentSuccessConfirmation = { + title: { + sco: () => 'Payment Success', + 'en-GB': () => 'Payment Success', + }, + 'payment-confirmation-message': { + sco: ({ scotsounId }: { scotsounId: ScotsounId }) => ` + Gin ye hae been sent til this page, at means ye hae successfully ordered + Scotsoun ${scotsounId} an we’ll be pittin it in the post fur ye belyve! + `, + 'en-GB': ({ scotsounId }: { scotsounId: ScotsounId }) => ` + If you have been directed to this page, that means you have successfully + ordered Scotsoun ${scotsounId} and we shall be putting it in the post for + you right away! + `, + }, + 'back-button-text': { + sco: ({ scotsounId }: { scotsounId: ScotsounId }) => `Retour til Scotsoun ${scotsounId}`, + 'en-GB': ({ scotsounId }: { scotsounId: ScotsounId }) => `Return to Scotsoun ${scotsounId}`, + }, +}; + +type Raw = typeof scotsounPaymentSuccessConfirmation; +export default scotsounPaymentSuccessConfirmation as TranslationsDictionary; diff --git a/src/pages/[locale]/furthsettins/index.astro b/src/pages/[locale]/furthsettins/index.astro index c6a805e..d7a9421 100644 --- a/src/pages/[locale]/furthsettins/index.astro +++ b/src/pages/[locale]/furthsettins/index.astro @@ -27,6 +27,14 @@ const t = translate(locale); +
  • + + + + +
  • diff --git a/src/pages/[locale]/furthsettins/scotsoun/[scotsounId]/index.astro b/src/pages/[locale]/furthsettins/scotsoun/[scotsounId]/index.astro new file mode 100644 index 0000000..5b5dc82 --- /dev/null +++ b/src/pages/[locale]/furthsettins/scotsoun/[scotsounId]/index.astro @@ -0,0 +1,27 @@ +--- +import Page from '$layouts/Page.astro'; +import localeStaticPaths from '$lib/localeStaticPaths'; +import tPage from '$i18n/translations/pages/scotsounGallery'; +import translate from '$i18n/translate'; +import type Locale from '$types/Locale'; +import { getScotsoun } from '$data/scotsoun'; +import type ScotsounId from '$types/ScotsounId'; +import Scotsoun from '$components/Scotsoun.astro'; + +export async function getStaticPaths() { + const scotsounIds = Object.keys(getScotsoun) as `${ScotsounId}`[]; + return scotsounIds.flatMap((n) => + localeStaticPaths.map((p) => ({ ...p, params: { ...p.params, scotsounId: n } })) + ); +} + +const locale = Astro.params.locale as Locale; +const scotsounId = Astro.params.scotsounId as ScotsounId; +const t = translate(locale); + +const scotsoun = await getScotsoun[scotsounId](); +--- + + + + diff --git a/src/pages/[locale]/furthsettins/scotsoun/[scotsounId]/payment-success-confirmation.astro b/src/pages/[locale]/furthsettins/scotsoun/[scotsounId]/payment-success-confirmation.astro new file mode 100644 index 0000000..e4f62cb --- /dev/null +++ b/src/pages/[locale]/furthsettins/scotsoun/[scotsounId]/payment-success-confirmation.astro @@ -0,0 +1,30 @@ +--- +import Page from '$layouts/Page.astro'; +import localeStaticPaths from '$lib/localeStaticPaths'; +import translate from '$i18n/translate'; +import tPage from '$i18n/translations/pages/scotsounPaymentSuccessConfirmation'; +import type Locale from '$types/Locale'; +import { getScotsoun } from '$data/scotsoun'; +import type ScotsounId from '$types/ScotsounId'; + +export async function getStaticPaths() { + const scotsounIds = Object.keys(getScotsoun) as `${ScotsounId}`[]; + return scotsounIds.flatMap((n) => + localeStaticPaths.map((p) => ({ ...p, params: { ...p.params, issueNumber: n } })) + ); +} + +const locale = Astro.params.locale as Locale; +const scotsounId = Astro.params.scotsounId as ScotsounId; +const t = translate(locale); +--- + + +
    +

    {t(tPage, { key: 'title' })}

    +

    {t(tPage, { key: 'payment-confirmation-message', scotsounId })}

    + + {t(tPage, { key: 'back-button-text', scotsounId })} + +
    +
    diff --git a/src/pages/[locale]/furthsettins/scotsoun/index.astro b/src/pages/[locale]/furthsettins/scotsoun/index.astro new file mode 100644 index 0000000..cd2e1fe --- /dev/null +++ b/src/pages/[locale]/furthsettins/scotsoun/index.astro @@ -0,0 +1,22 @@ +--- +import Page from '$layouts/Page.astro'; +import localeStaticPaths from '$lib/localeStaticPaths'; +import translate from '$i18n/translate'; +import tPage from '$i18n/translations/pages/scotsounGallery'; +import type Locale from '$types/Locale'; +import ScotsounCdGallery from '$components/ScotsounCdGallery.astro'; + +export async function getStaticPaths() { + return localeStaticPaths; +} + +const locale = Astro.params.locale as Locale; +const t = translate(locale); +--- + + +
    +

    Scotsoun

    + +
    +
    -- cgit v1.2.3