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:
commit
07295ad62d
13 changed files with 60 additions and 3 deletions
|
|
@ -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"`);
|
||||
}
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ export class MiMeta {
|
|||
})
|
||||
public description: string | null;
|
||||
|
||||
@Column('text', {
|
||||
nullable: true,
|
||||
})
|
||||
public about: string | null;
|
||||
|
||||
/**
|
||||
* メンテナの名前
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue