merge: Split descriptions. (!1167)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1167

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Hazelnoot 2025-07-27 15:29:41 +00:00
commit 07295ad62d
13 changed files with 60 additions and 3 deletions

8
locales/index.d.ts vendored
View file

@ -6413,6 +6413,14 @@ export interface Locale extends ILocale {
* E.g. In the sidebar, to visitors and in the "About" page.
*/
"sidebarLogoUsageExample": string;
/**
* About instance
*/
"aboutInstance": string;
/**
* A longer description that will be displayed in the 'Instance Information' page, going in place of the regular instance description. Supports HTML.
*/
"aboutInstanceDescription": string;
};
"_accountMigration": {
/**

View file

@ -0,0 +1,11 @@
export class SplitDescriptions1752607599852 {
name = 'SplitDescriptions1752607599852'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD COLUMN "about" TEXT`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "about"`);
}
}

View file

@ -75,6 +75,7 @@ export class MetaEntityService {
shortName: instance.shortName,
uri: this.config.url,
description: instance.description,
about: instance.about,
langs: instance.langs,
tosUrl: instance.termsOfServiceUrl,
repositoryUrl: instance.repositoryUrl,

View file

@ -43,6 +43,11 @@ export class MiMeta {
})
public description: string | null;
@Column('text', {
nullable: true,
})
public about: string | null;
/**
*
*/

View file

@ -43,6 +43,10 @@ export const packedMetaLiteSchema = {
type: 'string',
optional: false, nullable: true,
},
about: {
type: 'string',
optional: false, nullable: true,
},
langs: {
type: 'array',
optional: false, nullable: false,

View file

@ -664,6 +664,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
shortName: instance.shortName,
uri: this.config.url,
description: instance.description,
about: instance.about,
langs: instance.langs,
tosUrl: instance.termsOfServiceUrl,
repositoryUrl: instance.repositoryUrl,

View file

@ -67,6 +67,7 @@ export const paramDef = {
name: { type: 'string', nullable: true },
shortName: { type: 'string', nullable: true },
description: { type: 'string', nullable: true },
about: { type: 'string', nullable: true },
defaultLightTheme: { type: 'string', nullable: true },
defaultDarkTheme: { type: 'string', nullable: true },
defaultLike: { type: 'string' },
@ -340,6 +341,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.description = ps.description;
}
if (ps.about !== undefined) {
set.about = ps.about;
}
if (ps.defaultLightTheme !== undefined) {
set.defaultLightTheme = ps.defaultLightTheme;
}

View file

@ -41,7 +41,8 @@ export class ApiInstanceMastodon {
const response: MastodonEntity.Instance = {
uri: this.config.host,
title: this.meta.name || 'Sharkey',
description: this.meta.description || 'This is a vanilla Sharkey Instance. It doesn\'t seem to have a description.',
shortDescription: this.meta.description || 'This is a vanilla Sharkey Instance. It doesn\'t seem to have a description.',
description: this.meta.about || 'This is a vanilla Sharkey Instance.',
email: instance.email || '',
version: `3.0.0 (compatible; Sharkey ${this.config.version}; like Akkoma)`,
urls: instance.urls,

View file

@ -18,6 +18,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-html="sanitizeHtml(instance.description) || i18n.ts.headlineMisskey"></div>
</div>
<div v-if="instance.about && instance.description !== instance.about" :class=$style.showMore>
<p><a href="/about">{{ i18n.ts.showMore }}</a></p>
</div>
<div v-if="instance.disableRegistration || instance.federation !== 'all'" :class="$style.mainWarn" class="_gaps_s">
<MkInfo v-if="instance.disableRegistration" warn>{{ i18n.ts.invitationRequiredToRegister }}</MkInfo>
<MkInfo v-if="instance.federation === 'specified'" warn>{{ i18n.ts.federationSpecified }}</MkInfo>
@ -216,4 +219,9 @@ function showMenu(ev: MouseEvent) {
height: 350px;
overflow: auto;
}
.showMore {
font-size: 0.8m;
color: var(--MI_THEME-accent);
}
</style>

View file

@ -15,8 +15,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<MkKeyValue>
<template #key>{{ i18n.ts.description }}</template>
<template #value><div v-html="sanitizeHtml(instance.description)"></div></template>
<template #key>{{ i18n.ts.about }}</template>
<template #value><div v-html="sanitizeHtml(instance.about || instance.description)"></div></template>
</MkKeyValue>
<FormSection>

View file

@ -28,6 +28,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.instanceDescription }}<span v-if="infoForm.modifiedStates.description" class="_modified">{{ i18n.ts.modified }}</span></template>
</MkTextarea>
<MkTextarea v-model="infoForm.state.about">
<template #label>{{ i18n.ts._serverSettings.aboutInstance }}<span v-if="infoForm.modifiedStates.about" class="_modified">{{ i18n.ts.modified }}</span></template>
<template #caption>{{ i18n.ts._serverSettings.aboutInstanceDescription }}</template>
</MkTextarea>
<FormSplit :minWidth="300">
<MkInput v-model="infoForm.state.maintainerName">
<template #label>{{ i18n.ts.maintainerName }}<span v-if="infoForm.modifiedStates.maintainerName" class="_modified">{{ i18n.ts.modified }}</span></template>
@ -343,6 +349,7 @@ const infoForm = useForm({
name: meta.name ?? '',
shortName: meta.shortName ?? '',
description: meta.description ?? '',
about: meta.about ?? '',
maintainerName: meta.maintainerName ?? '',
maintainerEmail: meta.maintainerEmail ?? '',
tosUrl: meta.tosUrl ?? '',
@ -356,6 +363,7 @@ const infoForm = useForm({
name: state.name,
shortName: state.shortName === '' ? null : state.shortName,
description: state.description,
about: state.about,
maintainerName: state.maintainerName,
maintainerEmail: state.maintainerEmail,
tosUrl: state.tosUrl,

View file

@ -216,6 +216,8 @@ _serverSettings:
sidebarLogoUsageExample: "E.g. In the sidebar, to visitors and in the \"About\" page."
inquiryUrl: "Contact URL"
inquiryUrlDescription: "Specify the URL of a web page that contains a contact form or the instance operators' contact information."
aboutInstance: "About instance"
aboutInstanceDescription: "A longer description that will be displayed in the 'Instance Information' page, going in place of the regular instance description. Supports HTML."
_accountMigration:
moveAccountDescription: "This will migrate your account to a different one.\n ・Followers from this account will automatically be migrated to the new account\n ・This account will unfollow all users it is currently following\n ・You will be unable to create new notes etc. on this account\n\nWhile migration of followers is automatic, you must manually prepare some steps to migrate the list of users you are following. To do so, carry out a follows export that you will later import on the new account in the settings menu. The same procedure applies to your lists as well as your muted and blocked users.\n\n(This explanation applies to Sharkey v13.12.0 and later. Other ActivityPub software, such as Mastodon, might function differently.)"
_achievements:

View file

@ -10,3 +10,6 @@ blockingYou: "Bloqueando você"
attributionDomains: "Domínios de Atribuição"
attributionDomainsDescription: "Uma lista de domínios cujo conteúdo pode ser atribuído a você em prévias de link, separadas por linha. Qualquer subdomínio também será válido. O código seguinte precisa estar presente na página:"
writtenBy: "Escrito por {user}"
_serverSettings:
aboutInstance: "Sobre a instância"
aboutInstanceDescription: "Uma descrição maior que irá aparecer na página 'Informações da Instância', substituindo a descrição da instância. Aceita HTML."