Skip to content

Commit

Permalink
feat: show logo when gallery curated by Europeana (#1798)
Browse files Browse the repository at this point in the history
* feat: show logo when gallery curated by Europeana

* feat: use favicon for curated by img

* feat: switch back to logo with name

* style: 1.25 rem height
  • Loading branch information
rwd authored Dec 16, 2022
1 parent a99692f commit 4ec29fa
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/portal/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,6 @@ OAUTH_CLIENT="YOUR_CLIENT"
# Optional expiration date for the feature notification, after which it will no
# longer be shown.
# APP_FEATURE_NOTIFICATION_EXPIRATION=2022-02-22

# Username of the official Europeana account for published set-driven galleries.
# APP_GALLERIES_EUROPEANA_ACCOUNT=europeana
5 changes: 4 additions & 1 deletion packages/portal/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ export default {
app: {
// TODO: rename env vars to prefix w/ APP_, except feature toggles
baseUrl: process.env.PORTAL_BASE_URL,
internalLinkDomain: process.env.INTERNAL_LINK_DOMAIN,
galleries: {
europeanaAccount: process.env.APP_GALLERIES_EUROPEANA_ACCOUNT || 'europeana'
},
featureNotification: process.env.APP_FEATURE_NOTIFICATION,
featureNotificationExpiration: featureNotificationExpiration(process.env.APP_FEATURE_NOTIFICATION_EXPIRATION),
internalLinkDomain: process.env.INTERNAL_LINK_DOMAIN,
schemaOrgDatasetId: process.env.SCHEMA_ORG_DATASET_ID,
siteName: APP_SITE_NAME,
search: {
Expand Down
20 changes: 19 additions & 1 deletion packages/portal/src/pages/galleries/_.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,20 @@
v-if="set.creator.nickname"
class="curator mb-2"
>
{{ $t('set.labels.curatedBy') }} @{{ set.creator.nickname }}
{{ $t('set.labels.curatedBy') }}
<img
v-if="set.creator.nickname === $config.app.galleries.europeanaAccount"
src="~/assets/img/logo.svg"
alt="Europeana"
width="96"
height="20"
class="ml-1 logo"
>
<template
v-else
>
@{{ set.creator.nickname }}
</template>
</span>
<span
v-if="set.visibility === 'private'"
Expand Down Expand Up @@ -488,6 +501,11 @@
line-height: 1.125;
color: $mediumgrey;
img.logo {
height: 1.25rem;
width: auto;
}
.curator,
.visibility {
display: inline-flex;
Expand Down
7 changes: 7 additions & 0 deletions packages/portal/tests/unit/pages/galleries/_set.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ const factory = (options = {}) => shallowMountNuxt(page, {
context: {
res: {}
}
},
$config: {
app: {
galleries: {
europeanaAccount: 'europeana'
}
}
}
},
stubs: ['SetRecommendations', 'SetPublicationRequestWidget']
Expand Down

0 comments on commit 4ec29fa

Please sign in to comment.