#164 dynamic /team page and footer

This commit is contained in:
Avris 2021-01-12 20:06:59 +01:00
parent c465be5d56
commit df5f5df037
32 changed files with 397 additions and 347 deletions

View File

@ -1,30 +1,39 @@
<template>
<ul :class="{'list-unstyled': !expanded}">
<li v-for="author in config.contact.authors" class="mb-2">
<Icon v-if="!expanded" :v="author.group ? 'users' : 'user'"/>
<a :href="author.link" target="_blank" rel="noopener">
{{ author.name }}
</a>
<nuxt-link v-if="author.profile" :to="`/@${author.profile}`" class="badge badge-light border">
@{{author.profile}}
<ul class="list-unstyled">
<li class="mb-2">
<Icon v="collective-logo.svg"/>
<nuxt-link :to="`/${config.contact.team.route}`">
<T>contact.team.name</T>
</nuxt-link>
<br v-if="author.areas && Object.keys(author.areas).length"/>
<small v-for="(link, area, index) in author.areas">
<Spaceless>
<nuxt-link v-if="link && link.indexOf('/') === 0" :to="link">{{ area.replace(/_/g, ' ') }}</nuxt-link>
<a v-else-if="link" :href="link" target="_blank" rel="noopener">{{ area.replace(/_/g, ' ') }}</a>
<span v-else>{{ area.replace(/_/g, ' ') }}</span>
<span v-if="index < Object.keys(author.areas).length - 1">, </span>
</Spaceless>
</small>
</li>
<li v-if="authors === undefined">
<Spinner/>
</li>
<template v-else>
<li v-for="author in authors" class="mb-2">
<Icon v="user"/>
{{ author.footerName }}
<nuxt-link :to="`/@${author.username}`" class="badge badge-light border">
@{{author.username}}
</nuxt-link>
<br/>
<small>
{{author.footerAreas.replace(/,/g, ', ')}}
</small>
</li>
</template>
</ul>
</template>
<script>
export default {
props: {
expanded: { type: Boolean }
data() {
return {
authors: undefined,
}
},
async mounted() {
this.authors = await this.$axios.$get(`/admin/list/footer`);
},
}
</script>

View File

@ -181,6 +181,7 @@
link: '/' + this.config.contact.route,
icon: 'comment-alt-smile',
text: this.$t('contact.header'),
extra: ['/' + this.config.contact.team.route],
});
}

View File

@ -1,5 +1,6 @@
<template>
<span :class="['fa' + set, 'fa-' + v, 'fa-fw']" :style="`font-size: ${size}em`"></span>
<img v-if="v.endsWith('.svg')" :src="`/img/${v}`" :style="`height: ${size}em; width: 1.25em; display: inline;`" alt=""/>
<span v-else :class="['fa' + set, 'fa-' + v, 'fa-fw']" :style="`font-size: ${size}em`"></span>
</template>
<script>

View File

@ -180,43 +180,12 @@ contact:
icon: 'envelope'
url: 'mailto:contact@pronouns.page'
headline: 'contact@pronouns.page'
authors:
-
name: 'The “Neutral Language Council” collective'
link: '/blog/neutral-language-council'
group: true
-
name: 'Andrea'
profile: 'andrea'
pronouns: 'they'
pronounsLink: '/they'
website: 'https://avris.it'
twitter: 'AvrisIT'
mail: 'andrea@avris.it'
areas:
code: 'https://gitlab.com/Avris/Zaimki'
language: ~
faq: '/faq'
-
name: 'Paweł Dembowski'
profile: 'Ausir'
pronouns: 'he'
pronounsLink: '/he'
twitter: 'VaultAusir'
mail: 'pawel.dembowski@gmail.com'
areas:
language: ~
sources: '/sources'
-
name: 'Szymon Misiek'
profile: 'szymon'
pronouns: 'he'
pronounsLink: '/he'
mail: 'misiek.sz.93@gmail.com'
orcid: '0000-0002-0214-0387'
areas:
language: ~
sources: '/sources'
team:
enabled: true
route: 'team' # TODO
name: 'The “Neutral Language Council” collective' # TODO
blog: {}
support:
enabled: true

View File

