Merge branch 'main' into reorganising

This commit is contained in:
Avris 2021-09-05 19:22:38 +02:00
commit b5e461b8e4
3 changed files with 61 additions and 38 deletions

View File

@ -46,10 +46,31 @@ const LINK_PROVIDERS = {
homepage: 'https://cake.avris.it',
name: 'Attraction Layer Cake',
},
spectrum: {
regex: '^https://spectrum.avris.it/([A-Za-z0-9]{4})$',
icon: 'https://spectrum.avris.it/favicon.png',
},
orcid: {
regex: '^https?://(?:www.)?orcid.org/([^/]+)',
icon: 'https://orcid.org/assets/icons/favicon.ico',
},
kofi: {
regex: '^https?://(?:www.)?ko-fi.com/([^/]+)',
icon: 'https://ko-fi.com/favicon.png',
},
linktree: {
regex: '^https?://(?:www.)?linktr.ee/([^/]+)',
icon: 'https://linktr.ee/static/favicon.ico',
},
blogger: {
regex: '^https?://([^/]+).(?:blogger|blogspot).com',
icon: 'https://www.blogger.com/about/favicon/favicon.ico',
},
twitch: {
regex: '^https?://(?:www.)?twitch.tv/([^/]+)',
icon: 'twitch',
iconSet: 'b',
},
};
export default {

View File

@ -18,44 +18,46 @@
{{options.name}}
</LocaleLink>
</div>
<div v-if="$user() && $user().username === user.username">
<nuxt-link to="/editor" class="btn btn-primary btn-sm mb-2 mx-1">
<Icon v="edit"/>
<T>profile.edit</T>
</nuxt-link>
<a :href="`https://pronouns.page/@${user.username}`" v-if="Object.keys(user.profiles).length > 1"
class="btn btn-outline-secondary btn-sm mb-2 mx-1"
>
<Icon v="external-link"/>
pronouns.page/@{{user.username}}
</a>
</div>
<div v-if="($user() && $user().username === profile.username) || $isGranted('users')">
<small>
<Icon v="id-card"/>
<T>profile.card.link</T>:
</small>
<small v-if="profile.card === null">
<button class="btn btn-outline-success btn-sm" @click="generateCard">
<T>profile.card.generate</T>
</button>
</small>
<small v-else-if="profile.card === ''">
<Icon v="cogs"/>
<T>profile.card.generating</T>
</small>
<template v-if="profile.card">
<a :href="profile.card" target="_blank" rel="noopener"
class="btn btn-outline-success btn-sm mb-2 mx-1">
<Icon v="sun"/>
<T>mode.light</T>
<div v-if="$user() && $user().username === user.username" class="alert alert-info">
<div class="mb-2">
<nuxt-link to="/editor" class="btn btn-primary btn-sm mx-1">
<Icon v="edit"/>
<T>profile.edit</T>
</nuxt-link>
<a :href="`https://pronouns.page/@${user.username}`" v-if="Object.keys(user.profiles).length > 1"
class="btn btn-outline-secondary btn-sm mx-1"
>
<Icon v="external-link"/>
pronouns.page/@{{user.username}}
</a>
<a :href="profile.card.replace('.png', '-dark.png')" target="_blank" rel="noopener"
class="btn btn-outline-success btn-sm mb-2 mx-1">
<Icon v="moon"/>
<T>mode.dark</T>
</a>
</template>
</div>
<div>
<small>
<Icon v="id-card"/>
<T>profile.card.link</T>:
</small>
<small v-if="profile.card === null">
<button class="btn btn-outline-success btn-sm" @click="generateCard">
<T>profile.card.generate</T>
</button>
</small>
<small v-else-if="profile.card === ''">
<Spinner/>
<T>profile.card.generating</T>
</small>
<template v-if="profile.card">
<a :href="profile.card" target="_blank" rel="noopener"
class="btn btn-outline-success btn-sm mx-1">
<Icon v="sun"/>
<T>mode.light</T>
</a>
<a :href="profile.card.replace('.png', '-dark.png')" target="_blank" rel="noopener"
class="btn btn-outline-success btn-sm mx-1">
<Icon v="moon"/>
<T>mode.dark</T>
</a>
</template>
</div>
</div>
</Profile>

View File

@ -76,7 +76,7 @@ export const buildPronoun = (pronouns, path) => {
const slashMorphemes = process.env.CONFIG.pronouns.slashes === true
? MORPHEMES
: process.env.CONFIG.pronouns.slashes;
if (p.length === slashMorphemes.length) {
if (slashMorphemes && p.length === slashMorphemes.length) {
pronoun = new Pronoun(
`${p[0]}/${p[1]}`,
'',