@ -311,6 +311,16 @@ english: ~
contact:
header: 'Contact'
authors: 'Authors of the website'
team:
name: 'The “Neutral Language Council” collective' # TODO
description: # TODO
- >
{https://pronouns.page=Pronouns.page} and related initiatives
are created by the “Neutral Language Council” collective.
logo: 'Logo of the collective is a combination of the transgender symbol and a speech bubble that symbolises language.' # TODO
members: 'Current members' # TODO
blog: 'Blog' # TODO
upcoming: 'Upcoming language versions' # TODO
support:
header: 'Support'

View File

@ -1,5 +1,7 @@
# How to create a new language version of Pronouns.page
<small>06.12.2020 | [@andrea](/@andrea)</small>
So you're interested in helping us extend the platform to your native language? Awesome! 🥰
But how do I do that, you ask?

View File

@ -1,24 +0,0 @@
# The “Neutral Language Council” collective
<figure class="float-right">
<img src="/img/łoś.jpg"/>
<figcaption>Our logo is a black moose (pl. “łoś”) with a crowbar (pol. “łom”) (a nod to Polish neuter verb endings “-łom” and “-łoś”) against the background of the non-binary pride flag.</figcaption>
</figure>
[Pronouns.page](https://pronouns.page)
and the Facebook fanpage [Słownik Neutratywów Języka Polskiego](https://facebook.com/neutratywy) (in Polish)
are created by the “Neutral Language Council” collective.
## <span class="fal fa-user-friends"></span> Current members:
- [@andrea](/@andrea)
- [@Archie](/@Archie)
- [@ausir](/@ausir)
- [@Kafka](/@Kafka)
- [@Łucja](/@Łucja)
- [@Nikita](/@Nikita)
- [@Sybil](/@Sybil)
- [@szymon](/@szymon)
- [@Tess](/@Tess)
## <span class="fal fa-link"></span> [Polish page](https://zaimki.pl/blog/rada-j%C4%99zyka-neutralnego)

View File

@ -180,43 +180,12 @@ contact:
icon: 'envelope'
url: 'mailto:contact@pronouns.page'
headline: 'contact@pronouns.page'
authors:
-
name: 'The “Neutral Language Council” collective'
link: '/blog/neutral-language-council'
group: true
-
name: 'Andrea'
profile: 'andrea'
pronouns: 'they'
pronounsLink: '/they'
website: 'https://avris.it'
twitter: 'AvrisIT'
mail: 'andrea@avris.it'
areas:
code: 'https://gitlab.com/Avris/Zaimki'
language: ~
faq: '/faq'
-
name: 'Paweł Dembowski'
profile: 'ausir'
pronouns: 'he'
pronounsLink: '/he'
twitter: 'VaultAusir'
mail: 'pawel.dembowski@gmail.com'
areas:
language: ~
sources: '/sources'
-
name: 'Szymon Misiek'
profile: 'szymon'
pronouns: 'he'
pronounsLink: '/he'
mail: 'misiek.sz.93@gmail.com'
orcid: '0000-0002-0214-0387'
areas:
language: ~
sources: '/sources'
team:
enabled: true
route: 'team'
name: 'The “Neutral Language Council” collective'
blog:
creating-new-language-version: 'How to create a new language version of Pronouns.page'
support:
enabled: true

View File

@ -312,6 +312,16 @@ english: ~
contact:
header: 'Contact'
authors: 'Authors of the website'
team:
name: 'The “Neutral Language Council” collective' # TODO
description: # TODO
- >
{https://pronouns.page=Pronouns.page} and related initiatives
are created by the “Neutral Language Council” collective.
logo: 'Logo of the collective is a combination of the transgender symbol and a speech bubble that symbolises language.' # TODO
members: 'Current members' # TODO
blog: 'Blog' # TODO
upcoming: 'Upcoming language versions' # TODO
support:
header: 'Support'

View File

@ -85,36 +85,11 @@ contact:
icon: 'envelope'
url: 'mailto:contact@pronouns.page'
headline: 'contact@pronouns.page'
authors:
-
name: 'Andrea'
profile: 'andrea'
pronouns: 'elle'
pronounsLink: '/elle'
website: 'https://avris.it'
twitter: 'AvrisIT'
mail: 'andrea@avris.it'
areas:
código: 'https://gitlab.com/Avris/Zaimki'
-
name: 'Paweł Dembowski'
profile: 'ausir'
pronouns: 'él'
pronounsLink: '/él'
twitter: 'VaultAusir'
mail: 'pawel.dembowski@gmail.com'
areas:
idioma: ~
fuentes: '/fuentes'
-
name: 'Dante'
profile: 'AkerAdardun'
pronouns: 'él'
pronounsLink: '/él'
twitter: 'AkerAdardun'
mail: 'danteu2998@gmail.com'
areas:
traducción: ~
team:
enabled: true
route: 'team' # TODO
name: 'Cooperativa “Revolucionaria Academia Española”'
blog: {}
support:
enabled: true

View File

@ -94,11 +94,11 @@ sources:
thanks: '¡Gracias por contribuir!'
another: 'Enviar otro'
moderation: 'Los envíos deben ser aprobados antes de ser publicados.'
key: 'Clave'
keyInfo: 'Identificador para vincular fuentes entre versiones en varios idiomas y vincularlas con el diccionario'
images: 'Imágenes'
key: 'Clave'
keyInfo: 'Identificador para vincular fuentes entre versiones en varios idiomas y vincularlas con el diccionario'
images: 'Imágenes'
otherVersions: 'En otros idiomas'
referenced: 'Ejemplos del uso'
referenced: 'Ejemplos del uso'
nouns:
header: 'Diccionario'
@ -319,6 +319,16 @@ english: ~
contact:
header: 'Contacto'
authors: 'Autores/as/xs del sitio web'
team:
name: 'The “Neutral Language Council” collective' # TODO
description: # TODO
- >
{https://pronouns.page=Pronouns.page} and related initiatives
are created by the “Neutral Language Council” collective.
logo: 'Logo of the collective is a combination of the transgender symbol and a speech bubble that symbolises language.' # TODO
members: 'Current members' # TODO
blog: 'Blog' # TODO
upcoming: 'Upcoming language versions' # TODO
support:
header: 'Apóyanos'
@ -343,7 +353,7 @@ user:
Si no solicitaste este código, simplemente ignora este mensaje.
why: >
Registrarte te permite manejar tus tarjetas ({/@andrea=como esta}).
passwordless: 'Este sitio web no guarda las contraseñas. {https://avris.it/blog/passwords-are-passé=More info.}'
passwordless: 'Este sitio web no guarda las contraseñas. {https://avris.it/blog/passwords-are-passé=More info.}'
code:
action: 'Validar'
invalid: 'Código inválido.'
@ -470,11 +480,11 @@ localise:
images:
upload:
instruction: 'Haz clic aquí o arrastra tus imágenes aquí'
instruction: 'Haz clic aquí o arrastra tus imágenes aquí'
instructionShort: 'Subir'
error:
generic: 'Algo salió mal. Por favor, vuelve a intentarlo…'
generic: 'Algo salió mal. Por favor, vuelve a intentarlo…'
flags:
Abroromantic: 'Abrorrománti{inflection_c}'

View File

@ -179,43 +179,11 @@ contact:
icon: 'envelope'
url: 'mailto:contact@pronouns.page'
headline: 'contact@pronouns.page'
authors:
-
name: 'The “Neutral Language Council” collective'
link: '/blog/neutral-language-council'
group: true
-
name: 'Andrea'
profile: 'andrea'
pronouns: 'they'
pronounsLink: '/they'
website: 'https://avris.it'
twitter: 'AvrisIT'
mail: 'andrea@avris.it'
areas:
code: 'https://gitlab.com/Avris/Zaimki'
language: ~
faq: '/faq'
-
name: 'Paweł Dembowski'
profile: 'Ausir'
pronouns: 'he'
pronounsLink: '/he'
twitter: 'VaultAusir'
mail: 'pawel.dembowski@gmail.com'
areas:
language: ~
sources: '/sources'
-
name: 'Szymon Misiek'
profile: 'szymon'
pronouns: 'he'
pronounsLink: '/he'
mail: 'misiek.sz.93@gmail.com'
orcid: '0000-0002-0214-0387'
areas:
language: ~
sources: '/sources'
team:
enabled: true
route: 'team' # TODO
name: 'The “Neutral Language Council” collective' # TODO
blog: {}
support:
enabled: true

View File

@ -311,6 +311,16 @@ english: ~
contact:
header: 'Contact'
authors: 'Authors of the website'
team:
name: 'The “Neutral Language Council” collective' # TODO
description: # TODO
- >
{https://pronouns.page=Pronouns.page} and related initiatives
are created by the “Neutral Language Council” collective.
logo: 'Logo of the collective is a combination of the transgender symbol and a speech bubble that symbolises language.' # TODO
members: 'Current members' # TODO
blog: 'Blog' # TODO
upcoming: 'Upcoming language versions' # TODO
support:
header: 'Support'

View File

@ -1,27 +0,0 @@
# Kolektyw „Rada Języka Neutralnego”
<figure class="float-right">
<img src="/img/łoś.jpg"/>
<figcaption>Logo kolektywu to czarny łoś z łomem (ze względu na neutralne końcówki czasowników: „-łom” i „-łoś”) na tle flagi osób niebinarnych.</figcaption>
</figure>
Inicjatywy [zaimki.pl](https://zaimki.pl) oraz [Słownik Neutratywów Języka Polskiego](https://facebook.com/neutratywy)
są tworzone przez kolektyw **„Rada Języka Neutralnego”**.
## <span class="fal fa-user-friends"></span> Obecny skład
- [@andrea](/@andrea)
- [@Archie](/@Archie)
- [@ausir](/@ausir)
- [@Kafka](/@Kafka)
- [@Łucja](/@Łucja)
- [@Nikita](/@Nikita)
- [@Sybil](/@Sybil)
- [@szymon](/@szymon)
- [@Tess](/@Tess)
## <span class="fal fa-pen-nib"></span> Blog
- [Podsumowanie działalności w roku 2020](/blog/podsumowanie-2020)
- [Niebinarność w „Gwiezdnych Wojnach”](/blog/gwiezdne-wojny)
- [Nadszedł czas się obnosić!](/blog/czas-się-obnosić) przemówienie Sybila z Wrocławskiego Marszu Równości

View File

@ -444,44 +444,14 @@ contact:
icon: 'envelope'
url: 'mailto:contact@pronouns.page'
headline: 'contact@pronouns.page'
authors:
-
name: 'Rada Języka Neutralnego'
link: '/blog/rada-języka-neutralnego'
group: true
-
name: 'Andrea'
profile: 'andrea'
pronouns: 'onu'
pronounsLink: '/onu'
website: 'https://avris.it'
twitter: 'AvrisIT'
mail: 'andrea@avris.it'
areas:
kod: 'https://gitlab.com/Avris/Zaimki'
język: ~
pytania: '/pytania'
-
name: 'Paweł Dembowski'
profile: 'ausir'
pronouns: 'on'
pronounsLink: '/on'
twitter: 'VaultAusir'
mail: 'pawel.dembowski@gmail.com'
areas:
język: ~
literatura: '/literatura'
-
name: 'Sybil Zuz Grzybowskie'
profile: 'Sybil'
pronouns: 'on'
pronounsLink: '/on'
twitter: 'mykofanes'
mail: 'zuzannagrzybowska@protonmail.com'
areas:
neutratywy: '/słowniki'
# imiona: '/imiona'
social_media: ~
team:
enabled: true
route: 'kolektyw-rjn'
name: 'Kolektyw „Rada Języka Neutralnego”'
blog:
podsumowanie-2020: 'Podsumowanie działalności w roku 2020'
gwiezdne-wojny: 'Niebinarność w „Gwiezdnych Wojnach”'
czas-się-obnosić: 'Nadszedł czas się obnosić! przemówienie Sybila z Wrocławskiego Marszu Równości'
support:
enabled: true

View File

@ -853,6 +853,17 @@ english:
contact:
header: 'Kontakt'
authors: '{/słowniki#autor=Autorza} strony'
team:
name: 'Kolektyw „Rada Języka Neutralnego”'
description:
- >
Inicjatywy zaimki.pl / {https://pronouns.page=pronouns.page}
oraz {https://facebook.com/neutratywy=Słownik Neutratywów Języka Polskiego}
są tworzone przez kolektyw „Rada Języka Neutralnego”.
logo: 'Logo kolektywu to połączenie symbolu transpłciowości z chmurką dialogową symbolizującą język.'
members: 'Obecny skład'
blog: 'Blog'
upcoming: 'Nadchodzące wersje językowe'
support:
header: 'Wsparcie'

View File

@ -85,40 +85,11 @@ contact:
icon: 'envelope'
url: 'mailto:contact@pronouns.page'
headline: 'contact@pronouns.page'
authors:
-
name: 'The “Neutral Language Council” collective'
link: '/blog/neutral-language-council'
group: true
-
name: 'Andrea'
profile: 'andrea'
pronouns: 'elle'
pronounsLink: '/elle'
website: 'https://avris.it'
twitter: 'AvrisIT'
mail: 'andrea@avris.it'
areas:
code: 'https://gitlab.com/Avris/Zaimki'
-
name: 'Paweł Dembowski'
profile: 'Ausir'
pronouns: 'él'
pronounsLink: '/él'
twitter: 'VaultAusir'
mail: 'pawel.dembowski@gmail.com'
areas:
idioma: ~
fuentes: '/fuentes'
-
name: 'Dante'
profile: 'AkerAdardun'
pronouns: 'él'
pronounsLink: '/él'
twitter: 'AkerAdardun'
mail: 'danteu2998@gmail.com'
areas:
traducción: ~
team:
enabled: true
route: 'team' # TODO
name: 'The “Neutral Language Council” collective' # TODO
blog: {}
support:
enabled: true

View File

@ -319,6 +319,16 @@ english: ~
contact:
header: 'Contato'
authors: 'Autores/as/xs do site'
team:
name: 'The “Neutral Language Council” collective' # TODO
description: # TODO
- >
{https://pronouns.page=Pronouns.page} and related initiatives
are created by the “Neutral Language Council” collective.
logo: 'Logo of the collective is a combination of the transgender symbol and a speech bubble that symbolises language.' # TODO
members: 'Current members' # TODO
blog: 'Blog' # TODO
upcoming: 'Upcoming language versions' # TODO
support:
header: 'Apoie-nos'

View File

@ -88,51 +88,11 @@ contact:
icon: 'envelope'
url: 'mailto:contact@pronouns.page'
headline: 'contact@pronouns.page'
authors:
-
name: '台灣非二元酷兒浪子'
link: 'https://www.facebook.com/TaiwanNonbinary/'
group: true
-
name: 'Andrea'
profile: 'andrea'
website: 'https://avris.it'
twitter: 'AvrisIT'
mail: 'andrea@avris.it'
areas:
編碼: 'https://gitlab.com/Avris/Zaimki'
-
name: 'Paweł Dembowski'
profile: 'ausir'
pronouns: '他'
pronounsLink: '/他'
twitter: 'VaultAusir'
mail: 'pawel.dembowski@gmail.com'
areas:
翻譯監管: ~
-
name: '曹冠霖'
profile: 'zoruaniac'
pronouns: '佢'
pronounsLink: '佢'
twitter: 'zoruaniac'
mail: 'mimakatta.00@gmail.com'
facebook: 'zoruaniac'
instagram: 'zoruaniac'
areas:
術語學: ~
翻譯: ~
-
name: '曹昌倫'
profile: 'TWFoodLover'
pronouns: '他'
pronounsLink: '他'
twitter: 'TWFoodLover'
mail: 'atsaotw@gmail.com'
areas:
翻譯: ~
team:
enabled: true
route: 'team' # TODO
name: 'The “Neutral Language Council” collective' # TODO
blog: {}
support:

View File

@ -298,6 +298,16 @@ english: ~
contact:
header: 'Contact'
authors: 'Authors of the website'
team:
name: 'The “Neutral Language Council” collective' # TODO
description: # TODO
- >
{https://pronouns.page=Pronouns.page} and related initiatives
are created by the “Neutral Language Council” collective.
logo: 'Logo of the collective is a combination of the transgender symbol and a speech bubble that symbolises language.' # TODO
members: 'Current members' # TODO
blog: 'Blog' # TODO
upcoming: 'Upcoming language versions' # TODO
support:
header: 'Support'

View File

@ -0,0 +1,7 @@
-- Up
ALTER TABLE profiles ADD COLUMN teamName TEXT NULL DEFAULT NULL;
ALTER TABLE profiles ADD COLUMN footerName TEXT NULL DEFAULT NULL;
ALTER TABLE profiles ADD COLUMN footerAreas TEXT NULL DEFAULT NULL;
-- Down

View File

@ -161,7 +161,7 @@ export default {
if (config.links.enabled) {
routes.push({ path: '/' + config.links.route, component: resolve(__dirname, 'routes/links.vue') });
routes.push({ path: '/' + config.links.blogRoute + '/:slug', component: resolve(__dirname, 'routes/blog.vue') });
routes.push({ path: '/' + config.links.blogRoute + '/:slug', component: resolve(__dirname, 'routes/blog.vue'), name: 'blog' });
}
if (config.people.enabled) {
@ -175,6 +175,9 @@ export default {
if (config.contact.enabled) {
routes.push({ path: '/' + config.contact.route, component: resolve(__dirname, 'routes/contact.vue') });
}
if (config.contact.team.enabled) {
routes.push({ path: '/' + config.contact.team.route, component: resolve(__dirname, 'routes/team.vue') });
}
if (config.census.enabled) {
routes.push({ path: '/' + config.census.route, component: resolve(__dirname, 'routes/census.vue') });

View File

@ -19,7 +19,7 @@
<Icon v="users"/>
<T>contact.authors</T>
</h3>
<Authors expanded/>
<Authors/>
<small>
<T>localise.long</T>
<LocaleLink locale="en" link="/blog/creating-new-language-version">

View File

@ -134,7 +134,6 @@
return head({
title: this.$t('names.headerLong'),
description: this.$t('names.description'),
banner: 'bannerNouns.png',
});
},
}

View File

@ -53,7 +53,6 @@
return head({
title: this.$t('nouns.headerLonger'),
description: this.$t('nouns.description'),
banner: this.config.locale === 'pl' ? 'bannerNouns.png' : undefined,
});
},
}

View File

@ -14,11 +14,48 @@
</div>
</div>
<section>
<OpinionLegend/>
</section>
<form @submit.prevent="save" :class="[saving ? 'saving' : '']">
<div v-if="$isGranted('users')" class="border border-primary rounded p-4">
<h3 class="h4 mb-3">
<Icon v="user-cog"/>
Admin section
</h3>
<p class="small text-muted mb-0">
This will be shown on the Team page.
If you leave it empty, you won't show up there (for this language version).
You can use a different display name in different language versions.
</p>
<div class="form-group">
<label for="teamName">Team page display name:</label>
<input class="form-control" name="teamName" maxlength="36" v-model="teamName"/>
</div>
<hr/>
<p class="small text-muted mb-0">
If you feel that you've contributed to this language version enough to get credited in the footer
(not saying how much that is, that's on you to decide 😉),
then add your name and areas here (in the local language!).
The team as a whole will be credited in the footer either way.
</p>
<div class="form-group">
<label for="footerName">Footer display name:</label>
<input class="form-control" name="footerName" maxlength="36" v-model="footerName"/>
</div>
<div class="form-group">
<label for="footerAreas">Areas responsible for / contributing to:</label>
<ListInput v-model="footerAreas"/>
</div>
</div>
<section>
<OpinionLegend/>
</section>
<div class="form-group">
<h3 class="h4">
<Icon v="signature"/>
@ -142,6 +179,9 @@
links: Object.keys(profile.links).length ? profile.links : [],
flags: profile.flags,
words: profile.words.map(x => dictToList(x)),
teamName: profile.teamName,
footerName: profile.footerName,
footerAreas: profile.footerAreas,
};
}
}
@ -159,6 +199,9 @@
links: Object.keys(profile.links).length ? profile.links : [],
flags: profile.flags.filter(f => !f.startsWith('-')),
words: defaultWords,
teamName: profile.teamName,
footerName: profile.footerName,
footerAreas: [],
};
}
@ -170,6 +213,9 @@
links: [],
flags: [],
words: defaultWords,
teamName: '',
footerName: '',
footerAreas: [],
};
},
mounted() {
@ -189,6 +235,9 @@
links: [...this.links],
flags: [...this.flags],
words: this.words.map(x => listToDict(x)),
teamName: this.teamName,
footerName: this.footerName,
footerAreas: this.footerAreas,
});
this.saving = false;
this.$router.push(`/@${this.$user().username}`)

123
routes/team.vue Normal file
View File

@ -0,0 +1,123 @@
<template>
<div>
<h2>
<Icon v="collective-logo.svg"/>
<T>contact.team.name</T>
</h2>
<figure class="float-right border rounded">
<img src="/img/collective-logo.svg" alt=""/>
<figcaption>
<p><T>contact.team.logo</T></p>
<p class="text-center bigger mb-0">
<Icon v="transgender-alt"/>
+
<Icon v="comment"/>
=
<Icon v="collective-logo.svg"/>
</p>
</figcaption>
</figure>
<section>
<T>contact.team.description</T>
</section>
<section v-if="Object.keys(config.contact.blog).length">
<h3>
<Icon v="pen-nib"/>
<T>contact.team.blog</T>
</h3>
<ul>
<li v-for="(title, slug) in config.contact.blog" class="mb-2">
<nuxt-link :to="`/blog/${slug}`">
{{title}}
</nuxt-link>
</li>
</ul>
</section>
<section>
<h3>
<Icon v="user-friends"/>
<T>contact.team.members</T>
</h3>
<template v-for="(members, locale) in membersByLocale" v-if="members.length">
<h4 class="mt-4">
<template v-if="locale === ''">
<T>contact.team.upcoming</T>
</template>
<template v-else-if="locale === config.locale">
{{locales[locale].name}}
</template>
<a v-else :href="locales[locale].url">
{{locales[locale].name}}
</a>
</h4>
<ul class="list-unstyled member-list">
<li v-for="member in members" class="mb-2 d-flex">
<a :href="`https://pronouns.page/@${member.username}`">
<Avatar :user="member" dsize="4rem"/>
</a>
<span class="ml-2">
{{ member.teamName }}
<br/>
<a :href="`https://pronouns.page/@${member.username}`" class="badge badge-light border">
@{{member.username}}
</a>
</span>
</li>
</ul>
</template>
</section>
</div>
</template>
<script>
import { head } from "../src/helpers";
export default {
head() {
return head({
title: this.$t('contact.team.name'),
});
},
async asyncData({app}) {
return {
membersByLocale: await app.$axios.$get(`/admin/list`),
}
},
}
</script>
<style lang="scss" scoped>
@import "assets/variables";
img {
max-width: 100%;
}
figure {
width: 100%;
max-width: 18rem;
padding: $spacer;
> img {
width: 100%;
}
figcaption {
font-size: $small-font-size;
}
}
.bigger {
font-size: 2rem;
}
@include media-breakpoint-up('md', $grid-breakpoints) {
.member-list {
column-count: 3;
column-width: 16rem;
}
}
</style>

View File

@ -2,10 +2,56 @@ import { Router } from 'express';
import SQL from 'sql-template-strings';
import avatar from '../avatar';
import {config as socialLoginConfig} from "../social";
import {now, sortByValue} from "../../src/helpers";
import {buildDict, now, sortByValue} from "../../src/helpers";
import locales from '../../src/locales';
const router = Router();
router.get('/admin/list', async (req, res) => {
const admins = await req.db.all(SQL`
SELECT u.username, p.teamName, p.locale, u.id, u.email, u.avatarSource
FROM users u
LEFT JOIN profiles p ON p.userId = u.id
WHERE p.teamName IS NOT NULL AND p.teamName != ''
ORDER BY RANDOM()
`);
const adminsGroupped = buildDict(function*() {
yield [req.config.locale, []];
for (let [locale, , , published] of locales) {
if (locale !== req.config.locale && published) {
yield [locale, []];
}
}
yield ['', []];
});
for (let admin of admins) {
admin.avatar = await avatar(req.db, admin);
delete admin.id;
delete admin.email;
if (adminsGroupped[admin.locale] !== undefined) {
adminsGroupped[admin.locale].push(admin);
} else {
adminsGroupped[''].push(admin);
}
}
return res.json(adminsGroupped);
});
router.get('/admin/list/footer', async (req, res) => {
return res.json(await req.db.all(SQL`
SELECT u.username, p.footerName, p.footerAreas, p.locale
FROM users u
LEFT JOIN profiles p ON p.userId = u.id
WHERE p.locale = ${req.config.locale}
AND p.footerName IS NOT NULL AND p.footerName != ''
AND p.footerAreas IS NOT NULL AND p.footerAreas != ''
ORDER BY RANDOM()
`));
});
router.get('/admin/users', async (req, res) => {
if (!req.isGranted('users')) {
return res.status(401).json({error: 'Unauthorised'});

View File

@ -47,6 +47,9 @@ const fetchProfiles = async (db, username, self) => {
words: JSON.parse(profile.words),
avatar: await avatar(db, profile),
birthday: self ? profile.birthday : undefined,
teamName: profile.teamName,
footerName: profile.footerName,
footerAreas: profile.footerAreas ? profile.footerAreas.split(',') : [],
};
}
return p;
@ -64,10 +67,13 @@ router.post('/profile/save', async (req, res) => {
}
await req.db.get(SQL`DELETE FROM profiles WHERE userId = ${req.user.id} AND locale = ${req.config.locale}`);
await req.db.get(SQL`INSERT INTO profiles (id, userId, locale, names, pronouns, description, birthday, links, flags, words, active)
await req.db.get(SQL`INSERT INTO profiles (id, userId, locale, names, pronouns, description, birthday, links, flags, words, active, teamName, footerName, footerAreas)
VALUES (${ulid()}, ${req.user.id}, ${req.config.locale}, ${JSON.stringify(req.body.names)}, ${JSON.stringify(req.body.pronouns)},
${req.body.description}, ${req.body.birthday || null}, ${JSON.stringify(req.body.links.filter(x => !!x))}, ${JSON.stringify(req.body.flags)},
${JSON.stringify(req.body.words)}, 1
${JSON.stringify(req.body.words)}, 1,
${req.isGranted('users') ? req.body.teamName || null : ''},
${req.isGranted('users') ? req.body.footerName || null : ''},
${req.isGranted('users') ? req.body.footerAreas.join(',').toLowerCase() || null : ''}
)`);
return res.json(await fetchProfiles(req.db, req.user.username, true));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M 30.943359 -0.65625 C 24.343359 -0.65625 18.943359 4.7437496 18.943359 11.34375 L 18.943359 99.34375 C 18.943359 105.94375 24.343359 111.34375 30.943359 111.34375 L 38.943359 111.34375 C 45.543359 111.34375 50.943359 105.94375 50.943359 99.34375 L 50.943359 53.943359 L 94.943359 97.943359 L 63.84375 129.04297 C 59.14375 133.74297 59.14375 141.34297 63.84375 146.04297 L 69.542969 151.74219 C 74.242969 156.44219 81.842969 156.44219 86.542969 151.74219 L 117.64258 120.64258 L 136.84961 139.84961 C 102.78259 166.13511 81.539062 203.29838 81.539062 244.50781 C 81.539062 277.52252 95.33241 307.76253 118.20703 332.10742 C 107.87879 359.43471 86.391511 382.60147 86.044922 382.87891 C 81.470001 387.73401 80.221432 394.80855 82.855469 400.91211 C 85.489519 407.01567 91.451035 410.96875 98.105469 410.96875 C 140.73544 410.96875 174.35414 393.14334 194.52539 378.85547 C 209.84027 383.66406 226.04209 386.89627 242.94336 388.16602 L 242.94336 423.34375 L 190.94336 423.34375 C 184.34336 423.34375 178.94336 428.74375 178.94336 435.34375 L 178.94336 443.34375 C 178.94336 449.94375 184.34336 455.34375 190.94336 455.34375 L 242.94336 455.34375 L 242.94336 499.34375 C 242.94336 505.94375 248.34336 511.34375 254.94336 511.34375 L 262.94336 511.34375 C 269.54336 511.34375 274.94336 505.94375 274.94336 499.34375 L 274.94336 455.34375 L 326.94336 455.34375 C 333.54336 455.34375 338.94336 449.94375 338.94336 443.34375 L 338.94336 435.34375 C 338.94336 428.74375 333.54336 423.34375 326.94336 423.34375 L 274.94336 423.34375 L 274.94336 388.1875 C 365.47903 381.63033 436.44141 319.82778 436.44141 244.50781 C 436.44141 203.2771 415.17598 166.09642 381.07812 139.80859 L 466.94336 53.943359 L 466.94336 99.34375 C 466.94336 105.94375 472.34336 111.34375 478.94336 111.34375 L 486.94336 111.34375 C 493.54336 111.34375 498.94336 105.94375 498.94336 99.34375 L 498.94336 11.34375 C 498.94336 4.7437496 493.54336 -0.65625 486.94336 -0.65625 L 398.94336 -0.65625 C 392.34336 -0.65625 386.94336 4.7437496 386.94336 11.34375 L 386.94336 19.34375 C 386.94336 25.94375 392.34336 31.34375 398.94336 31.34375 L 444.34375 31.34375 L 353.36719 122.32031 C 326.03085 108.33734 293.67754 100.24219 258.99023 100.24219 C 224.27662 100.24219 191.90022 108.34904 164.55078 122.35156 L 140.14258 97.943359 L 171.24219 66.84375 C 175.94219 62.14375 175.94219 54.54375 171.24219 49.84375 L 165.54297 44.142578 C 160.84297 39.442578 153.24297 39.442578 148.54297 44.142578 L 117.54297 75.34375 L 73.542969 31.34375 L 118.94336 31.34375 C 125.54336 31.34375 130.94336 25.94375 130.94336 19.34375 L 130.94336 11.34375 C 130.94336 4.7437496 125.54336 -0.65625 118.94336 -0.65625 L 30.943359 -0.65625 z M 258.87305 132.41602 C 338.44473 132.41602 403.19727 184.0002 403.19727 247.33789 C 403.19727 310.67559 338.44473 362.25977 258.87305 362.25977 C 240.6392 362.25977 222.59939 359.45255 205.26758 353.90234 L 195.47461 350.76758 L 187.09766 356.77539 C 172.27866 367.41873 149.40604 379.82506 120.99219 382.63281 C 128.72384 372.77302 140.19194 356.25215 147.2793 337.18555 L 151.85547 324.97461 L 143.02734 315.44141 C 124.40692 295.46065 114.54883 271.88942 114.54883 247.33789 C 114.54883 184.00019 179.30134 132.41602 258.87305 132.41602 z " />
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB