Merge branch 'main' into main

This commit is contained in:
Xylight authored and GitHub committed 2024-07-11 15:46:43 -07:00
commit e0c9c07e84
138 files changed
+17608 -2197

No files matched your search

-24
View File
@@ -1,24 +0,0 @@
name: Node.js CI
on:
pull_request:
branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm test
+2 -1
View File
@@ -13,6 +13,7 @@ A better, more intuitive way to use Lemmy, with a cleaner UI, more features, and
![image](https://github.com/Xyphyn/photon/assets/80978739/e36468f6-03c5-4267-94e8-3bba60b6ccb2)
Photon's design philosophy is easy: all features must be intuitive and simple. If a feature can't be easily slipped in while making sense, it will not be added.
## Self-hosting
@@ -135,7 +136,7 @@ Want your instance added here? Make a GitHub issue or make a PR! (this is for ge
| [phtn.app (Official)](https://phtn.app) | 🇺🇸 US West | [photon@xylight.dev](mailto:photon@xylight.dev) |
| [ph.opnxng.com](https://ph.opnxng.com) | 🇸🇬 Singapore | [about.opnxng.com](https://about.opnxng.com) |
| [photon.thesanewriter.com](https://photon.thesanewriter.com) | 🇺🇸 US East | [thesanewriter@lemmy.thesanewriter.com](mailto:thesanewriter@lemmy.thesanewriter.com) |
| [p.darrennathanael.com](https://p.darrennathanael.com) | 🇺🇸 US East | [noc@darrennathanael.com](mailto:noc@darrennathanael.com) |
| [p.darrennathanael.com](https://p.darrennathanael.com) | 🇮🇩 ID West | [noc@darrennathanael.com](mailto:noc@darrennathanael.com) |
| [p.lemmy.ohaa.xyz](https://p.lemmy.ohaa.xyz) | 🇦🇹 Austria | (???) |
| [~~photon.zhenyapav.com~~ (Has not updated since v1.9.2)](https://photon.zhenyapav.com) | 🇮🇸 Iceland | [zhenyapav@zhenyapav.com](mailto:zhenyapav@zhenyapav.com) |
| [~~ph.buckodr.ink~~ (Has not updated since v1.21.1)](https://ph.buckodr.ink) | 🇺🇸 US East | [admin@buckodr.ink](mailto:admin@buckodr.ink) |
BIN
View File
Binary file not shown.
+9329
View File
File diff suppressed because it is too large. Load diff
+41 -43
View File
@@ -1,6 +1,46 @@
{
"name": "photon-lemmy",
"version": "1.29.0",
"version": "1.31.0",
"devDependencies": {
"@catdadcode/svelte-adapter-bun": "^0.5.7",
"@dicebear/core": "^8.0.1",
"@dicebear/initials": "^8.0.1",
"@sveltejs/adapter-auto": "^3.2.1",
"@sveltejs/adapter-node": "^2.0.0",
"@sveltejs/adapter-vercel": "^5.1.0",
"@sveltejs/kit": "latest",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@tailwindcss/container-queries": "^0.1.1",
"@tanstack/svelte-virtual": "^3.8.1",
"@types/markdown-it": "^12.2.3",
"@types/markdown-it-container": "^2.0.6",
"@types/nprogress": "^0.2.0",
"@vite-pwa/sveltekit": "^0.3.0",
"autoprefixer": "^10.4.16",
"jsdom": "^22.1.0",
"lemmy-js-client": "latest",
"markdown-it": "^14.1.0",
"markdown-it-container": "^3.0.0",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"mono-svelte": "^1.5.14",
"nprogress": "^0.2.0",
"postcss": "^8.4.30",
"rollup-plugin-visualizer": "^5.9.2",
"svelte": "latest",
"svelte-check": "^3.0.1",
"svelte-hero-icons": "^5.0.0",
"svelte-infinite-scroll": "^2.0.1",
"sveltekit-i18n": "^2.4.2",
"tailwindcss": "^3.3.3",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.0",
"vite-plugin-pwa": "^0.18.0",
"vitest": "^1.0.0",
"workbox-window": "^7.0.0",
"svelte-qrcode": "^1.0.0"
},
"private": true,
"scripts": {
"dev": "vite dev",
@@ -12,47 +52,5 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@catdadcode/svelte-adapter-bun": "^0.5.7",
"@sveltejs/adapter-node": "^2.0.0",
"@sveltejs/adapter-vercel": "^5.1.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/markdown-it": "^12.2.3",
"@types/markdown-it-container": "^2.0.6",
"@types/nprogress": "^0.2.0",
"@vite-pwa/sveltekit": "^0.3.0",
"autoprefixer": "^10.4.16",
"jsdom": "^22.1.0",
"lemmy-js-client": "^0.19.0-rc.13",
"markdown-it-container": "^3.0.0",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"nprogress": "^0.2.0",
"postcss": "^8.4.30",
"rollup-plugin-visualizer": "^5.9.2",
"svelte": "^4.2.0",
"svelte-check": "^3.0.1",
"svelte-hero-icons": "^5.0.0",
"svelte-tiny-virtual-list": "^2.0.5",
"tailwindcss": "^3.3.3",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.0",
"vite-plugin-pwa": "^0.18.0",
"vitest": "^1.0.0",
"workbox-window": "^7.0.0"
},
"dependencies": {
"@dicebear/core": "^6.0.4",
"@dicebear/initials": "^6.0.4",
"markdown-it": "^13.0.1",
"mono-svelte": "latest",
"svelte-qrcode": "^1.0.0"
},
"overrides": {
"@rollup/plugin-node-resolve": "^15.2.3",
"@sveltejs/kit": "^2.0.0"
},
"type": "module"
}
-95
View File
@@ -1,95 +0,0 @@
function buildUrl(inputUrl: URL): URL {
let withoutCors = inputUrl.pathname.replace('/cors/', '')
if (
!(withoutCors.startsWith('https://') || withoutCors.startsWith('http://'))
) {
withoutCors = 'https://' + withoutCors
}
return new URL(`${withoutCors}?${inputUrl.searchParams.toString()}`)
}
export async function handle({ event, resolve }) {
// annoying hack to fix lemmy's CORS
if (event.url.pathname.startsWith('/cors')) {
event.request.headers.delete('origin')
event.request.headers.delete('host')
try {
const url = buildUrl(event.url)
let headers: Headers = event.request.headers
headers.delete('origin')
headers.delete('host')
if (
event.request.method == 'POST' &&
url.pathname == '/pictrs/image' &&
url.searchParams.get('auth')
) {
headers.set('cookie', `jwt=${url.searchParams.get('auth')}`)
} else {
return new Response(
JSON.stringify({
message: 'Only CORS allowed is through /pictrs/image',
}),
{
status: 500,
}
)
}
const data = await fetch(url, {
method: event.request.method,
headers: headers,
body: event.request.body,
// @ts-ignore this works, idk why typescript complains
duplex: 'half',
signal: AbortSignal.timeout(20 * 1000),
}).catch((_) => undefined)
if (!data) {
return new Response(
JSON.stringify({
message: 'proxy failed to fetch',
}),
{
status: 500,
}
)
}
if (!data.ok) {
return new Response(
JSON.stringify({
message: await data.text(),
}),
{
status: data.status,
}
)
}
const json = await data.json()
return new Response(JSON.stringify(json), {
status: data.status,
})
} catch (error) {
console.log(error)
return new Response(
JSON.stringify({
message: 'the proxy failed to fetch from server',
}),
{
status: 500,
}
)
}
}
const response = await resolve(event)
return response
}
+135 -146
View File
@@ -4,15 +4,17 @@ import {
} from '$lib/components/lemmy/moderation/moderation.js'
import { toast } from 'mono-svelte'
import { DEFAULT_INSTANCE_URL, instance } from '$lib/instance.js'
import { client, getClient, site } from '$lib/lemmy.js'
import { client, getClient } from '$lib/lemmy.js'
import { site } from './lemmy'
import { userSettings } from '$lib/settings.js'
import { instanceToURL, moveItem } from '$lib/util.js'
import {
LemmyHttp,
type GetSiteResponse,
type MyUserInfo,
type Community,
} from 'lemmy-js-client'
import { get, writable } from 'svelte/store'
import { derived, get, writable, type Writable } from 'svelte/store'
import { MINIMUM_VERSION, versionIsSupported } from '$lib/version.js'
import { browser } from '$app/environment'
import { env } from '$env/dynamic/public'
@@ -43,7 +45,7 @@ export interface Profile {
user?: PersonData
username?: string
avatar?: string
favorites?: ResumableItem[]
favorites?: Community[]
color?: string
}
@@ -56,12 +58,12 @@ interface ProfileData {
defaultInstance?: string
}
interface PersonData extends MyUserInfo {
notifications: {
inbox: number
reports: number
applications: number
}
interface PersonData extends MyUserInfo {}
interface Notifications {
inbox: number
reports: number
applications: number
}
const getCookie = (key: string): string | undefined => {
@@ -69,83 +71,139 @@ const getCookie = (key: string): string | undefined => {
// sorry i was dying when i wrote this line
// ask chatgpt or something to explain this for you
return document?.cookie?.split(';').map(c => c.trim()).find(c => c.split('=')?.[0] == key)?.split('=')?.[1]
return document?.cookie
?.split(';')
.map((c) => c.trim())
.find((c) => c.split('=')?.[0] == key)
?.split('=')?.[1]
}
export let profileData = writable<ProfileData>(
getFromStorage<ProfileData>('profileData') ?? { profiles: [], profile: -1 }
getFromStorage<ProfileData>('profileData') ?? {
profiles: [
{
id: 1,
instance: DEFAULT_INSTANCE_URL,
username: 'Guest',
color: '#505050',
},
],
profile: 1,
}
)
// stupid hack to get dev server working
// why does this always happen to me
let fetchingUser = false
let initialInstance = get(profileData).defaultInstance
export let profile = derived<Writable<ProfileData>, Profile>(
profileData,
(pd) => {
const profile =
pd.profiles.find((p) => p.id == pd.profile) ?? getDefaultProfile()
if (profile?.jwt) {
if (!profile.user && !fetchingUser) {
site.set(undefined)
fetchingUser = true
notifications.set({ applications: 0, inbox: 0, reports: 0 })
userFromJwt(profile.jwt, profile.instance)
.then((res) => {
if (!res?.user)
toast({
content: 'Your login has expired. Re-login to fix this issue.',
type: 'warning',
})
site.set(res?.site)
profile.user = res?.user
profile.avatar = res?.user.local_user_view.person.avatar
checkInbox()
fetchingUser = false
})
.catch((e) => {
fetchingUser = false
toast({ content: e, type: 'error' })
})
}
} else {
if (browser) {
site.set(undefined)
client({ instanceURL: profile.instance })
.getSite()
.then((res) => site.set(res))
}
}
instance.set(profile.instance)
return profile
}
)
export let notifications = writable<Notifications>({
applications: 0,
inbox: 0,
reports: 0,
})
profileData.subscribe(async (pd) => {
setFromStorage('profileData', pd)
const serialized: ProfileData = {
...pd,
profiles: pd.profiles.map((p) => serializeUser(p)),
}
if (pd.profile == -1 && initialInstance != pd.defaultInstance) {
initialInstance = get(profileData).defaultInstance ?? DEFAULT_INSTANCE_URL
setFromStorage('profileData', serialized)
if (serialized.profile == -1) {
instance?.set(get(profileData).defaultInstance ?? DEFAULT_INSTANCE_URL)
}
if (serialized.profiles.length == 0) {
profileData.update((pd) => ({
...pd,
profiles: [
{
id: 1,
instance: DEFAULT_INSTANCE_URL,
username: 'Guest',
},
],
profile: 1,
}))
}
})
if (env.PUBLIC_MIGRATE_COOKIE && get(profileData).profiles.length == 0 && env.PUBLIC_INSTANCE_URL) {
if (
env.PUBLIC_MIGRATE_COOKIE &&
get(profileData).profiles.length == 0 &&
env.PUBLIC_INSTANCE_URL
) {
const jwt = getCookie('jwt')
if (jwt) {
new Promise(async () => {
const user = await userFromJwt(jwt, env.PUBLIC_INSTANCE_URL ?? '')
if (!user) return
const user = await userFromJwt(jwt, env.PUBLIC_INSTANCE_URL ?? '')
if (!user) return
const result = await setUser(jwt, env.PUBLIC_INSTANCE_URL ?? '', user?.user.local_user_view.person.name)
if (result)
toast({ content: 'Your instance migrated to Photon, and you were logged in using a leftover cookie.', type: 'success' })
const result = await setUser(
jwt,
env.PUBLIC_INSTANCE_URL ?? '',
user?.user.local_user_view.person.name
)
if (result)
toast({
content:
'Your instance migrated to Photon, and you were logged in using a leftover cookie.',
type: 'success',
})
})
}
}
export let profile = writable<Profile | undefined>(getProfile())
profile.subscribe(async (p) => {
if (p?.id == -1) {
instance?.set(get(profileData).defaultInstance ?? DEFAULT_INSTANCE_URL)
}
if (!p || !p.jwt) {
profileData.update((pd) => ({ ...pd, profile: -1 }))
return
}
if (p.user) return
instance.set(p.instance)
// fetch the user because p.user is undefined
const user = await userFromJwt(p.jwt, p.instance)
.then((user) => {
if (!user?.user)
toast({
content: 'Your login has expired. Re-login to fix this issue.',
type: 'warning',
})
site.set(user?.site)
return user
})
.catch((err) => {
toast({ content: err as any, type: 'error' })
})
if (!user?.user) return
profile.update(() => ({
...p,
user: user!.user,
username: user?.user.local_user_view.person.name,
avatar: user?.user.local_user_view.person.avatar,
}))
})
export async function setUser(jwt: string, inst: string, username: string) {
try {
new URL(instanceToURL(inst))
@@ -181,11 +239,6 @@ export async function setUser(jwt: string, inst: string, username: string) {
avatar: user.user.local_user_view.person.avatar,
}
profile.set({
...newProfile,
user: user!.user,
})
return {
profile: id,
profiles: [newProfile, ...pd.profiles],
@@ -225,32 +278,12 @@ async function userFromJwt(
if (!myUser) return undefined
return {
user: {
notifications: {
applications: 0,
inbox: 0,
reports: 0,
},
...myUser,
},
user: myUser,
site: site,
}
}
function getProfile() {
const id = get(profileData).profile
if (id == -1) {
return getDefaultProfile()
}
const pd = get(profileData)
return pd.profiles.find((p) => p.id == id)
}
export function resetProfile() {
profile.set(getDefaultProfile())
profileData.update((p) => ({ ...p, profile: -1 }))
}
@@ -272,10 +305,12 @@ export function deleteProfile(id: number) {
}
}
const serializeUser = (user: Profile): Profile => ({
...user,
user: undefined,
})
function serializeUser(user: Profile): Profile {
return {
...user,
user: undefined,
}
}
instance.subscribe(async (i) => {
try {
@@ -288,35 +323,8 @@ instance.subscribe(async (i) => {
})
export async function setUserID(id: number) {
const pd = get(profileData)
if (id == -1) {
resetProfile()
instance.set(DEFAULT_INSTANCE_URL)
return
}
let prof = pd.profiles.find((p) => p.id == id)
if (!prof) return profile.update(() => getDefaultProfile())
prof = serializeUser(prof)
profileData.update((p) => ({ ...p, profile: id }))
if (prof?.jwt) {
const user = await userFromJwt(prof.jwt, prof.instance)
.then((u) => u)
.catch((err) => {
toast({ content: err as any, type: 'error' })
})
instance.set(prof.instance)
prof.user = user?.user
prof.avatar = user?.user.local_user_view.person.avatar
site.set(user?.site)
}
profile.update(() => prof ?? getDefaultProfile())
return prof
return get(profile)
}
export function moveProfile(id: number, up: boolean) {
@@ -333,11 +341,7 @@ export function moveProfile(id: number, up: boolean) {
}
}
const getNotificationCount = async (
jwt: string,
mod: boolean,
admin: boolean
) => {
async function getNotificationCount(jwt: string, mod: boolean, admin: boolean) {
const unreads = await getClient().getUnreadCount()
let reports: number = 0
@@ -383,29 +387,14 @@ async function checkInbox() {
const notifs = await getNotificationCount(
jwt,
amModOfAny(user) ?? false,
isAdmin(user)
user ? isAdmin(user) : false
)
user.notifications = {
notifications.set({
inbox: notifs.unreads,
applications: notifs.applications,
reports: notifs.reports,
}
profile.update((p) => ({
...p!,
user: user,
}))
})
}
setInterval(checkInbox, 4 * 60 * 1000)
let prevId: number | undefined = -2
profile.subscribe((p) => {
if (p?.id == prevId || !p?.user) return
prevId = p?.id
if (p.id != -1) checkInbox()
})
+1 -1
View File
@@ -27,7 +27,7 @@
last:rounded-r-lg last:border-r last:dark:border-r-transparent
rounded-l-none
rounded-r-none
px-3 py-1.5 text-sm hover:brightness-110
px-3 py-1.5 text-sm hover:brightness-110 ${$$props.buttonClass || ''}
${
!selected
? `hover:dark:bg-zinc-800 border-slate-100 border-t border-b border-b-slate-300 dark:border-b-0
@@ -67,11 +67,13 @@
{:else if type == 'instance'}
<Search
search={async (q) => {
const results = await instances || {}
const results = (await instances) || {}
return q ? (results.federated_instances?.linked || []).filter(
(i) => i.software === 'lemmy' && i.domain.includes(q)
) : []
return q
? (results.federated_instances?.linked || []).filter(
(i) => i.software === 'lemmy' && i.domain.includes(q)
)
: []
}}
extractName={(i) => `${i.domain}`}
on:select
+45 -55
View File
@@ -2,26 +2,23 @@
import Markdown from '$lib/components/markdown/Markdown.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
import StickyCard from '$lib/components/ui/StickyCard.svelte'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import { getClient } from '$lib/lemmy.js'
import type { PersonView, SiteView, Tagline } from 'lemmy-js-client'
import { Button, Disclosure, Popover } from 'mono-svelte'
import { Button } from 'mono-svelte'
import {
BuildingOffice,
Calendar,
ChartBar,
ChatBubbleOvalLeftEllipsis,
Icon,
InformationCircle,
Newspaper,
PencilSquare,
ServerStack,
UserGroup,
} from 'svelte-hero-icons'
import Expandable from '../ui/Expandable.svelte'
import LabelStat from '../ui/LabelStat.svelte'
import ItemList from './generic/ItemList.svelte'
import { userLink } from '$lib/lemmy/generic'
import { t } from '$lib/translations'
import Entity from '../ui/Entity.svelte'
export let site: SiteView
export let taglines: Tagline[] | undefined = undefined
@@ -30,32 +27,35 @@
</script>
<StickyCard class="w-full {$$props.class} text-slate-600 dark:text-zinc-400">
<div class="flex flex-row gap-3 items-center">
{#if site.site.icon}
<Avatar
width={32}
url={site.site.icon}
alt={site.site.name}
circle={false}
/>
{/if}
<div class="flex flex-col">
<h1 class="font-bold text-base">{site.site.name}</h1>
<span class="text-sm opacity-60">
{new URL(site.site.actor_id).hostname}
</span>
</div>
</div>
<Entity name={site.site.name} label={new URL(site.site.actor_id).hostname}>
<Avatar
width={32}
url={site.site.icon}
alt={site.site.name}
circle={false}
slot="icon"
/>
</Entity>
<div class="flex flex-row gap-1 !border-0">
<Button href="/modlog" title="Modlog" color="ghost" size="square-md">
<Button
href="/modlog"
title={$t('routes.modlog')}
color="ghost"
size="square-md"
>
<Icon src={Newspaper} size="16" mini />
</Button>
<Button href="/legal" title="Legal" color="ghost" size="square-md">
<Button
href="/legal"
title={$t('routes.legal.title')}
color="ghost"
size="square-md"
>
<Icon src={BuildingOffice} size="16" mini />
</Button>
<Button
href="/instances"
title="Instances"
title={$t('routes.instances')}
class="3xl:rounded-l-none"
color="ghost"
size="square-md"
@@ -76,7 +76,8 @@
<Expandable>
<svelte:fragment slot="title">
<Icon src={InformationCircle} size="15" mini /> About
<Icon src={InformationCircle} size="15" mini />
{$t('cards.site.about')}
</svelte:fragment>
<Markdown source={site.site.description} />
<div class="my-4" />
@@ -85,21 +86,22 @@
<Expandable>
<svelte:fragment slot="title">
<Icon src={ChartBar} size="15" mini /> Stats
<Icon src={ChartBar} size="15" mini />
{$t('cards.site.stats')}
</svelte:fragment>
<div class="flex flex-row gap-4 flex-wrap">
<LabelStat
label="Users"
label={$t('content.users')}
content={site.counts.users.toString()}
formatted
/>
<LabelStat
label="Posts"
label={$t('content.posts')}
content={site.counts.posts.toString()}
formatted
/>
<LabelStat
label="Communities"
label={$t('content.communities')}
content={site.counts.communities.toString()}
formatted
/>
@@ -109,30 +111,18 @@
{#if admins}
<Expandable>
<svelte:fragment slot="title">
<Icon src={UserGroup} size="15" mini /> Admins
<Icon src={UserGroup} size="15" mini />
{$t('cards.site.admins')}
</svelte:fragment>
<div
class="flex items-center flex-wrap group transition-all
cursor-pointer"
>
{#each admins as admin}
<Popover openOnHover placement="top">
<a
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all -mx-0.5 group-hover:mx-0.5"
href="/u/{admin.person.name}@{new URL(admin.person.actor_id)
.hostname}"
slot="target"
>
<Avatar
width={28}
url={admin.person.avatar}
alt={admin.person.name}
/>
</a>
<span class="font-bold">{admin.person.name}</span>
</Popover>
{/each}
</div>
<ItemList
items={admins.map((a) => ({
id: a.person.id,
name: a.person.name,
url: userLink(a.person),
avatar: a.person.avatar,
instance: new URL(a.person.actor_id).hostname,
}))}
/>
</Expandable>
{/if}
+17 -10
View File
@@ -22,6 +22,9 @@
import ShieldIcon from '../moderation/ShieldIcon.svelte'
import { page } from '$app/stores'
import { onMount } from 'svelte'
import { t } from '$lib/translations'
import { slide } from 'svelte/transition'
import { expoOut } from 'svelte/easing'
export let node: CommentNodeI
export let postId: number
@@ -50,11 +53,6 @@
node.comment_view.comment.content = newComment
editing = false
toast({
content: 'Successfully edited comment.',
type: 'success',
})
} catch (err) {
toast({
// @ts-ignore i hate this
@@ -104,7 +102,9 @@
{/if}
<li
class="py-3 {highlight} {$$props.class}"
class="py-3 relative {node.comment_view.comment.distinguished
? ' text-primary-900 dark:text-primary-100'
: ''} {highlight} {$$props.class}"
id="#{node.comment_view.comment.id.toString()}"
>
<Disclosure bind:open class="flex flex-col">
@@ -145,7 +145,7 @@
src={Trash}
solid
size="12"
title="Deleted"
title={$t('post.badges.deleted')}
class="text-red-600 dark:text-red-500"
/>
{/if}
@@ -154,7 +154,7 @@
src={Bookmark}
solid
size="12"
title="Saved"
title={$t('post.badges.saved')}
class="text-yellow-600 dark:text-yellow-500"
/>
{/if}
@@ -162,8 +162,14 @@
</div>
<div
class="flex flex-col whitespace-pre-wrap
max-w-full gap-1 mt-1"
max-w-full gap-1 mt-1 relative"
>
{#if node.comment_view.comment.distinguished}
<div
class="-z-10 bg-slate-100 dark:bg-zinc-900 absolute -top-9 -bottom-1.5
-inset-x-6 -right-6"
/>
{/if}
<div class="max-w-full mt-0.5 break-words text-sm">
<Markdown source={node.comment_view.comment.content} />
</div>
@@ -180,8 +186,9 @@
{#if replying}
<div
class="max-w-full my-2 border-l border-slate-200 dark:border-zinc-800 pl-4"
transition:slide={{ axis: 'y', duration: 400, easing: expoOut }}
>
<h1 class="font-bold text-sm mb-2">Reply</h1>
<h1 class="font-bold text-sm mb-2">{$t('comment.reply')}</h1>
<CommentForm
{postId}
parentId={node.comment_view.comment.id}
@@ -8,6 +8,7 @@
EllipsisHorizontal,
Flag,
Icon,
Language,
PencilSquare,
Square2Stack,
Trash,
@@ -23,6 +24,10 @@
import { profile } from '$lib/auth.js'
import { deleteItem, save } from '$lib/lemmy/contentview.js'
import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte'
import { t } from '$lib/translations'
import Translation from '$lib/components/translate/Translation.svelte'
import { text } from '$lib/components/translate/translation'
import { userSettings } from '$lib/settings'
export let comment: CommentView
export let replying: boolean = false
@@ -30,9 +35,14 @@
const dispatcher = createEventDispatcher<{ edit: CommentView }>()
let reply = ''
let translating = false
</script>
<div class="flex flex-row items-center gap-0.5 h-7 relative">
{#if translating}
<Translation bind:open={translating} />
{/if}
<div class="flex flex-row items-center gap-0.5 h-7">
<CommentVote
bind:upvotes={comment.counts.upvotes}
bind:downvotes={comment.counts.downvotes}
@@ -47,7 +57,7 @@
disabled={comment.post.locked}
>
<Icon src={ArrowUturnLeft} width={14} height={14} mini />
<span class="text-xs">Reply</span>
<span class="text-xs">{$t('comment.reply')}</span>
</Button>
{#if $profile?.user && (amMod($profile?.user, comment.community) || isAdmin($profile.user))}
<CommentModerationMenu bind:item={comment} />
@@ -56,7 +66,7 @@
<Button
slot="target"
class="!p-1 text-slate-600 dark:text-zinc-400"
aria-label="Comment actions"
title={$t('comment.actions.label')}
color="tertiary"
>
<Icon
@@ -67,7 +77,7 @@
slot="prefix"
/>
</Button>
<MenuDivider>Actions</MenuDivider>
<MenuDivider>{$t('comment.actions.label')}</MenuDivider>
<MenuButton
on:click={() => {
navigator.share?.({
@@ -76,13 +86,25 @@
}}
>
<Icon src={Square2Stack} mini size="16" />
<divv>Copy Link</divv>
<div>{$t('comment.actions.link')}</div>
</MenuButton>
{#if $userSettings.translator}
<MenuButton
on:click={() => {
// @ts-ignore
text.set(comment.comment.content)
translating = !translating
}}
>
<Icon src={Language} size="16" mini slot="prefix" />
{$t('post.actions.more.translate')}
</MenuButton>
{/if}
{#if $profile?.jwt}
{#if comment.creator.id == $profile.user?.local_user_view.person.id}
<MenuButton on:click={() => dispatcher('edit', comment)}>
<Icon src={PencilSquare} mini size="16" />
<span>Edit</span>
<span>{$t('post.actions.more.edit')}</span>
</MenuButton>
{/if}
<MenuButton
@@ -92,7 +114,9 @@
}}
>
<Icon src={comment.saved ? BookmarkSlash : Bookmark} mini size="16" />
<span>{comment.saved ? 'Unsave' : 'Save'}</span>
<span>
{comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
</span>
</MenuButton>
{#if $profile?.user && $profile.jwt && $profile.user.local_user_view.person.id == comment.creator.id}
<MenuButton
@@ -107,13 +131,17 @@
}}
>
<Icon src={Trash} mini size="16" />
<span>{comment.comment.deleted ? 'Restore' : 'Delete'}</span>
<span>
{comment.comment.deleted
? $t('post.actions.more.restore')
: $t('post.actions.more.delete')}
</span>
</MenuButton>
{/if}
{#if $profile.jwt && $profile.user?.local_user_view.person.id != comment.creator.id}
<MenuButton on:click={() => report(comment)} color="danger-subtle">
<Icon src={Flag} mini size="16" />
<span>Report</span>
<span>{$t('moderation.report')}</span>
</MenuButton>
{/if}
{/if}
@@ -8,6 +8,7 @@
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { placeholders } from '$lib/util.js'
import { Button } from 'mono-svelte'
import { t } from '$lib/translations'
export let postId: number
export let parentId: number | undefined = undefined
@@ -40,10 +41,6 @@
dispatch('comment', response)
value = ''
toast({
content: 'Your comment was submitted.',
type: 'success',
})
} catch (err) {
console.error(err)
toast({
@@ -69,7 +66,7 @@
{...$$restProps}
{rows}
placeholder={locked
? 'This post is locked.'
? $t('comment.locked')
: placeholder ?? placeholders.get('comment')}
bind:value
disabled={locked || loading}
@@ -92,7 +89,7 @@
{loading}
disabled={locked || loading}
>
Submit
{$t('form.submit')}
</Button>
</div>
{/if}
@@ -17,6 +17,7 @@
import { shouldShowVoteColor } from '../post/PostVote.svelte'
import { fly } from 'svelte/transition'
import { backOut } from 'svelte/easing'
import { t } from '$lib/translations'
export let vote: number = 0
export let upvotes: number
@@ -25,7 +26,7 @@
const castVote = async (newVote: number) => {
if (!$profile?.jwt) {
toast({ content: 'You must be logged in to vote.', type: 'warning' })
toast({ content: $t('toast.loginVoteGate'), type: 'warning' })
return
}
@@ -18,6 +18,7 @@
import { Button } from 'mono-svelte'
import { afterNavigate } from '$app/navigation'
import { backOut } from 'svelte/easing'
import { t } from '$lib/translations'
export let nodes: CommentNodeI[]
export let isParent: boolean
@@ -62,7 +63,7 @@
if (newComments.comments.length == 0) {
loadingChildren = false
toast({
content: 'The API returned no comments.',
content: $t('toast.noComments'),
type: 'error',
})
return
@@ -81,7 +82,7 @@
parent.children = treeParent.children
if (treeParent.children.length == 0) {
toast({
content: 'The API returned no comments.',
content: $t('toast.noComments'),
type: 'warning',
})
}
@@ -90,7 +91,7 @@
parent.children = tree
if (tree.length == 0) {
toast({
content: 'The API returned no comments.',
content: $t('toast.noComments'),
type: 'warning',
})
}
@@ -99,7 +100,7 @@
} catch (error) {
console.error(error)
toast({
content: `Failed to fetch comments. ${error as any}`,
content: error as any,
type: 'error',
})
}
@@ -109,7 +110,7 @@
<ul
in:fly={{ opacity: 0, y: -4, duration: 400, easing: backOut }}
class={isParent
? 'divide-y dark:divide-zinc-800 divide-slate-100'
? 'divide-y dark:divide-zinc-900 divide-slate-100'
: 'pl-3.5 border-l border-slate-200 dark:border-zinc-800 my-1'}
>
{#each nodes as node (node.comment_view.comment.id)}
@@ -141,7 +142,10 @@
}}
>
<Icon src={ChevronDoubleDown} mini size="16" slot="prefix" />
{node.comment_view.counts.child_count} more
{$t('comment.more', {
// @ts-ignore
comments: node.comment_view.counts.child_count,
})}
</Button>
</svelte:element>
{/if}
@@ -18,7 +18,7 @@
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { client, getClient } from '$lib/lemmy.js'
import { addSubscription } from '$lib/lemmy/user.js'
import { addSubscription, hasFavorite } from '$lib/lemmy/user.js'
import { fullCommunityName } from '$lib/util.js'
import type { CommunityModeratorView, CommunityView } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
@@ -37,6 +37,7 @@
NoSymbol,
PencilSquare,
Plus,
Star,
UserGroup,
} from 'svelte-hero-icons'
import { publishedToDate } from '$lib/components/util/date.js'
@@ -44,6 +45,10 @@
import Expandable from '$lib/components/ui/Expandable.svelte'
import LabelStat from '$lib/components/ui/LabelStat.svelte'
import ShieldIcon from '../moderation/ShieldIcon.svelte'
import ItemList from '../generic/ItemList.svelte'
import { communityLink, userLink } from '$lib/lemmy/generic'
import { t } from '$lib/translations'
import Entity from '$lib/components/ui/Entity.svelte'
export let community_view: CommunityView
export let moderators: CommunityModeratorView[] = []
@@ -81,7 +86,7 @@
try {
const loading = toast({
content: `${blocked ? 'Unblocking' : 'blocking'} community...`,
content: ``,
loading: true,
})
@@ -93,9 +98,9 @@
removeToast(loading)
toast({
content: `Successfully ${
blocked ? 'unblocked' : 'blocked'
} that community.`,
content: blocked
? $t('toast.unblockedCommunity')
: $t('toast.blockedCommunity'),
type: 'success',
})
} catch (error) {
@@ -117,14 +122,14 @@
async function purgeCommunity() {
purgingCommunity = false
const purgeToast = toast({ content: 'Purging community...', loading: true })
const purgeToast = toast({ content: '', loading: true })
try {
await client().purgeCommunity({
community_id: community_view.community.id,
})
removeToast(purgeToast)
toast({ content: 'Purged that community.', type: 'success' })
toast({ content: $t('toast.purgedCommunity'), type: 'success' })
} catch (e) {
toast({ content: e as any, type: 'error' })
}
@@ -134,7 +139,7 @@
if (!$profile?.jwt) return
try {
const loading = toast({
content: `Blocking instance...`,
content: ``,
loading: true,
})
@@ -157,14 +162,12 @@
{#if purgingCommunity}
<Modal bind:open={purgingCommunity}>
<svelte:fragment slot="title">Purging Community</svelte:fragment>
<svelte:fragment slot="title">
{$t('admin.purgeCommunity.title')}
</svelte:fragment>
<CommunityLink avatar community={community_view.community} />
<p>
Purging community <span class="font-bold">
{community_view.community.title}
</span>
</p>
<p>
Are you sure you want to do this? (The button will enable in 3 seconds.)
{$t('admin.purgeCommunity.warning')}
</p>
<div class="flex flex-row gap-2">
<Button
@@ -172,7 +175,7 @@
on:click={() => (purgingCommunity = false)}
class="flex-1"
>
Cancel
{$t('common.cancel')}
</Button>
<Button
size="lg"
@@ -181,64 +184,55 @@
disabled={!purgeEnabled}
class="flex-1"
>
Purge
{$t('admin.purge')}
</Button>
</div>
</Modal>
{/if}
<StickyCard class="min-w-full pt-0 {$$props.class}">
<div class="flex flex-row gap-3 items-center">
<CommunityLink
name={false}
avatar
avatarSize={32}
community={community_view.community}
<StickyCard
class="min-w-full pt-0 text-slate-600 dark:text-zinc-400 {$$props.class}"
>
<Entity
name={community_view.community.title}
label="!{fullCommunityName(
community_view.community.name,
community_view.community.actor_id
)}"
>
<Avatar
width={32}
url={community_view.community.icon}
alt={community_view.community.name}
circle={false}
slot="icon"
/>
<div class="flex flex-col gap-0">
<h1 class="font-bold text-lg">
<a
href="/c/{fullCommunityName(
community_view.community.name,
community_view.community.actor_id
)}"
>
{community_view.community.title}
</a>
</h1>
<span
class="dark:text-zinc-400 text-slate-600 text-sm break-words max-w-full"
style="word-break: break-all;"
>
!{community_view.community.name}@{new URL(
community_view.community.actor_id
).hostname}
</span>
</div>
</div>
</Entity>
<div
class="flex flex-col divide-y divide-slate-200 dark:divide-zinc-800 [&>*]:py-3"
>
<Expandable class="!pt-0">
<svelte:fragment slot="title">
<Icon src={InformationCircle} size="15" mini /> About
<Icon src={InformationCircle} size="15" mini />
{$t('cards.site.about')}
</svelte:fragment>
<Markdown source={community_view.community.description} />
</Expandable>
<Expandable>
<svelte:fragment slot="title">
<Icon src={ChartBar} size="15" mini /> Stats
<Icon src={ChartBar} size="15" mini />
{$t('cards.site.stats')}
</svelte:fragment>
<div class="flex flex-row gap-4 flex-wrap">
<LabelStat
label="Members"
label={$t('cards.community.members')}
content={community_view.counts.subscribers.toString()}
formatted
/>
<LabelStat
label="Posts"
label={$t('content.posts')}
content={community_view.counts.posts.toString()}
formatted
/>
@@ -248,36 +242,23 @@
{#if moderators && moderators.length > 0}
<Expandable>
<svelte:fragment slot="title">
<ShieldIcon width={15} filled /> Moderators
<ShieldIcon width={15} filled />
{$t('cards.community.moderators')}
</svelte:fragment>
<div
class="flex items-center -space-x-1 flex-wrap hover:space-x-1 transition-all
cursor-pointer"
>
{#each moderators as moderator}
<Popover openOnHover placement="top-start" class="transition-all">
<a
class="block ring rounded-full ring-slate-50 dark:ring-zinc-950 transition-all"
href="/u/{moderator.moderator.name}@{new URL(
moderator.moderator.actor_id
).hostname}"
slot="target"
>
<Avatar
width={28}
url={moderator.moderator.avatar}
alt={moderator.moderator.name}
/>
</a>
<span class="font-bold">{moderator.moderator.name}</span>
</Popover>
{/each}
</div>
<ItemList
items={moderators.map((m) => ({
id: m.moderator.id,
name: m.moderator.name,
url: userLink(m.moderator),
avatar: m.moderator.avatar,
instance: new URL(m.moderator.actor_id).hostname,
}))}
/>
</Expandable>
{/if}
</div>
<div
class="flex flex-row items-center gap-2 sticky bottom-0 drop-shadow-xl w-full"
class="flex flex-row items-center gap-1 sticky bottom-0 drop-shadow-xl w-full"
>
{#if $profile?.jwt}
<Button
@@ -298,8 +279,8 @@
/>
{community_view.subscribed == 'Subscribed' ||
community_view.subscribed == 'Pending'
? 'Subscribed'
: 'Subscribe'}
? $t('cards.community.subscribed')
: $t('cards.community.subscribe')}
</Button>
{/if}
{#if $profile?.user && amMod($profile.user, community_view.community)}
@@ -319,17 +300,19 @@
</Button>
<MenuButton href="/modlog?community={community_view.community.id}">
<Icon src={Newspaper} size="16" mini />
Modlog
{$t('cards.community.modlog')}
</MenuButton>
{#if $profile?.jwt}
<MenuButton color="danger-subtle" size="lg" on:click={block}>
<Icon src={NoSymbol} size="16" mini slot="prefix" />
{community_view.blocked ? 'Unblock' : 'Block'}
{community_view.blocked
? $t('cards.community.unblock')
: $t('cards.community.block')}
</MenuButton>
{#if $profile?.user}
<MenuButton color="danger-subtle" size="lg" on:click={blockInstance}>
<Icon src={BuildingOffice2} size="16" mini slot="prefix" />
Block instance
{$t('cards.community.blockInstance')}
</MenuButton>
{/if}
{#if $profile?.user && isAdmin($profile.user)}
@@ -338,7 +321,7 @@
on:click={() => (purgingCommunity = !purgingCommunity)}
>
<Icon src={Fire} size="16" mini slot="prefix" />
Purge
{$t('admin.purge')}
</MenuButton>
{/if}
{/if}
@@ -7,6 +7,8 @@
import { addSubscription } from '$lib/lemmy/user.js'
import { Button, Checkbox, TextInput } from 'mono-svelte'
import { uploadImage } from '$lib/util.js'
import { t } from '$lib/translations'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
/**
* The community ID to edit.
@@ -68,7 +70,7 @@
})
toast({
content: `Your community was ${edit ? 'saved' : 'created'}.`,
content: $t('toast.updatedCommunity'),
type: 'success',
})
@@ -106,23 +108,31 @@
<form on:submit|preventDefault={submit} class="flex flex-col gap-4 h-full">
<slot name="formtitle">
<h1 class="text-2xl font-bold">Create Community</h1>
<Header>{$t('routes.createCommunity')}</Header>
</slot>
<TextInput
required
label="Name"
label={$t('form.name')}
bind:value={formData.name}
on:input={() => {
formData.name = formData.name.toLowerCase().replaceAll(' ', '_')
}}
disabled={edit != undefined}
/>
<TextInput required label="Display name" bind:value={formData.displayName} />
<ImageInput label="Icon" bind:files={formData.icon} />
<ImageInput label="Banner" bind:files={formData.banner} />
<MarkdownEditor previewButton label="Sidebar" bind:value={formData.sidebar} />
<TextInput
required
label={$t('form.profile.displayName')}
bind:value={formData.displayName}
/>
<ImageInput label={$t('form.profile.avatar')} bind:files={formData.icon} />
<ImageInput label={$t('form.profile.banner')} bind:files={formData.banner} />
<MarkdownEditor
previewButton
label={$t('routes.admin.config.sidebar')}
bind:value={formData.sidebar}
/>
<Checkbox bind:checked={formData.nsfw}>NSFW</Checkbox>
<Checkbox bind:checked={formData.nsfw}>{$t('post.badges.nsfw')}</Checkbox>
<Checkbox bind:checked={formData.postsLockedToModerators}>
Only moderators can post
</Checkbox>
@@ -134,6 +144,6 @@
loading={formData.submitting}
disabled={formData.submitting}
>
{edit ? 'Save' : 'Create'}
{edit ? $t('common.save') : $t('form.submit')}
</Button>
</form>
@@ -20,15 +20,18 @@
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
import LabelStat from '$lib/components/ui/LabelStat.svelte'
import PostBody from '../post/PostBody.svelte'
import { t } from '$lib/translations'
export let community: CommunityView
let showInfo = false
</script>
<Modal title="Community" bind:open={showInfo}>
<CommunityCard community_view={community} />
</Modal>
{#if showInfo}
<Modal title="Community" bind:open={showInfo}>
<CommunityCard community_view={community} />
</Modal>
{/if}
<div class="py-4 flex flex-col gap-2 text-sm max-w-full relative">
<div class="flex flex-row items-center">
@@ -77,9 +80,9 @@
slot="prefix"
/>
{#if isSubscribed(community.subscribed)}
Subscribed
{$t('cards.community.subscribed')}
{:else}
Subscribe
{$t('cards.community.subscribe')}
{/if}
</Button>
</Subscribe>
@@ -13,9 +13,10 @@
<a
{...$$restProps}
class="items-center flex flex-row gap-2 hover:underline flex-shrink-0 {$$props.class ||
class="items-center flex flex-row gap-2 hover:underline max-w-full min-w-0 {$$props.class ||
''}"
href="/c/{community.name}@{new URL(community.actor_id).hostname}"
data-sveltekit-preload-data="tap"
>
{#if avatar}
<Avatar
@@ -27,18 +28,32 @@
{/if}
{#if name}
<span class="flex gap-0 items-center">
<span class="flex gap-0 items-center max-w-full min-w-0 flex-shrink">
<span class="font-medium username-text">{community.title}</span>
{#if showInstance}
<span class="font-medium">{community.title}</span>
<span
class="text-slate-500 dark:text-zinc-500 font-normal {$$props.instanceClass ||
''}"
class="text-slate-500 dark:text-zinc-500 font-normal
instance-text flex-shrink {$$props.instanceClass || ''}"
>
@{new URL(community.actor_id).hostname}
</span>
{:else}
{community.title}
{/if}
</span>
{/if}
</a>
<style>
.instance-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
flex: 1;
}
.username-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
@@ -6,6 +6,7 @@
import { Select } from 'mono-svelte'
import { GlobeAmericas, Icon } from 'svelte-hero-icons'
import { amModOfAny } from '../moderation/moderation'
import { t } from '$lib/translations'
export let selected: string
export let navigate: boolean = true
@@ -33,19 +34,19 @@
{#if showLabel}
<span class="flex items-center gap-1">
<Icon src={GlobeAmericas} size="16" mini />
Location
{$t('filter.location.label')}
</span>
{/if}
</svelte:fragment>
<option value="All">All</option>
<option value="Local">Local</option>
<option value="All">{$t('filter.location.all')}</option>
<option value="Local">{$t('filter.location.local')}</option>
<option value="Subscribed" disabled={$profile?.jwt == undefined}>
Subscribed
{$t('filter.location.subscribed')}
</option>
<option
value="ModeratorView"
disabled={!$profile?.jwt || !amModOfAny($profile?.user)}
>
Moderator
{$t('filter.location.moderator')}
</option>
</Select>
+30 -23
View File
@@ -2,6 +2,7 @@
import { page } from '$app/stores'
import { site } from '$lib/lemmy.js'
import { userSettings } from '$lib/settings'
import { t } from '$lib/translations'
import { searchParam } from '$lib/util.js'
import { feature } from '$lib/version.js'
import type { SortType } from 'lemmy-js-client'
@@ -33,21 +34,19 @@
>
<span slot="label" class="flex items-center gap-1">
<Icon src={ChartBar} size="13" mini />
Sort
{$t('filter.sort.label')}
</span>
<option value="Active">Active</option>
<option value="Hot">Hot</option>
<option value="Active">{$t('filter.sort.active')}</option>
<option value="Hot">{$t('filter.sort.hot')}</option>
{#if feature('scaledSort', $site?.version)}
<option value="Scaled">Scaled</option>
<option value="Scaled">{$t('filter.sort.scaled')}</option>
{/if}
<option value="TopAll">Top</option>
<option value="New">New</option>
{#if feature('controversialSort', $site?.version)}
<option value="Controversial">Controversial</option>
{/if}
<option value="Old">Old</option>
<option value="MostComments">Comments</option>
<option value="NewComments">New Replies</option>
<option value="TopAll">{$t('filter.sort.top.label')}</option>
<option value="New">{$t('filter.sort.new')}</option>
<option value="Old">{$t('filter.sort.old')}</option>
<option value="Controversial">{$t('filter.sort.controversial')}</option>
<option value="MostComments">{$t('filter.sort.mostcomments')}</option>
<option value="NewComments">{$t('filter.sort.newcomments')}</option>
</Select>
{#if selected?.startsWith('Top')}
<div transition:fly={{ easing: backOut, x: 2 }}>
@@ -62,18 +61,26 @@
>
<span slot="label" class="flex items-center gap-1">
<Icon src={Clock} size="15" mini />
Time
{$t('filter.sort.top.time.label')}
</span>
<option value="TopAll">All</option>
<option value="TopNineMonths">9 Months</option>
<option value="TopSixMonths">6 Months</option>
<option value="TopThreeMonths">3 Months</option>
<option value="TopMonth">Month</option>
<option value="TopWeek">Week</option>
<option value="TopDay">Day</option>
<option value="TopTwelveHour">12 Hours</option>
<option value="TopSixHour">6 Hours</option>
<option value="TopHour">Hour</option>
<option value="TopAll">{$t('filter.sort.top.time.all')}</option>
<option value="TopNineMonths">
{$t('filter.sort.top.time.9months')}
</option>
<option value="TopSixMonths">
{$t('filter.sort.top.time.6months')}
</option>
<option value="TopThreeMonths">
{$t('filter.sort.top.time.3months')}
</option>
<option value="TopMonth">{$t('filter.sort.top.time.month')}</option>
<option value="TopWeek">{$t('filter.sort.top.time.week')}</option>
<option value="TopDay">{$t('filter.sort.top.time.day')}</option>
<option value="TopTwelveHour">
{$t('filter.sort.top.time.12hours')}
</option>
<option value="TopSixHour">{$t('filter.sort.top.time.6hours')}</option>
<option value="TopHour">{$t('filter.sort.top.time.hour')}</option>
</Select>
</div>
{/if}
@@ -1,5 +1,6 @@
<script lang="ts">
import { userSettings } from '$lib/settings.js'
import { t } from '$lib/translations'
import { Select } from 'mono-svelte'
import { Icon, ViewColumns } from 'svelte-hero-icons'
@@ -11,12 +12,12 @@
{#if showLabel}
<span class="flex items-center gap-1">
<Icon src={ViewColumns} size="14" mini />
View
{$t('filter.view.label')}
</span>
{/if}
</svelte:fragment>
<option value="cozy">Cozy</option>
<option value="list">List</option>
<option value="compact">Compact</option>
<option value="card">Legacy</option>
<option value="cozy">{$t('filter.view.cozy')}</option>
<option value="list">{$t('filter.view.list')}</option>
<option value="compact">{$t('filter.view.compact')}</option>
<option value="card">{$t('filter.view.legacy')}</option>
</Select>
@@ -0,0 +1,47 @@
<script lang="ts">
import Avatar from '$lib/components/ui/Avatar.svelte'
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
import { Button } from 'mono-svelte'
import { flip } from 'svelte/animate'
import { expoOut } from 'svelte/easing'
export let items: {
avatar?: string
name: string
instance?: string
id: number
url: string
}[]
</script>
{#each items.sort((a, b) => a.name.localeCompare(b.name)) as item (item.id)}
<div
class="inline-flex w-full"
animate:flip={{ duration: 500, easing: expoOut }}
>
<Button
class="font-normal w-full h-max"
color="tertiary"
alignment="left"
href={item.url}
>
<div class="flex-none">
<Avatar
url={item.avatar}
alt={item.name}
title={item.name}
width={24}
slot="prefix"
/>
</div>
<div class="flex flex-col max-w-full break-words">
<span>{item.name}</span>
{#if item.instance}
<span class="text-xs text-slate-600 dark:text-zinc-400">
{item.instance}
</span>
{/if}
</div>
</Button>
</div>
{/each}
@@ -1,38 +1,38 @@
<script lang="ts">
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import type { Person } from 'lemmy-js-client'
import { Button, Modal } from 'mono-svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { t } from '$lib/translations'
import type { Person } from 'lemmy-js-client'
import { Button, Modal } from 'mono-svelte'
export let open: boolean = false
export let user: Person
export let open: boolean = false
export let user: Person
export let denying: boolean
export let denying: boolean
export let denyReason: string = ''
export let denyReason: string = ''
let loading = false
let loading = false
function deny() {
denying = true
open = false
}
function deny() {
denying = true
open = false
}
</script>
<Modal bind:open>
<h1 class="text-2xl font-bold" slot="title">Deny Application</h1>
<form on:submit|preventDefault={() => deny()} class="flex flex-col gap-4">
<p class="inline-flex flex-row gap-2 items-center">
Denying <UserLink avatar {user} />'s Application
</p>
<MarkdownEditor
bind:value={denyReason}
label="Deny Reason (optional)"
placeholder="Application Reason breaks rule #3"
rows={4}
/>
<Button color="primary" size="lg" submit {loading} disabled={loading}>
Deny
</Button>
</form>
<h1 class="text-2xl font-bold" slot="title">
{$t('routes.admin.applications.modalTitle')}
</h1>
<form on:submit|preventDefault={() => deny()} class="flex flex-col gap-4">
<UserLink avatar {user} />
<MarkdownEditor
bind:value={denyReason}
label={$t('routes.admin.applications.reason')}
rows={4}
/>
<Button color="primary" size="lg" submit {loading} disabled={loading}>
{$t('routes.admin.applications.deny')}
</Button>
</form>
</Modal>
@@ -3,8 +3,10 @@
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { getClient } from '$lib/lemmy.js'
import { t } from '$lib/translations'
import type { Person } from 'lemmy-js-client'
import { Button, Modal, toast } from 'mono-svelte'
import { Icon, PaperAirplane } from 'svelte-hero-icons'
export let open: boolean = false
export let user: Person
@@ -25,7 +27,7 @@
})
toast({
content: 'Successfully sent that person a message.',
content: $t('toast.sentMessage'),
type: 'success',
})
@@ -45,16 +47,16 @@
<h1 class="text-2xl font-bold" slot="title">Message</h1>
<form on:submit|preventDefault={sendMessage} class="flex flex-col gap-4">
<p class="inline-flex flex-row gap-2 items-center">
Sending <UserLink avatar {user} /> a message
<Icon src={PaperAirplane} size="16" mini />
<UserLink avatar {user} />
</p>
<MarkdownEditor
bind:value={message}
label="Message"
placeholder="your hair looks nice today"
label={$t('content.message')}
rows={4}
/>
<Button color="primary" size="lg" submit {loading} disabled={loading}>
Send
{$t('common.send')}
</Button>
</form>
</Modal>
@@ -6,6 +6,8 @@
import { profile } from '$lib/auth.js'
import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { t } from '$lib/translations'
import CommunityLink from '../community/CommunityLink.svelte'
export let open = false
let item: Person | undefined
@@ -40,7 +42,7 @@
date = Date.parse(expires)
if (Number.isNaN(date)) {
toast({
content: 'Invalid date. It must be an absolute date.',
content: $t('toast.invalidDateAbsolute'),
type: 'error',
})
@@ -51,7 +53,7 @@
if (date < Date.now()) {
toast({
content: 'Invalid date. It is before the current time.',
content: $t('toast.invalidDateBeforeCurrent'),
type: 'error',
})
@@ -82,9 +84,7 @@
open = false
toast({
content: `Successfully ${
banned ? 'unbanned' : 'banned'
} that user. You may need to refresh to see changes.`,
content: banned ? $t('toast.unbannedUser') : $t('toast.bannedUser'),
type: 'success',
})
@@ -101,42 +101,38 @@
</script>
<Modal bind:open class="max-w-xl w-full">
<h1 slot="title">{banned ? 'Unbanning' : 'Banning'} user</h1>
<h1 slot="title">
{banned ? $t('moderation.ban.unbanning') : $t('moderation.ban.banning')}
</h1>
{#if item}
<form class="flex flex-col gap-4" on:submit|preventDefault={submit}>
<div class="flex items-center gap-1">
<Avatar url={item.avatar} alt={item.name} width={24} />
<span class="font-bold">{item.name}</span>
</div>
<p>
{banned ? 'Unbanning' : 'Banning'} from
<span class="font-bold">{community ? community.name : 'site'}</span>
</p>
{#if community}
<CommunityLink {community} avatar />
{/if}
<MarkdownEditor
required
bind:value={reason}
label="Reason"
placeholder="Why are you {banned
? 'unbanning'
: 'banning'} {item.name}?"
label={$t('moderation.reason')}
/>
{#if !banned}
<Checkbox bind:checked={deleteData}>
Delete data
{$t('moderation.ban.deleteData')}
<svelte:fragment slot="description">
This will delete ALL of this user's posts and comments on this {community
? 'community'
: 'site'}.
{$t('moderation.ban.warning')}
</svelte:fragment>
</Checkbox>
<TextInput
bind:value={expires}
label="Expires (UTC)"
label={$t('moderation.ban.expires')}
placeholder="2024 August 5"
/>
{/if}
<Button submit color="primary" {loading} disabled={loading} size="lg">
Submit
{$t('form.submit')}
</Button>
</form>
{/if}
@@ -6,6 +6,7 @@
import { profile } from '$lib/auth.js'
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte'
import { t } from '$lib/translations'
export let item: PostView | CommentView
</script>
@@ -22,16 +23,20 @@
</Button>
{#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))}
<MenuDivider>
Moderation {#if !item.community.local && !amMod($profile.user, item.community)}
(Instance Only)
{#if !item.community.local && !amMod($profile.user, item.community)}
{$t('moderation.labelInstanceOnly')}
{:else}
{$t('moderation.label')}
{/if}
</MenuDivider>
<MenuButton color="success-subtle" on:click={() => remove(item)}>
<Icon src={Trash} size="16" mini />
{#if isCommentView(item)}
{item.comment.removed ? 'Restore' : 'Remove'}
{item.comment.removed
? $t('moderation.restore')
: $t('moderation.remove')}
{:else}
{item.post.removed ? 'Restore' : 'Remove'}
{item.post.removed ? $t('moderation.restore') : $t('moderation.remove')}
{/if}
</MenuButton>
{#if $profile?.user && $profile.user?.local_user_view.person.id != item.creator.id}
@@ -42,17 +47,17 @@
>
<Icon src={ShieldExclamation} size="16" mini />
{item.creator_banned_from_community
? 'Unban from community'
: 'Ban from community'}
? $t('moderation.ban.unbanFromCommunity')
: $t('moderation.ban.banFromCommunity')}
</MenuButton>
{/if}
{/if}
{#if $profile?.user && isAdmin($profile.user)}
<MenuDivider>Admin</MenuDivider>
<MenuDivider>{$t('admin.label')}</MenuDivider>
<MenuButton color="danger-subtle" on:click={() => remove(item, true)}>
<Icon src={Fire} size="16" mini slot="prefix" />
Purge
{$t('admin.purge')}
</MenuButton>
{/if}
</Menu>
@@ -15,6 +15,8 @@
import { Menu, MenuButton, MenuDivider, toast } from 'mono-svelte'
import { profile } from '$lib/auth.js'
import { Button } from 'mono-svelte'
import { t } from '$lib/translations'
import ShieldIcon from './ShieldIcon.svelte'
export let item: PostView | CommentView
@@ -34,11 +36,6 @@
})
item.post.locked = lock
toast({
content: `Successfully ${lock ? 'locked' : 'unlocked'} that post.`,
type: 'success',
})
} catch (err) {
toast({
content: err as any,
@@ -62,11 +59,6 @@
})
item.post.featured_community = pinned
toast({
content: `Successfully ${pinned ? 'pinned' : 'unpinned'} that post.`,
type: 'success',
})
} catch (err) {
toast({
content: err as any,
@@ -87,26 +79,14 @@
loading={acting}
{...$$restProps}
>
<svg
width="16"
height="16"
viewBox="0 0 20 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
slot="prefix"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M10.516 1.17C10.3767 1.03791 10.192 0.964283 10 0.964283C9.80801 0.964283 9.62333 1.03791 9.484 1.17C7.36127 3.18588 4.53412 4.29133 1.607 4.25C1.44753 4.24793 1.29156 4.29674 1.16172 4.38935C1.03189 4.48196 0.934957 4.61355 0.885 4.765C0.462973 6.05116 0.248618 7.39637 0.25 8.75C0.25 14.692 4.314 19.683 9.813 21.098C9.93566 21.1296 10.0643 21.1296 10.187 21.098C15.686 19.683 19.75 14.692 19.75 8.75C19.75 7.36 19.527 6.02 19.115 4.765C19.0652 4.61336 18.9684 4.48156 18.8385 4.38875C18.7087 4.29595 18.5526 4.247 18.393 4.249L18.25 4.25C15.254 4.25 12.533 3.08 10.516 1.17Z"
fill="currentColor"
/>
</svg>
<ShieldIcon filled width={16} />
</Button>
{#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))}
<MenuDivider>
Moderation {#if !item.community.local && !amMod($profile.user, item.community)}
(Instance Only)
{#if !item.community.local && !amMod($profile.user, item.community)}
{$t('moderation.labelInstanceOnly')}
{:else}
{$t('moderation.label')}
{/if}
</MenuDivider>
<MenuButton
@@ -121,7 +101,7 @@
mini
slot="prefix"
/>
{item.post.locked ? 'Unlock' : 'Lock'}
{item.post.locked ? $t('moderation.unlock') : $t('moderation.lock')}
</MenuButton>
<MenuButton
@@ -135,18 +115,24 @@
<div
class="flex flex-row gap-2 text-left items-center justify-between w-full"
>
<span>{item.post.featured_community ? 'Unfeature' : 'Feature'}</span>
<span>
{item.post.featured_community
? $t('moderation.unfeature')
: $t('moderation.feature')}
</span>
{#if isAdmin($profile.user)}
<span class="text-xs opacity-80">Community</span>
<span class="text-xs opacity-80">{$t('form.post.community')}</span>
{/if}
</div>
</MenuButton>
<MenuButton color="danger-subtle" on:click={() => remove(item)}>
<Icon src={Trash} size="16" mini />
{#if isCommentView(item)}
{item.comment.removed ? 'Restore' : 'Remove'}
{item.comment.removed
? $t('moderation.restore')
: $t('moderation.remove')}
{:else}
{item.post.removed ? 'Restore' : 'Remove'}
{item.post.removed ? $t('moderation.restore') : $t('moderation.remove')}
{/if}
</MenuButton>
{#if $profile?.user && $profile.user.local_user_view.person.id != item.creator.id}
@@ -157,13 +143,13 @@
>
<Icon src={ShieldExclamation} size="16" mini />
{item.creator_banned_from_community
? 'Unban from community'
: 'Ban from community'}
? $t('moderation.ban.unbanFromCommunity')
: $t('moderation.ban.banFromCommunity')}
</MenuButton>
{/if}
{/if}
{#if $profile?.user && isAdmin($profile.user)}
<MenuDivider>Admin</MenuDivider>
<MenuDivider>{$t('admin.label')}</MenuDivider>
<MenuButton
color="success-subtle"
on:click={() =>
@@ -173,13 +159,17 @@
<div
class="flex flex-row gap-2 text-left items-center justify-between w-full"
>
<span>{item.post.featured_local ? 'Unfeature' : 'Feature'}</span>
<span class="text-xs opacity-80">Instance</span>
<span>
{item.post.featured_local
? $t('moderation.unfeature')
: $t('moderation.feature')}
</span>
<span class="text-xs opacity-80">{$t('admin.instance')}</span>
</div>
</MenuButton>
<MenuButton color="danger-subtle" on:click={() => remove(item, true)}>
<Icon src={Fire} size="16" mini />
Purge
{$t('admin.purge')}
</MenuButton>
{/if}
</Menu>
@@ -14,6 +14,7 @@
import { fullCommunityName } from '$lib/util.js'
import { amMod, isAdmin } from './moderation'
import { Button, Checkbox, Modal } from 'mono-svelte'
import { t } from '$lib/translations'
export let open: boolean
export let item: PostView | CommentView | undefined = undefined
@@ -68,7 +69,7 @@
}
toast({
content: 'Successfully purged that submission.',
content: $t('moderation.removeSubmission.successPurge'),
type: 'success',
})
@@ -81,7 +82,7 @@
if (commentReason) {
if (replyReason == '') {
toast({
content: 'Your reply cannot be empty if "Reply reason" is enabled.',
content: $t('moderation.removeSubmission.failEmptyReply'),
})
return
}
@@ -96,7 +97,7 @@
})
.catch(() => {
toast({
content: 'Failed to message user. Removing anyway...',
content: $t('moderation.removeSubmission.failMessage'),
type: 'warning',
})
})
@@ -109,7 +110,7 @@
})
.catch(() => {
toast({
content: 'Failed to post reply. Removing anyway...',
content: $t('moderation.removeSubmission.failReply'),
type: 'warning',
})
})
@@ -134,13 +135,6 @@
}
open = false
toast({
content: `Successfully ${
removed ? 'restored' : 'removed'
} that submission.`,
type: 'success',
})
} catch (err) {
toast({
content: err as any,
@@ -166,7 +160,11 @@
<Modal bind:open>
<span slot="title">
{purge ? 'Purging' : removed ? 'Restoring' : 'Removing'} submission
{purge
? $t('moderation.removeSubmission.titlePurge')
: removed
? $t('moderation.removeSubmission.titleRestore')
: $t('moderation.removeSubmission.title')}
</span>
{#if item}
<form
@@ -195,12 +193,17 @@
/>
{#if !removed && $profile?.user && (amMod($profile.user, item.community) || (isAdmin($profile.user) && item.community.local))}
<Checkbox bind:checked={commentReason}>Reply with reason</Checkbox>
<Checkbox bind:checked={commentReason}>
{$t('moderation.removeSubmission.withReason')}
</Checkbox>
{#if commentReason}
<MultiSelect
options={[false, true]}
optionNames={['Comment', 'Message']}
optionNames={[
$t('moderation.removeSubmission.comment'),
$t('moderation.removeSubmission.message'),
]}
bind:selected={privateMessage}
/>
<MarkdownEditor
@@ -209,7 +212,7 @@
rows={3}
>
<div class="flex justify-between items-end mb-1" slot="label">
Reply
{$t('comment.reply')}
<Select bind:value={preset} placeholder="No preset">
{#each $userSettings.moderation.presets as preset}
<option value={preset.content}>
@@ -231,9 +234,9 @@
>
<Icon src={purge ? Fire : Trash} mini size="16" slot="prefix" />
{#if purge}
Purge
{$t('admin.purge')}
{:else}
{removed ? 'Restore' : 'Remove'}
{removed ? $t('moderation.restore') : $t('moderation.remove')}
{/if}
</Button>
</form>
@@ -8,6 +8,8 @@
import { Button, Modal } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { onMount } from 'svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/translations'
export let open: boolean
export let item: PostView | CommentView | undefined = undefined
@@ -39,7 +41,7 @@
}
open = false
toast({
content: 'That submission has been reported.',
content: $t('moderation.reportModal.success'),
type: 'success',
})
} catch (err) {
@@ -59,10 +61,9 @@
</script>
<Modal bind:open>
<h1 class="font-bold text-2xl" slot="title">Report</h1>
<Header slot="title">{$t('moderation.reportModal.title')}</Header>
<form class="flex flex-col gap-4" on:submit|preventDefault={report}>
{#if item}
<span>Reporting this submission</span>
<div class="pointer-events-none list-none">
{#if isComment(item)}
<Comment
@@ -83,12 +84,11 @@
<MarkdownEditor
required
rows={4}
label="Reason"
placeholder="he's being a meanie :("
label={$t('moderation.reason')}
bind:value={reason}
/>
<Button submit {loading} disabled={loading} color="primary" size="lg">
Submit
{$t('form.submit')}
</Button>
</form>
</Modal>
+106 -32
View File
@@ -5,8 +5,11 @@
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
import { userSettings } from '$lib/settings.js'
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
import { Material, toast } from 'mono-svelte'
import PostMeta, {
parseTags,
type Tag,
} from '$lib/components/lemmy/post/PostMeta.svelte'
import { Badge, Material, toast } from 'mono-svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
import {
@@ -16,7 +19,12 @@
} from '$lib/components/lemmy/post/helpers.js'
import Empty from '$lib/components/helper/Empty.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import { Icon, VideoCamera } from 'svelte-hero-icons'
import {
ArrowUp,
ChatBubbleOvalLeft,
Icon,
VideoCamera,
} from 'svelte-hero-icons'
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
import PostMediaCompact from '$lib/components/lemmy/post/media/PostMediaCompact.svelte'
import PostBody from './PostBody.svelte'
@@ -29,30 +37,69 @@
export let view = $userSettings.view
$: type = mediaType(post.post.url, view)
$: tags = parseTags(post.post.name)
$: rule = getTagRule(tags.tags)
$: hideTitle =
$userSettings.posts.deduplicateEmbed &&
post.post.embed_title == post.post.name &&
view != 'compact'
view != 'compact' &&
type != 'iframe'
$: hideBody =
$userSettings.posts.deduplicateEmbed &&
post.post.embed_description == post.post.body &&
view != 'compact'
function getTagRule(tags: Tag[]): 'blur' | 'hide' | undefined {
const tagContent = tags.map((t) => t.content.toLowerCase())
let rule: 'blur' | 'hide' | undefined
tagContent.forEach((tag) => {
if ($userSettings.tagRules?.[tag])
rule = $userSettings.tagRules?.[tag] ?? rule
if (rule == 'hide') return rule
})
return rule
}
function onClick(e: any) {
const event = e as MouseEvent
const parent = document.getElementById(post.post.id.toString())
if (event.target == parent) {
goto(postLink(post.post))
}
}
</script>
<!--
@component
This is the sole component for displaying posts.
It adapts to all kinds of form factors for different contexts, such as feeds, full post view, and crosspost list.
-->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<Material
color={view != 'card' ? 'none' : 'distinct'}
padding="none"
class="relative max-w-full min-w-0 w-full test group gap-2 flex flex-col
class="post relative max-w-full min-w-0 w-full group cursor-pointer
{view != 'card' ? 'bg-transparent !border-0' : 'p-5'} {view == 'compact'
? 'py-4 list-type'
: view == 'list'
? 'py-5 list-type'
: 'py-5'} {$$props.class}"
id={post.post.id}
: 'py-5 flex flex-col gap-2'} {$$props.class}"
id={post.post.id.toString()}
padding="none"
on:click={(e) => {
onClick(e)
}}
style={$$props.style ?? ''}
>
<PostMeta
community={hideCommunity ? undefined : post.community}
community={post.community}
showCommunity={!hideCommunity}
user={post.creator}
published={publishedToDate(post.post.published)}
badges={{
@@ -71,49 +118,76 @@
? 'Subscribed'
: 'NotSubscribed'}
id={post.post.id}
title={hideTitle ? undefined : post.post.name}
title={hideTitle ? undefined : tags?.title ? tags.title : post.post.name}
read={post.read}
style="grid-area: meta;"
tags={tags?.tags}
>
<slot name="badges" slot="badges" />
</PostMeta>
<div
style="grid-area:embed"
class={view == 'list' || view == 'compact' ? '' : 'contents'}
>
<PostMedia bind:post={post.post} {view} {type} />
</div>
{#if view == 'list' || view == 'compact'}
<PostMediaCompact {view} bind:post={post.post} style="grid-area: media;" />
{/if}
{#if post.post.body && !post.post.nsfw && view != 'compact' && !hideBody}
{#key post.post.url}
<div
style="grid-area:embed;"
class={view == 'list' || view == 'compact' ? '' : 'contents'}
>
{#if rule != 'hide'}
<PostMedia
bind:post={post.post}
blur={rule == 'blur' ? true : undefined}
{view}
{type}
/>
{/if}
</div>
{#if view == 'list' || view == 'compact'}
<PostMediaCompact
bind:post={post.post}
bind:type
class="{$userSettings.leftAlign
? 'mr-2'
: 'ml-2'} flex-shrink no-list-margin"
style="grid-area: media;"
/>
{/if}
{/key}
{#if post.post.body && !post.post.nsfw && view != 'compact' && !hideBody && rule != 'hide'}
<PostBody body={post.post.body} {view} style="grid-area: body" />
{/if}
{#if actions}
<PostActions
bind:post
on:edit={(e) => {
toast({
content: 'The post was edited successfully.',
type: 'success',
})
}}
style="grid-area: actions;"
/>
<PostActions on:hide bind:post style="grid-area: actions;" />
{:else if view == 'compact'}
<div class="flex flex-row items-center gap-2 text-sm">
<Badge>
<Icon src={ArrowUp} slot="icon" size="14" micro />
{post.counts.score}
</Badge>
<Badge>
<Icon src={ChatBubbleOvalLeft} slot="icon" size="14" micro />
{post.counts.comments}
</Badge>
</div>
{/if}
<div
class="absolute overflow-hidden inset-0 group-hover:inset-y-0.5 group-hover:-inset-x-4 group-hover:sm:-inset-x-5
sm:rounded-xl bg-slate-50 dark:bg-zinc-900
opacity-0 group-hover:opacity-100 transition-all -z-10 no-list-margin
duration-150"
/>
</Material>
<style>
:global(.list-type) {
display: grid;
gap: 0.5rem;
grid-template-areas: var(
--template-areas,
'meta media' 'title media' 'body media' 'embed embed' 'actions actions'
);
width: 100%;
height: 100%;
grid-auto-rows: minmax(-0.5rem, auto);
grid-template-columns: var(--template-columns, 1fr auto);
}
:global(.list-type > *:not(.no-list-margin):not(:first-child)) {
margin-top: 0.5rem;
}
</style>
+110 -19
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import type { PostView } from 'lemmy-js-client'
import PostVote from './PostVote.svelte'
import { getInstance } from '$lib/lemmy.js'
import { getInstance, site } from '$lib/lemmy.js'
import {
ArrowTopRightOnSquare,
Bookmark,
@@ -13,13 +13,17 @@
Eye,
EyeSlash,
Flag,
GlobeAlt,
Home,
Icon,
Language,
Newspaper,
PencilSquare,
ServerStack,
Share,
Trash,
UserCircle,
XMark,
} from 'svelte-hero-icons'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { createEventDispatcher } from 'svelte'
@@ -46,13 +50,21 @@
MenuDivider,
Modal,
Spinner,
toast,
} from 'mono-svelte'
import { fediseer, type Data } from '$lib/fediseer/fediseer'
import Fediseer from '$lib/fediseer/Fediseer.svelte'
import { t } from '$lib/translations'
import { text } from '$lib/components/translate/translation'
import Translation from '$lib/components/translate/Translation.svelte'
import { hidePost, postLink } from './helpers'
import { feature } from '$lib/version'
import Switch from '$lib/components/input/Switch.svelte'
import { instanceToURL } from '$lib/util'
export let post: PostView
const dispatcher = createEventDispatcher<{ edit: PostView }>()
const dispatcher = createEventDispatcher<{ edit: PostView; hide: boolean }>()
let editing = false
let saving = false
@@ -61,6 +73,10 @@
let fediseerOpen = false
let fediseerData: Data | null = null
let fediseerLoading = false
let translating = false
let localShare = false
</script>
{#if fediseerData}
@@ -93,7 +109,14 @@
</Modal>
{/if}
<div class="flex flex-row gap-2 items-center h-8" style={$$props.style ?? ''}>
{#if translating}
<Translation bind:open={translating} />
{/if}
<div
class="flex flex-row gap-2 items-center !h-8 flex-shrink-0"
style={$$props.style ?? ''}
>
<PostVote
post={post.post}
bind:vote={post.my_vote}
@@ -107,7 +130,7 @@
href="/post/{getInstance()}/{post.post.id}"
class="!text-inherit h-8 px-3"
target={$userSettings.openLinksInNewTab ? '_blank' : ''}
title="Comments"
title={$t('post.actions.comments')}
>
<Icon slot="prefix" src={ChatBubbleOvalLeft} mini size="14" />
<FormattedNumber number={post.counts.comments} />
@@ -120,7 +143,12 @@
<DebugObject object={post} bind:open={debug} />
{/await}
{/if}
<Button on:click={() => (debug = true)} size="square-md" color="ghost">
<Button
on:click={() => (debug = true)}
title="Debug"
size="square-md"
color="ghost"
>
<Icon src={BugAnt} mini size="16" slot="prefix" />
</Button>
{/if}
@@ -140,7 +168,7 @@
color="ghost"
loading={saving}
disabled={saving}
title={post.saved ? 'Unsave' : 'Save'}
title={post.saved ? $t('post.actions.unsave') : $t('post.actions.save')}
>
<Icon
src={post.saved ? BookmarkSlash : Bookmark}
@@ -156,12 +184,17 @@
containerClass="overflow-auto max-h-[400px]"
class="h-8"
targetClass="h-full"
title="Post actions"
title={$t('post.actions.more.label')}
>
<Button slot="target" title="Post actions" color="ghost" size="square-md">
<Button
slot="target"
title={$t('post.actions.more.label')}
color="ghost"
size="square-md"
>
<Icon slot="prefix" src={EllipsisHorizontal} width={16} mini />
</Button>
<MenuDivider>Creator</MenuDivider>
<MenuDivider>{$t('post.actions.more.creator')}</MenuDivider>
<MenuButton
link
href="/u/{post.creator.name}@{new URL(post.creator.actor_id).hostname}"
@@ -186,7 +219,6 @@
const data = await fediseer.getInstanceInfo(
new URL(post.community.actor_id).hostname
)
console.log(data)
fediseerData = data
fediseerOpen = true
fediseerLoading = false
@@ -204,11 +236,11 @@
<span>{new URL(post.community.actor_id).hostname}</span>
</MenuButton>
<hr class="w-[90%] mx-auto opacity-100 dark:opacity-10 my-2" />
<MenuDivider>Actions</MenuDivider>
<MenuDivider>{$t('post.actions.more.actions')}</MenuDivider>
{#if $profile?.user && $profile?.jwt && $profile.user.local_user_view.person.id == post.creator.id}
<MenuButton on:click={() => (editing = true)}>
<Icon src={PencilSquare} width={16} mini slot="prefix" />
Edit
{$t('post.actions.more.edit')}
</MenuButton>
{/if}
{#if $profile?.jwt}
@@ -219,19 +251,54 @@
}}
>
<Icon slot="prefix" src={post.read ? EyeSlash : Eye} width={16} mini />
Mark as {post.read ? 'Unread' : 'Read'}
{post.read
? $t('post.actions.more.markUnread')
: $t('post.actions.more.markRead')}
</MenuButton>
{/if}
<MenuButton
on:click={() => {
navigator.share?.({
url: post.post.ap_id,
}) ?? navigator.clipboard.writeText(post.post.ap_id)
url: localShare
? `${instanceToURL(getInstance())}/post/${post.post.id}`
: post.post.ap_id,
}) ??
navigator.clipboard.writeText(
localShare
? `${instanceToURL(getInstance())}/post/${post.post.id}`
: post.post.ap_id
)
toast({ content: $t('toast.copied') })
}}
class="flex-1 py-0"
>
<Icon src={Share} width={16} mini slot="prefix" />
Share
{$t('post.actions.more.share')}
{#if !post.post.local}
<Switch
optionNames={[
$t('filter.location.global'),
$t('filter.location.local'),
]}
options={[false, true]}
bind:selected={localShare}
class="ml-auto"
buttonClass="!py-1"
/>
{/if}
</MenuButton>
{#if post.post.body && $userSettings.translator}
<MenuButton
on:click={() => {
// @ts-ignore
text.set(post.post.body)
translating = !translating
}}
>
<Icon src={Language} size="16" mini slot="prefix" />
{$t('post.actions.more.translate')}
</MenuButton>
{/if}
{#if $profile?.jwt}
<MenuButton
on:click={() => {
@@ -257,7 +324,7 @@
}}
>
<Icon src={ArrowTopRightOnSquare} width={16} mini slot="prefix" />
Crosspost
{$t('post.actions.more.crosspost')}
</MenuButton>
{#if $profile.user && post.creator.id == $profile.user.local_user_view.person.id}
<MenuButton
@@ -272,13 +339,37 @@
color="danger-subtle"
>
<Icon src={Trash} width={16} mini slot="prefix" />
{post.post.deleted ? 'Restore' : 'Delete'}
{post.post.deleted
? $t('post.actions.more.restore')
: $t('post.actions.more.delete')}
</MenuButton>
{/if}
{#if $profile.user?.local_user_view.person.id != post.creator.id}
{#if feature('hidePosts', $site?.version)}
<MenuButton
on:click={async () => {
if (!$profile?.jwt) return
const hidden = await hidePost(
post.post.id,
!post.hidden,
$profile?.jwt
)
post.hidden = hidden
if (hidden) {
dispatcher('hide', hidden)
}
}}
color="danger-subtle"
>
<Icon slot="prefix" src={XMark} size="16" mini />
{post.hidden
? $t('post.actions.more.unhide')
: $t('post.actions.more.hide')}
</MenuButton>
{/if}
<MenuButton on:click={() => report(post)} color="danger-subtle">
<Icon src={Flag} width={16} mini slot="prefix" />
Report
{$t('moderation.report')}
</MenuButton>
{/if}
{/if}
@@ -31,7 +31,8 @@
bg-gradient-to-b text-transparent from-slate-600 via-slate-600
dark:from-zinc-400 dark:via-zinc-400 bg-clip-text z-0
${view == 'list' ? `max-h-24` : 'max-h-48'}`
: 'text-slate-600 dark:text-zinc-400 max-h-full'} {$$props.class ?? ''}"
: 'text-slate-600 dark:text-zinc-400 max-h-full'} pointer-events-none {$$props.class ??
''}"
bind:this={element}
>
<Markdown inline={!expanded} source={body} />
@@ -40,7 +41,7 @@ ${view == 'list' ? `max-h-24` : 'max-h-48'}`
on:click={() => (expanded = !expanded)}
size="square-sm"
color="tertiary"
class="text-black dark:text-white absolute z-10 isolate drop-shadow-xl {expanded
class="text-black dark:text-white absolute z-10 isolate drop-shadow-xl pointer-events-auto {expanded
? 'bottom-6'
: 'bottom-16'} left-1/2 -translate-x-1/2"
title="Expand"
+50 -23
View File
@@ -10,6 +10,7 @@
BookOpen,
ArrowPath,
Sparkles,
ChatBubbleBottomCenterText,
} from 'svelte-hero-icons'
import { profile } from '$lib/auth.js'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
@@ -19,6 +20,10 @@
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
import { Button } from 'mono-svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
import { t } from '$lib/translations'
import { slide } from 'svelte/transition'
import { feature } from '$lib/version'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
export let edit = false
@@ -34,17 +39,21 @@
title: string
body: string
image: FileList | null
thumbnail: string | undefined
url: string | undefined
nsfw: boolean
loading: boolean
alt_text: string | undefined
} = {
community: null,
title: '',
body: '',
image: null,
thumbnail: undefined,
url: undefined,
nsfw: false,
loading: false,
alt_text: undefined,
}
let saveDraft = edit ? false : true
@@ -59,6 +68,9 @@
data.url = editingPost.url ?? ''
data.body = editingPost.body ?? ''
data.title = editingPost.name
data.nsfw = editingPost.nsfw
data.alt_text = editingPost.alt_text
data.thumbnail = editingPost.thumbnail_url
}
if (passedCommunity) {
@@ -84,7 +96,7 @@
if (!data.community && !edit) {
toast({
type: 'warning',
content: 'You need to set a community.',
content: $t('toast.needCommunity'),
})
return
}
@@ -94,7 +106,7 @@
new URL(data.url)
} catch (err) {
toast({
content: 'Invalid URL',
content: $t('toast.invalidURL'),
type: 'warning',
})
return
@@ -115,6 +127,8 @@
url: data.url || undefined,
post_id: editingPost.id,
nsfw: data.nsfw,
alt_text: data.alt_text,
custom_thumbnail: data.thumbnail,
})
if (!post) throw new Error('Failed to edit post')
@@ -123,16 +137,14 @@
dispatcher('submit', post.post_view)
} else {
let image = data.image
? await uploadImage(data.image[0], $profile.instance, $profile.jwt)
: undefined
data.url = image || data.url || undefined
const post = await client().createPost({
community_id: data.community!.id,
name: data.title,
body: data.body,
url: data.url,
url: data.url || undefined,
nsfw: data.nsfw,
custom_thumbnail: data.thumbnail,
alt_text: data.alt_text,
})
if (!post) throw new Error('Failed to upload post')
@@ -169,14 +181,14 @@
.join('\n')
toast({
content: `Generated title and body from that website. Would you like to undo this action?`,
content: $t('toast.generatedTitle'),
type: 'info',
action: () => (data = oldData),
duration: 15 * 1000,
})
} catch (e) {
toast({
content: 'There was no usable title or description of that website.',
content: $t('toast.failGenerateTitle'),
})
}
generation.loading = false
@@ -198,6 +210,8 @@
title: '',
}
let addAltText = false
$: generation.generatable = canGenerateTitle(data.url)
</script>
@@ -215,9 +229,9 @@
<form on:submit|preventDefault={submit} class="flex flex-col gap-4 h-full">
<slot name="formtitle">
<h1 class="font-bold text-xl">
{edit ? 'Edit' : 'Create'} Post
</h1>
<Header class="font-bold text-xl">
{edit ? $t('form.post.edit') : $t('form.post.create')}
</Header>
</slot>
{#if !edit && data}
{#if !data.community}
@@ -226,7 +240,7 @@
bind:items={communities}
jwt={$profile?.jwt}
listing_type="All"
label="Community"
label={$t('form.post.community')}
required
on:select={(e) => {
const c = e.detail
@@ -242,7 +256,7 @@
/>
{:else}
<div class="flex flex-col gap-1">
<span class="font-medium text-sm">Community</span>
<span class="font-medium text-sm">{$t('form.post.community')}</span>
<Button
class="w-full !bg-white dark:!bg-black h-[38px]"
on:click={() => (data.community = null)}
@@ -267,13 +281,13 @@
{/if}
<TextInput
required
label="Title"
label={$t('form.post.title')}
bind:value={data.title}
placeholder={placeholders.get('post')}
/>
<div class="flex gap-2 w-full items-end">
<TextInput
label="URL"
label={$t('form.post.url')}
bind:value={data.url}
placeholder={placeholders.get('url')}
class="w-full"
@@ -284,32 +298,45 @@
? 'width: 38px; padding: 0;'
: ''}"
class="flex-shrink-0"
title="Generate title/body"
title={$t('form.post.generateTitle')}
loading={generation.loading}
disabled={!generation.generatable || generation.loading}
>
<Icon src={Sparkles} size="18" mini slot="prefix" />
{#if generation.generatable}
Generate Title
{$t('form.post.generateTitle')}
{/if}
</Button>
<Button
on:click={() => (addAltText = !addAltText)}
style="width: 38px; height: 38px; padding: 0;"
class="flex-shrink-0"
title={$t('form.post.altText')}
>
<Icon src={ChatBubbleBottomCenterText} size="18" mini slot="prefix" />
</Button>
<Button
on:click={() => (uploadingImage = !uploadingImage)}
style="width: 38px; height: 38px; padding: 0;"
class="flex-shrink-0"
title="Upload image"
title={$t('form.post.uploadImage')}
>
<Icon src={Photo} size="18" mini slot="prefix" />
</Button>
</div>
{#if addAltText}
<div transition:slide={{ axis: 'y', duration: 150 }} class="w-full">
<TextInput label={$t('form.post.altText')} bind:value={data.alt_text} />
</div>
{/if}
<MarkdownEditor
rows={8}
label="Body"
label={$t('form.post.body')}
bind:value={data.body}
placeholder={placeholders.get('post')}
previewButton
/>
<Switch bind:checked={data.nsfw}>NSFW</Switch>
<Switch bind:checked={data.nsfw}>{$t('form.post.nsfw')}</Switch>
<div class="mt-auto" />
<div class="flex flex-row items-center gap-2">
<Button
@@ -320,13 +347,13 @@
disabled={data.loading}
class="flex-1"
>
Submit
{$t('form.submit')}
</Button>
{#if !edit}
<Button
on:click={() => {
toast({ content: 'Restored from draft' })
toast({ content: $t('toast.restoredFromDraft') })
const draft = getSessionStorage('postDraft')
if (draft && !edit) {
// @ts-ignore
+13 -6
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import Link, { parseURL } from '$lib/components/input/Link.svelte'
import { Material } from 'mono-svelte'
import { Button, Material } from 'mono-svelte'
import { Icon, Link as LinkIcon } from 'svelte-hero-icons'
import { optimizeImageURL } from './helpers'
@@ -14,6 +14,10 @@
$: richURL = parseURL(url)
</script>
<!--
@component
For embed-type posts. Displays embed card or a compact link.
-->
{#if embed_title && !compact}
<Material color="distinct" class="flex flex-row gap-4">
<div class="flex flex-col gap-2">
@@ -46,7 +50,7 @@
<a
href={url}
target="_blank"
class="ml-auto w-full thumbnail rounded-r-lg overflow-hidden flex-shrink -m-4 max-h-48"
class="ml-auto w-full thumbnail rounded-r-lg overflow-hidden flex-shrink -m-4"
>
<img
src={optimizeImageURL(thumbnail_url, 256)}
@@ -60,12 +64,15 @@
{/if}
</Material>
{:else}
<Link
<Button
href={url}
target="_blank"
class="text-slate-700 dark:text-zinc-300 inline-flex items-center gap-1 text-sm"
class="text-slate-700 dark:text-zinc-300 inline-flex items-center gap-1 text-xs overflow-hidden w-max max-w-full"
size="sm"
color="ghost"
rounding="pill"
>
<Icon src={LinkIcon} size="14" mini slot="icon" class="flex-shrink-0" />
<Icon src={LinkIcon} size="14" mini slot="prefix" class="flex-shrink-0" />
{#if richURL}
<div class="flex max-w-full overflow-hidden">
{richURL.hostname}
@@ -76,7 +83,7 @@
{:else}
{url}
{/if}
</Link>
</Button>
{#if thumbnail_url && !compact}
<a href={url} target="_blank">
<img
+133 -31
View File
@@ -1,3 +1,39 @@
<script lang="ts" context="module">
export interface Tag {
content: string
color?: string
icon?: IconSource
}
export const textToTag: Map<string, Tag> = new Map<string, Tag>([
['OC', { content: 'OC', color: '#03A8F240' }],
['NSFL', { content: 'NSFL', color: '#ff000040' }],
['CW', { content: 'CW', color: '#ff000040' }],
])
export const parseTags = (
title?: string
): { tags: Tag[]; title?: string } => {
if (!title) return { tags: [] }
let extracted: Tag[] = []
title = title.replace(/\[(.*?)\]/g, (match, content) => {
extracted.push(
textToTag.get(content) ?? {
content: content,
}
)
return ''
})
return {
tags: extracted,
title: title,
}
}
</script>
<script lang="ts">
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import Avatar from '$lib/components/ui/Avatar.svelte'
@@ -8,10 +44,12 @@
import {
Bookmark,
Check,
ExclamationTriangle,
Icon,
LockClosed,
Megaphone,
Plus,
Tag,
Trash,
} from 'svelte-hero-icons'
import { getInstance } from '$lib/lemmy.js'
@@ -19,8 +57,12 @@
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
import ShieldIcon from '../moderation/ShieldIcon.svelte'
import { userSettings } from '$lib/settings'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import { t } from '$lib/translations'
import type { IconSource } from 'svelte-hero-icons'
export let community: Community | undefined = undefined
export let showCommunity: boolean = true
export let subscribed: SubscribedType | undefined = undefined
export let user: Person | undefined = undefined
@@ -40,15 +82,29 @@
moderator: false,
admin: false,
}
export let tags: Tag[] = []
$: {
if (title && tags.length == 0) {
const result = parseTags(title)
tags = result.tags
title = result.title
}
}
</script>
<!--
@component
This component will build two different things: a post's meta block and the title.
-->
<div
class="grid w-full meta {community
? 'grid-rows-2'
: 'grid-rows-1'} text-xs min-w-0 max-w-full"
style={$$props.style ?? ''}
>
{#if community}
{#if showCommunity && community}
<Subscribe let:subscribe let:subscribing>
<button
on:click={async () => {
@@ -57,21 +113,22 @@
subscribed =
subscribed == 'NotSubscribed' ? 'Subscribed' : 'NotSubscribed'
}}
class="relative cursor-pointer pr-2 row-span-2"
class="relative cursor-pointer pr-2 row-span-2 flex-shrink-0"
>
<Avatar
url={community.icon}
width={28}
alt={community.name}
style="grid-area: avatar; height: 100%;"
class="flex-shrink-0"
/>
{#if subscribed != undefined && $profile?.jwt}
<div
class="absolute w-3.5 h-3.5 {subscribed == 'NotSubscribed'
? 'bg-primary-900 dark:bg-primary-100 text-white dark:text-black'
: 'bg-primary-100 dark:bg-primary-900 text-black dark:text-white'} rounded-full ring-2 box-border
ring-slate-50 dark:ring-zinc-950
-bottom-1 right-1 grid place-items-center transition-all"
ring-slate-50 dark:ring-zinc-950 grid place-items-center transition-all
right-0 -translate-x-1 -translate-y-2"
>
<Icon
src={subscribed == 'NotSubscribed' ? Plus : Check}
@@ -83,15 +140,19 @@
</button>
</Subscribe>
{/if}
{#if community}
<CommunityLink {community} style="grid-area: community;" />
{#if showCommunity && community}
<CommunityLink
{community}
style="grid-area: community;"
class="flex-shrink self-end"
/>
{/if}
<span
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 flex-wrap items-center"
class="text-slate-600 dark:text-zinc-400 flex flex-row gap-2 items-center self-start"
style="grid-area: stats;"
>
{#if user}
<UserLink avatarSize={20} {user} avatar={!community}>
<UserLink avatarSize={20} {user} avatar={!showCommunity}>
<svelte:fragment slot="badges">
{#if badges.moderator}
<ShieldIcon filled width={14} class="text-green-500" />
@@ -103,45 +164,79 @@
</UserLink>
{/if}
{#if published}
<RelativeDate date={published} />
<RelativeDate date={published} class="flex-shrink-0" />
{/if}
</span>
<div
class="flex flex-row items-center place-self-end overflow-auto gap-2 [&>*]:flex-shrink-0 ml-2"
class="flex flex-row justify-end items-center self-center flex-wrap gap-2 [&>*]:flex-shrink-0 badges ml-2"
style="grid-area: badges;"
>
{#if tags}
{#each tags as tag}
<a
class="hover:brightness-110"
href="/search?community={community?.id}&q=[{tag.content}]&type=Posts"
style={tag.color ? `--tag-color: ${tag.color};` : ''}
>
<Badge class={tag.color ? 'badge-tag-color' : ''}>
<svelte:fragment slot="icon">
{#if tag.icon}
<Icon src={tag.icon} micro size="14" />
{:else}
<Icon src={Tag} micro size="14" />
{/if}
</svelte:fragment>
{tag.content}
</Badge>
</a>
{/each}
{/if}
{#if badges.nsfw}
<Badge color="red-subtle">NSFW</Badge>
<Badge label={$t('post.badges.nsfw')} color="red-subtle" allowIconOnly>
<Icon src={ExclamationTriangle} size="14" micro slot="icon" />
{$t('post.badges.nsfw')}
</Badge>
{/if}
{#if badges.saved}
<Badge label="Saved" color="yellow-subtle" allowIconOnly>
<Icon src={Bookmark} mini size="12" slot="icon" />
Saved
<Badge
label={$t('post.badges.saved')}
color="yellow-subtle"
allowIconOnly
>
<Icon src={Bookmark} micro size="14" slot="icon" />
{$t('post.badges.saved')}
</Badge>
{/if}
{#if badges.locked}
<Badge label="Locked" color="yellow-subtle" allowIconOnly>
<Icon src={LockClosed} mini size="14" slot="icon" />
<span class="max-md:hidden">Locked</span>
<Badge
label={$t('post.badges.locked')}
color="yellow-subtle"
allowIconOnly
>
<Icon src={LockClosed} micro size="14" slot="icon" />
<span class="max-md:hidden">{$t('post.badges.locked')}</span>
</Badge>
{/if}
{#if badges.removed}
<Badge label="Removed" color="red-subtle" allowIconOnly>
<Icon src={Trash} mini size="14" slot="icon" />
<span class="max-md:hidden">Removed</span>
<Badge label={$t('post.badges.removed')} color="red-subtle" allowIconOnly>
<Icon src={Trash} micro size="14" slot="icon" />
<span class="max-md:hidden">{$t('post.badges.removed')}</span>
</Badge>
{/if}
{#if badges.deleted}
<Badge label="Deleted" color="red-subtle" allowIconOnly>
<Icon src={Trash} mini size="14" slot="icon" />
<span class="max-md:hidden">Deleted</span>
<Badge label={$t('post.badges.deleted')} color="red-subtle" allowIconOnly>
<Icon src={Trash} micro size="14" slot="icon" />
<span class="max-md:hidden">{$t('post.badges.deleted')}</span>
</Badge>
{/if}
{#if badges.featured}
<Badge label="Featured" color="green-subtle" allowIconOnly>
<Icon src={Megaphone} mini size="14" slot="icon" />
<span class="max-md:hidden">Featured</span>
<Badge
label={$t('post.badges.featured')}
color="green-subtle"
allowIconOnly
>
<Icon src={Megaphone} micro size="14" slot="icon" />
<span class="max-md:hidden">{$t('post.badges.featured')}</span>
</Badge>
{/if}
<slot name="badges" />
@@ -150,17 +245,20 @@
{#if title && id}
<a
href="/post/{getInstance()}/{id}"
class="text-lg leading-6 w-full hover:underline hover:text-primary-900 hover:dark:text-primary-100
transition-colors
class="inline text-lg hover:underline
hover:text-primary-900 hover:dark:text-primary-100 transition-colors
{$userSettings.font == 'satoshi/nunito'
? 'font-display font-semibold'
: 'font-medium'}"
class:text-slate-600={$userSettings.markReadPosts && read}
class:dark:text-zinc-400={$userSettings.markReadPosts && read}
style="grid-area: title;"
data-sveltekit-preload-data="tap"
>
{title}
<Markdown source={title} inline noStyle class="leading-[1.3]"></Markdown>
</a>
{:else}
<div style="grid-area: title; margin: 0;"></div>
{/if}
<style>
@@ -171,6 +269,10 @@
'avatar stats badges';
gap: 0;
grid-template-rows: auto auto;
grid-template-columns: auto 1fr;
grid-template-columns: max-content minmax(0, auto) auto;
}
:global(.badge-tag-color) {
background-color: var(--tag-color) !important;
}
</style>
@@ -29,6 +29,7 @@
import { site } from '$lib/lemmy.js'
import { fly } from 'svelte/transition'
import { backOut } from 'svelte/easing'
import { t } from '$lib/translations'
export let post: Post
export let vote: number = 0
@@ -42,7 +43,7 @@
const castVote = async (newVote: number) => {
if (!$profile?.jwt) {
toast({ content: 'You must be logged in to vote.', type: 'warning' })
toast({ content: $t('toast.loginVoteGate'), type: 'warning' })
return
}
loading = true
@@ -56,8 +57,8 @@
<slot {vote} {score}>
<div
class="{buttonColor.secondary} rounded-lg h-full flex items-center [&>*]:p-2
hover:bg-white hover:dark:bg-zinc-900 overflow-hidden transition-colors
class="{buttonColor.secondary} rounded-lg h-8 flex items-center [&>*]:p-2
hover:bg-white hover:dark:bg-zinc-900 overflow-hidden transition-colors flex-shrink-0
{loading ? 'animate-pulse opacity-75 pointer-events-none' : ''}"
>
<button
@@ -7,6 +7,11 @@
import { ArchiveBox, Icon, Minus, Plus } from 'svelte-hero-icons'
import { expoOut } from 'svelte/easing'
import { fly, slide } from 'svelte/transition'
import { browser } from '$app/environment'
import { afterUpdate, onMount, tick, type SvelteComponent } from 'svelte'
import { createWindowVirtualizer } from '@tanstack/svelte-virtual'
import { afterNavigate, beforeNavigate } from '$app/navigation'
import { _posts } from '../../../../../routes/+page.svelte'
type PostViewWithCrossposts = PostView & {
withCrossposts: true
@@ -103,11 +108,11 @@
<li
in:fly|global={{
y: -8,
duration: index < 4 ? 500 : 0,
duration: 500,
opacity: 0,
delay: index < 4 ? index * 100 : 0,
delay: 100 + index * 20,
}}
class="relative"
class="relative post-container"
>
<Post
hideCommunity={community}
@@ -116,35 +121,35 @@
? 'compact'
: $userSettings.view}
{post}
class="transition-all duration-250 {post.withCrossposts &&
viewPost != post.post.id
? ''
: ''}"
class="transition-all duration-250"
on:hide={() => {
posts = posts.toSpliced(index, 1)
}}
>
<button
slot="badges"
class:hidden={!post.withCrossposts}
on:click={() => {
if (viewPost == post.post.id) viewPost = -1
else viewPost = post.post.id
}}
>
<svelte:fragment slot="badges">
{#if post.withCrossposts}
<Badge
class="z-10 backdrop-blur-xl hover:brightness-110 cursor-pointer transition-all"
color="gray-subtle"
<button
on:click={() => {
if (viewPost == post.post.id) viewPost = -1
else viewPost = post.post.id
}}
>
{#if viewPost == post.post.id}
<Icon mini src={Minus} size="14" />
{:else}
<Icon mini src={Plus} size="14" />
{/if}
{post.crossposts.length} crosspost{post.crossposts.length == 1
? ''
: 's'}
</Badge>
{/if}
</button>
<Badge
class="z-10 backdrop-blur-xl hover:brightness-110 cursor-pointer transition-all"
color="gray-subtle"
>
{#if viewPost == post.post.id}
<Icon mini src={Minus} size="14" />
{:else}
<Icon mini src={Plus} size="14" />
{/if}
{post.crossposts.length} crosspost{post.crossposts.length ==
1
? ''
: 's'}
</Badge>
</button>{/if}
</svelte:fragment>
</Post>
{#if post.withCrossposts && viewPost == post.post.id}
<div
@@ -172,4 +177,5 @@
{/if}
{/each}
{/if}
<slot />
</ul>
@@ -0,0 +1,222 @@
<script lang="ts">
import Post from '$lib/components/lemmy/post/Post.svelte'
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { userSettings } from '$lib/settings.js'
import type { PostView } from 'lemmy-js-client'
import { Badge, Button } from 'mono-svelte'
import { ArchiveBox, Icon, Minus, Plus } from 'svelte-hero-icons'
import { expoOut } from 'svelte/easing'
import { fly, slide } from 'svelte/transition'
import { browser } from '$app/environment'
import { afterUpdate, onMount, tick, type SvelteComponent } from 'svelte'
import { createWindowVirtualizer } from '@tanstack/svelte-virtual'
import { afterNavigate, beforeNavigate } from '$app/navigation'
import { _posts } from '../../../../../routes/+page.svelte'
type PostViewWithCrossposts = PostView & {
withCrossposts: true
crossposts: PostView[]
}
type PostViewWithoutCrossposts = PostView & { withCrossposts?: false }
export let posts: PostView[]
export let community: boolean = false
const addCrosspostProperty = (
post: PostView,
crossposts: PostView[]
): PostViewWithCrossposts => ({
...post,
crossposts: crossposts,
withCrossposts: true,
})
const combineCrossposts = (
posts: PostView[]
): (PostViewWithCrossposts | PostViewWithoutCrossposts)[] => {
const urlMap = new Map<
string,
PostViewWithCrossposts | PostViewWithoutCrossposts
>()
const results: (PostViewWithCrossposts | PostViewWithoutCrossposts)[] = []
const seenUrls = new Set<string>()
posts?.forEach((post) => {
if (
!post ||
($userSettings.hidePosts.deleted && post.post.deleted) ||
($userSettings.hidePosts.removed && post.post.removed)
)
return
if (!post?.post?.url) {
results.push(post)
return
}
let existing = urlMap.get(post.post.url)
if (existing) {
existing.withCrossposts = true
if (existing.withCrossposts) {
existing.crossposts = [...(existing.crossposts || []), post]
}
urlMap.set(post.post.url, existing)
} else {
urlMap.set(post.post.url, post)
results.push(post)
}
seenUrls.add(post.post.url)
})
return results
}
// $: combinedPosts = combineCrossposts(posts)
let viewPost: number = -1
const virtualizer = createWindowVirtualizer({
count: posts.length,
estimateSize: () => 150,
})
$: if (posts.length)
$virtualizer.setOptions({
count: posts.length,
})
let virtualItemEls: HTMLElement[] = []
$: items = $virtualizer.getVirtualItems()
$: {
if (virtualItemEls.length)
virtualItemEls.forEach((el) => $virtualizer.measureElement(el))
}
afterNavigate(() => {
$virtualizer.scrollToIndex($_posts?.lastSeen)
})
</script>
<ul
class="flex flex-col list-none {$userSettings.view == 'card'
? 'gap-3 md:gap-4'
: 'divide-y'} divide-slate-200 dark:divide-zinc-800"
style={$userSettings.leftAlign
? `--template-areas:
'media meta'
'media title'
'media body'
'embed embed'
'actions actions'; --template-columns: auto 1fr;`
: ``}
>
{#if posts?.length == 0}
<div class="h-full grid place-items-center">
<Placeholder
icon={ArchiveBox}
title="No posts"
description="There are no posts that match this filter."
>
<Button href="/communities">
<Icon src={Plus} size="16" mini slot="prefix" />
<span>Follow some communities</span>
</Button>
</Placeholder>
</div>
{:else}
<!-- {#each combinedPosts as post, index} -->
<!-- {#if !($userSettings.hidePosts.deleted && post.post.deleted) && !($userSettings.hidePosts.removed && post.post.removed)} -->
<div
style="position:relative; height: {browser
? `${$virtualizer.getTotalSize()}px`
: '100%'}; width: 100%;"
>
<div
style="position: absolute; top: 0; left: 0; width: 100%; transform: translateY({items[0]
? items[0].start
: 0}px);"
class="divide-y divide-slate-200 dark:divide-zinc-800"
id="feed"
>
{#each items as row, index (row.index)}
<li
in:fly|global={{
y: -8,
duration: 300,
opacity: 0,
delay: 50 + index * 20,
}}
bind:this={virtualItemEls[index]}
data-index={row.index}
class="relative post-container"
>
<Post
hideCommunity={community}
view={(posts[row.index].post.featured_community ||
posts[row.index].post.featured_local) &&
$userSettings.posts.compactFeatured
? 'compact'
: $userSettings.view}
post={posts[row.index]}
class="transition-all duration-250"
on:hide={() => {
posts = posts.toSpliced(row.index, 1)
}}
>
<svelte:fragment slot="badges">
<!-- {#if posts[index].withCrossposts}
<button
on:click={() => {
if (viewPost == posts[index].post.id) viewPost = -1
else viewPost = posts[index].post.id
}}
>
<Badge
class="z-10 backdrop-blur-xl hover:brightness-110 cursor-pointer transition-all"
color="gray-subtle"
>
{#if viewPost == posts[index].post.id}
<Icon mini src={Minus} size="14" />
{:else}
<Icon mini src={Plus} size="14" />
{/if}
{posts[index].crossposts.length} crosspost{posts[index]
.crossposts.length == 1
? ''
: 's'}
</Badge>
</button>{/if} -->
</svelte:fragment>
</Post>
<!-- {#if posts[index].withCrossposts && viewPost == posts[index].post.id}
<div
transition:slide|global={{
axis: 'y',
duration: 500,
easing: expoOut,
}}
>
<span
class="text-sm flex flex-row gap-2 items-center"
class:my-4={$userSettings.view == 'card'}
>
Crossposts <hr class="w-full dark:border-zinc-800" />
{posts[index].crossposts.length}
</span>
{#each posts[index].crossposts as crosspost, index}
<div class="w-full transition-all mb-4">
<Post post={crosspost} view={$userSettings.view} />
</div>
{/each}
</div>
{/if} -->
</li>
{/each}
</div>
</div>
<!-- {/if} -->
<!-- {/each} -->
{/if}
<slot />
</ul>
+39 -15
View File
@@ -1,4 +1,4 @@
import { getInstance } from '$lib/lemmy.js'
import { client, getInstance } from '$lib/lemmy.js'
import type { View } from '$lib/settings'
import { isImage, isVideo } from '$lib/ui/image'
import { findClosestNumber } from '$lib/util'
@@ -12,18 +12,19 @@ export const bestImageURL = (
compact: boolean = true,
width: number = 1024
) => {
if (width > 1024) {
if (post.url) return `${post.url}?format=webp`
else if (post.thumbnail_url) return `${post.thumbnail_url}?format=webp`
}
let fetchWidth =
width > 1024
? // -1 disables a small thumbnail
-1
: // set width to 512 if compact
compact
? 512
: // otherwise, just use the original width
width
if (compact && post.thumbnail_url)
return `${post.thumbnail_url}?thumbnail=256&format=webp`
else if (compact && post.url) return `${post.url}?thumbnail=256&format=webp`
if (post.url) return `${post.url}?thumbnail=${width}&format=webp`
else if (post.thumbnail_url)
return `${post.thumbnail_url}?thumbnail=${width}&format=webp`
if (post.thumbnail_url)
return optimizeImageURL(post.thumbnail_url, fetchWidth)
else if (post.url) return optimizeImageURL(post.url, fetchWidth)
return post.url ?? ''
}
@@ -34,15 +35,25 @@ export const optimizeImageURL = (
): string => {
try {
const url = new URL(urlStr)
url.searchParams.append('format', 'webp')
url.searchParams.append('thumbnail', findClosestNumber([128, 256, 512, 1024], width).toString())
if (width > 0) {
url.searchParams.append(
'thumbnail',
findClosestNumber([128, 256, 512, 728, 1024, 1536], width).toString()
)
}
return url.toString()
} catch (e) {
console.log(e)
return urlStr
}
}
const YOUTUBE_REGEX = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/
const YOUTUBE_REGEX =
/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|shorts\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
export const isYoutubeLink = (url?: string): RegExpMatchArray | null => {
if (!url) return null
@@ -69,4 +80,17 @@ export const iframeType = (post: Post): IframeType => {
if (isVideo(post.url)) return 'video'
if (isYoutubeLink(post.url)) return 'youtube'
return 'none'
}
}
export async function hidePost(
id: number,
hide: boolean,
jwt: string
): Promise<boolean> {
const res = await client({ auth: jwt }).hidePost({
hide: hide,
post_ids: [id],
})
return hide
}
@@ -5,13 +5,25 @@
return 'www.youtube-nocookie.com'
}
case 'invidious': {
return 'vid.puffyan.us'
return get(userSettings).embeds.invidious || 'yewtu.be'
}
case 'piped': {
return 'piped.video'
return get(userSettings).embeds.piped || 'piped.video'
}
}
}
function youtubeVideoID(url: string): string | null {
const regex =
/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|shorts\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
const match = url.match(regex)
if (match && match[1]) {
return match[1]
}
return null
}
</script>
<script lang="ts">
@@ -23,6 +35,7 @@
} from 'svelte-hero-icons'
import { optimizeImageURL, type IframeType, type MediaType } from '../helpers'
import { userSettings } from '$lib/settings'
import { get } from 'svelte/store'
export let type: IframeType = 'none'
export let thumbnail: string | undefined = undefined
@@ -36,8 +49,8 @@
if (type == 'youtube') {
const url = new URL(inputUrl)
const videoID = url.searchParams.get('v')
url.searchParams.delete('v')
const videoID = youtubeVideoID(inputUrl)
return `https://${youtubeDomain(
$userSettings.embeds.youtube
@@ -79,6 +92,10 @@
$: embedUrl = urlToEmbed(url)
</script>
<!--
@component
Displays a video file or embedded video iframe.
-->
{#if opened}
{#if type == 'video'}
<!-- svelte-ignore a11y-media-has-caption -->
@@ -13,13 +13,23 @@
import { userSettings } from '$lib/settings.js'
import type { Post } from 'lemmy-js-client'
import PostIframe from './PostIframe.svelte'
import { Button, Material } from 'mono-svelte'
export let view: 'card' | 'cozy' | 'list' | 'compact' = 'cozy'
export let post: Post
export let type: MediaType = 'none'
export let opened: boolean | undefined = undefined
export let blur: boolean = post.nsfw && $userSettings.nsfwBlur
let showAltText = false
</script>
<!--
@component
This component will show either
- A media item (pictures, videos) (large form factor posts only)
- Embed link/card.
-->
{#if type == 'image'}
{#if view == 'card' || view == 'cozy'}
<!--disabled preloads here since most people will hover over every image while scrolling-->
@@ -34,11 +44,11 @@
role="button"
tabindex="0"
>
<!-- svelte-ignore a11y-missing-attribute -->
<img
src={bestImageURL(post, false, 256)}
src={bestImageURL(post, false, 64)}
loading="lazy"
class="-z-10 absolute top-0 left-0 w-full h-full object-cover blur-xl opacity-50"
alt="the background blur"
class="-z-10 absolute top-0 left-0 w-full h-full object-cover blur-xl opacity-40"
/>
<picture class="max-h-[inherit]">
<source
@@ -49,17 +59,44 @@
srcset={bestImageURL(post, false, 512)}
media="(max-width: 512px)"
/>
<source
srcset={bestImageURL(post, false, 1024)}
media="(max-width: 1024px)"
/>
<source
srcset={bestImageURL(post, false, 1512)}
media="(max-width: 1512px)"
/>
<!-- svelte-ignore a11y-missing-attribute -->
<img
src={bestImageURL(post, false, 1024)}
src={bestImageURL(post, false, 2048)}
loading="lazy"
class="max-h-[inherit] max-w-full h-auto z-30
transition-opacity duration-300 object-contain mx-auto"
width={512}
height={300}
class:blur-3xl={post.nsfw && $userSettings.nsfwBlur}
class:blur-3xl={blur}
alt={post.alt_text ?? ''}
/>
</picture>
{#if post.alt_text}
<Button
on:click={(e) => {
e.stopPropagation()
showAltText = !showAltText
}}
class="absolute bottom-0 left-0 text-sm m-2 text-left"
size="sm"
rounding="lg"
alignment="left"
>
{#if showAltText}
{post.alt_text}
{:else}
<span class="font-bold">ALT</span>
{/if}
</Button>
{/if}
</svelte:element>
{/if}
{:else if (type == 'iframe' || type == 'video') && (view == 'cozy' || view == 'card') && post.url}
@@ -72,10 +109,10 @@
{:else if type == 'embed' && post.url}
<PostLink
url={post.url}
thumbnail_url={post.thumbnail_url}
thumbnail_url={view != 'list' ? post.thumbnail_url : undefined}
nsfw={post.nsfw}
embed_description={post.embed_description}
embed_title={post.embed_title}
compact={view == 'compact'}
compact={view == 'compact' || (view == 'list' && !post.embed_title)}
/>
{/if}
@@ -1,34 +1,93 @@
<script lang="ts">
import { bestImageURL, postLink } from '$lib/components/lemmy/post/helpers.js'
import {
bestImageURL,
optimizeImageURL,
postLink,
type MediaType,
} from '$lib/components/lemmy/post/helpers.js'
import { showImage } from '$lib/components/ui/ExpandableImage.svelte'
import { userSettings } from '$lib/settings.js'
import { isImage } from '$lib/ui/image'
import type { Post } from 'lemmy-js-client'
import { Material, Popover } from 'mono-svelte'
import { DocumentText, Icon, Link, VideoCamera } from 'svelte-hero-icons'
export let view: 'card' | 'cozy' | 'list' | 'compact' = 'cozy'
export let post: Post
export let type: MediaType = 'none'
</script>
{#if (view == 'list' || view == 'compact') && !post.embed_title && (post.thumbnail_url || isImage(post.url))}
<div class="flex-shrink-0 w-24 h-24" style={$$props.style ?? ''}>
{#if !$userSettings.expandImages || (post.thumbnail_url && !isImage(post.url))}
<a href={postLink(post)}>
<!-- svelte-ignore a11y-missing-attribute -->
<img
src={bestImageURL(post, true)}
loading="lazy"
class="object-cover bg-slate-100 dark:bg-zinc-800 rounded-md h-24 w-24 border border-slate-200 dark:border-zinc-700"
/>
</a>
<!--
@component
Thumbnails for compact and list view posts.
-->
<div
class="w-24 sm:w-32 h-24 relative group/media {$$props.class ?? ''}"
style={$$props.style ?? ''}
>
{#if post.alt_text}
<Popover
openOnHover
placement={$userSettings.leftAlign ? 'bottom-start' : 'bottom-end'}
>
<Material
slot="target"
padding="none"
rounding="full"
elevation="high"
class="w-max absolute bottom-0 left-0 py-0.5 px-1.5 m-1 font-bold"
>
ALT
</Material>
<div class="max-w-sm">
{post.alt_text}
</div>
</Popover>
{/if}
<svelte:element
this={!$userSettings.expandImages || type != 'image' ? 'a' : 'button'}
href={postLink(post)}
on:click={() => {
if (type == 'image') {
showImage(bestImageURL(post, false, 2048))
}
}}
role="button"
tabindex="0"
>
{#if post.thumbnail_url || isImage(post.url)}
<img
src={optimizeImageURL(post.thumbnail_url || post.url || '', 128)}
loading="lazy"
class="object-cover overflow-hidden bg-slate-100 dark:bg-zinc-800 rounded-xl h-24 w-24 sm:w-32
border border-slate-200 dark:border-zinc-800 group-hover/media:border-slate-400
group-hover/media:dark:border-zinc-600 transition-colors"
alt={post.name}
/>
{#if type != 'image'}
<div
class="relative w-7 h-7 bottom-8 left-1 rounded-lg text-slate-800 dark:text-zinc-200
backdrop-blur-sm bg-[#ffffff]/75 dark:bg-black/75 grid place-items-center"
>
<Icon src={type == 'iframe' ? VideoCamera : Link} mini size="16" />
</div>
{/if}
{:else}
<button on:click={() => showImage(bestImageURL(post, false, 2048))}>
<!-- svelte-ignore a11y-missing-attribute -->
<img
src={bestImageURL(post, true)}
loading="lazy"
class="object-cover bg-slate-100 rounded-md h-24 w-24 border border-slate-200 dark:border-zinc-700"
<div
class="object-cover overflow-hidden bg-slate-100 dark:bg-zinc-800 rounded-xl h-24 w-24 sm:w-32
border border-slate-200 dark:border-zinc-800 group-hover/media:border-slate-400
group-hover/media:dark:border-zinc-600 transition-colors text-slate-400 dark:text-zinc-600 grid
place-items-center"
>
<Icon
src={type == 'embed'
? Link
: type == 'iframe'
? VideoCamera
: DocumentText}
solid
size="32"
/>
</button>
</div>
{/if}
</div>
{/if}
</svelte:element>
</div>
+31 -5
View File
@@ -16,20 +16,29 @@
</script>
<a
class="items-center inline-flex flex-row gap-1 hover:underline {$$props.class ??
class="items-center flex flex-row gap-1 hover:underline max-w-full min-w-0 {$$props.class ??
''}"
href="/u/{user.name}@{new URL(user.actor_id).hostname}"
data-sveltekit-preload-data="tap"
>
{#if avatar}
<Avatar url={user.avatar} alt={user.name} width={avatarSize} />
<Avatar
url={user.avatar}
alt={user.name}
width={avatarSize}
class="flex-shrink-0"
/>
{/if}
<span class="flex flex-wrap gap-0 items-center" class:ml-0.5={avatar}>
<span class:font-medium={showInstance}>
<span
class="flex gap-0 items-center flex-shrink max-w-full min-w-0"
class:ml-0.5={avatar}
>
<span class:font-medium={showInstance} class="username-text">
{$userSettings.displayNames ? user.display_name || user.name : user.name}
</span>
{#if showInstance}
<span
class="text-slate-500 dark:text-zinc-500 font-normal {$$props.instanceClass ??
class="text-slate-500 dark:text-zinc-500 font-normal instance-text flex-shrink {$$props.instanceClass ??
''}"
>
@{new URL(user.actor_id).hostname}
@@ -48,3 +57,20 @@
<slot name="badges" />
{/if}
</a>
<style>
.instance-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
max-width: 100%;
flex: 1;
}
.username-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
@@ -1,5 +1,6 @@
<script lang="ts">
import { goto } from '$app/navigation'
import { t } from '$lib/translations'
import { TextInput } from 'mono-svelte'
let query: string = ''
@@ -15,7 +16,8 @@
<TextInput
bind:value={query}
class="w-full h-full {$$props.class}"
placeholder="Search"
placeholder={$t('nav.search')}
autofocus
/>
</form>
<slot {search} {loading} />
+7 -2
View File
@@ -1,10 +1,12 @@
<script lang="ts">
import { page } from '$app/stores'
import { env } from '$env/dynamic/public'
import { md, mdInline, photonify } from '$lib/components/markdown/markdown'
import { onMount } from 'svelte'
export let source: string = ''
export let inline: boolean = false
export let noStyle: boolean = false
let rendered = ''
@@ -16,7 +18,7 @@
const photonified = photonify(l.href)
if (photonified) l.href = photonified
else {
else if (!l.href.startsWith($page.url.origin)) {
l.target = '_blank'
l.rel = 'noopener noreferrer'
}
@@ -52,7 +54,10 @@
<div
bind:this={div}
class="break-words flex flex-col markdown gap-2 leading-[1.5] {$$props.class}"
class="{noStyle
? ''
: 'break-words flex flex-col markdown gap-2 leading-[1.5]'} {$$props.class}"
style={$$props.style}
>
{@html rendered}
</div>
@@ -2,6 +2,7 @@
import { profile } from '$lib/auth.js'
import MultiSelect from '$lib/components/input/Switch.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import { t } from '$lib/translations'
import { uploadImage } from '$lib/util.js'
import { ImageInput, toast } from 'mono-svelte'
import { Button, Label, Modal, TextArea } from 'mono-svelte'
@@ -19,7 +20,7 @@
export let images: boolean = true
export let value: string = ''
export let label: string | undefined = undefined
export let previewButton: boolean = false
export let previewButton: boolean = true
export let tools: boolean = true
export let disabled: boolean = false
export let rows: number = 4
@@ -63,12 +64,11 @@
let uploadingImage = false
let loading = false
let image: any
$: previewURL =
image instanceof FileList
? URL.createObjectURL(image[0])
: image
? URL.createObjectURL(image)
: ''
$: previewURL = image?.length
? URL.createObjectURL(image[0])
: image
? URL.createObjectURL(image)
: ''
async function upload() {
if (!$profile?.jwt || !image) return
@@ -97,7 +97,7 @@
loading = false
}
let previewing = false
export let previewing = false
const shortcuts = {
KeyB: () => wrapSelection('**', '**'),
@@ -166,7 +166,7 @@
</Label>
{/if}
<div
class="flex flex-col border border-slate-300 dark:border-zinc-800
class="flex flex-col border border-slate-200 border-b-slate-300 dark:border-t-zinc-700 dark:border-zinc-800
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring ring-slate-300
dark:ring-zinc-700 rounded-xl
overflow-hidden transition-colors"
@@ -174,7 +174,8 @@ overflow-hidden transition-colors"
>
{#if previewing}
<div
class="px-3 py-2.5 h-32 overflow-auto text-sm resize-y bg-white dark:bg-zinc-950"
class="px-3 py-2.5 overflow-auto text-sm resize-y bg-white dark:bg-zinc-950"
style="height: {rows * 2}em"
>
<Markdown source={beforePreview(value)} />
</div>
@@ -182,7 +183,8 @@ overflow-hidden transition-colors"
{#if tools}
<!--Toolbar-->
<div
class="[&>*]:flex-shrink-0 flex flex-row overflow-auto p-1.5 gap-1.5 {$$props.disabled
class="[&>*]:flex-shrink-0 flex flex-row overflow-auto p-1.5 gap-1.5 border-b
border-slate-200 dark:border-zinc-900 {$$props.disabled
? 'opacity-60 pointer-events-none'
: ''}"
>
@@ -311,13 +313,13 @@ overflow-hidden transition-colors"
/>
{/if}
{#if $$slots.default && previewButton}
{#if previewButton}
<div class="p-2 flex items-center w-full bg-white dark:bg-zinc-950">
{#if previewButton}
<MultiSelect
bind:selected={previewing}
options={[false, true]}
optionNames={['Edit', 'Preview']}
optionNames={[$t('form.edit'), $t('form.preview')]}
/>
{/if}
<slot />
@@ -0,0 +1,116 @@
<script lang="ts">
import { Button, Modal, Select, Spinner, TextArea } from 'mono-svelte'
import { text } from './translation'
import { locale, t } from '$lib/translations'
import { userSettings } from '$lib/settings'
import { ArrowRight, Icon } from 'svelte-hero-icons'
import MarkdownEditor from '../markdown/MarkdownEditor.svelte'
interface TranslateResponse {
translatedText: string
}
export let open: boolean = false
let error = false
const opened = () => translate($text)
$: if (open) opened()
let result: Promise<TranslateResponse> | undefined = undefined
let from = 'auto'
let to = $locale
async function translate(text: string) {
const url = $userSettings.translator
if (!url) {
return
}
error = false
const requestURL = new URL(`https://${url}/translate`)
requestURL.searchParams.set('q', text)
requestURL.searchParams.set('source', from)
requestURL.searchParams.set('target', to)
requestURL.searchParams.set('alternatives', '')
result = fetch(requestURL.toString(), {
method: 'POST',
}).then(async (res) => {
if (!res.ok) {
error = true
throw new Error(`${res.status} ${res.statusText}`)
return {
translatedText: `${res.status} ${res.statusText}`,
}
}
return await res.json()
})
}
</script>
<Modal title={$t('post.actions.more.translate')} bind:open>
<TextArea bind:value={$text} rows={2}>
<Button on:click={() => translate($text)} slot="suffix" color="primary">
{$t('post.actions.more.translate')}
</Button>
</TextArea>
<div class="flex items-center gap-2 w-full">
<Select bind:value={from} class="flex-1">
<option value="auto">Auto</option>
</Select>
<Icon src={ArrowRight} mini size="20" />
<Select on:change={() => translate($text)} bind:value={to} class="flex-1">
<option value="en">English</option>
<option value="ar">Arabic</option>
<option value="zh">Chinese</option>
<option value="cs">Czech</option>
<option value="nl">Dutch</option>
<option value="fi">Finnish</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="el">Greek</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="pl">Polish</option>
<option value="es">Spanish</option>
<option value="sv">Swedish</option>
</Select>
</div>
{#if result}
{#await result}
<div
style="height: 226px; width:100%;"
class="flex items-center justify-center"
>
<Spinner width={32} />
</div>
{:then result}
{#if !error}
<MarkdownEditor
previewButton={false}
previewing
tools={false}
rows={8}
value={result.translatedText || 'Failed to translate'}
disabled
></MarkdownEditor>
{/if}
{:catch err}
<MarkdownEditor
previewButton={false}
previewing
tools={false}
disabled
rows={8}
value={err || 'Failed to translate'}
class="!border-red-500 !ring-red-500 !text-red-500"
></MarkdownEditor>
{/await}
{:else}
<TextArea disabled />
{/if}
</Modal>
@@ -0,0 +1,3 @@
import { writable } from 'svelte/store'
export let text = writable<string>(undefined)
+26 -5
View File
@@ -3,7 +3,7 @@
import { createAvatar } from '@dicebear/core'
import * as initials from '@dicebear/initials'
const sizes = [48, 64, 128, 256, 512]
const sizes = [16, 32, 48, 64, 128, 256, 512]
export let url: string | undefined
export let alt: string = ''
@@ -12,24 +12,45 @@
export let width: number
export let res: number | undefined = undefined
const optimizeUrl = (url: string | undefined): string | undefined => {
if (url === undefined) return
try {
const urlObj = new URL(url)
urlObj.searchParams.append('format', 'webp')
urlObj.searchParams.append(
'thumbnail',
findClosestNumber(sizes, res || width).toString()
)
return urlObj.toString()
} catch (e) {
return undefined
}
}
$: optimizedURL = optimizeUrl(url)
</script>
{#if url}
{#if optimizedURL}
<img
src="{url}?format=webp&thumbnail={findClosestNumber(sizes, res || width)}"
src={optimizedURL}
{alt}
{width}
{title}
loading="lazy"
class="aspect-square object-cover overflow-hidden {$$props.class}"
class="aspect-square object-cover overflow-hidden {$$props.class} flex-shrink-0"
style="width: {width}px; height: {width}px;"
class:rounded-full={circle}
class:rounded-md={!circle}
/>
{:else}
<div
style="width: {width}px; height: {width}px;"
class="aspect-square object-cover overflow-hidden {$$props.class}"
class="aspect-square object-cover overflow-hidden {$$props.class} flex-shrink-0"
class:rounded-full={circle}
class:rounded-md={!circle}
>
{@html createAvatar(initials, {
seed: alt,
+4 -2
View File
@@ -7,9 +7,11 @@
</script>
<div class="flex flex-row gap-2 items-center">
<Avatar url={icon} width={32} />
<slot name="icon">
<Avatar url={icon} width={32} />
</slot>
<div class="flex flex-col">
<span class="font-medium">{name}</span>
<span class="font-bold text-base">{name}</span>
<span class="text-sm">{label}</span>
</div>
</div>
+1 -1
View File
@@ -39,7 +39,7 @@
width={400}
height={400}
src={$page.state.openImage}
class="w-full h-auto object-contain max-w-screen-sm mx-auto my-auto overscroll-contain bg-white dark:bg-zinc-900"
class="w-full object-contain max-w-screen-md mx-auto my-auto overscroll-contain bg-white dark:bg-zinc-900"
transition:scale={{ start: 0.95, easing: backOut, duration: 250 }}
{alt}
/>
+3 -2
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { t } from '$lib/translations'
import { Button } from 'mono-svelte'
import { createEventDispatcher } from 'svelte'
import {
@@ -32,7 +33,7 @@
class={$$slots.default ? '' : 'flex-1'}
>
<Icon src={ChevronLeft} size="18" mini slot="prefix" />
Back
{$t('common.back')}
</Button>
{/if}
@@ -43,7 +44,7 @@
}}
class={$$slots.default ? '' : 'flex-1'}
>
Next
{$t('common.next')}
<Icon src={ChevronRight} size="18" mini slot="suffix" />
</Button>
</div>
+64 -25
View File
@@ -15,7 +15,7 @@
if (panel) {
if (top) {
if (content) return '!pt-20'
else return 'top-16'
else return 'top-16 !max-h-[calc(100vh-4rem)]'
} else return '!pb-20'
} else {
if (!content) return ''
@@ -27,41 +27,80 @@
return 'hi this is easter egg, my code broke'
}
$: contentPadding = calculatePadding(
$userSettings.dock.noGap,
$userSettings.dock.top,
true
)
$: sidePadding = calculatePadding(
$userSettings.dock.noGap,
$userSettings.dock.top,
false
)
$: topPanel = $userSettings.dock.noGap && $userSettings.dock.top
let screenWidth = 1000
const calculateDockProperties = (
settings: typeof $userSettings.dock,
screenWidth: number
): {
noGap: boolean
top: boolean
} => {
let panel = false
let top = false
if (screenWidth >= 1000) {
panel = true
top = true
} else if (screenWidth > 800) {
panel = true
top = false
} else if (screenWidth > 600) {
panel = false
top = false
}
panel = settings.noGap ?? panel
top = settings.top ?? top
return {
noGap: panel,
top: top,
}
}
$: dockProps = calculateDockProperties($userSettings.dock, screenWidth)
$: contentPadding = calculatePadding(dockProps.noGap, dockProps.top, true)
$: sidePadding = calculatePadding(dockProps.noGap, dockProps.top, false)
$: topPanel = dockProps.noGap && dockProps.top
</script>
<div class="shell {$$props.class}" style={colorsToVars($colors)}>
<svelte:window bind:innerWidth={screenWidth} />
<div
{...$$restProps}
class="shell {$$props.class}"
style={colorsToVars($colors)}
>
<slot />
<div
class="
{$userSettings.dock.noGap ? '' : 'p-4 max-w-3xl left-1/2 -translate-x-1/2'}
{$userSettings.dock.top ? 'top-0' : 'bottom-0'}
{dockProps.noGap ? '' : 'p-4 max-w-3xl left-1/2 -translate-x-1/2'}
{dockProps.top ? 'top-0' : 'bottom-0'}
{topPanel ? 'fixed top-0' : 'fixed'}
w-full z-50 pointer-events-none"
style="grid-area: navbar;"
style="grid-area: navbar;
transition-property: padding, top, bottom;
transition-duration: 250ms;
transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1);"
>
<slot
name="navbar"
class="
{$userSettings.dock.noGap
? $userSettings.dock.top
? 'border-b shadow-none'
: 'border-t'
{dockProps.noGap
? dockProps.top
? 'border-b shadow-none rounded-none'
: 'border-t rounded-none'
: 'border rounded-full'}
border-slate-200 dark:border-zinc-800 shadow-2xl
backdrop-blur-xl dark:backdrop-brightness-[25%] bg-[#ffffff]/75 dark:bg-transparent transition-colors duration-500
pointer-events-auto"
dark:bg-transparent transition-colors duration-500
pointer-events-auto {topPanel
? 'bg-slate-50 dark:bg-zinc-950 border-slate-100 dark:border-zinc-900'
: `border-slate-200 dark:border-zinc-800 shadow-2xl backdrop-blur-xl
dark:backdrop-brightness-[25%] bg-[#ffffff]/75`}"
{title}
style="transition: border-radius 250ms;"
/>
</div>
<div
@@ -71,7 +110,7 @@
>
<slot
name="sidebar"
class="hidden md:flex sticky top-0 left-0 w-full max-w-full h-max bg-slate-50 dark:bg-zinc-950
class="hidden md:flex sticky top-0 left-0 max-w-full h-max bg-slate-50 dark:bg-zinc-950
z-40
{sidePadding}"
style="grid-area: sidebar; width: 100% !important;"
@@ -84,7 +123,7 @@
/>
<slot
name="suffix"
class="max-xl:hidden w-full sticky top-0 left-0 h-max bg-slate-50 dark:bg-zinc-950 z-40 {sidePadding}"
class="max-xl:hidden w-full sticky top-0 left-0 max-h-screen bg-slate-50 dark:bg-zinc-950 z-40 {sidePadding}"
style="grid-area: suffix;"
/>
</div>
@@ -1,5 +1,12 @@
<script lang="ts">
import { userSettings } from '$lib/settings'
</script>
<h1
class="text-2xl font-bold tracking-wider font-display flex items-center agp-1"
class="text-3xl font-bold flex items-center gap-2 {$userSettings.font ==
'satoshi/nunito'
? 'font-display'
: ''} {$$props.class ?? ''}"
>
<slot />
</h1>
+61 -94
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { profile, profileData } from '$lib/auth.js'
import { notifications, profile, profileData } from '$lib/auth.js'
import Link from '$lib/components/input/Link.svelte'
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
import {
@@ -8,7 +8,14 @@
} from '$lib/components/lemmy/moderation/moderation.js'
import Avatar from '$lib/components/ui/Avatar.svelte'
import { site } from '$lib/lemmy.js'
import { Button, Menu, MenuButton, MenuDivider, Spinner } from 'mono-svelte'
import {
Button,
Menu,
MenuButton,
MenuDivider,
Modal,
Spinner,
} from 'mono-svelte'
import {
GlobeAlt,
Home,
@@ -27,6 +34,10 @@
import { flip } from 'svelte/animate'
import SearchBar from '$lib/components/lemmy/util/SearchBar.svelte'
import { swipeGesture } from '$lib/input/swipe'
import Logo from '../Logo.svelte'
import { LINKED_INSTANCE_URL } from '$lib/instance'
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import { t } from '$lib/translations'
let searching = false
</script>
@@ -38,6 +49,24 @@
"
style={$$props.style}
>
<NavButton href="/" label={$t('nav.home')} class="ml-2 logo">
<svelte:fragment slot="icon">
{#if LINKED_INSTANCE_URL}
{#if $site}
<Avatar
alt={$site.site_view.site.name}
url={$site.site_view.site.icon}
width={32}
circle={false}
/>
{:else}
<Spinner width={32} />
{/if}
{:else}
<Logo width={32} />
{/if}
</svelte:fragment>
</NavButton>
{#if searching}
<div
class="w-full h-full absolute z-20 p-2 flex items-center gap-2 bg-white dark:bg-zinc-950
@@ -71,91 +100,19 @@
</SearchBar>
</div>
{/if}
<div class="flex flex-row gap-2 py-2 px-2 items-center w-full">
<Profile
placement="top"
itemsClass="h-8 md:h-8 z-10"
targetClass="z-10 h-10"
containerClass="!max-h-[28rem] z-10"
buttonClass=""
/>
{#if $profile}
<div
class="px-2 border-r border-l border-slate-200 dark:border-zinc-900
flex flex-row items-center gap-2 [&>*]:flex-shrink-0 overflow-x-auto overflow-y-hidden
md:max-w-64 sm:max-w-48 max-w-36 w-full max-[424px]:hidden"
>
{#each $profile.favorites ?? [] as favorite (favorite.id)}
<div
class="h-10 w-10 flex"
transition:scale={{
start: 0.7,
easing: backOut,
duration: 400,
delay: 0,
}}
animate:flip={{
easing: backOut,
duration: 400,
delay: 0,
}}
>
<NavButton
class="w-full h-full bg-slate-100 dark:bg-zinc-900 relative"
title={favorite.name}
href={favorite.url.toString()}
label={favorite.name}
>
{#if favorite.type == 'post'}
<div
class="relative w-full h-full grid place-items-center overflow-visible"
>
{#if favorite.subdivision}
<Avatar
alt={favorite.subdivision.name}
url={favorite.subdivision.avatar}
width={32}
res={64}
class=""
/>
<Icon
src={PencilSquare}
mini
size="20"
class="absolute -bottom-1 -right-1 rounded-full bg-slate-100 dark:bg-zinc-900 p-0.5"
/>
{/if}
</div>
{:else}
<Avatar
alt={favorite.name}
url={favorite.avatar}
res={64}
width={32}
class="w-full"
/>
<Icon
src={Newspaper}
mini
size="20"
class="absolute -bottom-1 -right-1 rounded-full bg-slate-100 dark:bg-zinc-900 p-0.5"
/>
{/if}
</NavButton>
</div>
{/each}
</div>
{/if}
<div
class="flex flex-row gap-2 py-2 px-2 items-center w-full rounded-full overflow-auto"
>
<div class="ml-auto" />
{#if $profile?.user && isAdmin($profile.user)}
<NavButton
href="/admin"
label="Admin"
label={$t('nav.admin')}
icon={ServerStack}
class="relative"
isSelectedFilter={(path) => path.startsWith('/admin')}
>
{#if ($profile?.user?.notifications.applications ?? 0) > 0}
{#if ($notifications.applications ?? 0) > 0}
<div
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
/>
@@ -163,8 +120,12 @@
</NavButton>
{/if}
{#if amModOfAny($profile?.user)}
<NavButton href="/moderation" label="Moderation" class="relative">
{#if ($profile?.user?.notifications.reports ?? 0) > 0}
<NavButton
href="/moderation"
label={$t('nav.moderation')}
class="relative"
>
{#if ($notifications.reports ?? 0) > 0}
<div
class="rounded-full w-2 h-2 bg-red-500 absolute -top-1 -left-1"
/>
@@ -172,29 +133,28 @@
<ShieldIcon let:isSelected slot="icon" filled={isSelected} width={18} />
</NavButton>
{/if}
<NavButton href="/communities" label="Explore" icon={GlobeAlt} />
<NavButton
href="/communities"
label={$t('nav.communities')}
icon={GlobeAlt}
/>
<NavButton
on:click={() => (searching = true)}
label="Search"
label={$t('nav.search')}
icon={MagnifyingGlass}
/>
<NavButton href="/" label="Home" icon={Home} />
<Menu placement="top">
<NavButton
class="relative"
color="primary"
slot="target"
label="Create"
label={$t('nav.create.label')}
icon={Plus}
/>
<MenuDivider>Create</MenuDivider>
<MenuButton
link
href="/create/post"
disabled={$profile?.jwt == undefined}
>
<MenuDivider>{$t('nav.create.label')}</MenuDivider>
<MenuButton link href="/create/post" disabled={!$profile?.jwt}>
<Icon src={PencilSquare} mini width={16} slot="prefix" />
Post
{$t('nav.create.post')}
</MenuButton>
<MenuButton
link
@@ -205,13 +165,20 @@
!isAdmin($profile.user))}
>
<Icon src={Newspaper} mini width={16} slot="prefix" />
Community
{$t('nav.create.community')}
</MenuButton>
{#if !$profile?.jwt}
<span class="text-sm mx-4 my-1 py-1">
<Link highlight href="/login">Log in</Link> to create content.
{$t('nav.create.logingate')}
</span>
{/if}
</Menu>
<Profile
placement="top"
itemsClass="h-8 md:h-8 z-10"
targetClass="z-10 h-10"
containerClass="!max-h-[28rem] z-10"
buttonClass=""
/>
</div>
</nav>
+50 -25
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { profile } from '$lib/auth'
import { notifications, profile } from '$lib/auth'
import {
Badge,
@@ -9,6 +9,7 @@
MenuDivider,
Modal,
Select,
Spinner,
toast,
} from 'mono-svelte'
import Avatar from '../Avatar.svelte'
@@ -32,17 +33,34 @@
} from 'svelte-hero-icons'
import { legacyTheme } from '$lib/ui/colors'
import { userSettings } from '$lib/settings'
import { goto } from '$app/navigation'
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import { site } from '$lib/lemmy'
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import { t } from '$lib/translations'
let showInstance = false
</script>
{#if showInstance}
<Modal bind:open={showInstance} title="Instance">
{#if $site}
<SiteCard
site={$site.site_view}
admins={$site.admins}
taglines={$site.taglines}
version={$site.version}
/>
{:else}
<Spinner />
{/if}
</Modal>
{/if}
<Menu {...$$restProps}>
<button
class="w-10 h-10 rounded-full ring-1 ring-slate-200 dark:ring-zinc-700
transition-all bg-slate-50 dark:bg-zinc-900 relative
hover:dark:brightness-125 hover:brightness {$$props.buttonClass}"
aria-label="Profile"
title={$t('profile.profile')}
slot="target"
>
{#if $profile?.user}
@@ -55,7 +73,7 @@
alt={$profile.user.local_user_view.person.name}
/>
</div>
{#if $profile.user.notifications.inbox > 0}
{#if $notifications.inbox > 0}
<div
class="rounded-full w-2 h-2 bg-red-500 absolute top-0 left-0 z-10"
/>
@@ -76,34 +94,36 @@
{$profile?.user?.local_user_view?.person.name}
</div>
{:else}
<MenuDivider>Profile</MenuDivider>
<MenuDivider>{$t('nav.menu.label')}</MenuDivider>
{/if}
{#if $profile?.user}
<MenuButton link href="/profile">
<Icon src={UserCircle} mini width={16} slot="prefix" /> Profile
<Icon src={UserCircle} mini width={16} slot="prefix" />
{$t('profile.profile')}
</MenuButton>
<MenuButton link href="/inbox">
<Icon src={Inbox} mini width={16} slot="prefix" />
Inbox
{#if $profile.user.notifications.inbox > 0}
{$t('profile.inbox')}
{#if $notifications.inbox > 0}
<Badge color="red-subtle" class="text-xs ml-auto font-bold !py-0.5">
{$profile.user.notifications.inbox}
{$notifications.inbox}
</Badge>
{/if}
</MenuButton>
<MenuButton link href="/saved">
<Icon src={Bookmark} mini width={16} slot="prefix" /> Saved
<Icon src={Bookmark} mini width={16} slot="prefix" />
{$t('profile.saved')}
</MenuButton>
{/if}
<MenuButton link href="/accounts">
<Icon src={UserGroup} mini width={16} slot="prefix" />
Accounts
{$t('account.accounts')}
</MenuButton>
<hr class="dark:opacity-10 w-[90%] my-2 mx-auto" />
<MenuDivider>App</MenuDivider>
<MenuDivider>{$t('nav.menu.app')}</MenuDivider>
<MenuButton link href="/settings">
<Icon src={Cog6Tooth} mini width={16} slot="prefix" />
Settings
{$t('nav.menu.settings')}
</MenuButton>
<MenuButton class="!py-0">
<Icon
@@ -118,20 +138,20 @@
size="16"
slot="prefix"
/>
<span>Color Scheme</span>
<span>{$t('nav.menu.colorscheme.label')}</span>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="contents" on:click|stopPropagation={() => {}}>
<Select bind:value={$legacyTheme} class="ml-auto my-auto w-24" size="sm">
<option value="system">System</option>
<option value="light">Light</option>
<option value="dark">Dark</option>
<option value="system">{$t('nav.menu.colorscheme.system')}</option>
<option value="light">{$t('nav.menu.colorscheme.light')}</option>
<option value="dark">{$t('nav.menu.colorscheme.dark')}</option>
</Select>
</div>
</MenuButton>
<MenuButton href="/theme">
<Icon src={Swatch} size="16" mini slot="prefix" />
Theme
{$t('nav.menu.theme')}
</MenuButton>
{#if $userSettings.debugInfo}
<MenuButton link href="/util">
@@ -148,16 +168,24 @@
class="hover:brightness-110 transition-all"
on:click={() => {
navigator?.clipboard?.writeText(__VERSION__)
toast({ content: 'Copied version to clipboard.' })
toast({ content: $t('toast.copied') })
}}
>
<Badge color="blue-subtle">{__VERSION__}</Badge>
</button>
</div>
<Button
on:click={() => (showInstance = !showInstance)}
color="tertiary"
title={$t('nav.menu.instance')}
size="square-md"
>
<Icon src={ServerStack} size="16" mini />
</Button>
<Button
color="tertiary"
href="https://buymeacoffee.com/xylight"
title="Donate"
title={$t('nav.menu.donate')}
size="square-md"
>
<Icon src={Heart} size="16" mini />
@@ -165,14 +193,11 @@
<Button
color="tertiary"
href="https://github.com/Xyphyn/Photon"
title="GitHub"
title={$t('nav.menu.source')}
size="square-md"
>
<Icon src={CodeBracketSquare} size="16" mini />
</Button>
<Button color="tertiary" href="/about" title="About" size="square-md">
<Icon src={InformationCircle} size="16" mini />
</Button>
</div>
</li>
</Menu>
+117
View File
@@ -0,0 +1,117 @@
import { t } from '$lib/translations'
import {
UserCircle,
type IconSource,
Home,
ChartBar,
Cog6Tooth,
Newspaper,
GlobeAmericas,
GlobeAlt,
MagnifyingGlass,
ShieldCheck,
ServerStack,
PencilSquare,
MapPin,
Fire,
ArrowTrendingUp,
Star,
} from 'svelte-hero-icons'
import { get } from 'svelte/store'
export interface Link {
url: string
label?: string
}
export const defaultLinks: Link[] = [
{
url: '/',
label: t.get('nav.home'),
},
{
url: '/?type=All',
label: t.get('filter.location.all'),
},
{
url: '/?type=Local',
label: t.get('filter.location.local'),
},
{
url: '/?type=Subscribed',
label: t.get('filter.location.subscribed'),
},
{
url: '/?type=All&sort=Hot',
label: t.get('filter.sort.hot'),
},
{
url: '/?type=All&sort=Active',
label: t.get('filter.sort.active'),
},
{
url: '/?type=All&sort=TopDay',
label: t.get('filter.sort.top.time.day'),
},
{
url: '/?type=All&sort=New',
label: t.get('filter.sort.new'),
},
{
url: '/communities',
label: t.get('nav.communities'),
},
{
url: '/search',
label: t.get('nav.search'),
},
{
url: '/moderation',
label: t.get('moderation.label'),
},
{
url: '/admin',
label: t.get('admin.label'),
},
{
url: '/settings',
label: t.get('nav.menu.settings'),
},
{
url: '/create/post',
label: t.get('form.post.create'),
},
]
export const iconOfLink = (url: string): IconSource => {
switch (url) {
case '/':
return Home
case '/?type=All':
return GlobeAmericas
case '/?type=Subscribed':
return Newspaper
case '/?type=Local':
return MapPin
case '/?type=All&sort=Hot':
return Fire
case '/?type=All&sort=Active':
return ArrowTrendingUp
case '/?type=All&sort=TopDay':
return ChartBar
case '/?type=All&sort=New':
return Star
case '/communities':
return GlobeAlt
case '/search':
return MagnifyingGlass
case '/moderation':
return ShieldCheck
case '/admin':
return ServerStack
case '/settings':
return Cog6Tooth
case '/create/post':
return PencilSquare
}
}
@@ -1,35 +1,67 @@
<script lang="ts">
import { profile } from '$lib/auth'
import Avatar from '$lib/components/ui/Avatar.svelte'
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
import { communityLink } from '$lib/lemmy/generic'
import { addFavorite } from '$lib/lemmy/item'
import { hasFavorite } from '$lib/lemmy/user'
import type { Community } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Icon, Star, Trash } from 'svelte-hero-icons'
import { flip } from 'svelte/animate'
import { expoOut } from 'svelte/easing'
import { slide } from 'svelte/transition'
export let items: Community[]
export let isFavorites = false
</script>
{#each items.sort( (a, b) => a.title.localeCompare(b.title) ) as follow (follow.id)}
<div
class="inline-flex w-full"
class="inline-flex w-full items-center pl-3 hover:bg-slate-100 hover:dark:bg-zinc-800
transition-colors rounded-lg"
animate:flip={{ duration: 500, easing: expoOut }}
>
<div class="flex-none grid group">
{#if $profile && !hasFavorite($profile, follow.id)}
<Button
rounding="pill"
size="custom"
class="hidden group-hover:inline-flex opacity-0 group-hover:opacity-100 transition-all z-20
items-center justify-center box-border w-7 h-7"
style="grid-column: 1; grid-row: 1;"
on:click={() => addFavorite(follow)}
>
<Icon src={Star} size="16" mini />
</Button>
{:else if isFavorites && $profile && hasFavorite($profile, follow.id)}
<Button
rounding="pill"
size="custom"
class="hidden group-hover:inline-flex opacity-0 group-hover:opacity-100 transition-all z-20
items-center justify-center box-border w-7 h-7"
style="grid-column: 1; grid-row: 1;"
on:click={() => addFavorite(follow, false)}
>
<Icon src={Trash} size="16" mini />
</Button>
{/if}
<Avatar
url={follow.icon}
alt={follow.name}
title={follow.title}
width={28}
class={!isFavorites && $profile && hasFavorite($profile, follow.id)
? ''
: 'group-hover:hidden'}
/>
</div>
<SidebarButton
class="font-normal w-full h-max"
color="tertiary"
color="none"
alignment="left"
href="/c/{follow.name}@{new URL(follow.actor_id).hostname}"
>
<div class="flex-none">
<Avatar
url={follow.icon}
alt={follow.name}
title={follow.title}
width={20}
slot="prefix"
/>
</div>
<div class="flex flex-col max-w-full break-words" slot="label">
<span>{follow.title}</span>
<span class="text-xs text-slate-600 dark:text-zinc-400">
@@ -3,8 +3,10 @@
import { page } from '$app/stores'
import { profile, setUserID, type Profile } from '$lib/auth.js'
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
import { LINKED_INSTANCE_URL } from '$lib/instance'
import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte'
import { Button } from 'mono-svelte'
import { Icon, QuestionMarkCircle } from 'svelte-hero-icons'
export let prof: Profile
export let index: number
@@ -22,9 +24,7 @@
on:click={async () => {
switching = true
if ($profile?.id == prof.id) {
await setUserID(-1)
} else {
if ($profile?.id != prof.id) {
await setUserID(prof.id)
}
@@ -46,14 +46,18 @@
slot="icon"
/>
<span
class="flex flex-col gap-0 {$profile?.id == prof.id ? 'font-semibold' : ''}"
slot="label"
class="inline-flex flex-col gap-0 {$profile?.id == prof.id
? 'font-semibold'
: ''}"
>
{prof.username ?? prof.user?.local_user_view.person.name}
{#if !guest}
{#if !guest && !LINKED_INSTANCE_URL}
<span class="text-slate-500 dark:text-zinc-400 font-normal text-xs">
{prof.instance}
</span>
{/if}
</span>
{#if !prof.jwt}
<Icon src={QuestionMarkCircle} size="14" micro class="ml-auto opacity-50" />
{/if}
</SidebarButton>
+120 -44
View File
@@ -14,7 +14,7 @@
UserCircle,
UserGroup,
} from 'svelte-hero-icons'
import { profile, profileData } from '$lib/auth.js'
import { notifications, profile, profileData } from '$lib/auth.js'
import { userSettings } from '$lib/settings.js'
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
import CommunityList from '$lib/components/ui/sidebar/CommunityList.svelte'
@@ -26,6 +26,11 @@
import Expandable from '$lib/components/ui/Expandable.svelte'
import EndPlaceholder from '../EndPlaceholder.svelte'
import Application from '../../../../routes/admin/applications/Application.svelte'
import { t } from '$lib/translations'
import ItemList from '$lib/components/lemmy/generic/ItemList.svelte'
import { iconOfLink } from '../navbar/link'
import { goto } from '$app/navigation'
import { page } from '$app/stores'
</script>
<nav
@@ -33,38 +38,73 @@
gap-1 h-fit max-h-screen {$$props.class}"
style={$$props.style}
>
{#if $userSettings.dock.pins?.length ?? 0 > 0}
<div class="flex items-center flex-wrap gap-2 pl-1.5">
{#each $userSettings.dock.pins as pin}
<SidebarButton
icon={iconOfLink(pin.url)}
on:click={() => goto(pin.url)}
color="tertiary"
alignment="center"
selected={`${$page.url.pathname}${$page.url.search}` == pin.url}
on:contextmenu={(e) => {
e.preventDefault()
$userSettings.dock.pins = $userSettings.dock.pins.toSpliced(
$userSettings.dock.pins.findLastIndex((p) => pin.url == p.url),
1
)
return false
}}
size="square-md"
></SidebarButton>
{/each}
</div>
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if}
{#if $profile?.jwt}
<SidebarButton icon={UserCircle} href="/profile/user">
Profile
<span slot="label">
{$t('profile.profile')}
</span>
</SidebarButton>
<SidebarButton icon={Inbox} href="/inbox">
Inbox
{#if $profile?.user?.notifications.inbox}
<Badge
class="w-5 h-5 !p-0 grid place-items-center ml-auto"
color="red-subtle"
>
{$profile?.user?.notifications.inbox}
</Badge>
{/if}
<span slot="label" class="flex items-center gap-2">
{$t('profile.inbox')}
{#if $notifications.inbox}
<Badge
class="w-5 h-5 !p-0 grid place-items-center ml-auto"
color="red-subtle"
>
{$notifications.inbox}
</Badge>
{/if}
</span>
</SidebarButton>
<SidebarButton icon={Bookmark} href="/saved">
<span slot="label">{$t('profile.saved')}</span>
</SidebarButton>
<SidebarButton icon={Bookmark} href="/saved">Saved</SidebarButton>
{:else}
<SidebarButton href="/login" title="Log In" icon={ArrowLeftOnRectangle}>
<span slot="label">Log In</span>
<SidebarButton
href="/login"
title={$t('account.login')}
icon={ArrowLeftOnRectangle}
>
<span slot="label">{$t('account.login')}</span>
</SidebarButton>
<SidebarButton href="/signup" title="Sign Up" icon={Identification}>
<span slot="label">Sign Up</span>
<SidebarButton
href="/signup"
title={$t('account.signup')}
icon={Identification}
>
<span slot="label">{$t('account.signup')}</span>
</SidebarButton>
<SidebarButton
href="/settings"
title={$t('nav.menu.settings')}
icon={Cog6Tooth}
>
<span slot="label">{$t('nav.menu.settings')}</span>
</SidebarButton>
{#if LINKED_INSTANCE_URL === undefined}
<SidebarButton
href="/accounts"
title="Change Instance"
icon={ServerStack}
>
<span slot="label">Change Instance</span>
</SidebarButton>
{/if}
{/if}
{#if $profileData.profiles.length >= 1}
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
@@ -73,35 +113,71 @@
<ProfileButton {index} {prof} />
</div>
{/each}
<ProfileButton
index={0}
prof={{
id: -1,
instance: $profileData?.defaultInstance ?? DEFAULT_INSTANCE_URL,
username: 'Guest',
}}
guest
/>
<SidebarButton href="/accounts" icon={UserGroup}>
<span slot="label">Accounts</span>
<span slot="label">{$t('account.accounts')}</span>
</SidebarButton>
{/if}
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{#if $profile?.user}
{#if $profile?.user.moderates.length > 0}
<CommunityList items={$profile.user.moderates.map((i) => i.community)} />
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if}
<Expandable bind:open={$userSettings.expandCommunities}>
{#if $profile?.favorites && $profile?.favorites.length > 0}
<Expandable
class="max-w-full min-w-0 w-full"
bind:open={$userSettings.expand.favorites}
>
<span
slot="title"
class="px-2 py-1 w-full {$userSettings.expandSidebar
? ''
: 'max-lg:hidden'}"
: '//max-lg:hidden'}"
>
<EndPlaceholder>
Subscribed
{$t('routes.profile.favorites')}
<span slot="action" class="dark:text-white text-black">
{$profile.favorites.length}
</span>
</EndPlaceholder>
</span>
<CommunityList isFavorites items={$profile.favorites} />
</Expandable>
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if}
{#if $profile?.user}
{#if $profile?.user.moderates.length > 0}
<Expandable
class="max-w-full min-w-0 w-full"
bind:open={$userSettings.expand.moderates}
>
<span
slot="title"
class="px-2 py-1 w-full {$userSettings.expandSidebar
? ''
: '//max-lg:hidden'}"
>
<EndPlaceholder>
{$t('routes.profile.moderates')}
<span slot="action" class="dark:text-white text-black">
{$profile.user.moderates.length}
</span>
</EndPlaceholder>
</span>
<CommunityList
items={$profile.user.moderates.map((i) => i.community)}
/>
</Expandable>
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if}
<Expandable
class="max-w-full min-w-0 w-full"
bind:open={$userSettings.expand.communities}
>
<span
slot="title"
class="px-2 py-1 w-full {$userSettings.expandSidebar
? ''
: '//max-lg:hidden'}"
>
<EndPlaceholder>
{$t('profile.subscribed')}
<span slot="action" class="dark:text-white text-black">
{$profile.user.follows.length}
</span>
@@ -15,16 +15,17 @@
</script>
<Button
{...$$restProps}
{href}
color="tertiary"
alignment="left"
{...$$restProps}
{href}
on:click
class="hover:bg-slate-100 font-normal {selected
on:contextmenu
class="font-normal {selected
? 'text-primary-900 dark:!text-primary-100'
: 'text-slate-600 dark:text-zinc-400'} {$userSettings.expandSidebar
? ''
: 'max-lg:!p-1 [&>*]:max-lg:!justify-center'} {$$props.class}"
: '//max-lg:!p-1 //[&>*]:max-lg:!justify-center'} {$$props.class}"
>
<slot {selected} name="icon" slot="prefix">
{#if icon}
@@ -32,7 +33,11 @@
{/if}
</slot>
<slot />
<div class={$userSettings.expandSidebar ? 'contents' : 'max-lg:hidden'}>
<div
class="{$userSettings.expandSidebar
? 'contents'
: '//max-lg:hidden'} contents"
>
<slot name="label" />
</div>
</Button>
@@ -1,11 +1,15 @@
<script lang="ts">
import { locale } from '$lib/translations'
export let number: number
export let locale: string = 'en'
let localeToUse: string = $locale
export let options: Intl.NumberFormatOptions = {
notation: 'compact',
}
export { localeToUse as locale }
</script>
<span class={$$props.class ?? ''}>
{Intl.NumberFormat(locale, options).format(number)}
{Intl.NumberFormat(localeToUse, options).format(number)}
</span>
+3 -4
View File
@@ -1,4 +1,6 @@
<script lang="ts">
import { locale } from '$lib/translations'
export let date: Date
export let relativeTo: Date | undefined = undefined
export let options: Intl.RelativeTimeFormatOptions = {
@@ -36,10 +38,7 @@
if (diffInMillis >= thresholds[i].threshold) {
const value = Math.round(diffInMillis / thresholds[i].threshold)
let language = 'en'
if (typeof navigator != 'undefined') {
language = navigator.language
}
let language = $locale
const rtf = new Intl.RelativeTimeFormat(language, options)
+651
View File
@@ -0,0 +1,651 @@
{
"profile": {
"inbox": "Posteingang",
"saved": "Gespeichert",
"subscribed": "Abonniert",
"profile": "Profil"
},
"nav": {
"home": "Startseite",
"admin": "Admin",
"communities": "Erkunden",
"search": "Suchen",
"create": {
"label": "Erstellen",
"post": "Absenden",
"community": "Gemeinschaft",
"logingate": "Du musst dich anmelden, um Beiträge zu erstellen."
},
"menu": {
"label": "Profil",
"app": "App",
"settings": "Einstellungen",
"colorscheme": {
"label": "Farbschema",
"system": "System",
"dark": "Dunkel",
"light": "Hell"
},
"theme": "Thema",
"about": "Über",
"source": "Quellcode",
"donate": "Spenden",
"instance": "Instanz"
},
"moderation": "Moderation"
},
"account": {
"login": "Anmelden",
"logout": "Abmelden",
"signup": "Registrieren",
"accounts": "Konten",
"changeinstance": "Instanz wechseln",
"resetColor": "Farbe zurücksetzen",
"moveUp": "Nach oben",
"moveDown": "Nach unten",
"guest": "Gast",
"addGuest": "Gast hinzufügen",
"versionGate": "Diese Version von Photon unterstützt Instanzen mit {{version}} oder höher."
},
"filter": {
"location": {
"label": "Ort",
"local": "Lokal",
"subscribed": "Abonniert",
"moderator": "Moderator",
"all": "Alle",
"global": "Global"
},
"sort": {
"label": "Sortieren",
"active": "Aktiv",
"hot": "Heiß",
"top": {
"time": {
"label": "Zeit",
"all": "Alle",
"9months": "9 Monate",
"6months": "6 Monate",
"3months": "3 Monate",
"month": "Monat",
"week": "Woche",
"day": "Tag",
"12hours": "12 Stunden",
"6hours": "6 Stunden",
"hour": "Stunde"
},
"label": "Spitze"
},
"new": "Neu",
"old": "Alt",
"scaled": "Skaliert",
"mostcomments": "Kommentare",
"newcomments": "Neue Antworten",
"controversial": "Kontrovers"
},
"view": {
"label": "Ansicht",
"cozy": "Gemütlich",
"list": "Liste",
"compact": "Kompakt",
"legacy": "Legacy"
},
"type": "Art",
"filter": "Filter",
"unread": "Ungelesen",
"inbox": {
"messages": "Nachrichten",
"replies": "Antworten",
"mentions": "Erwähnungen"
}
},
"form": {
"username": "Benutzername",
"name": "Name",
"instance": "Instanz URL",
"password": "Passwort",
"confirmPassword": "Passwort bestätigen",
"2fa": "2FA Code",
"forgotpassword": "Passwort vergessen",
"submit": "Absenden",
"edit": "Bearbeiten",
"preview": "Vorschau",
"post": {
"edit": "Beitrag editieren",
"community": "Gemeinschaft",
"title": "Titel",
"url": "URL",
"body": "Hauptteil",
"nsfw": "NSFW",
"generateTitle": "Titel generieren",
"uploadImage": "Bild hochladen",
"create": "Beitrag erstellen"
},
"profile": {
"bio": "Biografie",
"avatar": "Avatar",
"banner": "Banner",
"email": "E-Mail",
"matrix": "Matrix Nutzer",
"showNSFW": "NSFW Beiträge anzeigen",
"bot": "Bot-Konto",
"showBots": "Bots anzeigen",
"showRead": "Gelesene Beiträge anzeigen",
"currentPassword": "Aktuelles Passwort",
"newPassword": "Neues Passwort",
"verifyNewPassword": "Neues Passwort wiederholen",
"2fa": {
"totp": "TOTP",
"2fa": "2FA",
"paste": "Füge dies in deine Authenticator-App ein."
},
"deleteAccount": {
"label": "Konto löschen",
"deleteContent": "Beiträge löschen",
"warning": "Dies wird ALLE deine Beiträge löschen."
},
"displayName": "Anzeigename",
"scores": "Stände anzeigen"
},
"email": "E-Mail",
"setup": "Einrichten",
"signup": {
"title": "Registrieren",
"info": "Eine Instanz ist der Server, auf dem Dein Konto gehostet wird, aber Du kannst weiterhin auf Inhalte von anderen Instanzen zugreifen und mit diesen interagieren.",
"chooseInstance": "Instanz auswählen",
"application": {
"label": "Anwendung",
"info": "Um dieser Instanz beizutreten, musst Du diesen Antrag ausfüllen und warten, bis er angenommen wird. Du erhältst eine E-Mail, wenn Dein Antrag angenommen wurde."
},
"closed": {
"title": "Registrierungen geschlossen",
"description": "Diese Instanz hat Registrierungen geschlossen. Finde eine andere Instanz.",
"anotherInstance": "Eine andere Instanz finden"
},
"description": "Wähle eine Instanz aus, die Dich interessiert, oder gebe die URL manuell ein."
},
"description": "Beschreibung"
},
"routes": {
"frontpage": {
"title": "Startseite",
"footer": "{{users:number}} aktiv {{users; 1:user; default:users;}}"
},
"modlog": "Moderationsverlauf",
"instances": "Instanzen",
"legal": {
"title": "Rechtliches",
"noLegal": "Diese Instanz hat keine rechtlichen Hinweise."
},
"profile": {
"user": "Benutzer",
"settings": "Einstellungen",
"blocks": "Blöcke",
"credentials": "Anmeldedaten",
"moderates": "Moderiert",
"favorites": "Favoriten"
},
"translators": "Übersetzer",
"communities": "Gemeinschaften",
"search": {
"title": "Suchen",
"federating": "Föderiert",
"query": "Anfrage",
"noResults": {
"description": "Es gibt keine Ergebnisse, die diesem Filter entsprechen. Versuche Deine Suche anders zu formulieren.",
"alt": "Das Fediverse durchsuchen",
"title": "Keine Ergebnisse"
}
},
"saved": "Gespeichert",
"createPost": "Beitrag erstellen",
"post": {
"crosspostCount": "Querposts",
"commentCount": "Kommentare",
"addComment": "Kommentar hinzufügen",
"scrollToTop": "Nach oben scrollen",
"remoteView": "Entfernte Ansicht",
"localView": "Lokale Ansicht",
"thread": {
"single": "Du betrachtest gerade einen einzelnen Beitrag.",
"allComments": "Alle Kommentare",
"part": "Du betrachtest einen Teil des Beitrags.",
"context": "Kontext anzeigen"
},
"instanceWarning": "Dieser Beitrag wurde von einem anderen Server als dem Deines Kontos angefordert. Viele Aktionen werden nicht funktionieren."
},
"inbox": {
"title": "Posteingang",
"markAsRead": "Alle als gelesen markieren",
"empty": {
"title": "Keine neuen Benachrichtigungen",
"description": "Nachrichten, Antworten und Erwähnungen werden hier angezeigt."
}
},
"moderation": {
"title": "Moderation",
"empty": {
"title": "Keine neuen Meldungen",
"description": "Wenn Beiträge gemeldet werden, kannst du hier darauf reagieren."
},
"reason": "Grund",
"resolve": "Abschließen",
"unresolve": "Aufmachen"
},
"admin": {
"title": "Administration",
"config": {
"title": "Konfiguration",
"sidebar": "Seitenleiste",
"icon": "Symbol",
"banner": "Banner",
"downvotesEnabled": "Herabwählen aktivieren",
"nsfwEnabled": "NSFW aktivieren",
"registration": {
"open": "Offen",
"application": "Antrag erforderlich",
"closed": "Geschlossen",
"label": "Registrierungsmodus"
},
"applicationQuestion": "Antragsfrage",
"adminCommunityOnly": "Nur Admins können Gemeinschaften erstellen",
"requireVerifyEmail": "E-mail Verifizierung erforderlich",
"emailAdminsOnReport": "Admins bei neuen Meldungen per E-Mail benachrichtigen",
"listingType": {
"label": "Sortierart",
"all": "Alle",
"local": "Lokal"
},
"private": "Private Instanz",
"slurFilter": "Beleidigungsfilter Regex",
"federation": "Föderation aktiviert",
"captcha": {
"enabled": "CAPTCHA Aktiviert"
},
"federationDebug": "Föderationsfehlerbehebungsmodus",
"emailAdminsOnApplication": "Bei neuen Anträgen Admins per E-Mail benachrichtigen",
"hideModlogModNames": "Moderatorennamen im Moderationsverlauf verstecken"
},
"applications": {
"title": "Anträge",
"empty": {
"title": "Keine neuen Anträge",
"description": "Anträge deiner Instanz beizutreten werden hier erscheinen."
},
"application": "Antrag",
"approved": "Genehmigt",
"denied": "Abgelehnt",
"user": "Nutzer",
"deny": "Ablehnen",
"approve": "Genehmigen",
"reason": "Grund",
"modalTitle": "Antrag ablehnen"
},
"taglines": {
"title": "Mottos",
"add": "Motto hinzufügen",
"empty": {
"title": "Keine Mottos",
"description": "Ein zufälliges Motto wird auf der Webseite erscheinen, wenn Benutzer deine Instanz besuchen."
}
},
"team": {
"title": "Admins",
"empty": {
"title": "Keine Admins",
"description": "Irgendwie gibt es keine Admins auf dieser Seite. Wie ist das möglich??"
}
},
"federation": {
"title": "Föderation",
"csv": "CSV hochladen",
"blocked": "Blockierte Instanzen",
"block": "Blockieren",
"blockplaceholder": "Eine Instanz blockieren...",
"allowed": "Erlaubte Instanzen",
"allow": "Erlaubliste",
"allowplaceholder": "Eine Instanz erlauben",
"emptyBlock": {
"title": "Keine blockierten Instanzen",
"description": "Eine Instanz blockieren versteckt neue Beiträge von dieser Instanz."
},
"emptyAllow": {
"title": "Keine Instanzen auf der Erlaubliste",
"description": "Alle Instanzen die nicht auf der Erlaubliste sind werden blockiert."
}
}
},
"verifyEmail": {
"message": "Deine E-Mail Adresse wurde bestätigt. Du kannst dieses Fenster nun schließen.",
"error": "Deine E-Mail Adresse konnte nicht verifiziert werden."
},
"passwordChange": {
"title": "Passwort ändern",
"description": "Ein neues Passwort auswählen.",
"instance": "Auf welcher Instanz ist dein Konto gehostet?"
},
"accounts": "Konten",
"createCommunity": "Gemeinschaft erstellen",
"resetLogin": {
"title": "Passwort zurücksetzen",
"description": "Gib die E-Mail deines Kontos ein, und ein Link zum Zurücksetzen des Passworts wird Dir zugesendet. Wenn dein Konto keine E-Mail hat, wende dich an die Administratoren deiner Instanz."
},
"theme": {
"title": "Thema",
"import": "Importieren",
"export": "Exportieren",
"reset": "Zurücksetzen",
"accent": "Akzentuierung",
"resetWarning": {
"title": "Thema zurücksetzen",
"description": "Dadurch werden alle Farben auf die Standardwerte zurückgesetzt. Es wird empfohlen, das Thema vorher zu exportieren."
}
}
},
"toast": {
"unblockedCommunity": "Die Blockierung dieser Gemeinschaft wurde aufgehoben.",
"noComments": "Die API gab keine Kommentare zurück.",
"loginVoteGate": "Du musst angemeldet sein, um zu wählen.",
"blockedCommunity": "Diese Gemeinschaft wurde blockiert.",
"purgedCommunity": "Diese Gemeinschaft wurde ausgelöscht.",
"blockedInstance": "Diese Instanz wurde blockiert.",
"updatedCommunity": "Deine Gemeinschaft wurde aktualisiert.",
"sentMessage": "Diese Nachricht wurde versandt.",
"saveSettings": "Benutzereinstellungen wurden gespeichert. Wenn du Deine E-Mail Adresse geändert hast, wurde ein Verifizierungslink an diese versendet.",
"removeAdminWarning": "Bist du sicher, dass du diesen Admin entfernen möchtest?",
"failFindUser": "Nutzer konnte nicht gefunden werden.",
"verifyEmail": "Ein Verifizierungslink wurde an deine E-Mail versendet. Verifiziere deine E-Mail und melde dich dann an.",
"resetLink": "Ein \"Passwort Zurücksetzen\"-Link wurde an Deine E-Mail gesendet.",
"invalidDateAbsolute": "Ungültiges Datum. Es muss ein absolutes Datum sein.",
"invalidDateBeforeCurrent": "Ungültiges Datum. Es ist vor der aktuellen Zeit.",
"bannedUser": "Nutzer wurde gebannt.",
"unbannedUser": "Verbannung des Nutzers wurde aufgehoben.",
"needCommunity": "Du musst eine Gemeinschaft festlegen.",
"invalidURL": "Ungültige URL",
"restoredFromDraft": "Dein Beitrag wurde vom Entwurf wiederhergestellt.",
"copied": "In die Zwischenablage kopiert.",
"approvedApplication": "Antrag wurde angenommen.",
"deniedApplication": "Antrag wurde abgelehnt.",
"updatedSite": "Deine Seite wurde aktualisiert.",
"failCSV": "Fehler beim Lesen von CSV",
"removeAdmin": "Admin wurde entfernt.",
"addMod": "Moderator wurde hinzugefügt.",
"logIn": "Anmeldung erfolgreich.",
"addAccount": "Account wurde hinzugefügt.",
"passwordReset": "Dein Passwort wurde zurückgesetzt.",
"invalidLogin": "Ungültige Anmeldedaten",
"confirmDelete1": "Bist Du sicher, dass du Deinen Account löschen möchtest?",
"confirmDelete2": "Bist Du wirklich sicher?",
"confirmDelete3": "Letzte Warnung. Bist Du wirklich sicher?",
"needPassword": "Du musst dein Passwort angeben.",
"deleting": "Dein Account wird gelöscht...",
"deleted": "Dein Account wurde gelöscht.",
"resetSettings": "Möchtest du Deine Einstellung auf Standard zurücksetzen?",
"failSignup": "Registrierung fehlgeschlagen.",
"successSignup": "Erfolgreich registriert.",
"waitApplication": "Warte bis dein Registrierungsantrag akzeptiert wurde, bevor Du versuchst Dich anzumelden.",
"blockUser": "Nutzer wurde blockiert.",
"unblockUser": "Blockierung des Nutzers aufgehoben."
},
"cards": {
"community": {
"modlog": "Moderationsverlauf",
"members": "Mitglieder",
"moderators": "Moderatoren",
"subscribe": "Abonnieren",
"subscribed": "Abonniert",
"block": "Blockieren",
"unblock": "Blockierung aufheben",
"blockInstance": "Instanz blockieren",
"favorite": "Favorisieren",
"unfavorite": "Favorisierung aufheben"
},
"site": {
"about": "Über",
"stats": "Statistiken",
"admins": "Admins"
}
},
"post": {
"actions": {
"more": {
"delete": "Löschen",
"hide": "Verstecken",
"label": "Mehr Aktionen",
"edit": "Editieren",
"creator": "Ersteller",
"actions": "Aktionen",
"markRead": "Als gelesen markieren",
"markUnread": "Als ungelesen markieren",
"unhide": "Aufdecken",
"translate": "Übersetzen",
"share": "Teilen",
"crosspost": "Querpost",
"restore": "Wiederherstellen"
},
"comments": "Kommentare",
"save": "Speichern",
"unsave": "Speichern aufheben"
},
"badges": {
"nsfw": "NSFW",
"locked": "Geschlossen",
"featured": "Vorgestellt",
"removed": "Entfernt",
"deleted": "Gelöscht",
"saved": "Gespeichert"
}
},
"comment": {
"locked": "Dieser Beitrag ist geschlossen.",
"reply": "Antworten",
"actions": {
"label": "Aktionen",
"link": "Link kopieren"
},
"more": "{{comments:number}} mehr"
},
"moderation": {
"removeSubmission": {
"failEmptyReply": "Deine Antwort kann nicht leer sein, wenn 'Antwort mit Grund' aktiviert ist.",
"failReply": "Antwort konnte nicht verschickt werden. Entferne trotzdem...",
"failMessage": "Nutzer konnte nicht benachrichtigt werden. Entferne trotzdem...",
"title": "Entferne Beitrag",
"titleRestore": "Beitrag wird wiederhergestellt",
"titlePurge": "Beitrag wird ausgelöscht",
"withReason": "Antwort mit Grund",
"comment": "Kommentar",
"message": "Nachricht",
"successPurge": "Dieser Beitrag wurde erfolgreich ausgelöscht."
},
"ban": {
"warning": "Dies wird ALLE Beiträge dieses Nutzers hier löschen.",
"deleteData": "Lösche Daten",
"banning": "Nutzer sperren",
"unbanning": "Nutzersperrung aufheben",
"expires": "Verfällt (UTC)",
"banFromCommunity": "Von Gemeinschaft verbannen",
"unbanFromCommunity": "Verbannung von Gemeinschaft aufheben"
},
"report": "Melden",
"reportModal": {
"title": "Melden",
"success": "Dieser Beitrag wurde gemeldet."
},
"reason": "Grund",
"lock": "Schließen",
"unlock": "Aufschließen",
"remove": "Entfernen",
"restore": "Wiederherstellen",
"label": "Moderation",
"labelInstanceOnly": "Moderation (Nur diese Instanz)",
"feature": "Vorstellen",
"unfeature": "Vorstellung aufheben"
},
"admin": {
"purgeCommunity": {
"warning": "Dadurch werden alle Beiträge gelöscht. Bist du sicher? (Die Schaltfläche wird in 3 Sekunden aktiviert.)",
"title": "Gemeinschaft bereinigen"
},
"instance": "Instanz",
"purge": "Bereinigen",
"label": "Administration"
},
"common": {
"jump": "Springen",
"back": "Zurück",
"next": "Weiter",
"debug": "Fehlerbehebung",
"refresh": "Aktualisieren",
"save": "Speichern",
"enabled": "Aktiviert",
"disabled": "Deaktiviert",
"enable": "Aktivieren",
"disable": "Deaktivieren",
"add": "Hinzufügen",
"cancel": "Abbrechen",
"send": "Senden"
},
"content": {
"all": "Alles",
"users": "Nutzer",
"posts": "Beiträge",
"comments": "Kommentare",
"communities": "Gemeinschaften",
"instances": "Instanzen",
"message": "Nachricht"
},
"message": {
"success": "Erfolg",
"error": "Fehler"
},
"settings": {
"other": {
"debug": {
"title": "Fehlerbehebungsinformationen",
"description": "Fehlerbehebungsinformationen anzeigen"
},
"title": "Andere"
},
"app": {
"translation": {
"description": "Die LibreTranslate Instanz, die für die Übersetzung verwendet wird.",
"title": "Übersetzung",
"instance": "Domäne"
},
"limitLayoutWidth": {
"description": "Verbessere die Lesbarkeit, durch die Begrenzung der Breite des Hauptinhalts.",
"title": "Layout Breite begrenzen"
},
"lang": {
"description": "Die verwendete Sprache für Photons UI.",
"note": "Sprachen außer Englisch und Hebräisch wurden von der Community übersetzt und könnten unvollständig sein.",
"de": "Deutsch",
"fi": "Finnisch",
"pt": "Portugiesisch",
"auto": "Automatisch",
"credits": "Credits",
"title": "Sprache",
"en": "Englisch",
"en-US": "Englisch (US)",
"he": "Hebräisch",
"et": "Estnisch",
"fr": "Französisch"
},
"view": {
"title": "Beitragsstil",
"legacy": "Der alte Photon-Look."
},
"sort": {
"title": "Standard-Sortierung"
},
"postsInNewTab": {
"title": "Beiträge in einem neuen Tab öffnen",
"description": "Beiträge in einem separaten Tab öffnen statt im Aktuellen."
},
"thumbnailSide": {
"left": "Links",
"right": "Rechts"
},
"title": "Photon",
"theming": {
"description": "Photons Farben anpassen.",
"link": "Gehe zu Themen"
},
"displayName": {
"title": "Anzeigename verwenden",
"description": "Zeige die Anzeigenamen von Nutzern statt ihren tatsächlichen Nutzernamen."
},
"placeholders": {
"title": "Zufällige Platzhalter",
"description": "Zeige zufällige Platzhalter für bestimmte Texteingabefelder."
},
"expandImages": {
"title": "Bilder erweitern",
"description": "Durch Klicken auf ein Beitragsbild gelangt man in eine vergrößerte Ansicht des Bildes statt in die Beitragsansicht."
},
"font": {
"title": "Schriftart",
"description": "Welche Schriftart Photon in der UI verwendet."
}
},
"navigation": {
"dockPos": {
"description": "Wo das Dock auf dem Bildschirm positioniert sein soll.",
"title": "Dock Position",
"top": "Oben",
"bottom": "Unten",
"adaptive": "Adaptiv"
},
"title": "Navigation",
"panel": {
"title": "Panel Modus",
"description": "Erweitere das Dock zum Rand des Bildschirms, ähnlich zu einem Panel.",
"on": "An",
"off": "Aus",
"adaptive": "Adaptiv"
}
},
"lemmy": {
"compactFeatured": {
"description": "Stelle vorgestellte Beiträge kompakter dar",
"title": "Kompakte vorgestellte Beiträge"
},
"markReadPosts": {
"title": "Gelesene Beiträge markieren",
"description": "Markiere einen Beitrag als gelesen, wenn Du auf ihn klickst"
},
"fadeReadPosts": {
"title": "Gelesene Beiträge verblassen",
"description": "Titel von Beiträgen, die Du bereits gelesen hast, verblassen lassen"
},
"hideSubmissions": {
"deleted": "Vom Nutzer gelöscht",
"removed": "Durch einen Moderator entfernt"
},
"instances": {
"title": "Instanzen anzeigen"
},
"title": "Lemmy",
"showHiddenPosts": {
"title": "Versteckte Beiträge anzeigen",
"description": "Zeige die von Dir versteckten Beiträge an."
}
},
"beta": "Beta",
"embeds": {
"title": "Einbettungen",
"clickToView": {
"description": "Einbettungen nur laden, sobald Du auf sie klickst.",
"title": "Zum Ansehen klicken"
}
},
"title": "Einstellungen",
"moderation": {
"title": "Moderation",
"replyPresets": {
"syntax": "Syntax"
}
}
}
}
+732
View File
@@ -0,0 +1,732 @@
{
"profile": {
"profile": "Profile",
"inbox": "Inbox",
"saved": "Saved",
"subscribed": "Subscribed"
},
"nav": {
"home": "Home",
"admin": "Admin",
"moderation": "Moderation",
"communities": "Explore",
"search": "Search",
"create": {
"label": "Create",
"post": "Post",
"community": "Community",
"logingate": "You must log in to create content."
},
"menu": {
"label": "Profile",
"app": "App",
"settings": "Settings",
"colorscheme": {
"label": "Color Scheme",
"system": "System",
"dark": "Dark",
"light": "Light"
},
"theme": "Theme",
"about": "About",
"source": "Source",
"donate": "Donate",
"instance": "Instance"
}
},
"account": {
"login": "Log In",
"logout": "Log Out",
"signup": "Sign Up",
"accounts": "Accounts",
"changeinstance": "Change Instance",
"resetColor": "Reset Color",
"addGuest": "Add Guest",
"moveUp": "Move Up",
"moveDown": "Move Down",
"guest": "Guest",
"versionGate": "This version of Photon supports instances running {{version}} or higher."
},
"filter": {
"location": {
"label": "Location",
"all": "All",
"local": "Local",
"subscribed": "Subscribed",
"moderator": "Moderator",
"global": "Global"
},
"sort": {
"label": "Sort",
"active": "Active",
"hot": "Hot",
"top": {
"label": "Top",
"time": {
"label": "Time",
"all": "All",
"9months": "9 Months",
"6months": "6 Months",
"3months": "3 Months",
"month": "Month",
"week": "Week",
"day": "Day",
"12hours": "12 Hours",
"6hours": "6 Hours",
"hour": "Hour"
}
},
"new": "New",
"old": "Old",
"controversial": "Controversial",
"scaled": "Scaled",
"mostcomments": "Comments",
"newcomments": "New Replies"
},
"view": {
"label": "View",
"cozy": "Cozy",
"list": "List",
"compact": "Compact",
"legacy": "Legacy"
},
"type": "Type",
"filter": "Filter",
"unread": "Unread",
"inbox": {
"messages": "Messages",
"replies": "Replies",
"mentions": "Mentions"
}
},
"form": {
"username": "Username",
"name": "Name",
"instance": "Instance URL",
"password": "Password",
"confirmPassword": "Confirm Password",
"2fa": "2FA Code",
"forgotpassword": "Forgot Password",
"submit": "Submit",
"edit": "Edit",
"preview": "Preview",
"post": {
"create": "Create Post",
"edit": "Edit Post",
"community": "Community",
"title": "Title",
"url": "URL",
"body": "Body",
"nsfw": "NSFW",
"generateTitle": "Generate Title",
"uploadImage": "Upload Image",
"altText": "Alt Text"
},
"profile": {
"displayName": "Display name",
"bio": "Bio",
"avatar": "Avatar",
"banner": "Banner",
"email": "Email",
"matrix": "Matrix User",
"showNSFW": "Show NSFW content",
"scores": "Show Scores",
"bot": "Bot Account",
"showBots": "Show Bots",
"showRead": "Show Read Posts",
"currentPassword": "Current Password",
"newPassword": "New Password",
"verifyNewPassword": "Verify New Password",
"2fa": {
"totp": "TOTP",
"2fa": "2FA",
"paste": "Paste this in your authenticator app."
},
"deleteAccount": {
"label": "Delete account",
"deleteContent": "Delete content",
"warning": "This will delete ALL of your submissions."
}
},
"email": "Email",
"setup": "Setup",
"signup": {
"title": "Sign Up",
"description": "Choose an instance that interests you, or type the URL manually.",
"info": "An instance is the server that your account will be hosted on, but you can still access and interact with content from other instances.",
"chooseInstance": "Choose an instance",
"application": {
"label": "Application",
"info": "To join this instance, you must fill out this application, and wait to be accepted. You will receive an email if your application is accepted."
},
"closed": {
"title": "Registrations closed",
"description": "This instance has registrations closed. Find another instance.",
"anotherInstance": "Find another instance"
}
},
"description": "Description"
},
"routes": {
"frontpage": {
"title": "Frontpage",
"footer": "{{users:number}} active {{users; 1:user; default:users;}}"
},
"modlog": "Modlog",
"instances": "Instances",
"legal": {
"title": "Legal",
"noLegal": "This instance does not have any legal information."
},
"profile": {
"user": "User",
"settings": "Settings",
"blocks": "Blocks",
"credentials": "Credentials",
"moderates": "Moderates",
"favorites": "Favorites"
},
"translators": "Translators",
"accounts": "Accounts",
"communities": "Communities",
"search": {
"title": "Search",
"federating": "Federating",
"query": "Query",
"noResults": {
"title": "No Results",
"description": "There are no results that match that filter. Try refining your search.",
"alt": "Search across the fediverse"
}
},
"saved": "Saved",
"createPost": "Create Post",
"createCommunity": "Create Community",
"post": {
"crosspostCount": "crossposts",
"commentCount": "comments",
"addComment": "Add a comment",
"scrollToTop": "Scroll to top",
"instanceWarning": "This post was requested from a different server than your account's. Many actions won't work.",
"remoteView": "Remote View",
"localView": "Local View",
"thread": {
"single": "You're viewing a single thread.",
"allComments": "All Comments",
"part": "You're viewing part of a thread.",
"context": "Show Context"
}
},
"inbox": {
"title": "Inbox",
"markAsRead": "Mark All Read",
"empty": {
"title": "No new notifications",
"description": "Messages, replies, and mentions will appear here."
}
},
"moderation": {
"title": "Moderation",
"empty": {
"title": "No new reports",
"description": "When submissions are reported, you can act on them here."
},
"reason": "Reason",
"resolve": "Resolve",
"unresolve": "Unresolve"
},
"admin": {
"title": "Administration",
"config": {
"title": "Configuration",
"sidebar": "Sidebar",
"icon": "Icon",
"banner": "Banner",
"downvotesEnabled": "Enable Downvotes",
"nsfwEnabled": "Enable NSFW",
"registration": {
"label": "Registration Mode",
"open": "Open",
"application": "Require Application",
"closed": "Closed"
},
"applicationQuestion": "Application Question",
"adminCommunityOnly": "Only admins can create communities",
"requireVerifyEmail": "Require email verification",
"emailAdminsOnApplication": "Email admins on receiving new applications",
"emailAdminsOnReport": "Email admins on receiving new reports",
"listingType": {
"label": "Listing Type",
"all": "All",
"local": "Local"
},
"private": "Private instance",
"hideModlogModNames": "Hide modlog mod names",
"slurFilter": "Slur filter regex",
"federation": "Federation enabled",
"federationDebug": "Federation debug mode",
"captcha": {
"enabled": "CAPTCHA Enabled"
}
},
"applications": {
"title": "Applications",
"empty": {
"title": "No new applications",
"description": "Applications to join your instance will appear here."
},
"application": "Application",
"approved": "Approved",
"denied": "Denied",
"user": "User",
"deny": "Deny",
"approve": "Approve",
"reason": "Reason",
"modalTitle": "Deny Application"
},
"taglines": {
"title": "Taglines",
"add": "Add a tagline",
"empty": {
"title": "No taglines",
"description": "A random tagline will appear on the site card when users visit your instance."
}
},
"team": {
"title": "Admins",
"empty": {
"title": "No admins",
"description": "Somehow there's no admins of this site. How??"
}
},
"federation": {
"title": "Federation",
"csv": "Upload CSV",
"blocked": "Blocked Instances",
"block": "Block",
"blockplaceholder": "Block an instance...",
"allowed": "Whitelisted Instances",
"allow": "Whitelist",
"allowplaceholder": "Whitelist an instance",
"emptyBlock": {
"title": "No blocked instances",
"description": "Blocking an instance will hide new submissions from that instance."
},
"emptyAllow": {
"title": "No whitelisted instances",
"description": "Whitelisting an instance will block every other instance."
}
}
},
"verifyEmail": {
"message": "Your email was verified. You can now close this window.",
"error": "Failed to verify your email."
},
"passwordChange": {
"title": "Change Password",
"description": "Choose your new password.",
"instance": "Which instance is your account hosted on?"
},
"resetLogin": {
"title": "Reset Password",
"description": "Enter your account's email, and a password reset link will be sent. If your account does not have an email, contact your instance admins."
},
"theme": {
"title": "Theme",
"import": "Import",
"export": "Export",
"reset": "Reset",
"accent": "Accent",
"resetWarning": {
"title": "Reset Theme",
"description": "This will reset all of your colors to the default. It is recommended to export your theme before this."
}
}
},
"cards": {
"site": {
"about": "About",
"stats": "Stats",
"admins": "Admins"
},
"community": {
"members": "Members",
"moderators": "Moderators",
"subscribe": "Subscribe",
"subscribed": "Subscribed",
"modlog": "Modlog",
"block": "Block",
"unblock": "Unblock",
"blockInstance": "Block instance",
"favorite": "Favorite",
"unfavorite": "Remove Favorite"
}
},
"admin": {
"purge": "Purge",
"instance": "Instance",
"label": "Administration",
"purgeCommunity": {
"title": "Purging Community",
"warning": "This will delete all posts. Are you sure? (The button will enable in 3 seconds.)"
}
},
"content": {
"all": "All",
"users": "Users",
"posts": "Posts",
"comments": "Comments",
"communities": "Communities",
"instances": "Instances",
"message": "Message"
},
"post": {
"actions": {
"comments": "Comments",
"save": "Save",
"unsave": "Unsave",
"more": {
"label": "More Actions",
"edit": "Edit",
"creator": "Creator",
"actions": "Actions",
"markRead": "Mark as Read",
"markUnread": "Mark as Unread",
"hide": "Hide",
"unhide": "Unhide",
"translate": "Translate",
"share": "Share",
"crosspost": "Crosspost",
"delete": "Delete",
"restore": "Restore"
}
},
"badges": {
"nsfw": "NSFW",
"locked": "Locked",
"featured": "Featured",
"removed": "Removed",
"deleted": "Deleted",
"saved": "Saved"
}
},
"comment": {
"reply": "Reply",
"actions": {
"label": "Actions",
"link": "Copy Link"
},
"locked": "This post is locked.",
"more": "{{comments:number}} more"
},
"moderation": {
"report": "Report",
"ban": {
"banning": "Banning User",
"unbanning": "Unbanning User",
"deleteData": "Delete data",
"warning": "This will delete ALL of this user's submissions here.",
"expires": "Expires (UTC)",
"banFromCommunity": "Ban from community",
"unbanFromCommunity": "Unban from community"
},
"removeSubmission": {
"title": "Removing Submission",
"titleRestore": "Restoring Submission",
"titlePurge": "Purging Submission",
"withReason": "Reply with reason",
"comment": "Comment",
"message": "Message",
"failReply": "Failed to post reply. Removing anyway...",
"failMessage": "Failed to message user. Removing anyway...",
"failEmptyReply": "Your reply cannot be empty if 'Reply with reason' is enabled.",
"successPurge": "Successfully purged that submission."
},
"reportModal": {
"title": "Report",
"success": "Reported that submission."
},
"reason": "Reason",
"lock": "Lock",
"unlock": "Unlock",
"remove": "Remove",
"restore": "Restore",
"label": "Moderation",
"labelInstanceOnly": "Moderation (Instance Only)",
"feature": "Feature",
"unfeature": "Unfeature"
},
"common": {
"back": "Back",
"next": "Next",
"debug": "Debug",
"refresh": "Refresh",
"jump": "Jump",
"save": "Save",
"enabled": "Enabled",
"disabled": "Disabled",
"enable": "Enable",
"disable": "Disable",
"add": "Add",
"cancel": "Cancel",
"send": "Send"
},
"message": {
"success": "Success",
"error": "Error",
"retry": "Retry"
},
"toast": {
"noComments": "The API returned no comments.",
"loginVoteGate": "You must be logged in to vote.",
"blockedCommunity": "Blocked that community.",
"unblockedCommunity": "Unblocked that community.",
"purgedCommunity": "Purged that community.",
"blockedInstance": "Blocked that instance.",
"updatedCommunity": "Your community was updated.",
"sentMessage": "Sent that message.",
"invalidDateAbsolute": "Invalid date. It must be an absolute date.",
"invalidDateBeforeCurrent": "Invalid date. It is before the current time.",
"bannedUser": "Banned that user.",
"unbannedUser": "Unbanned that user.",
"needCommunity": "You must set a community.",
"invalidURL": "Invalid URL",
"generatedTitle": "Generated title and body from the URL. Do you want to undo this?",
"failGenerateTitle": "There was no usable title or description of that website.",
"restoredFromDraft": "Restored your post from the draft.",
"copied": "Copied to clipboard.",
"approvedApplication": "Approved that application.",
"deniedApplication": "Denied that application.",
"updatedSite": "Updated your site.",
"failCSV": "Failed to read CSV",
"removeAdminWarning": "Are you sure you want to remove that admin?",
"removeAdmin": "Removed that admin.",
"failFindUser": "Could not find that user.",
"addMod": "Added that moderator.",
"updateMods": "Updated community moderators.",
"logIn": "Successfully logged in.",
"failInstanceURL": "Failed to contact that instance URL. Is it down?",
"addAccount": "Added that account.",
"resetLink": "A password reset link was sent to your email.",
"resolveReport": "Resolved that report.",
"unresolveReport": "Unresolved that report.",
"passwordReset": "Your password was reset.",
"fetchPostOnHome": "Attempting to fetch this post on your home instance...",
"loginRefresh": "Your login was refreshed.",
"invalidLogin": "Invalid credentials",
"saveSettings": "Saved your user settings. If you changed your email, a verification link was sent.",
"confirmDelete1": "Are you sure you want to delete your account?",
"confirmDelete2": "Are you really sure?",
"confirmDelete3": "Final warning. Are you really sure?",
"needPassword": "You must provide your password.",
"deleting": "Deleting your account...",
"deleted": "Your account was deleted.",
"resetSettings": "Do you want to reset your settings to the default?",
"failFetchInstances": "Failed to fetch available instances.",
"verifyEmail": "A verification link was sent to your email. Verify your email, then log in.",
"failSignup": "Failed to sign up.",
"successSignup": "Signed up.",
"waitApplication": "Wait for your registration application to be accepted before logging in.",
"blockUser": "Blocked that user.",
"unblockUser": "Unblocked that user.",
"purgeUser": "Purged that user.",
"settingsImport": "Successfully imported settings",
"settingsImportWarning": "The imported settings don't seem valid. Are you sure you want to import this?"
},
"settings": {
"title": "Settings",
"beta": "Beta",
"desktop": "Desktop",
"tablet": "Tablet",
"mobile": "Mobile",
"export": "Export",
"import": "Import",
"reset": "Reset",
"navigation": {
"title": "Navigation",
"dockPos": {
"title": "Dock position",
"description": "Where the dock should be positioned on the screen.",
"top": "Top",
"bottom": "Bottom",
"adaptive": "Adaptive"
},
"panel": {
"title": "Panel mode",
"description": "Extend the dock to the screen edges, similar to a panel.",
"on": "On",
"off": "Off",
"adaptive": "Adaptive"
},
"pins": {
"title": "Pins",
"description": "Click a pin to send it to the top of the sidebar. Right click a pinned item to remove it."
}
},
"app": {
"title": "Photon",
"theming": {
"title": "Theming",
"description": "Customize Photon's colors.",
"link": "Go to themes"
},
"colorscheme": {
"title": "Color Scheme",
"description": "The color scheme to use."
},
"lang": {
"title": "Language",
"description": "The language used for Photon's UI.",
"note": "Languages other than English and Hebrew are community translated, and may be incomplete.",
"en": "English",
"en-US": "English",
"he": "Hebrew",
"et": "Estonian",
"fr": "French",
"de": "German",
"fi": "Finnish",
"pt": "Portuguese",
"zh": "Chinese",
"zh-Hans": "Chinese (Simplified)",
"zh-Hant": "Chinese (Traditional)",
"auto": "Auto",
"credits": "Credits",
"useRtl": {
"title": "Use RTL layout",
"description": "Use an RTL layout for RTL languages."
}
},
"view": {
"title": "Post style",
"list": "Show posts in a list, with post bodies and compact media.",
"cozy": "Show posts with large images, rich embeds, and longer post bodies.",
"compact": "Show posts in a list, without post bodies and with tighter spacing.",
"legacy": "The old look of Photon."
},
"sort": {
"title": "Default sort",
"description": "The default sorting to use in feeds."
},
"infiniteScroll": {
"title": "Infinite scroll",
"description": "New posts are added as you scroll down, without having to click 'next'."
},
"postsInNewTab": {
"title": "Open posts in new tab",
"description": "Open posts in a separate tab instead of the current."
},
"displayName": {
"title": "Use display name",
"description": "Show users' display names instead of their actual usernames."
},
"limitLayoutWidth": {
"title": "Limit layout width",
"description": "Improve readability by limiting the main content width."
},
"placeholders": {
"title": "Random placeholders",
"description": "Show random placeholders for certain text inputs."
},
"expandImages": {
"title": "Expand images",
"description": "Clicking on a post's image brings you to an expanded view rather than the post page."
},
"duplicateTitles": {
"title": "Hide duplicate titles/bodies",
"description": "Hides the post title and body if they are identical to the embed."
},
"thumbnailSide": {
"title": "Thumbnail alignment",
"description": "Where thumbnails should be on the post in list/compact mode",
"left": "Left",
"right": "Right"
},
"font": {
"title": "Font",
"description": "What font Photon uses in the UI."
},
"translation": {
"title": "Translation",
"description": "The LibreTranslate instance to use for translation.",
"instance": "Domain"
},
"titleTags": {
"title": "Parse tags in title",
"description": "Take text in [brackets] and turn it into tags that you can click to search for.",
"rules": {
"title": "Rules",
"blur": "Blur",
"hide": "Hide",
"show": "Show"
}
}
},
"embeds": {
"title": "Embeds",
"clickToView": {
"title": "Click to view",
"description": "Only load embeds once you click on them."
},
"youtube": {
"description": "The website to embed YouTube content in."
},
"instance": {
"invidious": "Invidious instance",
"piped": "Piped instance",
"description": "The instance to embed YouTube content in."
}
},
"lemmy": {
"title": "Lemmy",
"showHiddenPosts": {
"title": "Show hidden posts",
"description": "Show the posts you've manually hidden."
},
"compactFeatured": {
"title": "Compact featured posts",
"description": "Make featured posts more compact"
},
"markReadPosts": {
"title": "Mark read posts",
"description": "Mark a post as read when you click on it"
},
"fadeReadPosts": {
"title": "Fade read posts",
"description": "Fade the title of posts you've already read"
},
"crosspostMarker": {
"title": "Mark crossposts",
"description": "Show 'crossposted from' when crossposting."
},
"hideSubmissions": {
"title": "Hide submissions",
"description": "Hide certain types of submissions.",
"deleted": "Deleted by user",
"removed": "Removed by moderator"
},
"nsfwBlur": {
"title": "NSFW blur",
"description": "Blur images and remove post bodies of NSFW posts."
},
"instances": {
"title": "Show instances",
"description": "Show the instances where certain content is from."
}
},
"moderation": {
"title": "Moderation",
"replyPresets": {
"title": "Removal reply presets",
"description": "Presets to use for 'reply reason' in the submission removal dialog.",
"syntax": "Syntax"
}
},
"other": {
"title": "Other",
"debug": {
"title": "Debug info",
"description": "Display debug information"
}
}
}
}
+262
View File
@@ -0,0 +1,262 @@
{
"profile": {
"profile": "Profiil",
"inbox": "Postkast",
"saved": "Salvestatud",
"subscribed": "Tellitud"
},
"nav": {
"home": "Pealeht",
"communities": "Uuri",
"search": "Otsi",
"create": {
"label": "Koosta",
"post": "Postida",
"logingate": "sa pead logima sisse et postidata."
},
"menu": {
"label": "Profiil",
"settings": "Settingud",
"colorscheme": {
"label": "Värvi Skeem",
"system": "Süsteem",
"dark": "Must",
"light": "Valge"
},
"theme": "Theme",
"donate": "Anneta",
"instance": "Server",
"app": "Äpp"
}
},
"account": {
"login": "Logi sisse",
"logout": "Logi Välja",
"signup": "Registreeru",
"accounts": "Kasutajad",
"changeinstance": "vaheta Instance",
"resetColor": "Restarti värv",
"moveUp": "Liigu ülesse",
"moveDown": "Liigu alla",
"versionGate": "See versioon Photonist Toetab servereid millel on {{version}} Või üles."
},
"filter": {
"location": {
"label": "Asukoht",
"all": "Küik - kõik",
"local": "Locaalne",
"subscribed": "Tellitud"
},
"sort": {
"label": "Sorteeri",
"active": "aktiivne",
"top": {
"label": "Topp",
"time": {
"label": "Aeg",
"all": "Kõik",
"9months": "9 Kuud",
"6months": "6 Kuud",
"3months": "3 Kuud",
"month": "Kuu",
"week": "Nädal",
"day": "Päev",
"12hours": "12 Tundi",
"6hours": "6 Tundi",
"hour": "Tund"
}
},
"new": "Uus",
"old": "Vana",
"controversial": "Kontreversed"
},
"view": {
"label": "Vaata",
"legacy": "Vana menüü"
},
"type": "Tüüp"
},
"form": {
"username": "Kasutaja nimi",
"name": "Nimi",
"instance": "Serveri URL",
"password": "Parool",
"confirmPassword": "kinnita parooli",
"2fa": "2FA kood",
"forgotpassword": "Unustasid parooli?",
"submit": "Esita",
"edit": "Muuda",
"preview": "enne vaata",
"post": {
"create": "Koosta postitus",
"edit": "Muuda postistust",
"title": "Tiitel"
},
"profile": {
"bio": "all text",
"avatar": "Pilt",
"matrix": "Matrix Kasutaja",
"bot": "Robot kasutaja",
"currentPassword": "Präägune parool",
"newPassword": "uus parool",
"2fa": {
"paste": "Kllebi seda enda authenticatori äppi."
}
},
"signup": {
"title": "Regisreeru"
}
},
"routes": {
"search": {
"title": "Otsi",
"federating": "Födiversing",
"noResults": {
"title": "Pole midagi nähtavat",
"alt": "Otsi Födiversumist"
}
},
"saved": "Salvestatud",
"createPost": "koosta postitus",
"post": {
"crosspostCount": "crosspost",
"thread": {
"context": "Vaata Contexti"
}
},
"inbox": {
"title": "Postkast"
},
"admin": {
"config": {
"registration": {
"open": "Lahti",
"closed": "Kinni"
},
"listingType": {
"all": "Kõik",
"local": "Locaalne"
},
"private": "Privaatne server"
},
"applications": {
"user": "Kasutaja"
},
"federation": {
"block": "Blokeeri",
"blockplaceholder": "Blokeeri server..."
}
},
"passwordChange": {
"title": "Vaheta Parooli",
"description": "Tee oma uus parool.",
"instance": "Mis serveris on sinu kasutaja?"
}
},
"cards": {
"community": {
"members": "Kasutajad",
"subscribe": "Telli",
"subscribed": "Tellitud",
"block": "Blokeeri",
"unblock": "lõpeta blokeerimine",
"blockInstance": "Blokeeri server"
}
},
"admin": {
"instance": "Server"
},
"content": {
"all": "Kõik",
"users": "Kasutajad",
"posts": "Postitused",
"message": "Kiri"
},
"post": {
"actions": {
"more": {
"delete": "Kustuta"
}
},
"badges": {
"locked": "Lukustatud"
}
},
"comment": {
"locked": "See postitus on lukustatud."
},
"moderation": {
"removeSubmission": {
"message": "Kiri"
},
"lock": "Lukusta",
"unlock": "unblock"
},
"common": {
"back": "Tagasi",
"next": "Järgmine",
"add": "Pane",
"send": "Saada"
},
"toast": {
"copied": "Kopeeritud.",
"failFindUser": "ei leidnud seda kasutajat.",
"confirmDelete1": "kas oled kindel et tahad kustudata oma profiili?",
"confirmDelete2": "Kassa oled väga kindel?",
"confirmDelete3": "Viimane hüüatus. Kas sa oled kindel?",
"needPassword": "Sul on vaja parooli.",
"deleting": "Kustutan kasutajat...",
"deleted": "Sinu kasutaja on kustutatud."
},
"settings": {
"title": "Settingud",
"navigation": {
"title": "Navigatioon",
"dockPos": {
"top": "ülemine",
"bottom": "Alumine",
"adaptive": "Adaptiivne"
}
},
"app": {
"lang": {
"title": "keel",
"": "Dont translate the below!"
},
"view": {
"title": "Postituse stiil",
"legacy": "Vana photoni nägemus."
},
"sort": {
"title": "tavaline sorteerimine"
},
"postsInNewTab": {
"title": "Tee postituded uues browseri välilehele"
},
"translation": {
"instance": "Domeen(server)"
}
},
"embeds": {
"clickToView": {
"title": "Klõpsa et näha"
},
"youtube": {
"description": "Interneti domeen et embedida YouTuubi videoid."
}
},
"lemmy": {
"instances": {
"title": "Näe serverit"
}
},
"moderation": {
"replyPresets": {
"syntax": "Süntax"
}
},
"other": {
"title": "Muu"
}
}
}
+705
View File
@@ -0,0 +1,705 @@
{
"routes": {
"passwordChange": {
"instance": "Millä instanssilla tilisi sijaitsee?",
"title": "Vaihda salasana",
"description": "Valitse uusi salasana."
},
"resetLogin": {
"title": "Palauta salasana",
"description": "Syötä käyttäjätiliisi liitetty sähköposti. Salasanan palautuslinkki lähetetään sinne. Jos tiliisi ei ole liitetty sähköpostia, ota yhteys instanssisi ylläpitoon."
},
"theme": {
"title": "Teema",
"import": "Tuo",
"export": "Vie",
"reset": "Palauta oletukset",
"accent": "Korostusväri",
"resetWarning": {
"title": "Palauta teema",
"description": "Tämä palauttaa kaikki värisi oletukseksi. On suositeltavaa viedä teema ulos ensin."
}
},
"frontpage": {
"title": "Etusivu",
"footer": "{{users:number}} {{users; 1:aktiivinen käyttäjä; default:aktiivista käyttäjää;}}"
},
"modlog": "Moderointiloki",
"profile": {
"user": "Käyttäjä",
"blocks": "Estot",
"credentials": "Kirjautumistiedot",
"moderates": "Moderoidut yhteisöt",
"settings": "Asetukset",
"favorites": "Suosikit"
},
"instances": "Instanssit",
"createPost": "Luo julkaisu",
"translators": "Kääntäjät",
"accounts": "Käyttäjätilit",
"search": {
"title": "Haku",
"query": "Hakusanat",
"noResults": {
"title": "Ei tuloksia",
"alt": "Etsi kaikkialta",
"description": "Haku ei tuottanut tuloksia näillä rajoituksilla. Yritä muokata hakua."
},
"federating": "Federoidaan"
},
"saved": "Tallennetut",
"createCommunity": "Luo yhteisö",
"post": {
"commentCount": "kommenttia",
"addComment": "Kommentoi",
"scrollToTop": "Takaisin ylös",
"thread": {
"context": "Näytä konteksti",
"allComments": "Kaikki kommentit",
"single": "Selaat yksittäistä ketjua.",
"part": "Selaat osittaista ketjua."
},
"remoteView": "Etänäkymä",
"localView": "Paikallinen näkymä",
"crosspostCount": "ristijakoa",
"instanceWarning": "Tämä julkaisu haettiin eri palvelimelta, kuin käyttäjäsi. Moni toiminto ei toimi."
},
"inbox": {
"title": "Postilaatikko",
"markAsRead": "Merkitse kaikki luetuksi",
"empty": {
"title": "Ei uusia ilmoituksia",
"description": "Viestit, vastaukset, sekä maininnat näkyvät täällä."
}
},
"legal": {
"title": "Lakitiedot",
"noLegal": "Tällä instanssilla ei ole lakitietoja."
},
"moderation": {
"resolve": "Ratkaise",
"unresolve": "Merkitse ratkaisemattomaksi",
"title": "Moderointi",
"empty": {
"description": "Kun sisältö ilmiannetaan, voit ratkaista tapauksen täällä.",
"title": "Ei uusia ilmiantoja"
},
"reason": "Syy"
},
"admin": {
"title": "Ylläpito",
"config": {
"icon": "Kuvake",
"banner": "Kansikuva",
"downvotesEnabled": "Ota alaäänet käyttöön",
"nsfwEnabled": "Salli NSFW",
"registration": {
"label": "Rekisteröitymistila",
"open": "Avoin",
"application": "Vaadi hakemus",
"closed": "Suljettu"
},
"sidebar": "Sivupalkki",
"title": "Sivuston asetukset",
"applicationQuestion": "Hakemuksen kysymys",
"adminCommunityOnly": "Vain ylläpitäjät voivat luoda yhteisöjä",
"requireVerifyEmail": "Vaadi sähköpostivahvistus",
"emailAdminsOnReport": "Lähetä ylläpitäjille sähköposti-ilmoitus ilmiannoista",
"listingType": {
"label": "Listaustyyppi",
"all": "Kaikki",
"local": "Paikallinen"
},
"private": "Yksityinen instanssi",
"hideModlogModNames": "Piilota moderaattorien nimet lokissa",
"slurFilter": "Kielletyt sanat (regex)",
"federation": "Federointi päällä",
"captcha": {
"enabled": "CAPTCHA Päällä"
},
"emailAdminsOnApplication": "Lähetä ylläpitäjille sähköposti-ilmoitus hakemuksista",
"federationDebug": "Federoinnin vianetsintätila"
},
"applications": {
"title": "Hakemukset",
"empty": {
"title": "Ei uusia hakemuksia",
"description": "Liittymishakemukset ilmestyvät tänne."
},
"application": "Hakemus",
"approved": "Hyväksytty",
"denied": "Evätty",
"user": "Käyttäjä",
"approve": "Hyväksy",
"reason": "Syy",
"modalTitle": "Epää hakemus",
"deny": "Epää"
},
"taglines": {
"title": "Iskulauseet",
"add": "Lisää iskulause",
"empty": {
"title": "Ei iskulauseita",
"description": "Sivun kortissa näytetään satunnaisesti valittu iskulause, kun käyttäjä vierailee instanssillasi."
}
},
"team": {
"title": "Ylläpitäjät",
"empty": {
"title": "Ei ylläpitäjiä",
"description": "Jostain syyst tällä sivustolla ei ole ylläpitäjiä. Miten??"
}
},
"federation": {
"title": "Federointi",
"csv": "Lataa CSV",
"blocked": "Estetyt instanssit",
"block": "Estä",
"blockplaceholder": "Estä instanssi...",
"allowed": "Sallitut instanssit",
"allowplaceholder": "Lisää sallittu instanssi",
"emptyBlock": {
"title": "Ei estettyjä instansseja",
"description": "Instanssin estäminen piilottaa uuden sisällön siltä."
},
"emptyAllow": {
"title": "Ei erikseen sallittuja instansseja",
"description": "Sallittujen instanssien lisääminen estää kaikki muut instanssit."
},
"allow": "Sallitut"
}
},
"verifyEmail": {
"message": "Sähköpostisi on vahvistettu. Voit nyt sulkea tämän ikkunan.",
"error": "Sähköpostin vahvistus epäonnistui."
},
"communities": "Yhteisöt"
},
"cards": {
"site": {
"about": "Tietoja",
"stats": "Tilastot",
"admins": "Ylläpitäjät"
},
"community": {
"members": "Jäsenet",
"moderators": "Moderaattorit",
"subscribe": "Tilaa",
"subscribed": "Tilattu",
"modlog": "Moderointiloki",
"block": "Estä yhteisö",
"unblock": "Poista yhteisön esto",
"blockInstance": "Estä instanssi",
"favorite": "Lisää suosikkeihin",
"unfavorite": "Poista suosikeista"
}
},
"post": {
"actions": {
"more": {
"share": "Jaa",
"markRead": "Merkitse luetuksi",
"markUnread": "Merkitse lukemattomaksi",
"translate": "Käännä",
"label": "Lisää toimintoja",
"edit": "Muokkaa",
"creator": "Lähettäjä",
"crosspost": "Jaa (tee ristijulkaisu)",
"actions": "Toiminnot",
"delete": "Poista",
"restore": "Palauta",
"hide": "Piilota",
"unhide": "Näytä"
},
"comments": "Kommentit",
"save": "Tallenna",
"unsave": "Poista tallennus"
},
"badges": {
"featured": "Nostettu",
"removed": "Poistettu",
"deleted": "Käyttäjän poistama",
"locked": "Lukittu",
"saved": "Tallennettu",
"nsfw": "NSFW"
}
},
"content": {
"all": "Kaikki",
"users": "Käyttäjät",
"posts": "Julkaisut",
"comments": "Kommentit",
"instances": "Instanssit",
"message": "Viesti",
"communities": "Yhteisöt"
},
"admin": {
"purge": "Puhdista",
"instance": "Instanssi",
"label": "Ylläpito",
"purgeCommunity": {
"title": "Puhdista yhteisö",
"warning": "Tämä poistaa kaikki julkaisut. Oletko varma? (Nappula avautuu kolmessa sekunnissa)"
}
},
"nav": {
"menu": {
"app": "Sovellus",
"label": "Profiili",
"settings": "Asetukset",
"colorscheme": {
"dark": "Tumma",
"light": "Vaalea",
"label": "Väritila",
"system": "Oletus"
},
"theme": "Teemat",
"about": "Tietoja",
"source": "Lähdekoodi",
"donate": "Lahjoita",
"instance": "Instanssi"
},
"communities": "Selaa yhteisöjä",
"home": "Koti",
"search": "Hae",
"create": {
"label": "Luo",
"post": "Julkaisu",
"community": "Yhteisö",
"logingate": "Kirjaudu sisään luodaksesi sisältöä."
},
"moderation": "Moderointi",
"admin": "Ylläpito"
},
"profile": {
"profile": "Profiili",
"inbox": "Postilaatikko",
"subscribed": "Tilaukset",
"saved": "Tallennetut"
},
"account": {
"login": "Kirjaudu sisään",
"logout": "Kirjaudu ulos",
"signup": "Luo tili",
"accounts": "Käyttäjätilit",
"changeinstance": "Vaihda instanssia",
"resetColor": "Palauta väri",
"addGuest": "Lisää vieras",
"moveUp": "Siirrä ylös",
"moveDown": "Siirrä alas",
"guest": "Vieras",
"versionGate": "Tämä Photon-versio tukee instansseja versiosta {{version}} eteenpäin."
},
"filter": {
"sort": {
"top": {
"label": "Parhaat",
"time": {
"all": "milloin tahansa",
"label": "Aika",
"9months": "9 kk",
"3months": "3 kk",
"month": "kuukausi",
"week": "viikko",
"day": "päivä",
"hour": "tunti",
"12hours": "12 t",
"6hours": "6 t",
"6months": "6 kk"
}
},
"hot": "Kuumat",
"label": "Lajittelu",
"active": "Aktiiviset",
"controversial": "Kiistanalaiset",
"new": "Uusimmat",
"old": "Vanhimmat",
"newcomments": "Uusia vastauksia",
"scaled": "Skaalattu",
"mostcomments": "Eniten kommentteja"
},
"location": {
"moderator": "Moderaattori",
"label": "Sijainti",
"local": "Paikallinen",
"subscribed": "Tilaukset",
"all": "Kaikki",
"global": "Yleinen"
},
"inbox": {
"mentions": "Maininnat",
"messages": "Viestit",
"replies": "Vastaukset"
},
"view": {
"compact": "Tiivis lista",
"label": "Näkymä",
"cozy": "Mukava",
"list": "Lista",
"legacy": "Vanha"
},
"type": "Tyyppi",
"filter": "Suodata",
"unread": "Lukemattomat"
},
"form": {
"2fa": "2FA-koodi",
"username": "Käyttäjänimi",
"forgotpassword": "Unohdin salasanani",
"name": "Nimi",
"password": "Salasana",
"post": {
"body": "Sisältö",
"nsfw": "NSFW",
"community": "Yhteisö",
"title": "Otsikko",
"uploadImage": "Liitä kuva",
"generateTitle": "Hae otsikko",
"create": "Luo julkaisu",
"edit": "Muokkaa julkaisua",
"url": "URL",
"altText": "Vaihtoehtoinen teksti"
},
"profile": {
"2fa": {
"totp": "TOTP",
"2fa": "Kaksivaiheinen tunnistautuminen (2FA)",
"paste": "Liitä tämä todenninsovellukseesi (authenticator app)."
},
"deleteAccount": {
"warning": "Tämä poistaa KAIKEN lähettämäsi sisällön.",
"label": "Poista tili",
"deleteContent": "Poista sisältö"
},
"bio": "Profiilin kuvaus",
"matrix": "Matrix-käyttäjä",
"newPassword": "Uusi salasana",
"verifyNewPassword": "Vahvista uusi salasana",
"currentPassword": "Nykyinen salasana",
"email": "Sähköposti",
"bot": "Robottikäyttäjä",
"avatar": "Profiilikuva",
"banner": "Kansikuva",
"showNSFW": "Näytä NSFW-sisältö",
"scores": "Näytä pisteet",
"showRead": "Näytä luetut julkaisut",
"showBots": "Näytä robottikäyttäjät",
"displayName": "Näyttönimi"
},
"setup": "Ota käyttöön",
"signup": {
"title": "Luo tili",
"application": {
"label": "Vastaus",
"info": "Liittyäksesi tälle instanssille, sinun tulee täyttää tämä hakemus ja odottaa sen hyväksymistä. Saat vastauksen sähköpostiisi, kun se on hyväksytty."
},
"closed": {
"title": "Rekisteröityminen suljettu",
"description": "Rekisteröityminen tälle instanssille on suljettu. Etsi toinen instanssi.",
"anotherInstance": "Etsi toinen instanssi"
},
"chooseInstance": "Valitse instanssi",
"description": "Valitse kiinnostava instanssi tai syötä osoite manuaalisesti.",
"info": "Instanssi on palvelin, jolla käyttäjätilisi sijaitsee. Voit silti osallistua keskusteluun muilla instansseilla."
},
"description": "Kuvaus",
"email": "Sähköposti",
"preview": "Esikatsele",
"submit": "Lähetä",
"confirmPassword": "Vahvista salasana",
"edit": "Muokkaa",
"instance": "Instanssin osoite"
},
"moderation": {
"ban": {
"banning": "Anna porttikielo",
"unbanning": "Poista porttikielto",
"deleteData": "Poista data",
"expires": "Vanhentuu (UTC)",
"banFromCommunity": "Anna porttikielto yhteisöön",
"unbanFromCommunity": "Poista porttikielto yhteisöstä",
"warning": "Tämä poistaa KAIKEN tämän käyttäjän lähettämän sisällön tänne."
},
"removeSubmission": {
"title": "Poista lähetys",
"titleRestore": "Palauta lähetys",
"titlePurge": "Puhdista lähetys",
"withReason": "Vastaa syyn kanssa",
"comment": "Kommentti",
"failMessage": "Viestin lähetys epäonnistui. Poistetaan silti...",
"successPurge": "Lähetys puhdistettiin onnistuneesti.",
"failReply": "Vastauksen lähetys epäonnistui. Poistetaan silti...",
"message": "Viesti",
"failEmptyReply": "Vastaus ei voi olla tyhjä, jos \"Vastaa syyn kanssa\" on valittu."
},
"reportModal": {
"title": "Ilmianna",
"success": "Lähetys ilmiannettu."
},
"reason": "Syy",
"lock": "Lukitse",
"unlock": "Poista lukitus",
"remove": "Poista",
"restore": "Palauta",
"label": "Moderointi",
"labelInstanceOnly": "Moderointi (vain instanssi)",
"feature": "Nosta",
"unfeature": "Poista nosto",
"report": "Ilmianna"
},
"comment": {
"actions": {
"link": "Kopioi linkki",
"label": "Toiminnot"
},
"locked": "Tämä julkaisu on lukittu.",
"reply": "Vastaa",
"more": "{{comments:number}} lisää"
},
"common": {
"back": "Takaisin",
"next": "Seuraava",
"debug": "Vianetsintä",
"refresh": "Päivitä",
"jump": "Hyppää",
"save": "Tallenna",
"enabled": "Päällä",
"disabled": "Pois päältä",
"enable": "Ota käyttöön",
"disable": "Poista käytöstä",
"add": "Lisää",
"send": "Lähetä",
"cancel": "Peru"
},
"message": {
"success": "Onnistui",
"error": "Virhe"
},
"toast": {
"noComments": "API ei palauttanut kommentteja.",
"loginVoteGate": "Kirjaudu sisään äänestääksesi.",
"blockedCommunity": "Yhteisö estetty.",
"unblockedCommunity": "Yhteisön esto poistettu.",
"purgedCommunity": "Yhteisö puhdistettu.",
"blockedInstance": "Instanssi estetty.",
"sentMessage": "Viesti lähetetty.",
"bannedUser": "Porttikielto annettu käyttäjälle.",
"unbannedUser": "Porttilkielto poistettu käyttäjältä.",
"needCommunity": "Täsmennä yhteisö.",
"invalidURL": "Virheellinen URL",
"invalidDateBeforeCurrent": "Virheellinen päivämäärä. Päivämäärä on menneisyydessä.",
"generatedTitle": "Otsikko ja sisältö haettu osoitteen perusteella. Peru?",
"copied": "Kopioitu leikepöydälle.",
"approvedApplication": "Hakemus hyväksytty.",
"deniedApplication": "Hakemus evätty.",
"updatedSite": "Sivusto päivitetty.",
"failCSV": "CSV:n luku epäonnistui",
"removeAdminWarning": "Oletko varma, että haluat poistaa tämän ylläpitäjän?",
"removeAdmin": "Ylläpitäjä poistettu.",
"failFindUser": "Käyttäjää ei löydetty.",
"updateMods": "Yhteisön moderaattorit päivitetty.",
"logIn": "Sisäänkirjautuminen onnistui.",
"failInstanceURL": "Yhteys instanssiin epäonnistui. Onko se alhaalla?",
"addAccount": "Käyttäjätili lisätty.",
"resolveReport": "Ilmianto ratkaistu.",
"unresolveReport": "Ilmianto merkitty ratkaisemattomaksi.",
"passwordReset": "Salasanasi on palautettu.",
"loginRefresh": "Kirjautumisesi on päivitetty.",
"saveSettings": "Käyttäjän asetukset tallennettu. Jos vaihdoit sähkköpostisi, saat vahvistuslinkin.",
"confirmDelete1": "Oletko varma, että haluat poistaa käyttäjätilisi?",
"confirmDelete2": "Oletko oikeasti varma?",
"needPassword": "Salasana tarvitaan.",
"deleting": "Poistetaan käyttäjätiliä...",
"deleted": "Käyttäjätilisi on poistettu.",
"resetSettings": "Haluatko palauttaa oletusasetukset?",
"failFetchInstances": "Saatavilla olevien instanssien haku epäonnistui.",
"failSignup": "Rekisteröityminen epäonnistui.",
"successSignup": "Rekisteröidytty.",
"waitApplication": "Odota rekisteröitymisesi hyväksymistä ennen sisäänkirjautumista.",
"blockUser": "Käyttäjä estetty.",
"unblockUser": "Käyttäjän esto poistettu.",
"purgeUser": "Käyttäjä puhdistettu.",
"restoredFromDraft": "Julkaisu palautettu luonnoksesta.",
"fetchPostOnHome": "Haetaan julkaisu instanssiltasi...",
"updatedCommunity": "Yhteisösi on päivitetty.",
"invalidDateAbsolute": "Virheellinen päivämäärä. Päivämäärä ei voi olla suhteellinen.",
"failGenerateTitle": "Otsikon hakeminen sivulta epäonnistui.",
"addMod": "Moderaattori lisätty.",
"resetLink": "Palautuslinkki lähetettin sähköpostiisi.",
"invalidLogin": "Virheelliset kirjautuimistiedot",
"confirmDelete3": "Viimeinen varoitus. Oletko oikeasti varma?",
"verifyEmail": "Vahvistuslinkki lähetettiin sähköpostiisi. Vahvista sähköpostisi ja sitten kirjaudu."
},
"settings": {
"app": {
"sort": {
"title": "Oletusjärjestys",
"description": "Syötteiden oletuslajittelu."
},
"view": {
"title": "Näkymän tyyli",
"legacy": "Photonin vanha ulkoasu.",
"cozy": "Näytä kuvat, sisältö ja upotukset suurina.",
"compact": "Näytä julkaisut tiiviinä listana, ilman sisältöä.",
"list": "Näytä julkaisut listana, lyhennetyn sisällön kanssa."
},
"lang": {
"title": "Kieli",
"en": "englanti",
"en-US": "englanti",
"he": "heprea",
"et": "viro",
"fr": "ranska",
"auto": "automaattinen",
"credits": "Kääntäjät",
"description": "Käyttöliittymän kieli.",
"note": "Virallisesti tuetut kielet ovat englanti ja heprea. Muut käännökset ovat yhteisön tekemiä, eivätkä siten välttämättä ole täydellisiä.",
"fi": "suomi",
"pt": "portugali",
"de": "saksa"
},
"title": "Photon",
"theming": {
"title": "Teemat",
"description": "Muokkaa värejä.",
"link": "Mene teemoihin"
},
"displayName": {
"title": "Käytä näyttönimeä",
"description": "Näytä käyttäjien näyttönimet oikeiden käyttäjänimien sijaan."
},
"limitLayoutWidth": {
"title": "Rajoita leveyttä",
"description": "Paranna luettavuutta rajoittamalla käyttöliittymän leveyttä."
},
"expandImages": {
"title": "Laajenna kuvat",
"description": "Julkaisun kuvan klikkaaminen suurentaa sen, eikä avaa itse julkaisua."
},
"duplicateTitles": {
"title": "Piilota identtinen otsikko ja sisältö",
"description": "Jos julkaisun otsikko ja sisältö ovat identtiset upotuksen kanssa, piilota ne."
},
"font": {
"description": "Valitse käyttöliittymän fontti.",
"title": "Fontti"
},
"translation": {
"title": "Käännös",
"description": "LibreTranslate-instanssi, jota käyttää konekäännöksiin.",
"instance": "Verkkotunnus"
},
"thumbnailSide": {
"title": "Pikkukuvan sijainti",
"left": "Vasen",
"right": "Oikea",
"description": "Pikkukuvan sijainti tiiviissä- ja listanäkymässä"
},
"postsInNewTab": {
"title": "Avaa uudessa välilehdessä",
"description": "Avaa julkaisut aina uudessa välilehdessä."
},
"placeholders": {
"title": "Satunnaiset paikkamerkit",
"description": "Näytä satunnaisia paikkamerkkejä tyhjillä tekstikentillä."
},
"colorscheme": {
"title": "Väritila",
"description": "Valitse väritila."
}
},
"title": "Asetukset",
"beta": "Beta",
"navigation": {
"title": "Navigointi",
"dockPos": {
"title": "Telakan sijainti",
"top": "Ylhäällä",
"bottom": "Alhaalla",
"adaptive": "Mukautuva",
"description": "Minne telakka sijoitetaan näytöllä."
},
"panel": {
"title": "Paneelitila",
"description": "Laajenna telakka näytön reunoille.",
"on": "Päällä",
"off": "Pois päältä",
"adaptive": "Mukautuva"
},
"pins": {
"title": "Kiinnitykset",
"description": "Lisää kiinnityksiä sivupalkkiin napsauttamalla kuvaketta. Napsauta oikealla poistaaksesi sen."
}
},
"lemmy": {
"compactFeatured": {
"title": "Tiiviit nostot",
"description": "Näytä nostetut julkaisut tiiviinä"
},
"markReadPosts": {
"description": "Merkitse julkaisut luetuksi avattaessa",
"title": "Merkitse avatut luetuksi"
},
"fadeReadPosts": {
"title": "Häivytä luetut",
"description": "Häivytä luettujen julkaisujen otsikot"
},
"hideSubmissions": {
"title": "Piilota sisältö",
"description": "Piilota tietyntyyppinen sisältö.",
"removed": "Poistettu moderaattorin toimesta",
"deleted": "Poistettu käyttäjän toimesta"
},
"instances": {
"description": "Näytä instanssi, josta sisältö on kotoisin.",
"title": "Näytä instanssit"
},
"nsfwBlur": {
"title": "NSFW-sumennus",
"description": "Sumenna NSFW-julkaisujen kuvat ja piilota teksti."
},
"title": "Lemmy",
"crosspostMarker": {
"title": "Merkitse ristijulkaisut",
"description": "Näytä ristijulkaisut."
},
"showHiddenPosts": {
"title": "Näytä piilotetut julkaisut",
"description": "Näytä käsin piilottamasi julkaisut."
}
},
"moderation": {
"title": "Moderointi",
"replyPresets": {
"title": "Poistovastaukset",
"description": "Valmiit vastaukset sisällön poiston syyksi.",
"syntax": "Syntaksi"
}
},
"embeds": {
"title": "Upotukset",
"clickToView": {
"title": "Klikkaa näyttääksesi",
"description": "Lataa upotus vasta, kun olet klikannut sitä."
},
"youtube": {
"description": "Sivusto, jota käytetään YouTube-sisällön upotukseen."
},
"instance": {
"description": "Instanssi, jonka kautta upottaa YouTube-sisältö.",
"invidious": "Invidious-instanssi",
"piped": "Piped-instanssi"
}
},
"other": {
"debug": {
"title": "Vianetsintätiedot",
"description": "Näytä vianetsintätiedot"
},
"title": "Muut"
},
"desktop": "Työpöytä",
"tablet": "Tabletti",
"mobile": "Mobiili"
}
}
+425
View File
@@ -0,0 +1,425 @@
{
"profile": {
"profile": "Profil",
"inbox": "Boîte de réception",
"saved": "Sauvegardé",
"subscribed": "Abonnés"
},
"nav": {
"moderation": "Modération",
"communities": "Explorer",
"search": "Recherche",
"create": {
"label": "Créer",
"post": "Publication",
"community": "communauté",
"logingate": "Vous devez vous inscrire pour créer du contenu."
},
"menu": {
"label": "Profil",
"settings": "Paramètres",
"colorscheme": {
"label": "Apparence",
"system": "Systeme",
"dark": "Sombre",
"light": "Clair"
},
"theme": "Apparence",
"about": "À propos",
"donate": "Faire un Don",
"source": "Source",
"instance": "Instance"
},
"home": "Page d'acceuil",
"admin": "Administrateur"
},
"account": {
"login": "Connexion",
"logout": "Déconnexion",
"signup": "S'inscrire",
"accounts": "Comptes",
"changeinstance": "Changer de Instance",
"addGuest": "Ajouter un autre Invité",
"moveUp": "Monter",
"moveDown": "Descendre",
"guest": "invité",
"versionGate": "Cette version de Photon prend en charge des instances qui tournent la version {{version}} ou mieux.",
"resetColor": "Remettre à zéro les couleurs"
},
"filter": {
"location": {
"label": "Emplacement",
"all": "Tout",
"subscribed": "Abonnés",
"moderator": "Modérateur",
"global": "Tout",
"local": "Local"
},
"sort": {
"label": "Trier",
"active": "Actif",
"hot": "Tendances",
"top": {
"time": {
"label": "Temps",
"all": "De tout temps",
"9months": "Des neuf derniers mois",
"6months": "Des six derniers mois",
"3months": "Des trois derniers mois",
"month": "Du mois",
"week": "De la semaine",
"day": "Du jour",
"12hours": "Des douze dernières heures",
"6hours": "Des six dernières heures",
"hour": "De l'heure"
},
"label": "Top"
},
"new": "Nouveaux",
"old": "Ancien",
"controversial": "Controversé",
"scaled": "Mis à l'échelle",
"mostcomments": "Plus commentés",
"newcomments": "Nouveaux commentaires"
},
"view": {
"label": "Style",
"cozy": "Confortable",
"list": "Liste",
"compact": "Compacte",
"legacy": "Classique"
},
"filter": "Filtrer",
"unread": "Non lu",
"inbox": {
"replies": "Réponses",
"messages": "Messages",
"mentions": "Mentions"
},
"type": "Type"
},
"form": {
"username": "Utilisateur",
"name": "Nom affiché",
"instance": "Adresse de l'instance",
"confirmPassword": "Confirmer mot de passe",
"2fa": "Code 2FA",
"forgotpassword": "Mot de passe oublié",
"submit": "Soumettre",
"edit": "Modifier",
"preview": "Aperçu",
"post": {
"create": "Créer une publication",
"edit": "Éditer publication",
"community": "Communauté",
"title": "Titre",
"body": "Contenu",
"generateTitle": "Generate le Titre",
"uploadImage": "Ajouter une Image",
"url": "URL",
"nsfw": "NSFW",
"altText": "Équivalent textuel"
},
"profile": {
"displayName": "Nom affiché",
"bio": "Biographie",
"banner": "Bannière",
"matrix": "Utilisateur Matrix",
"showNSFW": "Afficher le contenu NSFW",
"scores": "Afficher les Scores",
"bot": "Compte automatisé",
"showBots": "Afficher le contenu automatisé",
"showRead": "Afficher les publications lues",
"currentPassword": "Mot de passe actuel",
"newPassword": "Nouveau mot de passe",
"verifyNewPassword": "Vérifiez le mot de passe",
"2fa": {
"paste": "Copier ceci dans votre applicaton d'authentication.",
"totp": "L'authentification à plusieurs facteurs",
"2fa": "l'authentification à deux facteurs"
},
"deleteAccount": {
"label": "Supprimer le compte",
"deleteContent": "Supprimer le contenu",
"warning": "Cette opération supprimera TOUTES vos publications."
},
"avatar": "Avatar",
"email": "Email"
},
"email": "Adresse E-mail",
"setup": "Activer",
"signup": {
"title": "S’inscrire",
"description": "Choisissez une instance qui vous intéresse ou entrez l'URL d'une instance vous-même.",
"info": "L'instance que vous choisiriez est le serveur sur lequel votre compte sera hébergé, mais vous pouvez toujours accéder et interagir avec le contenu sur d'autres instances.",
"chooseInstance": "Choisissez une instance",
"application": {
"label": "Demande d'autorisation",
"info": "Pour rejoindre cet instance, vous devez remplir cette demande d'autorisation et attendre q'uelle soit accepté. Vous recevrez un courriel si votre demande d'autorisation est acceptée."
},
"closed": {
"title": "Les inscriptions sont closes",
"description": "Cet instance n'accepte plus les registration. Trouvez un autre instance.",
"anotherInstance": "Trouver une autre instance"
}
},
"password": "Mot de passe",
"description": "Description"
},
"routes": {
"frontpage": {
"title": "Page d'accueil",
"footer": "{{users:number}} En ligne {{users; 1:user; default:users;}}"
},
"legal": {
"noLegal": "Cet instance n'a aucune information legale.",
"title": "Légal"
},
"profile": {
"user": "Utilisateur",
"settings": "Paramètres",
"blocks": "Blocages",
"credentials": "sécurité",
"moderates": "Modérés",
"favorites": "Favoris"
},
"accounts": "Comptes",
"communities": "Communautés",
"search": {
"title": "Rechercher",
"federating": "Federation",
"query": "Requête",
"noResults": {
"title": "Aucun résultats",
"description": "Il n'y a aucun resultat qui correspond a ce filtre. Faite une autre Recherche.",
"alt": "Recherchez toute la 'Fediverse'"
}
},
"saved": "Sauvegardé",
"createPost": "Créer une publication",
"post": {
"crosspostCount": "crosspublications",
"commentCount": "commentaires",
"addComment": "Ajouter un commentaire",
"scrollToTop": "Revenir vers le haut",
"instanceWarning": "Ce message a été demandé à partir d'une instance différent de celui de votre compte. La plupart des actions ne fonctionneront pas.",
"remoteView": "Vue a partir d'un autre instance",
"localView": "Vue a partir de l'instance du compte",
"thread": {
"single": "Vous regardez un seul fil de commentaires.",
"allComments": "Voir tout les commentaires",
"part": "Vous regardez une partie d'un fil de commentaires.",
"context": "Afficher le contexte"
}
},
"inbox": {
"title": "Boîte de réception",
"markAsRead": "Marquer tout comme lu",
"empty": {
"title": "Boîte de réception est vide",
"description": "les messages, réponses, and mentions will appear here."
}
},
"moderation": {
"title": "modération",
"empty": {
"title": "Aucun nouveaux signalements",
"description": "Quand il y a des nouveaux signalements, vous pourrez agir ici."
},
"reason": "Raison",
"resolve": "Resolu",
"unresolve": "Non resolu"
},
"admin": {
"title": "L'administration",
"config": {
"sidebar": "Barre latérale",
"icon": "Icone",
"banner": "Bannière",
"downvotesEnabled": "Activer les downvotes",
"nsfwEnabled": "Permettre le contenu NSFW",
"registration": {
"label": "Mode d'inscription",
"open": "Ouvrir",
"application": "Exiger une demande d'adhésion",
"closed": "fermée"
},
"applicationQuestion": "Question pour la demande d'adhésion",
"adminCommunityOnly": "Seul les administrateurs peuvent créer des communautés",
"requireVerifyEmail": "Exiger un courriel de verification",
"emailAdminsOnApplication": "Envoyer un courriel au administrateurs a chaque nouvelle inscription",
"emailAdminsOnReport": "Envoyer un courriel au administrateurs a chaque nouveau signalement",
"listingType": {
"label": "Type d'annonce",
"all": "Tout",
"local": "Local"
},
"private": "Instance privé",
"hideModlogModNames": "Cacher les noms dans le journal du modérateur",
"slurFilter": "Filtre anti-bavure",
"federation": "Federation activée",
"federationDebug": "mode de débogage de federation",
"captcha": {
"enabled": "CAPTCHA Activé"
},
"title": "Configuration"
},
"applications": {
"title": "Demandes",
"empty": {
"title": "Pas de nouvelles demandes",
"description": "Les demandes d'adhesion a votre instance apparaitront ici."
},
"application": "Demande",
"approved": "acceptée",
"denied": "Rejetée",
"user": "Utilisateur",
"deny": "Rejeter",
"approve": "Accepter",
"reason": "Raison",
"modalTitle": "Rejeter la demande d'authorisation"
},
"taglines": {
"title": "Pas de slogans",
"add": "Ajoutez un slogan",
"description": "Un slogan aleatoire apparaitra quand un utilisateur visitera votre instance.",
"empty": {
"title": "Aucun slogan",
"description": "Un slogan apparaîtra au hasard quand un utilisateur visitera votre instance."
}
},
"team": {
"title": "Administrateurs",
"empty": {
"title": "Aucun administrateurs",
"description": "Il n'y a aucun administrateur de serveur, je ne sais pas comment vous avez reussi a faire cela."
}
},
"federation": {
"title": "Federation",
"csv": "Charger un CSV",
"blocked": "Instances Bloquées",
"block": "Bloquer",
"blockplaceholder": "Bloquer une instance...",
"allowed": "Instances Whitelistées",
"allow": "Whitelister",
"allowplaceholder": "Whitelister une instance",
"emptyBlock": {
"title": "Aucune instances bloqués",
"description": "Le bloc d'une instance cachera toutes nouvelles soumissions de cette instance."
},
"emptyAllow": {
"title": "Aucunes instances sur la liste blanche",
"description": "Mettre une instance sur la liste blanche bloquera toutes les autres instances."
}
}
},
"team": {
"title": "administrateurs",
"empty": {
"title": "Aucun administrateurs",
"description": "Il n'y a aucun administrateur pour cet instance, il y a un probleme"
}
},
"federation": {
"title": "Federation",
"csv": "Envoyez un CSV",
"blocked": "Instances bloqués",
"block": "Bloque",
"blockplaceholder": "Bloque une instance...",
"allowed": "Instances ",
"allow": "Whitelist",
"allowplaceholder": "Whitelist une instance",
"emptyBlock": {
"title": "Aucunes instances bloquées",
"description": "Blocking an instance will hide new submissions from that instance."
},
"emptyAllow": {
"title": "pas de instances whitelistées",
"description": "Whitelister une instance va bloquer toutes les autres instances."
}
},
"instances": "Instances",
"translators": "Traducteurs",
"createCommunity": "Créer une communauté",
"modlog": "Journal de modération",
"verifyEmail": {
"message": "Votre email a été verifié, vous pouvez maintenant fermer cette fenêtre.",
"error": "La vérification de l'email a échouée."
},
"passwordChange": {
"title": "Changer le mot de passe",
"description": "Choisissez votre nouveaux mot de passe.",
"instance": "Sur quelle instance est hostée votre compte?"
},
"resetLogin": {
"title": "Réinitialiser le mot de passe",
"description": "Mettez l'email de vôtre compte, et un lien de réinitialision de mot de passe sera envoyé. Si vôtre compte n'a pas de email, vous devez contacter les administrateurs de votre instance."
},
"theme": {
"import": "Importer",
"export": "Exporter",
"reset": "Réinitialiser",
"accent": "Couleur d'accentuation",
"resetWarning": {
"title": "Réinitialiser les paramètres d'apparence",
"description": "Ceci remettera a zéro toute la configuration de l'apparence, il est conseillé de l'exporter d'abord."
},
"title": "Apparence"
}
},
"verifyEmail": {
"message": "Votre e-mail est maintenant vérifié. Vous pouvez maintenant fermer cette fenetre.",
"error": "Votre e-mail n'a pas pu etre vérifié."
},
"passwordChange": {
"title": "Changer votre mot de passe",
"description": "Choisir votre nouveau code.",
"instance": "De quelle instance viens votre compte?"
},
"resetLogin": {
"title": "Réinitialiser le mot de passe",
"description": "Entrez l'email de votre compte, et un lien pour réinitialiser le mot de passe vont être envoyés à cette adresse e-mai. Si votre compte n'a pas de adresse e-mail, contactez votre administrateur"
},
"settings": {
"app": {
"lang": {
"": "Dont translate the below!"
},
"theming": {
"link": "Configuration d'apparence"
}
}
},
"comment": {
"reply": "Répondre",
"actions": {
"link": "Copier le lien"
}
},
"moderation": {
"report": "Créer un signalement",
"ban": {
"banning": "Bannir l'utilisateur",
"deleteData": "Suprimmer les données",
"warning": "Cette option supprimera TOUTES les publications de cet utilisateur.",
"expires": "Expire (UTC)",
"banFromCommunity": "Ban d'une communauté"
}
},
"cards": {
"site": {
"stats": "Statistiques",
"admins": "Administrateurs"
},
"community": {
"members": "Membres",
"moderators": "Modérateurs",
"subscribe": "S'abonner",
"subscribed": "Abonné",
"modlog": "Journal de modération",
"block": "Bloquer",
"unblock": "Débloquer"
}
}
}
+310
View File
@@ -0,0 +1,310 @@
{
"filter": {
"unread": "לא נקרא",
"location": {
"label": "מיקום",
"all": "הכל",
"local": "מקומי",
"subscribed": "רשום",
"moderator": "מנהל",
"global": "גלובלי"
},
"sort": {
"label": "מיון",
"active": "פעיל",
"hot": "חם",
"top": {
"time": {
"label": "זמן",
"all": "הכל",
"9months": "9 חודשים",
"6months": "6 חודשים",
"3months": "3 חודשים",
"month": "חודש",
"week": "שבוע",
"day": "יום",
"12hours": "12 שעות",
"6hours": "6 שעות",
"hour": "שעה"
},
"label": "הטובים ביותר"
},
"new": "חדש",
"old": "ישן",
"controversial": "שנוי במחלוקת",
"mostcomments": "תגובות",
"newcomments": "תגובות חדשות",
"scaled": "מטפסים"
},
"view": {
"label": "פריסה",
"cozy": "נוח",
"list": "רשימה",
"compact": "דחוס",
"legacy": "ישן"
},
"type": "סוג",
"filter": "סינון",
"inbox": {
"messages": "הודעות",
"replies": "תגובות",
"mentions": "אזכורים"
}
},
"form": {
"profile": {
"showBots": "הצגת בוטים",
"2fa": {
"paste": "נא להדביק את זה באפליקציית ה-authenticator שלך.",
"totp": "TOTP",
"2fa": "2FA"
},
"displayName": "כינוי",
"bio": "אודות",
"avatar": "תמונת פרופיל",
"banner": "באנר",
"email": "אימייל",
"matrix": "משתמש Matrix",
"showNSFW": "הצגת תוכן למבוגרים",
"bot": "חשבון בוט",
"currentPassword": "סיסמה נוכחית",
"newPassword": "סיסמה חדשה",
"verifyNewPassword": "אימות סיסמה חדשה",
"deleteAccount": {
"label": "מחיקת חשבון",
"deleteContent": "מחיקת תוכן",
"warning": "פעולה זו תמחק את כל התוכן שלך."
},
"scores": "הצגת הצבעות",
"showRead": "תצוגת פוסטים שנקראו"
},
"confirmPassword": "אישור סיסמה",
"post": {
"title": "כותרת",
"altText": "טקסט חלופי",
"create": "יצירת פוסט",
"edit": "עריכת פוסט",
"community": "קהילה",
"url": "קישור",
"body": "גוף",
"nsfw": "תוכן למבוגרים",
"generateTitle": "יצירת כותרת",
"uploadImage": "העלאת תמונה"
},
"signup": {
"application": {
"info": "כדי להצטרף לשרת זה, חובה למלא את בקשת ההצטרפות ולחכות לקבלה. ישלח אימייל כאשר בקשתך התקבלה.",
"label": "בקשה להצטרפות"
},
"title": "הרשמה",
"description": "נא לבחור שרת שמעניין אותך, או לכתוב קישור באופן ידני.",
"chooseInstance": "בחירת שרת",
"closed": {
"title": "רישומים סגורים",
"description": "בשרת זה הרישומים סגורים. נא למצוא שרת אחר.",
"anotherInstance": "מציאת שרת אחר"
},
"info": "השרת הוא היכן שחשבונך שמור, אך עדיין ניתן לגשת לתוכן משרתים נוספים."
},
"email": "אימייל",
"description": "תיאור",
"username": "שם משתמש",
"name": "שם",
"password": "סיסמה",
"2fa": "קוד 2FA",
"forgotpassword": "שכחתי את הסיסמה",
"submit": "שליחה",
"edit": "עריכה",
"preview": "תצוגה מקדימה",
"instance": "קישור לשרת",
"setup": "הגדרה"
},
"profile": {
"profile": "פרופיל",
"inbox": "דואר נכנס",
"saved": "שמורים",
"subscribed": "רשומים"
},
"routes": {
"frontpage": {
"footer": "{{users:number}} {{users; 1:משתמש; default:משתמשים;}} {{users; 1:פעיל; default:פעילים;}}",
"title": "דף הבית"
},
"modlog": "יומן הנהלה",
"instances": "שרתים",
"legal": {
"title": "משפטי",
"noLegal": "לשרת זה אין מידע משפטי."
},
"profile": {
"user": "משתמש",
"settings": "הגדרות",
"credentials": "אימות",
"moderates": "מנהל/ת",
"favorites": "אהובים"
},
"translators": "מתרגמים",
"accounts": "חשבונות",
"communities": "קהילות",
"search": {
"title": "חיפוש",
"noResults": {
"title": "אין תוצאות",
"description": "אין תוצאות שתואמות את מילות המפתח שלך. מומלץ לעדכן את חיפושך.",
"alt": "חיפוש ברחבי הפדיורס"
},
"query": "חיפוש"
},
"admin": {
"config": {
"captcha": {
"enabled": "CAPTCHA מופעלת"
},
"federation": "פדרציה מופעלת",
"title": "הגדרות",
"sidebar": "סרגל צידי",
"icon": "סמל",
"banner": "באנר",
"downvotesEnabled": "הפעלת הצבעות נגד",
"nsfwEnabled": "הפעלת תוכן למבוגרים",
"registration": {
"label": "מצב רישום",
"open": "פתוח",
"application": "חייב בקשה",
"closed": "סגור"
},
"applicationQuestion": "שאלת בקשה",
"adminCommunityOnly": "רק מנהלים גבוהים יכולים ליצור קהילות",
"requireVerifyEmail": "חייב אימות על ידי אימייל",
"emailAdminsOnApplication": "שליחות אימייל למנהלים גבוהים בעת קבלת בקשות חדשות",
"emailAdminsOnReport": "שליחת אימייל למנהלים גבוהים בעת קבלת דיווחים חדשים",
"listingType": {
"label": "סוג רישום",
"all": "הכל",
"local": "מקומי"
},
"private": "שרת פרטי",
"slurFilter": "סינון קללות regex",
"federationDebug": "מצב דיבוג פדרציה",
"hideModlogModNames": "הסתרת שמות מנהלים ביומן ההנהלה"
},
"title": "מנהל גבוה",
"applications": {
"title": "בקשות",
"empty": {
"title": "אין בקשות חדשות",
"description": "בקשות להצטרפות השרת יופיעו פה."
},
"application": "בקשה",
"approved": "מאושרת",
"denied": "נדחתה",
"user": "משתמש",
"deny": "לדחות",
"approve": "לאשר",
"reason": "סיבה",
"modalTitle": "דחיית בקשה"
},
"taglines": {
"title": "שורות תיוג",
"add": "הוספת שורת תיוג",
"empty": {
"title": "אין שורות תיוג",
"description": "שורת תיוג אקראית תופיע על כרטיס האתר כאשר משתמשים יבקרו בשרתך."
}
},
"team": {
"title": "מנהלים גבוהים",
"empty": {
"title": "אין מנהלים גבוהים",
"description": "איכשהו אין מנהלים גבוהים לאתר זה. איך??"
}
},
"federation": {
"title": "פדרציה",
"csv": "העלאת CSV",
"block": "חסימה",
"blockplaceholder": "חסימת שרת...",
"blocked": "שרתים חסומים",
"allowed": "שרתים מורשים"
}
},
"saved": "שמורים",
"createPost": "יצירת פוסט",
"createCommunity": "יצירת קהילה",
"post": {
"commentCount": "תגובות",
"addComment": "הוספת תגובה",
"scrollToTop": "גלילה לתחילת העמוד",
"instanceWarning": "הפוסט הזה מבוקש משרת השונה משל חשבונך. פעולות רבות יכשלו.",
"remoteView": "תצוגה מרחוק",
"localView": "תצוגה מקומית",
"thread": {
"single": "מוצג שרשור בודד.",
"allComments": "כל התגובות",
"part": "מוצג חלק משרשור",
"context": "תצוגת הקשר"
},
"crosspostCount": "פוסטים משותפים"
},
"inbox": {
"title": "דואר נכנס",
"markAsRead": "סימון הכל כנקרא",
"empty": {
"title": "אין הודעות חדשות",
"description": "הודעות, תגובות, ואזכורים יופיעו פה."
}
},
"moderation": {
"title": "מנהל",
"empty": {
"title": "אין דיווחים חדשים",
"description": "כאשר תוכן מדווח, ניתן לפעול בנידון כאן."
},
"reason": "סיבה",
"resolve": "פתירה",
"unresolve": "הסרת פתירה"
}
},
"nav": {
"home": "בית",
"admin": "מנהל גבוה",
"moderation": "מנהל",
"communities": "קהילות",
"search": "חיפוש",
"create": {
"label": "יצירה",
"community": "קהילה",
"logingate": "חובה עליך להתחבר כדי ליצור תוכן.",
"post": "פוסט"
},
"menu": {
"label": "פרופיל",
"app": "אפליקציה",
"settings": "הגדרות",
"colorscheme": {
"label": "צבעים",
"system": "מערכת",
"dark": "כהה",
"light": "בהיר"
},
"theme": "סגנון",
"about": "אודות",
"source": "מקור",
"donate": "תרומה",
"instance": "שרת"
}
},
"account": {
"login": "התחברות",
"logout": "התנתקות",
"signup": "הרשמה",
"accounts": "חשבונות",
"changeinstance": "שינוי שרת",
"resetColor": "איפוס צבעים",
"addGuest": "הוספת אורח",
"moveUp": "הזזה למעלה",
"moveDown": "הזזה למטה",
"guest": "אורח",
"versionGate": "הגרסה הזו של Photon תומכת בשרתים המריצים {{version}} או גרסה עדכנית יותר."
}
}
+693
View File
@@ -0,0 +1,693 @@
{
"profile": {
"profile": "Perfil",
"saved": "Guardado",
"subscribed": "Subscrita",
"inbox": "Caixa de entrada"
},
"nav": {
"home": "Página inicial",
"moderation": "Moderação",
"communities": "Explorar",
"menu": {
"label": "Perfil",
"settings": "Configurações",
"app": "Aplicação",
"colorscheme": {
"label": "Esquema de cores",
"system": "Sistema",
"dark": "Escuro",
"light": "Claro"
},
"theme": "Tema",
"about": "Sobre",
"source": "Código fonte",
"donate": "Doar",
"instance": "Instância"
},
"admin": "Admin",
"search": "Pesquisar",
"create": {
"label": "Criar",
"post": "Publicar",
"community": "Comunidade",
"logingate": "É necessário iniciar sessão para publicar."
}
},
"account": {
"login": "Iniciar sessão",
"moveDown": "Mover para baixo",
"versionGate": "Esta versão do Photon suporta instâncias na versão {{version}} ou superior.",
"logout": "Terminar sessão",
"signup": "Registar",
"accounts": "Contas",
"changeinstance": "Trocar de instância",
"resetColor": "Repor cor",
"addGuest": "Adicionar convidado",
"moveUp": "Mover para cima",
"guest": "Convidado"
},
"filter": {
"filter": "Filtro",
"sort": {
"top": {
"time": {
"12hours": "12 horas",
"9months": "9 meses",
"label": "Quando",
"all": "Sempre",
"6months": "6 meses",
"3months": "3 meses",
"week": "Semana",
"month": "Mês",
"day": "Dia",
"6hours": "6 horas",
"hour": "Hora"
},
"label": "Topo"
},
"label": "Ordem",
"active": "Ativas",
"hot": "Populares",
"new": "Novas",
"old": "Antigas",
"controversial": "Controversas",
"scaled": "Escaladas",
"mostcomments": "Comentários",
"newcomments": "Novos comentários"
},
"location": {
"local": "Local",
"subscribed": "Subscrito",
"moderator": "Moderador",
"label": "Fonte",
"all": "Tudo",
"global": "Global"
},
"view": {
"label": "Vista",
"cozy": "Confortável",
"list": "Lista",
"compact": "Conpacta",
"legacy": "Antiga"
},
"type": "Tipo",
"unread": "Por ler",
"inbox": {
"messages": "Mensagens",
"replies": "Respostas",
"mentions": "Menções"
}
},
"form": {
"profile": {
"displayName": "Nome de exibição",
"showRead": "Mostrar publicações lidas",
"deleteAccount": {
"warning": "Isto irá eliminar TODAS as tuas submissões.",
"label": "Eliminar conta",
"deleteContent": "Eliminar conteúdo"
},
"bio": "Bio",
"avatar": "Avatar",
"banner": "Foto de capa",
"email": "E-mail",
"matrix": "Utilizador de Matrix",
"showNSFW": "Mostrar conteúdo NSFW",
"scores": "Mostrar pontoação",
"bot": "Conta robô",
"showBots": "Mostrar robôs",
"currentPassword": "Senha atual",
"newPassword": "Nova senha",
"verifyNewPassword": "Verificar nova senha",
"2fa": {
"totp": "TOTP",
"2fa": "A2F",
"paste": "Cola isto no teu autenticador."
}
},
"signup": {
"info": "A tua instância é o servidor no qual a tua conta irá residir, permitindo na mesma aceder e interagir com conteúdo de outras instâncias.",
"application": {
"info": "Para te juntares a esta instância, tens que preencher esta candidatura, e aguardar a sua aprovação. Receberás um e-mail se fores aceite.",
"label": "Candidatura"
},
"title": "Registar",
"description": "Escolhe uma instância do teu interesse, ou escreve um URL manualmente.",
"chooseInstance": "Escolher uma instância",
"closed": {
"title": "Registos fechados",
"description": "Esta instância não está a permitir novos registos. Por favor, encontra outra.",
"anotherInstance": "Encontrar outra instância"
}
},
"username": "Nome de utilizador",
"name": "Nome",
"instance": "URL da instância",
"password": "Senha",
"confirmPassword": "Confirmar senha",
"2fa": "Código A2F",
"forgotpassword": "Esqueci-me da senha",
"submit": "Submeter",
"edit": "Editar",
"preview": "Pré-visualizar",
"post": {
"create": "Criar publicação",
"edit": "Editar publicação",
"community": "Comunidade",
"title": "Título",
"url": "URL",
"body": "Corpo",
"nsfw": "NSFW",
"generateTitle": "Gerar título",
"uploadImage": "Carregar imagem"
},
"email": "E-mail",
"setup": "Configurar",
"description": "Descrição"
},
"routes": {
"frontpage": {
"footer": "{{users:number}} {{users; 1:utilizador ativo; default:utilizadores ativos;}}",
"title": "Página inicial"
},
"search": {
"noResults": {
"description": "Sem resultados para essa pesquisa. Tenta ajustá-la.",
"title": "Sem resultados",
"alt": "Pesquisa por todo o fediverso"
},
"title": "Pesquisar",
"federating": "A federar",
"query": "Pesquisa"
},
"post": {
"instanceWarning": "Esta publicação foi pedida a um servidor diferente do da tua conta. Algumas ações não vão funcionar.",
"crosspostCount": "publicações cruzadas",
"commentCount": "comentários",
"addComment": "Adicionar comentário",
"scrollToTop": "Ir para o topo",
"remoteView": "Vista remota",
"localView": "Vista local",
"thread": {
"single": "Estás a ver uma única linha de comentários.",
"allComments": "Todos os comentários",
"part": "Estás a ver parte de uma linha de comentários.",
"context": "Mostrar conteúdo"
}
},
"admin": {
"config": {
"downvotesEnabled": "Ativar votos negativos",
"title": "Configuração",
"sidebar": "Barra lateral",
"icon": "Ícone",
"banner": "Foto de capa",
"nsfwEnabled": "Ativar NSFW",
"registration": {
"label": "Modo de registos",
"open": "Abertos",
"closed": "Fechados",
"application": "Exigir candidatura"
},
"applicationQuestion": "Questão de candidatura",
"requireVerifyEmail": "Exigir verificação de e-mail",
"emailAdminsOnApplication": "Enviar e-mail aos administradores ao receber novas candidaturas",
"emailAdminsOnReport": "Enviar e-mail aos administradores ao receber novas denúncias",
"listingType": {
"label": "Tipo de listagem",
"all": "Tudo",
"local": "Local"
},
"private": "Instância privada",
"slurFilter": "Regex de filtragem de insultos",
"federation": "Federação ativada",
"federationDebug": "Modo de depuração de federação",
"captcha": {
"enabled": "Ativado"
},
"adminCommunityOnly": "Apenas administradores podem criar comunidades",
"hideModlogModNames": "Esconder o nome dos moderadores no registo"
},
"title": "Administração",
"applications": {
"title": "Candidaturas",
"empty": {
"title": "Sem novas candidaturas",
"description": "Candidaturas de registo para a tua instância irão aparecer aqui."
},
"application": "Candidatura",
"approved": "Aprovada",
"denied": "Recusada",
"user": "Utilizador",
"deny": "Recusar",
"approve": "Aprovar",
"reason": "Razão",
"modalTitle": "Recusar candidatura"
},
"taglines": {
"title": "Mensagens de cabeçalho",
"add": "Adicionar uma mensagem",
"empty": {
"title": "Sem mensagens",
"description": "Uma mensagem aleatória irá aparecer no cartão do site, quando os utilizadores visitarem a tua instância."
}
},
"team": {
"title": "Admins",
"empty": {
"title": "Sem admins",
"description": "Por algum motivo não há admins neste site. Como??"
}
},
"federation": {
"title": "Federação",
"csv": "Carregar CSV",
"blocked": "Instâncias bloqueadas",
"block": "Bloquear",
"allow": "Permitir",
"allowplaceholder": "Permitir uma instância",
"emptyBlock": {
"title": "Sem instâncias bloqueadas",
"description": "Bloquear uma instância irá esconder submissões daí."
},
"emptyAllow": {
"title": "Sem instâncias permitidas",
"description": "Permitir uma instância irá bloquear todas as outras."
},
"blockplaceholder": "Bloquear uma instância...",
"allowed": "Instâncias permitidas"
}
},
"moderation": {
"unresolve": "Desfazer resolução",
"title": "Moderação",
"empty": {
"title": "Sem novas denúncias",
"description": "Quando forem denunciadas submissões, podes geri-las aqui."
},
"reason": "Razão",
"resolve": "Resolver"
},
"modlog": "Registo de moderação",
"instances": "Instâncias",
"legal": {
"title": "Info legal",
"noLegal": "Esta instância não tem informação legal."
},
"profile": {
"user": "Utilizador",
"settings": "Configurações",
"blocks": "Bloqueios",
"credentials": "Credenciais",
"moderates": "Modera",
"favorites": "Favoritos"
},
"translators": "Tradutores",
"accounts": "Contas",
"communities": "Comunidades",
"saved": "Guardados",
"createPost": "Criar publicação",
"createCommunity": "Criar comunidade",
"inbox": {
"title": "Caixa de entrada",
"markAsRead": "Marcar tudo como lido",
"empty": {
"title": "Sem notificações novas",
"description": "Mensagens, respostas e menções irão aparecer aqui."
}
},
"verifyEmail": {
"message": "O teu e-mail foi verificado. Já podes fechar esta janela.",
"error": "Falha ao verificar o teu e-mail."
},
"passwordChange": {
"title": "Alterar senha",
"description": "Escolhe a tua nova senha.",
"instance": "Em que instância reside a tua conta?"
},
"resetLogin": {
"title": "Repor senha",
"description": "Insere o e-mail da tua conta, e ser-te-á enviada uma ligação para a reposição da senha. Se a tua conta não tem um e-mail, contacta os administradores da tua instância."
},
"theme": {
"title": "Tema",
"import": "Importar",
"export": "Exportar",
"reset": "Repor",
"accent": "Destaque",
"resetWarning": {
"title": "Repor tema",
"description": "Isto irá repor todas as tuas cores às predefinições. Recomenda-se que exportes o teu tema antes de continuar."
}
}
},
"cards": {
"site": {
"about": "Sobre",
"stats": "Estatísticas",
"admins": "Administradores"
},
"community": {
"members": "Membros",
"moderators": "Moderadores",
"subscribe": "Subscrever",
"subscribed": "Subscrita",
"modlog": "Registo de moderação",
"block": "Bloquear",
"unblock": "Desbloquear",
"blockInstance": "Bloquear instância",
"favorite": "Adicionar aos favoritos",
"unfavorite": "Remover dos favoritos"
}
},
"admin": {
"purge": "Purgar",
"instance": "Instância",
"label": "Administração",
"purgeCommunity": {
"title": "A purgar comunidade",
"warning": "Isto irá eliminar todas as publicações. Tens a certeza? (O botão irá ativar-se em 3 segundos)"
}
},
"content": {
"all": "Tudo",
"users": "Utilizadores",
"posts": "Publicações",
"comments": "Comentários",
"communities": "Comunidades",
"instances": "Instâncias",
"message": "Mensagem"
},
"post": {
"actions": {
"comments": "Comentários",
"save": "Guardar",
"unsave": "Esquecer",
"more": {
"label": "Mais ações",
"edit": "Editar",
"creator": "Criador",
"actions": "Ações",
"markRead": "Marcar como lida",
"markUnread": "Marcar como não lida",
"hide": "Esconder",
"share": "Partilhar",
"unhide": "Revelar",
"translate": "Traduzir",
"crosspost": "Fazer publicação cruzada",
"delete": "Eliminar",
"restore": "Restaurar"
}
},
"badges": {
"nsfw": "NSFW",
"locked": "Trancada",
"featured": "Destacada",
"removed": "Removida",
"deleted": "Eliminada",
"saved": "Guardada"
}
},
"common": {
"cancel": "Cancelar",
"back": "Voltar",
"next": "Próximo",
"debug": "Depuração",
"refresh": "Atualizar",
"jump": "Saltar",
"save": "Guardar",
"enabled": "Ativado",
"disabled": "Desativado",
"enable": "Ativar",
"disable": "Desativar",
"add": "Adicionar",
"send": "Enviar"
},
"comment": {
"actions": {
"label": "Ações",
"link": "Copiar ligação"
},
"reply": "Responder",
"locked": "Esta publicação está trancada.",
"more": "Mais {{comments:number}}"
},
"moderation": {
"removeSubmission": {
"failEmptyReply": "A tua resposta não pode estar vazia se 'Responder com razão' estiver ativada.",
"failReply": "Falha ao publicar resposta. A remover ainda assim...",
"successPurge": "Submissão purgada com sucesso.",
"title": "Remover submissão",
"titleRestore": "Restaurar submissão",
"titlePurge": "Purgar submissão",
"withReason": "Responder com razão",
"comment": "Comentar",
"message": "Enviar mensagem",
"failMessage": "Falha ao enviar mensagem ao utilizador. A remover ainda assim..."
},
"ban": {
"warning": "Isto irá eliminar TODAS as submissões deste utilizador aqui.",
"banning": "Banir utilizador",
"unbanning": "Desbanir utilizador",
"deleteData": "Eliminar dados",
"expires": "Expiração (UTC)",
"banFromCommunity": "Banir da comnunidade",
"unbanFromCommunity": "Desbanir da comunidade"
},
"report": "Denunciar",
"reportModal": {
"title": "Denunciar",
"success": "Submissão denunciada."
},
"reason": "Razão",
"lock": "Trancar",
"unlock": "Destrancar",
"remove": "Remover",
"restore": "Restaurar",
"label": "Moderação",
"labelInstanceOnly": "Moderação (apenas na instância)",
"feature": "Destacar",
"unfeature": "Remover destaque"
},
"toast": {
"loginVoteGate": "É necessário ter sessão iniciada para votar.",
"noComments": "A API não devolveu qualquer comentário.",
"resetLink": "Foi-te enviado um e-mail para a recuperação da tua senha.",
"verifyEmail": "Foi-te enviada uma ligação de verificação para o teu e-mail. Abre-a e depois inicia sessão.",
"saveSettings": "Configurações de utilizador guardadas. Se alteraste o teu endereço de e-mail, receberás uma nova ligação de verificação.",
"removeAdminWarning": "Tens a certeza que queres remover esse administrador?",
"fetchPostOnHome": "A tentar obter esta publicação na tua instância...",
"failFindUser": "Não foi possível encontrar esse utilizador.",
"addMod": "Utilizador promovido.",
"removeAdmin": "Administrador removido.",
"blockedCommunity": "Comunidade bloqueada.",
"unblockedCommunity": "Comunidade desbloqueada.",
"purgedCommunity": "Comunidade purgada.",
"blockedInstance": "Instância bloqueada.",
"sentMessage": "Mensagem enviada.",
"invalidDateAbsolute": "Data inválida. Tem que ser absoluta.",
"invalidDateBeforeCurrent": "Data inválida. Não pode ser no passado.",
"bannedUser": "Utilizador banido.",
"unbannedUser": "Utilizador desbanido.",
"needCommunity": "É necessário definir uma comunidade.",
"invalidURL": "URL inálido",
"generatedTitle": "Título e corpo gerado através do URL. Queres reverter isto?",
"failGenerateTitle": "Não foi possível extrair nenhum título ou corpo a partir desse website.",
"restoredFromDraft": "Publicação restaurada a partir do rascunho.",
"copied": "Copiado para a área de transferência.",
"approvedApplication": "Candidatura aprovada.",
"deniedApplication": "Candidatura rejeitada.",
"updatedCommunity": "A tua comunidade foi modificada.",
"updatedSite": "Instância modificada.",
"failCSV": "Falha ao ler CSV",
"updateMods": "Moderadores da comunidade modificados.",
"logIn": "Sessão iniciada com sucesso.",
"failInstanceURL": "Falha ao contactar com essa instância. Estará em baixo?",
"addAccount": "Conta adicionada.",
"resolveReport": "Denúncia resolvida.",
"unresolveReport": "Resolução da denúncia desfeita.",
"passwordReset": "A tua senha foi redefinida.",
"loginRefresh": "A tua sessão foi atualizada.",
"invalidLogin": "Credenciais inválidas",
"confirmDelete1": "Queres mesmo eliminar a tua conta?",
"confirmDelete2": "Tens a certeza?",
"confirmDelete3": "Último aviso. Tens mesmo a certeza?",
"needPassword": "É necessário inserires a tua senha.",
"deleting": "A eliminar a tua conta...",
"deleted": "A tua conta foi eliminada.",
"resetSettings": "Queres repor as tuas configurações?",
"failFetchInstances": "Falha ao obter instâncias disponíveis.",
"failSignup": "Falha no registo.",
"successSignup": "Registado.",
"waitApplication": "Aguarda pela aprovação da tua candidatura antes de iniciares a sessão.",
"blockUser": "Utilizador bloqueado.",
"unblockUser": "Utilizador desbloqueado.",
"purgeUser": "Utilizador purgado."
},
"message": {
"success": "Sucesso",
"error": "Erro"
},
"settings": {
"lemmy": {
"instances": {
"description": "Mostrar a instância de onde as coisas vêm.",
"title": "Mostrar instâncias"
},
"hideSubmissions": {
"description": "Ocultar certos tipos de submissões.",
"title": "Ocultar submissões",
"deleted": "Eliminado pelo utilizador",
"removed": "Removido por um moderador"
},
"fadeReadPosts": {
"description": "Escurece um pouco o título das publicações que já leste",
"title": "Escurecer publicações lidas"
},
"showHiddenPosts": {
"description": "Mostrar as publicações que escondeste manualmente.",
"title": "Mostrar publicações escondidas"
},
"compactFeatured": {
"title": "Publicações afixadas compactas",
"description": "Tornar publicações afixadas mais compactas"
},
"title": "Lemmy",
"markReadPosts": {
"title": "Marcar publicações como lidas",
"description": "Marcar uma publicação como lida quando lhe clicas"
},
"crosspostMarker": {
"title": "Marcar publicações cruzadas",
"description": "Mostrar \"publicação cruzada em\" quando pertinente."
},
"nsfwBlur": {
"title": "Desfoque de NSFW",
"description": "Desfocar imagens e remover texto das publicações NSFW."
}
},
"app": {
"expandImages": {
"description": "Clicar na imagem de uma publicação mostra-te uma versão aumentada ao invés de te levar para a página da publicação.",
"title": "Expandir imagens"
},
"translation": {
"description": "A instância de LibreTranslate a usar para a tradução.",
"title": "Tradução",
"instance": "Domínio"
},
"lang": {
"description": "O idioma a usar na interface do Photon.",
"note": "Os idiomas além do Inglês e do Hebraico são traduzidos pela comunidade, e podem estar incompletos.",
"en": "Inglês",
"en-US": "Inglês",
"he": "Hebraico",
"et": "Estónio",
"fr": "Francês",
"de": "Alemão",
"fi": "Finlandês",
"pt": "Português",
"auto": "Automático",
"credits": "Créditos",
"title": "Idioma"
},
"placeholders": {
"description": "Mostrar frases aleatórias em alguns campos de texto.",
"title": "Indicadores de texto aleatórios"
},
"view": {
"title": "Estilo de publicação",
"list": "Mostrar publicações numa lista, com texto e imagens compactos.",
"cozy": "Mostrar publicações com imagens grandes, pré-visualizações ricas e mais texto.",
"compact": "Mostrar publicações numa lista, sem texto e com espaçamento mais apertado.",
"legacy": "O estilo antigo do Photon."
},
"sort": {
"title": "Ordem padrão",
"description": "A ordem padrão a usar nas listagens."
},
"postsInNewTab": {
"title": "Abrir publicações num novo separador",
"description": "Abrir publicações num novo separador ao invés de no atual."
},
"displayName": {
"title": "Utilizar nome de exibição",
"description": "Mostrar os nomes de exibição ao invés dos nomes de utilizador."
},
"limitLayoutWidth": {
"title": "Limitar largura do conteúdo",
"description": "Facilitar leitura limitando a largura do conteúdo principal."
},
"title": "Photon",
"theming": {
"title": "Temas",
"description": "Personaliza as cores do Photon.",
"link": "Ver os temas"
},
"duplicateTitles": {
"title": "Ocultar títulos/corpos duplicados",
"description": "Oculta o título e o corpo de uma publicação se forem iguais à da pré-visualização."
},
"thumbnailSide": {
"title": "Alinhamento das miniaturas",
"description": "Onde é que as miniaturas devem estar numa publicação no modo lista/compacto",
"left": "Esquerda",
"right": "Direita"
},
"font": {
"title": "Tipo de letra",
"description": "Que tipo de letra o Photon usa na sua interface."
}
},
"navigation": {
"dockPos": {
"description": "Onde a \"doca\" se deve posicionar no ecrã.",
"title": "Posição da \"doca\"",
"top": "Topo",
"bottom": "Fundo",
"adaptive": "Adaptável"
},
"title": "Navegação",
"panel": {
"title": "Modo \"painel\"",
"description": "Estende a \"doca\" até às extremidades do ecrã, como num painel.",
"on": "Ativado",
"off": "Desativado",
"adaptive": "Adaptável"
}
},
"embeds": {
"instance": {
"description": "Instância a usar para pré-visualizar conteúdo do YouTube.",
"invidious": "Instância de Invidious",
"piped": "Instância de Piped"
},
"title": "Pré-visualizações",
"clickToView": {
"title": "Clicar para ver",
"description": "Carregar pré-visualizações apenas quando são clicadas."
},
"youtube": {
"description": "O website a usar para pré-visualizar conteúdo do YouTube."
}
},
"other": {
"debug": {
"description": "Mostrar informação técnica de depuração",
"title": "Informação técnica"
},
"title": "Outras"
},
"title": "Configurações",
"beta": "Beta",
"moderation": {
"title": "Moderação",
"replyPresets": {
"title": "Modelo de resposta sobre remoção",
"description": "Modelos a usar para \"responder com razão\" na confirmação de remoção de submissões.",
"syntax": "Sintaxe"
}
}
}
}
+228
View File
@@ -0,0 +1,228 @@
{
"form": {
"profile": {
"email": "Email",
"displayName": "顯示名稱",
"bio": "個人簡介",
"avatar": "大頭貼",
"banner": "背景橫幅",
"showNSFW": "顯示限制級(NSFW)內容",
"scores": "顯示讚數",
"bot": "機器人帳號",
"showBots": "顯示機器人貼文",
"showRead": "顯示已讀貼文",
"currentPassword": "當前密碼",
"newPassword": "新密碼",
"verifyNewPassword": "確認密碼"
},
"username": "使用者名稱",
"name": "名稱",
"instance": "站點網址",
"password": "密碼",
"confirmPassword": "確認密碼",
"2fa": "2FA兩步驗證碼",
"forgotpassword": "忘記密碼",
"submit": "送出",
"edit": "編輯",
"preview": "預覽",
"post": {
"create": "發文",
"edit": "編輯貼文",
"community": "社群",
"title": "標題",
"url": "網址",
"body": "內文",
"nsfw": "限制級(NSFW)",
"generateTitle": "代入標題",
"uploadImage": "上傳影像",
"altText": "替代文字"
},
"signup": {
"title": "註冊"
}
},
"routes": {
"createPost": "發文",
"saved": "保存",
"createCommunity": "創建社群",
"post": {
"crosspostCount": "轉貼",
"commentCount": "留言",
"addComment": "新增留言"
},
"verifyEmail": {
"message": "您的電子郵件已通過驗證。您現在可以關閉此視窗。",
"error": "無法驗證您的電子郵件。"
},
"passwordChange": {
"title": "更改密碼",
"description": "選擇您的新密碼。",
"instance": "您的帳戶託管在哪個實例上?"
},
"resetLogin": {
"title": "重置密碼",
"description": "輸入您帳戶的電子郵件,將發送密碼重設連結。如果您的帳戶沒有電子郵件,請聯繫您的實例管理員。"
},
"theme": {
"title": "主題",
"import": "匯入",
"export": "匯出",
"reset": "重設"
}
},
"common": {
"back": "往前",
"next": "往後",
"refresh": "重整"
},
"profile": {
"profile": "個人資料",
"inbox": "信箱",
"saved": "保存",
"subscribed": "訂閱"
},
"nav": {
"home": "首頁",
"admin": "設定",
"moderation": "管理",
"communities": "探索",
"search": "搜尋",
"create": {
"label": "新增",
"post": "貼文",
"community": "社群",
"logingate": "你需要登入,才能發文."
},
"menu": {
"label": "個人資料",
"app": "App",
"settings": "設定",
"colorscheme": {
"label": "主題",
"system": "系統",
"dark": "暗黑",
"light": "光亮"
},
"theme": "主題",
"about": "關於",
"source": "來源",
"instance": "站點"
}
},
"account": {
"login": "登入",
"logout": "登出",
"signup": "註冊",
"accounts": "帳號",
"changeinstance": "變更站點",
"resetColor": "重設顏色",
"addGuest": "新增遊客",
"moveUp": "往上",
"moveDown": "往下",
"guest": "遊客"
},
"filter": {
"location": {
"label": "範圍",
"all": "所有",
"local": "本站",
"subscribed": "已訂閱",
"moderator": "管理的",
"global": "全部"
},
"sort": {
"label": "排序",
"active": "活躍",
"hot": "熱門",
"top": {
"label": "最佳",
"time": {
"label": "時間",
"all": "所有",
"9months": "9月以來",
"6months": "6月以來",
"3months": "3月以來",
"month": "這月以來",
"week": "這周",
"day": "日",
"12hours": "12小時",
"6hours": "6小時",
"hour": "這小時"
}
},
"new": "最新",
"old": "最舊",
"controversial": "最有爭議",
"scaled": "各版熱門",
"mostcomments": "最多留言",
"newcomments": "最新留言"
},
"view": {
"label": "顯示模式",
"cozy": "可莉",
"list": "列表",
"compact": "緊湊",
"legacy": "經典"
},
"type": "類型",
"filter": "過濾",
"unread": "未讀",
"inbox": {
"messages": "私信",
"replies": "回覆",
"mentions": "標記"
}
},
"cards": {
"site": {
"about": "關於",
"stats": "統計",
"admins": "管理員"
},
"community": {
"members": "訪客",
"moderators": "管理員",
"subscribe": "訂閱",
"subscribed": "已訂閱",
"block": "封鎖",
"unblock": "取消封鎖",
"blockInstance": "封鎖站點",
"favorite": "最愛",
"unfavorite": "取消最愛"
}
},
"content": {
"all": "所有",
"users": "使用者"
},
"post": {
"actions": {
"save": "保存",
"more": {
"crosspost": "轉貼"
}
},
"badges": {
"nsfw": "限制級(NSFW)",
"featured": "置頂"
}
},
"moderation": {
"report": "檢舉"
},
"settings": {
"title": "設定",
"app": {
"lang": {
"title": "語言",
"auto": "自動"
}
},
"lemmy": {
"nsfwBlur": {
"title": "限制級(NSFW) 遮擋",
"description": "模糊圖片並隱藏限制級(NSFW)帖文預覽。"
}
}
}
}
+228
View File
@@ -0,0 +1,228 @@
{
"profile": {
"inbox": "信箱",
"profile": "個人資料",
"saved": "保存",
"subscribed": "訂閱"
},
"nav": {
"home": "首頁",
"moderation": "管理",
"admin": "設定",
"communities": "探索",
"search": "搜尋",
"create": {
"label": "新增",
"post": "貼文",
"community": "社群",
"logingate": "你需要登入,才能發文."
},
"menu": {
"app": "App",
"settings": "設定",
"colorscheme": {
"label": "主題",
"system": "系統",
"dark": "暗黑",
"light": "光亮"
},
"theme": "主題",
"about": "關於",
"source": "來源",
"instance": "站點",
"label": "個人資料"
}
},
"account": {
"login": "登入",
"logout": "登出",
"accounts": "帳號",
"changeinstance": "變更站點",
"resetColor": "重設顏色",
"addGuest": "新增遊客",
"moveUp": "往上",
"moveDown": "往下",
"guest": "遊客",
"signup": "註冊"
},
"filter": {
"location": {
"label": "範圍",
"all": "所有",
"subscribed": "已訂閱",
"moderator": "管理的",
"global": "全部",
"local": "本站"
},
"sort": {
"label": "排序",
"hot": "熱門",
"top": {
"label": "最佳",
"time": {
"label": "時間",
"all": "所有",
"9months": "9月以來",
"6months": "6月以來",
"3months": "3月以來",
"month": "這月以來",
"week": "這周",
"day": "日",
"6hours": "6小時",
"hour": "這小時",
"12hours": "12小時"
}
},
"new": "最新",
"old": "最舊",
"controversial": "最有爭議",
"scaled": "各版熱門",
"newcomments": "最新留言",
"mostcomments": "最多留言",
"active": "活躍"
},
"view": {
"cozy": "可莉",
"list": "列表",
"compact": "緊湊",
"label": "顯示模式",
"legacy": "經典"
},
"type": "類型",
"filter": "過濾",
"unread": "未讀",
"inbox": {
"messages": "私信",
"replies": "回覆",
"mentions": "標記"
}
},
"form": {
"name": "名稱",
"instance": "站點網址",
"username": "使用者名稱",
"password": "密碼",
"confirmPassword": "確認密碼",
"forgotpassword": "忘記密碼",
"submit": "送出",
"edit": "編輯",
"preview": "預覽",
"post": {
"create": "發文",
"edit": "編輯貼文",
"community": "社群",
"title": "標題",
"url": "網址",
"body": "內文",
"nsfw": "限制級(NSFW)",
"altText": "替代文字",
"generateTitle": "代入標題",
"uploadImage": "上傳影像"
},
"profile": {
"displayName": "顯示名稱",
"bio": "個人簡介",
"avatar": "大頭貼",
"banner": "背景橫幅",
"email": "Email",
"showNSFW": "顯示限制級(NSFW)內容",
"scores": "顯示讚數",
"bot": "機器人帳號",
"showRead": "顯示已讀貼文",
"currentPassword": "當前密碼",
"newPassword": "新密碼",
"verifyNewPassword": "確認密碼",
"showBots": "顯示機器人貼文"
},
"signup": {
"title": "註冊"
},
"2fa": "2FA兩步驗證碼"
},
"routes": {
"saved": "保存",
"createPost": "發文",
"createCommunity": "創建社群",
"post": {
"crosspostCount": "轉貼",
"commentCount": "留言",
"addComment": "新增留言"
},
"verifyEmail": {
"error": "無法驗證您的電子郵件。",
"message": "您的電子郵件已通過驗證。您現在可以關閉此視窗。"
},
"passwordChange": {
"title": "更改密碼",
"description": "選擇您的新密碼。",
"instance": "您的帳戶託管在哪個實例上?"
},
"resetLogin": {
"title": "重置密碼",
"description": "輸入您帳戶的電子郵件,將發送密碼重設連結。如果您的帳戶沒有電子郵件,請聯繫您的實例管理員。"
},
"theme": {
"title": "主題",
"import": "匯入",
"export": "匯出",
"reset": "重設"
}
},
"cards": {
"site": {
"about": "關於",
"stats": "統計",
"admins": "管理員"
},
"community": {
"moderators": "管理員",
"subscribe": "訂閱",
"subscribed": "已訂閱",
"block": "封鎖",
"unblock": "取消封鎖",
"blockInstance": "封鎖站點",
"favorite": "最愛",
"unfavorite": "取消最愛",
"members": "訪客"
}
},
"content": {
"all": "所有",
"users": "使用者"
},
"post": {
"actions": {
"save": "保存",
"more": {
"crosspost": "轉貼"
}
},
"badges": {
"nsfw": "限制級(NSFW)",
"featured": "置頂"
}
},
"moderation": {
"report": "檢舉"
},
"settings": {
"title": "設定",
"app": {
"lang": {
"auto": "自動",
"title": "語言"
}
},
"lemmy": {
"nsfwBlur": {
"description": "模糊圖片並隱藏限制級(NSFW)帖文預覽。",
"title": "限制級(NSFW) 遮擋"
}
}
},
"common": {
"next": "往後",
"back": "往前",
"refresh": "重整"
}
}
+2 -2
View File
@@ -11,9 +11,9 @@ export const LINKED_INSTANCE_URL =
const getDefaultInstance = (): string => {
if (browser) {
return env.PUBLIC_INSTANCE_URL || 'lemmy.ml'
return env.PUBLIC_INSTANCE_URL || 'lemm.ee'
} else {
return env.PUBLIC_INTERNAL_INSTANCE || env.PUBLIC_INSTANCE_URL || 'lemmy.ml'
return env.PUBLIC_INTERNAL_INSTANCE || env.PUBLIC_INSTANCE_URL || 'lemm.ee'
}
}
+22 -19
View File
@@ -44,11 +44,8 @@ async function customFetch(
}
}
const url = toURL(input)
if (auth && url) url.searchParams.set('auth', auth)
const res = await f(url ?? input, init)
if (!res.ok) error(res.status, await res.text());
const res = await f(input, init)
if (!res.ok) error(res.status, await res.text())
return res
}
@@ -101,27 +98,33 @@ export async function validateInstance(instance: string): Promise<boolean> {
}
}
export function mayBeIncompatible(minVersion: string, availableVersion: string) {
if (minVersion.valueOf() === availableVersion.valueOf()) return false;
export function mayBeIncompatible(
minVersion: string,
availableVersion: string
) {
if (minVersion.valueOf() === availableVersion.valueOf()) return false
const versionFormatter = /[\d.]/;
if (!minVersion.match(versionFormatter) || !availableVersion.match(availableVersion)) {
return true;
const versionFormatter = /[\d.]/
if (
!minVersion.match(versionFormatter) ||
!availableVersion.match(availableVersion)
) {
return true
}
const splitMinVersion = minVersion.split('.');
const splitAvailableVersion = availableVersion.split('.');
const splitMinVersion = minVersion.split('.')
const splitAvailableVersion = availableVersion.split('.')
if (splitMinVersion.length !== splitAvailableVersion.length) return true;
if (splitMinVersion.length !== splitAvailableVersion.length) return true
for (let i = 0; i < splitMinVersion.length; ++i) {
const minVersionDigit = parseInt(splitMinVersion[i]);
const availableVersionDigit = parseInt(splitAvailableVersion[i]);
const minVersionDigit = parseInt(splitMinVersion[i])
const availableVersionDigit = parseInt(splitAvailableVersion[i])
if (availableVersionDigit === undefined) return true;
if (minVersionDigit < availableVersionDigit) return false;
if (availableVersionDigit < minVersionDigit) return true;
if (availableVersionDigit === undefined) return true
if (minVersionDigit < availableVersionDigit) return false
if (availableVersionDigit < minVersionDigit) return true
}
return false;
return false
}
+8
View File
@@ -0,0 +1,8 @@
import { fullCommunityName } from '$lib/util'
import type { Community, Person } from 'lemmy-js-client'
export const communityLink = (community: Community, prefix: string = '') =>
`${prefix}/c/${fullCommunityName(community.name, community.actor_id)}`
export const userLink = (person: Person, prefix: string = '') =>
`${prefix}/u/${person.name}@${new URL(person.actor_id).hostname}`
+15 -13
View File
@@ -1,4 +1,4 @@
import { profile } from '$lib/auth'
import { profile, profileData } from '$lib/auth'
import type {
CommentReportView,
CommentView,
@@ -10,6 +10,7 @@ import type {
Post,
PrivateMessageReportView,
PrivateMessageView,
Community,
} from 'lemmy-js-client'
import { get } from 'svelte/store'
@@ -70,7 +71,7 @@ export const isPrivateMessageReport = (
): item is PrivateMessageReportView => 'private_message_report' in item
export interface ResumableItem {
url: URL
url: string
id: number
name: string
avatar?: string
@@ -81,17 +82,18 @@ export interface ResumableItem {
}
}
export function addResumable(item: ResumableItem) {
const p = get(profile)
export function addFavorite(item: Community, add: boolean = true) {
const pd = get(profileData)
const p = pd.profiles.find((p) => p.id == get(profile)?.id)
if (!p) return
let favs = p.favorites ?? []
if (favs.map((fav) => fav.url.toString()).includes(item.url.toString()))
return
if (favs.length >= 5) favs.pop()
favs.unshift(item)
profile.update(() => ({
...p,
favorites: favs
}))
}
if (favs.map((fav) => fav.id).includes(item.id)) if (add) return
if (!add) {
favs.splice(favs.map((c) => c.id).indexOf(item.id), 1)
} else {
favs.unshift(item)
}
p.favorites = favs
profileData.update(() => pd)
}
+8 -16
View File
@@ -1,4 +1,4 @@
import { profile } from '$lib/auth.js'
import { profile, profileData, type Profile } from '$lib/auth.js'
import { getClient } from '$lib/lemmy.js'
import { trycatch } from '$lib/util.js'
import type { Community, MyUserInfo, PersonView } from 'lemmy-js-client'
@@ -22,30 +22,19 @@ export const addSubscription = (
community: Community,
subscribe: boolean = true
) => {
const p = get(profile)
const pd = get(profileData)
const p = pd.profiles.find((p) => p.id == pd.profile)
if (!p?.user) return
if (subscribe) {
profile.set({
...p,
user: {
...p.user,
follows: [
...p.user.follows,
{
community: community,
follower: p.user.local_user_view.person,
},
],
},
})
profileData.set(pd)
} else {
p.user.follows.splice(
p.user.follows.findIndex((i) => i.community.id == community.id),
1
)
profile.set(p)
profileData.set(pd)
}
}
@@ -62,3 +51,6 @@ export const addAdmin = async (handle: string, added: boolean, jwt: string) =>
person_id: user.person.person.id,
})
})
export const hasFavorite = (profile: Profile, id: number): boolean =>
profile?.favorites?.map((i) => i.id).includes(id) ?? false
+11
View File
@@ -0,0 +1,11 @@
// to allow for loading before promises are finished on the client.
import { browser } from '$app/environment'
type AnyFunction = (...args: any[]) => any
export const awaitIfServer = async <T>(
promise: Promise<T>
): Promise<{
data: Promise<T> | T
}> => ({ data: browser ? promise : await promise })
+3
View File
@@ -1,3 +1,4 @@
import { browser } from '$app/environment'
import type { Community } from 'lemmy-js-client'
import { writable } from 'svelte/store'
@@ -20,6 +21,7 @@ export const setSessionStorage = (
key: keyof SessionStorage,
value: SessionStorage[typeof key]
) => {
if (!browser) return
if (value == undefined) {
sessionStorage.removeItem(key)
} else {
@@ -30,6 +32,7 @@ export const setSessionStorage = (
export const getSessionStorage = (
key: keyof SessionStorage
): SessionStorage[typeof key] => {
if (!browser) return
return JSON.parse(sessionStorage.getItem(key)!)
}
+51 -9
View File
@@ -1,6 +1,9 @@
import type { CommentSortType, SortType } from 'lemmy-js-client'
import { writable } from 'svelte/store'
import { env } from '$env/dynamic/public'
import { locale } from './translations'
import { browser } from '$app/environment'
import type { Link } from './components/ui/navbar/link'
console.log('Using the following default settings from the environment:')
console.log(env)
@@ -44,7 +47,11 @@ interface Settings {
removed: boolean
}
expandSidebar: boolean
expandCommunities: boolean
expand: {
communities: boolean
moderates: boolean
favorites: boolean
}
displayNames: boolean
nsfwBlur: boolean
moderation: {
@@ -68,14 +75,26 @@ interface Settings {
embeds: {
clickToView: boolean
youtube: 'youtube' | 'invidious' | 'piped'
invidious: string | undefined
piped: string | undefined
}
dock: {
noGap: boolean
top: boolean
noGap: boolean | null
top: boolean | null
pins: Link[]
}
posts: {
deduplicateEmbed: boolean
compactFeatured: boolean
showHidden: boolean
}
infiniteScroll: boolean
language: string | null
useRtl: boolean
translator: string | undefined
parseTags: boolean
tagRules: {
[key: string]: 'hide' | 'blur'
}
}
@@ -97,7 +116,11 @@ export const defaultSettings: Settings = {
removed: toBool(env.PUBLIC_HIDE_REMOVED) ?? true,
},
expandSidebar: toBool(env.PUBLIC_EXPAND_SIDEBAR) ?? true,
expandCommunities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true,
expand: {
communities: toBool(env.PUBLIC_EXPAND_COMMUNITIES) ?? true,
favorites: toBool(env.PUBLIC_EXPAND_FAVORITES) ?? true,
moderates: toBool(env.PUBLIC_EXPAND_MODERATES) ?? true,
},
displayNames: toBool(env.PUBLIC_DISPLAY_NAMES) ?? true,
nsfwBlur: toBool(env.PUBLIC_NSFW_BLUR) ?? true,
moderation: {
@@ -125,21 +148,35 @@ export const defaultSettings: Settings = {
embeds: {
clickToView: true,
youtube: 'youtube',
invidious: undefined,
piped: undefined,
},
dock: {
noGap: toBool(env.PUBLIC_DOCK_PANEL) ?? false,
top: toBool(env.PUBLIC_DOCK_TOP) ?? false
noGap: toBool(env.PUBLIC_DOCK_PANEL) ?? null,
top: toBool(env.PUBLIC_DOCK_TOP) ?? null,
pins: [],
},
posts: {
deduplicateEmbed: toBool(env.PUBLIC_DEDUPLICATE_EMBED) ?? true,
compactFeatured: toBool(env.PUBLIC_COMPACT_FEATURED) ?? true
}
compactFeatured: toBool(env.PUBLIC_COMPACT_FEATURED) ?? true,
showHidden: false,
},
infiniteScroll: true,
language: env.PUBLIC_LANGUAGE ?? null,
useRtl: false,
translator: env.PUBLIC_TRANSLATOR ?? undefined,
parseTags: true,
tagRules: {
cw: 'blur',
nsfl: 'blur',
nsfw: 'blur',
},
}
export const userSettings = writable(defaultSettings)
const migrate = (settings: any): Settings => {
if (typeof settings.moderation.removalReasonPreset == 'string') {
if (typeof settings?.moderation?.removalReasonPreset == 'string') {
settings.moderation.presets = [
{
title: 'Preset 1',
@@ -166,4 +203,9 @@ userSettings.subscribe((settings) => {
if (typeof window != 'undefined') {
localStorage.setItem('settings', JSON.stringify(settings))
}
if (settings.language) {
locale.set(settings.language)
} else {
if (browser) locale.set(navigator?.language)
}
})
+56
View File
@@ -0,0 +1,56 @@
import i18n, { type Config } from 'sveltekit-i18n'
const config: Config = {
loaders: [
{
locale: 'en',
key: '',
loader: async () => (await import('./i18n/en.json')).default,
},
{
locale: 'et',
key: '',
loader: async () => (await import('./i18n/et.json')).default,
},
{
locale: 'fi',
key: '',
loader: async () => (await import('./i18n/fi.json')).default,
},
{
locale: 'fr',
key: '',
loader: async () => (await import('./i18n/fr.json')).default,
},
{
locale: 'de',
key: '',
loader: async () => (await import('./i18n/de.json')).default,
},
{
locale: 'he',
key: '',
loader: async () => (await import('./i18n/he.json')).default,
},
{
locale: 'pt',
key: '',
loader: async () => (await import('./i18n/pt.json')).default,
},
{
locale: 'zh-Hans',
key: '',
loader: async () => (await import('./i18n/zh-Hans.json')).default,
},
{
locale: 'zh-Hant',
key: '',
loader: async () => (await import('./i18n/zh-Hant.json')).default,
},
],
fallbackLocale: 'en',
}
export const { t, locale, locales, loading, loadTranslations } = new i18n(
config
)
+17 -15
View File
@@ -30,7 +30,7 @@ interface Theme {
export interface Colors {
slate: {
25?: string,
25?: string
50?: string
100?: string
200?: string
@@ -42,7 +42,7 @@ export interface Colors {
900?: string
925?: string
950?: string
},
}
zinc: {
100?: string
200?: string
@@ -55,13 +55,13 @@ export interface Colors {
900?: string
925?: string
950?: string
},
}
primary: {
100?: string,
900?: string,
},
100?: string
900?: string
}
other: {
black?: string,
black?: string
white?: string
}
}
@@ -101,15 +101,15 @@ export const defaultColors = {
},
other: {
black: `#000`,
white: `var(--c-o-white,#fff)`
}
white: `var(--c-o-white,#fff)`,
},
}
export let colors = writable<Colors>({
slate: {},
zinc: {},
primary: {},
other: {}
other: {},
})
export function colorsToVars(colors: Colors): string {
@@ -118,15 +118,18 @@ export function colorsToVars(colors: Colors): string {
for (let shade in colors[category as keyof Colors]) {
if (category)
// @ts-ignore
vars.push(`--c-${category.slice(0, 1)}-${shade}:${colors[category][shade]}`)
vars.push(
`--c-${category.slice(0, 1)}-${shade}:${colors[category][shade]}`
)
}
}
return vars.join(';')
}
export const colorToVar = (category: keyof Colors, shade: keyof keyof Colors): string =>
`--c-${category.slice(0,2)}-${shade.toString()}`
export const colorToVar = (
category: keyof Colors,
shade: keyof (keyof Colors)
): string => `--c-${category.slice(0, 2)}-${shade.toString()}`
function loadColors() {
const loaded = localStorage.getItem('colors')
@@ -142,7 +145,6 @@ if (browser) {
loadColors()
}
const configuredLegacyTheme = env.PUBLIC_LEGACYTHEME ?? 'system'
export const legacyTheme = writable<'system' | 'light' | 'dark'>(
configuredLegacyTheme as 'system' | 'light' | 'dark'
+9 -12
View File
@@ -5,7 +5,8 @@ import { get } from 'svelte/store'
import type { SubscribedType } from 'lemmy-js-client'
import { page } from '$app/stores'
import { feature } from '$lib/version.js'
import { client, site } from '$lib/lemmy.js'
import { client } from '$lib/lemmy.js'
import { site } from './lemmy'
export const findClosestNumber = (numbers: number[], target: number): number =>
numbers.reduce((prev, curr) =>
@@ -29,29 +30,25 @@ export const fullCommunityName = (name: string, actorId: string) =>
`${name}@${new URL(actorId).hostname}`
export const placeholders = {
url: ['https://notas.cam', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'],
url: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'],
post: [
'Is starting nuclear warfare illegal?',
'A cool photo I took before the destruction of mankind!',
'AITA for ending all contention and causing world peace?',
"AITA for making somebody's day?",
'BREAKING NEWS: Police break into gun shop, find weapons',
'How do I make sure my pet rock stays alive?',
'My cat just invented a time machine, what do I do?',
'Unpopular opinion: world peace and global happiness would be beneficial to humanity',
'Unpopular opinion: world peace would be beneficial to humanity',
'LPT: The smaller weights are easier to lift than the bigger weights in a gym',
'javascript bad',
'ELI5: What is 4 + 8?',
],
comment: [
'aint no way',
'what?',
'new response just dropped',
'<insert funny joke here>',
'say, why did we name restaurant staff after computers, anyway?',
`this.\nedit: thanks for 1 upvote😃😃😃!`,
'Officer, I drop kicked that child in self defense! You gotta believe me man.',
"i did not read this post at all and i'm about to give my opinion on it.",
'this comment placeholder is very important dont forget',
'As Abraham Lincoln once said, "don\'t believe everything you see on the internet."',
'huh. i did not understand any of that.',
'existential crisis in progress',
'hello user i am a sentient placeholder. please dont type anything or i disappear forever. thanks',
],
get: (type: 'url' | 'post' | 'comment') => {
return get(userSettings)?.randomPlaceholders
+3
View File
@@ -6,6 +6,9 @@ const FEATURES = {
cursorPagination: '0.19.0',
newTotp: '0.19.0',
blockInstances: '0.19.0',
hidePosts: '0.19.4',
altText: '0.19.4',
customThumbnail: '0.19.4',
}
type Feature = keyof typeof FEATURES
+14 -12
View File
@@ -1,22 +1,24 @@
<script lang="ts">
import { goto } from '$app/navigation'
import { page } from '$app/stores'
import { t } from '$lib/translations'
import { Button } from 'mono-svelte'
import { Icon, XMark } from 'svelte-hero-icons'
</script>
<div
class="flex flex-col gap-2 mx-auto my-auto items-center h-full justify-center"
>
<div
class="rounded-full bg-red-200 dark:bg-red-900 text-red-600 dark:text-red-300 p-3 w-max"
>
<Icon src={XMark} size="32" mini />
</div>
<h1 class="text-red-800 dark:text-red-300 text-4xl font-black">
<div class="flex flex-col gap-4 mx-auto my-auto h-full justify-center">
<h1 class="text-red-500 text-4xl font-black flex items-center flex-row gap-2">
<div
class="rounded-full bg-red-500 text-red-100 dark:text-red-900 p-1 w-max"
>
<Icon src={XMark} mini size="24" />
</div>
{$page.status}
</h1>
<p class="text-red-800 dark:text-red-300">Failed to fetch that page.</p>
<code>{$page.error?.message}</code>
<Button on:click={() => goto($page.url)}>Retry</Button>
<code class="rounded-md dark:!bg-zinc-950 px-2 py-1 min-w-48">
{$page.error?.message}
</code>
<Button size="sm" class="w-max" on:click={() => goto($page.url)}>
{$t('message.retry')}
</Button>
</div>
+22
View File
@@ -0,0 +1,22 @@
import { loadTranslations, locales } from '$lib/translations.js'
import { get } from 'svelte/store'
export const load = async ({ url, request }) => {
const languages = request.headers.get('Accept-Language')?.split(',')
const availableLangs = get(locales)
let preferredLanguage = 'en'
if (!languages) {
await loadTranslations(preferredLanguage)
return
}
for (const lang of languages.reverse()) {
const splitLang = lang.split(';')[0]
if (availableLangs.includes(splitLang)) {
preferredLanguage = splitLang
}
}
await loadTranslations(preferredLanguage)
return
}
+20 -8
View File
@@ -14,6 +14,7 @@
defaultColors,
inDarkLegacyTheme,
legacyTheme,
type Colors,
} from '$lib/ui/colors.js'
import { userSettings } from '$lib/settings.js'
import { Button, ModalContainer, Spinner, ToastContainer } from 'mono-svelte'
@@ -26,21 +27,24 @@
import { site } from '$lib/lemmy.js'
import ExpandableImage from '$lib/components/ui/ExpandableImage.svelte'
import { LINKED_INSTANCE_URL } from '$lib/instance'
import { locale } from '$lib/translations'
nProgress.configure({
minimum: 0.4,
trickleSpeed: 200,
showSpinner: false,
easing: 'ease-out',
speed: 300,
})
let barTimeout: any = 0
$: {
if (browser) {
if ($navigating) {
nProgress.start()
barTimeout = setTimeout(() => nProgress.start(), 100)
}
if (!$navigating) {
clearTimeout(barTimeout)
nProgress.done()
}
}
@@ -62,21 +66,28 @@
.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', (event) => {
darklegacyTheme = inDarkLegacyTheme()
themeColor = getMetaColor($colors)
})
document.body.querySelector('.loader')?.classList.add('hidden')
}
})
$: title = routes[($page.route.id as keyof typeof routes) ?? '']
$: browser ? document.body.setAttribute('style', colorsToVars($colors)) : ''
// svelte reactivity goof
const getMetaColor = (colors: Colors): string | undefined => {
const regex = /var\([^,]+,\s*(#[0-9A-Fa-f]{6})\)/m
return darklegacyTheme
? colors.zinc?.[925] ?? defaultColors.zinc[925].match(regex)?.[1]
: colors.slate?.[25] ?? defaultColors.slate[25].match(regex)?.[1]
}
$: themeColor = getMetaColor($colors)
</script>
<svelte:head>
<meta
name="theme-color"
content={darklegacyTheme
? $colors?.zinc?.[925] ?? defaultColors.zinc[925]
: $colors?.slate?.[25] ?? defaultColors.slate[25]}
/>
<meta name="theme-color" content={themeColor} />
{#if $site}
<title>{$site.site_view.site.name}</title>
{#if LINKED_INSTANCE_URL}
@@ -97,6 +108,7 @@
Skip Navigation
</Button>
<Shell
dir={$locale == 'he' && $userSettings.useRtl ? 'rtl' : 'ltr'}
class="min-h-screen {$userSettings.font == 'inter'
? 'font-inter'
: $userSettings.font == 'system'
+18 -1
View File
@@ -1,3 +1,20 @@
import { browser } from '$app/environment'
import { env } from '$env/dynamic/public'
import { userSettings } from '$lib/settings.js'
import { loadTranslations } from '$lib/translations.js'
import { get } from 'svelte/store'
export let ssr = (env.PUBLIC_SSR_ENABLED?.toLowerCase() ?? 'false') == 'true'
export let ssr = (env.PUBLIC_SSR_ENABLED?.toLowerCase() ?? 'false') == 'true'
export const load = async ({}) => {
if (browser) {
const initLocale =
get(userSettings)?.language ?? navigator?.language ?? 'en'
console.log(`Loading locale ${initLocale}`)
await loadTranslations(initLocale)
}
return
}
+181 -54
View File
@@ -1,49 +1,148 @@
<script lang="ts" context="module">
export interface CachedPosts {
data: {
sort: SortType
listingType: ListingType
page: number
posts: GetPostsResponse
cursor: {
next: string | undefined
}
}
params: URLSearchParams
lastSeen: number
instance: string
}
export const _posts = writable<CachedPosts>(undefined)
export const shouldReload = (
cache: CachedPosts | undefined,
params: string,
instance: string
): boolean =>
cache?.instance != instance || cache?.params.toString() != params
</script>
<script lang="ts">
import { page } from '$app/stores'
import StickyCard from '$lib/components/ui/StickyCard.svelte'
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import Pageination from '$lib/components/ui/Pageination.svelte'
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
import ViewSelect from '$lib/components/lemmy/dropdowns/ViewSelect.svelte'
import { searchParam } from '$lib/util.js'
import PostFeed from '$lib/components/lemmy/post/PostFeed.svelte'
import { Button, Modal, Select, Spinner } from 'mono-svelte'
import { ChartBar, GlobeAmericas, Icon, ServerStack } from 'svelte-hero-icons'
import { profile } from '$lib/auth.js'
import { site } from '$lib/lemmy.js'
import { amModOfAny } from '$lib/components/lemmy/moderation/moderation.js'
import { feature } from '$lib/version.js'
import { userSettings } from '$lib/settings.js'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { ChartBar, ExclamationTriangle, Icon } from 'svelte-hero-icons'
import { getClient, site } from '$lib/lemmy.js'
import Location from '$lib/components/lemmy/dropdowns/Location.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/translations.js'
import InfiniteScroll from 'svelte-infinite-scroll'
import { Button } from 'mono-svelte'
import { writable } from 'svelte/store'
import type { GetPostsResponse, ListingType, SortType } from 'lemmy-js-client'
import { userSettings } from '$lib/settings.js'
import { browser } from '$app/environment'
import { onMount } from 'svelte'
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.svelte'
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
export let data
let sidebar = false
const limit = 20
let hasMore = data.posts.posts.length != 0
let error: any = undefined
let loading = false
async function loadMore() {
if (!hasMore || loading) return
try {
loading = true
console.log(`loading more with cursor ${data.cursor.next}`)
const newPosts = await getClient()
.getPosts({
limit: limit,
page: data.page,
sort: data.sort,
type_: data.listingType,
page_cursor: data.cursor.next,
})
.catch((e) => {
throw new Error(e)
})
error = null
hasMore = newPosts.posts.length != 0
data.cursor.next = newPosts.next_page
data.posts.posts = [...data.posts.posts, ...newPosts.posts]
_posts.update((ps) => ({
data: data,
params: ps.params,
lastSeen: ps.lastSeen,
instance: ps.instance,
}))
loading = false
} catch (e) {
error = e
loading = false
}
}
const callback: IntersectionObserverCallback = (entries, observer) => {
entries.forEach((entry) => {
if (!entry.isIntersecting) return
const element = entry.target as HTMLElement
const id = element.getAttribute('data-index')
if (!id) return
$_posts.lastSeen = Number(id)
observer.unobserve(element)
})
}
onMount(() => {
const observer = new IntersectionObserver(callback, {
root: null,
rootMargin: '0px',
threshold: 0.5,
})
const elements = document.querySelectorAll('.post-container')
elements.forEach((el) => observer.observe(el))
const postContainer = document.querySelector('#feed')
if (postContainer) {
const mutationObserver = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === 'childList') {
mutation.addedNodes.forEach((node) => {
if (
node instanceof HTMLElement &&
node.classList.contains('post-container')
) {
observer.observe(node)
}
})
}
})
})
mutationObserver.observe(postContainer, {
childList: true,
subtree: true,
})
}
})
</script>
<Modal bind:open={sidebar}>
<span slot="title">About</span>
<div class="mx-auto">
{#if $site}
<SiteCard
site={$site.site_view}
taglines={$site.taglines}
admins={$site.admins}
version={$site.version}
/>
{/if}
</div>
</Modal>
<div
class="background-gradient w-full h-48 absolute top-0 left-0 -z-10 object-cover"
></div>
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<header>
<Header>Frontpage</Header>
<Header>{$t('routes.frontpage.title')}</Header>
</header>
<div class="flex items-center gap-2">
<Location changeDefault selected={data.listingType} />
@@ -52,11 +151,51 @@
<ViewSelect />
</div>
</div>
<PostFeed posts={data.posts.posts} />
<div class="mt-auto">
<svelte:component
this={browser ? VirtualFeed : PostFeed}
posts={data.posts.posts}
>
{#if $userSettings.infiniteScroll && browser}
{#if error}
<div
class="flex flex-col justify-center items-center
rounded-xl gap-2 py-8 mt-6
border !border-b !border-red-500 bg-red-500/5 px-4"
>
<div class="bg-red-500/30 rounded-full p-3 text-red-500">
<Icon src={ExclamationTriangle} size="24" solid></Icon>
</div>
<pre class="py-0.5">{error}</pre>
<Button
color="primary"
{loading}
disabled={loading}
on:click={loadMore}
>
{$t('message.retry')}
</Button>
</div>
{:else if hasMore}
<div class="w-full flex flex-col skeleton gap-2 animate-pulse pt-6">
<div class="w-96 h-8"></div>
<div class="w-full h-48"></div>
<div class="!bg-transparent h-8 flex justify-between">
<div class="w-48 h-8"></div>
<div class="w-24 h-8"></div>
</div>
</div>
{/if}
<InfiniteScroll window threshold={1000} on:loadMore={loadMore} />
{/if}
</svelte:component>
<svelte:element
this={$userSettings.infiniteScroll ? 'noscript' : 'div'}
class="mt-auto"
>
<Pageination
page={data.page}
cursor={{ next: data.cursor.next, back: data.cursor.back }}
cursor={{ next: data.cursor.next }}
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
on:cursor={(c) => {
searchParam($page.url, 'cursor', c.detail)
@@ -64,29 +203,17 @@
>
<span class="flex flex-row items-center gap-1">
<Icon src={ChartBar} size="16" mini />
<FormattedNumber
number={$site?.site_view.counts.users_active_day ?? 0}
class="text-black dark:text-white font-medium"
/>
<span class="font-normal">active users</span>
{$t('routes.frontpage.footer', {
// @ts-ignore
users: $site?.site_view.counts.users_active_day ?? '??',
})}
</span>
</Pageination>
</div>
</svelte:element>
</div>
<style>
.background-gradient {
background-image: radial-gradient(
circle at left,
rgba(162, 1, 114, 0.05) 0%,
rgba(255, 0, 43, 0) 100%
),
radial-gradient(
circle at 60% 80%,
rgba(162, 33, 1, 0.1) 0%,
rgba(255, 0, 174, 0) 100%
);
background-repeat: no-repeat;
mask-image: linear-gradient(to bottom, rgba(0 0 0 / 100%), transparent);
<style lang="postcss">
.skeleton * {
@apply bg-slate-100 dark:bg-zinc-800 rounded-md;
}
</style>
+57 -30
View File
@@ -1,46 +1,73 @@
import { getClient } from '$lib/lemmy.js'
import { userSettings } from '$lib/settings.js'
import type { ListingType, SortType } from 'lemmy-js-client'
import { get } from 'svelte/store'
import type { GetPostsResponse, ListingType, SortType } from 'lemmy-js-client'
import { get, writable } from 'svelte/store'
import { error } from '@sveltejs/kit'
import { profile } from '$lib/auth.js'
import { feature } from '$lib/version.js'
import { _posts, shouldReload, type CachedPosts } from './+page.svelte'
import { browser } from '$app/environment'
import { instance } from '$lib/instance'
export async function load({ url, fetch }) {
const cursor = url.searchParams.get('cursor') as string | undefined
const prevCursor = url.searchParams.get('prevCursor') as string | undefined
const page = Number(url.searchParams.get('page')) || undefined
const sort: SortType =
(url.searchParams.get('sort') as SortType) ||
get(userSettings).defaultSort.sort
const listingType: ListingType =
(url.searchParams.get('type') as ListingType) ||
get(userSettings).defaultSort.feed
const settings = get(userSettings)
const posts = await getClient(undefined, fetch).getPosts({
limit: 20,
page: page,
sort: sort,
type_: listingType,
page_cursor: cursor,
})
const sort: SortType =
(url.searchParams.get('sort') as SortType) || settings.defaultSort.sort
const listingType: ListingType =
(url.searchParams.get('type') as ListingType) || settings.defaultSort.feed
const cached: CachedPosts | undefined = get(_posts)
const posts = shouldReload(cached, url.searchParams.toString(), get(instance))
? await getClient(undefined, fetch).getPosts({
limit: 20,
page: page,
sort: sort,
type_: listingType,
page_cursor: cursor,
show_hidden: settings.posts.showHidden,
})
: cached.data.posts
if (
shouldReload(cached, url.searchParams.toString(), get(instance)) &&
browser
)
_posts.set({
data: {
sort: sort,
listingType: listingType,
page: page || 1,
posts: posts,
cursor: {
next: posts.next_page,
},
},
params: url.searchParams,
lastSeen: 0,
instance: get(instance),
})
try {
return {
sort: sort,
listingType: listingType,
page: page || 1,
posts: posts,
cursor: {
next: posts.next_page,
back: prevCursor,
current: cursor,
},
}
return shouldReload(cached, url.searchParams.toString(), get(instance))
? {
sort: sort,
listingType: listingType,
page: page || 1,
posts: posts,
cursor: {
next: posts.next_page,
back: prevCursor,
current: cursor,
},
}
: cached.data
} catch (err) {
error(500, {
message: 'Failed to fetch homepage.',
});
message: 'Failed to fetch homepage.',
})
}
}
+29 -100
View File
@@ -23,6 +23,7 @@
import {
ArrowLeftOnRectangle,
ArrowRightOnRectangle,
ArrowsRightLeft,
ArrowUturnLeft,
BugAnt,
Check,
@@ -38,41 +39,12 @@
} from 'svelte-hero-icons'
import { flip } from 'svelte/animate'
import { expoInOut, expoOut } from 'svelte/easing'
import { t } from '$lib/translations'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
let newInstance: string = $profileData.defaultInstance ?? DEFAULT_INSTANCE_URL
let loading = false
async function changeGuestInstance() {
loading = true
try {
const valid = await validateInstance(newInstance.trim())
if (!valid) {
throw new Error('invalid instance')
}
toast({
content: 'Changed guest instance.',
type: 'success',
})
} catch (err) {
toast({
content: 'Failed to contact that instance URL. Is it down?',
type: 'error',
})
loading = false
return
}
$profileData.defaultInstance = newInstance
if ($currentProfile && $currentProfile.id == -1) {
$instance = newInstance
}
loading = false
}
let debugging = false
let debugProfile: Profile | undefined = undefined
@@ -85,7 +57,7 @@
</script>
<svelte:head>
<title>Accounts</title>
<title>{$t('routes.accounts')}</title>
</svelte:head>
{#if debugging}
@@ -159,31 +131,12 @@
Sign up
</Button>
</div>
{#if LINKED_INSTANCE_URL === undefined}
<div class="flex flex-row font-normal gap-2">
<TextInput
label="Guest instance"
on:change={changeGuestInstance}
placeholder="Instance URL"
bind:value={newInstance}
/>
<Button
color="primary"
class="h-max self-end"
size="lg"
{loading}
disabled={loading}
>
Change
</Button>
</div>
{/if}
</div>
</div>
{:else}
<div class="flex flex-col h-full gap-4">
<div class="flex flex-row justify-between">
<h1 class="text-2xl font-bold">Accounts</h1>
<Header>{$t('routes.accounts')}</Header>
</div>
<EditableList
on:action={(acc) => {
@@ -232,21 +185,24 @@
? 'Switch'
: 'Current'}
on:click={async () => {
if (profile.id == $currentProfile?.id) setUserID(-1)
else {
if (profile.id != $currentProfile?.id) {
switching = profile.id
await setUserID(profile.id)
switching = -69
}
}}
size="square-md"
color={profile.id == $currentProfile?.id ? 'primary' : 'secondary'}
color={profile.id == $currentProfile?.id ? 'primary' : 'ghost'}
loading={switching == profile.id}
disabled={switching == profile.id}
>
{#if profile.id == $currentProfile?.id}
<Icon src={Check} mini size="16" />
{/if}
<svelte:fragment slot="prefix">
{#if profile.id == $currentProfile?.id}
<Icon src={Check} mini size="16" />
{:else}
<Icon src={ArrowsRightLeft} size="16" mini />
{/if}
</svelte:fragment>
</Button>
<Menu placement="bottom-end">
<Button size="square-md" slot="target">
@@ -256,6 +212,7 @@
<Button
size="square-md"
color="secondary"
title={$t('account.moveUp')}
on:click={() => moveProfile(profile.id, true)}
>
<Icon src={ChevronUp} size="16" mini slot="prefix" />
@@ -263,6 +220,7 @@
<Button
size="square-md"
color="secondary"
title={$t('account.moveDown')}
on:click={() => moveProfile(profile.id, false)}
>
<Icon src={ChevronDown} size="16" mini slot="prefix" />
@@ -273,7 +231,7 @@
on:click={() => (profile.color = undefined)}
>
<Icon src={ArrowUturnLeft} size="16" mini slot="prefix" />
Reset Color
{$t('account.resetColor')}
</MenuButton>
{#if $userSettings.debugInfo}
<MenuButton
@@ -283,58 +241,29 @@
}}
>
<Icon src={BugAnt} size="16" mini slot="prefix" />
Debug Info
{$t('common.debug')}
</MenuButton>
{/if}
<MenuButton on:click={() => action(profile)} color="danger-subtle">
<Icon slot="prefix" src={ArrowRightOnRectangle} size="16" mini />
Log Out
{$t('account.logout')}
</MenuButton>
</Menu>
</div>
{/each}
<div class="flex flex-row gap-4 items-center py-4">
<span class="font-bold flex flex-col">Guest</span>
<div class="ml-auto" />
<Button
aria-label={$currentProfile?.id != -1 ? 'Switch' : 'Current'}
on:click={async () => {
if ($currentProfile?.id != -1) setUserID(-1)
}}
size="square-md"
color={$currentProfile?.id == -1 ? 'primary' : 'secondary'}
>
{#if $currentProfile?.id == -1}
<Icon src={Check} mini size="16" />
{/if}
</Button>
</div>
</EditableList>
<div class="mt-auto" />
<div class="flex flex-row font-normal gap-2">
<TextInput
on:change={changeGuestInstance}
placeholder="Instance URL"
label="Guest instance"
bind:value={newInstance}
disabled={LINKED_INSTANCE_URL != undefined}
size="sm"
>
<span slot="prefix">https://</span>
</TextInput>
<Button
color="primary"
{loading}
disabled={loading || LINKED_INSTANCE_URL != undefined}
class="self-end"
>
Change
<div class="flex items-center gap-2">
<Button href="/login" size="lg" class="flex-1" color="primary">
<Icon slot="prefix" src={ArrowLeftOnRectangle} size="16" mini />
{$t('account.login')}
</Button>
{#if !LINKED_INSTANCE_URL}
<Button href="/login/guest" size="lg">
<Icon slot="prefix" src={Plus} size="16" mini />
{$t('account.addGuest')}
</Button>
{/if}
</div>
<Button href="/login" size="lg">
<Icon slot="prefix" src={ArrowLeftOnRectangle} size="16" mini />
Log In
</Button>
</div>
{/if}
+9 -8
View File
@@ -1,15 +1,16 @@
<script>
import { goto } from '$app/navigation'
import { page } from '$app/stores'
import { profile } from '$lib/auth'
import { notifications, profile } from '$lib/auth'
import MultiSelect from '$lib/components/input/Switch.svelte'
import { t } from '$lib/translations'
import { Badge } from 'mono-svelte'
</script>
{#if ($profile?.user?.notifications.applications ?? 0) > 0}
{#if $notifications.applications > 0}
<span class="flex flex-row text-red-500 gap-2">
<Badge color="red-subtle" class="w-max">
{$profile?.user?.notifications.applications}
{$notifications.applications}
</Badge> unread applications
</span>
{/if}
@@ -24,11 +25,11 @@
'/admin/federation',
]}
optionNames={[
'Configuration',
'Applications',
'Taglines',
'Team',
'Federation',
$t('routes.admin.config.title'),
$t('routes.admin.applications.title'),
$t('routes.admin.taglines.title'),
$t('routes.admin.team.title'),
$t('routes.admin.federation.title'),
]}
selected={$page.url.pathname}
on:select={(e) => {
+2 -1
View File
@@ -1,6 +1,7 @@
import { profile } from '$lib/auth.js'
import { get } from 'svelte/store'
import { getClient, site as siteStore } from '$lib/lemmy.js'
import { getClient } from '$lib/lemmy.js'
import { site as siteStore } from '$lib/lemmy'
export async function load({ fetch }) {
if (!get(profile)) return
+6 -4
View File
@@ -6,15 +6,17 @@
import { ClipboardDocumentCheck, Icon } from 'svelte-hero-icons'
import Application from './Application.svelte'
import MultiSelect from '$lib/components/input/Switch.svelte'
import { t } from '$lib/translations'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
export let data
</script>
<h1 class="font-bold text-2xl">Applications</h1>
<Header>{$t('routes.admin.applications.title')}</Header>
<MultiSelect
options={[false, true]}
selected={data.unreadOnly ?? true}
optionNames={['All', 'Unread']}
optionNames={[$t('filter.location.all'), $t('filter.unread')]}
on:select={(e) =>
searchParam($page.url, 'unreadOnly', e.detail.toString(), 'page')}
/>
@@ -35,7 +37,7 @@
{:else}
<Placeholder
icon={ClipboardDocumentCheck}
title="No new applications"
description="Applications to join your instance will appear here."
title={$t('routes.admin.applications.empty.title')}
description={$t('routes.admin.applications.empty.description')}
/>
{/if}
@@ -1,15 +1,19 @@
<script lang="ts">
import { profile } from '$lib/auth.js'
import { notifications, profile } from '$lib/auth.js'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
import { Material, toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js'
import type {ApproveRegistrationApplication, RegistrationApplicationView} from 'lemmy-js-client'
import type {
ApproveRegistrationApplication,
RegistrationApplicationView,
} from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Check, Icon, XMark } from 'svelte-hero-icons'
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { publishedToDate } from '$lib/components/util/date'
import ApplicationDenyModal from "$lib/components/lemmy/modal/ApplicationDenyModal.svelte";
import ApplicationDenyModal from '$lib/components/lemmy/modal/ApplicationDenyModal.svelte'
import { t } from '$lib/translations'
export let application: RegistrationApplicationView
@@ -31,32 +35,32 @@
} else {
reviewing = true
while (reviewing) {
await new Promise(res => setTimeout(res, 1000))
await new Promise((res) => setTimeout(res, 1000))
}
if (!denying) {
denyReason = ""
denyReason = ''
return
}
if (denyReason != "") {
if (denyReason != '') {
registrationApplicationAnswer.deny_reason = denyReason
}
}
try {
await getClient().approveRegistrationApplication(registrationApplicationAnswer)
await getClient().approveRegistrationApplication(
registrationApplicationAnswer
)
toast({
content: `Successfully ${
approve ? 'approved' : 'denied'
} that application.`,
content: approve
? $t('toast.approvedApplication')
: $t('toast.deniedApplication'),
type: 'success',
})
application.creator_local_user.accepted_application = approve
application.admin = $profile.user!.local_user_view.person
application.registration_application.deny_reason = denyReason
$profile.user!.notifications.applications -= 1
$notifications.applications -= 1
} catch (err) {
toast({
content: err as any,
@@ -71,7 +75,12 @@
</script>
{#if reviewing}
<ApplicationDenyModal bind:open={reviewing} bind:denying bind:denyReason user={application.creator}/>
<ApplicationDenyModal
bind:open={reviewing}
bind:denying
bind:denyReason
user={application.creator}
/>
{/if}
<Material class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
@@ -81,7 +90,7 @@
/>
</span>
<SectionTitle>User</SectionTitle>
<SectionTitle>{$t('routes.admin.applications.user')}</SectionTitle>
<span class="text-sm">
<UserLink user={application.creator} avatar avatarSize={20} />
</span>
@@ -95,12 +104,12 @@
{#if typeof application.registration_application.deny_reason !== 'undefined' && application.registration_application.deny_reason !== ''}
<div>
<div class="flex items-center gap-1 text-sm">
<UserLink avatar user={application.admin} />
<SectionTitle>
{application.creator_local_user.accepted_application
? 'Approved'
: 'Denied'} by
? $t('routes.admin.applications.approved')
: $t('routes.admin.applications.denied')}
</SectionTitle>
<UserLink avatar user={application.admin} />
<SectionTitle>:</SectionTitle>
</div>
<p>{application.registration_application.deny_reason}</p>
@@ -108,12 +117,12 @@
<div class="md:ml-auto" />
{:else}
<div class="flex items-center gap-1 text-sm">
<SectionTitle>
{application.creator_local_user.accepted_application
? 'Approved'
: 'Denied'} by
</SectionTitle>
<UserLink avatar user={application.admin} />
<SectionTitle>
{application.creator_local_user.accepted_application
? $t('routes.admin.applications.approved')
: $t('routes.admin.applications.denied')}
</SectionTitle>
</div>
<div class="md:ml-auto" />
{/if}
@@ -125,7 +134,7 @@
.accepted_application === false && application.admin
? '!text-red-500'
: ''}"
aria-label="Deny"
aria-label={$t('routes.admin.applications.deny')}
on:click={() => review(false)}
loading={denying || reviewing}
disabled={approving || denying || reviewing}
@@ -138,7 +147,7 @@
.accepted_application
? '!text-green-500'
: ''}"
aria-label="Approve"
title={$t('routes.admin.applications.approve')}
on:click={() => review(true)}
loading={approving}
disabled={approving || denying || reviewing}
+91 -62
View File
@@ -1,13 +1,15 @@
<script lang="ts">
import { profile } from '$lib/auth.js'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { Label, toast } from 'mono-svelte'
import { Label, Switch, toast } from 'mono-svelte'
import { getClient } from '$lib/lemmy.js'
import type { EditSite } from 'lemmy-js-client'
import type { PageData } from './$types.js'
import { Button, Checkbox, Select, TextInput } from 'mono-svelte'
import ImageUploadModal from '$lib/components/lemmy/modal/ImageUploadModal.svelte';
import { DocumentPlus, Icon } from 'svelte-hero-icons';
import ImageUploadModal from '$lib/components/lemmy/modal/ImageUploadModal.svelte'
import { DocumentPlus, Icon } from 'svelte-hero-icons'
import { t } from '$lib/translations.js'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
export let data: PageData
@@ -29,7 +31,7 @@
...formData,
})
toast({
content: 'Updated your site.',
content: $t('toast.updatedSite'),
type: 'success',
})
} catch (err) {
@@ -46,136 +48,163 @@
let uploading = {
icon: false,
banner: false
banner: false,
}
</script>
<svelte:head>
<title>Administration</title>
<title>{$t('routes.admin.title')}</title>
</svelte:head>
<form class="flex flex-col gap-4" on:submit|preventDefault={save}>
<h1 class="font-bold text-2xl">Site configuration</h1>
<Header>{$t('routes.admin.config.title')}</Header>
{#if formData}
<TextInput bind:value={formData.name} label="Name" />
<TextInput bind:value={formData.description} label="Description" />
<TextInput bind:value={formData.name} label={$t('form.name')} />
<TextInput
bind:value={formData.description}
label={$t('form.description')}
/>
<MarkdownEditor
previewButton
bind:value={formData.sidebar}
label="Sidebar"
label={$t('routes.admin.config.sidebar')}
/>
<MarkdownEditor
previewButton
bind:value={formData.legal_information}
label="Legal"
label={$t('routes.legal.title')}
/>
<div class="flex flex-col gap-1">
<Label>Icon</Label>
<button type="button" on:click={() => uploading.icon = !uploading.icon} class="flex flex-col gap-4 bg-white dark:bg-black border border-slate-300 dark:border-zinc-800 p-4 w-full h-32 rounded-xl">
<Label>{$t('routes.admin.config.icon')}</Label>
<button
type="button"
on:click={() => (uploading.icon = !uploading.icon)}
class="flex flex-col gap-4 bg-white dark:bg-black border border-slate-300 dark:border-zinc-800 p-4 w-full h-32 rounded-xl"
>
{#if formData.icon}
<img src={formData.icon} class="rounded-md mx-auto h-full" />
{:else}
<Icon src={DocumentPlus} size="48" class="text-slate-500 dark:text-zinc-500 mx-auto my-auto" />
<Icon
src={DocumentPlus}
size="48"
class="text-slate-500 dark:text-zinc-500 mx-auto my-auto"
/>
{/if}
</button>
{#if uploading.icon}
<ImageUploadModal
bind:open={uploading.icon}
bind:output={formData.icon}
on:upload={() => uploading.icon = false}
on:upload={() => (uploading.icon = false)}
/>
{/if}
</div>
<div class="flex flex-col gap-1">
<Label>Banner</Label>
<button type="button" on:click={() => uploading.banner = !uploading.banner} class="flex flex-col gap-4 bg-white dark:bg-black border border-slate-300 dark:border-zinc-800 p-4 w-full h-32 rounded-xl">
<Label>{$t('routes.admin.config.banner')}</Label>
<button
type="button"
on:click={() => (uploading.banner = !uploading.banner)}
class="flex flex-col gap-4 bg-white dark:bg-black border border-slate-300 dark:border-zinc-800 p-4 w-full h-32 rounded-xl"
>
{#if formData.banner}
<img src={formData.banner} class="rounded-md mx-auto h-full" />
{:else}
<Icon src={DocumentPlus} size="48" class="text-slate-500 dark:text-zinc-500 mx-auto my-auto" />
<Icon
src={DocumentPlus}
size="48"
class="text-slate-500 dark:text-zinc-500 mx-auto my-auto"
/>
{/if}
</button>
{#if uploading.banner}
<ImageUploadModal
bind:open={uploading.banner}
bind:output={formData.banner}
on:upload={() => uploading.banner = false}
on:upload={() => (uploading.banner = false)}
/>
{/if}
</div>
<Checkbox bind:checked={formData.enable_downvotes} defaultValue={true}>
Enable downvotes
</Checkbox>
<Checkbox checked={formData.enable_nsfw} defaultValue={true}>
Enable NSFW
</Checkbox>
<Switch bind:checked={formData.enable_downvotes} defaultValue={true}>
{$t('routes.admin.config.downvotesEnabled')}
</Switch>
<Switch checked={formData.enable_nsfw} defaultValue={true}>
{$t('routes.admin.config.nsfwEnabled')}
</Switch>
<Select
label="Registration Mode"
label={$t('routes.admin.config.registration.label')}
bind:value={formData.registration_mode}
class="w-max"
>
<option value="Open">Open</option>
<option value="RequireApplication">Require Application</option>
<option value="Closed">Closed</option>
<option value="Open">
{$t('routes.admin.config.registration.open')}
</option>
<option value="RequireApplication">
{$t('routes.admin.config.registration.application')}
</option>
<option value="Closed">
{$t('routes.admin.config.registration.closed')}
</option>
</Select>
{#if formData.registration_mode == 'RequireApplication'}
<MarkdownEditor
previewButton
label="Application question"
label={$t('routes.admin.config.applicationQuestion')}
bind:value={formData.application_question}
/>
{/if}
<Checkbox
<Switch
bind:checked={formData.community_creation_admin_only}
defaultValue={true}
>
Only admins can create communities
</Checkbox>
<Checkbox
{$t('routes.admin.config.adminCommunityOnly')}
</Switch>
<Switch
bind:checked={formData.require_email_verification}
defaultValue={true}
>
Require email verification
</Checkbox>
<Checkbox
{$t('routes.admin.config.requireVerifyEmail')}
</Switch>
<Switch
bind:checked={formData.application_email_admins}
defaultValue={true}
>
Email admins on receiving new applications
</Checkbox>
<Checkbox bind:checked={formData.reports_email_admins} defaultValue={true}>
Email admins on receiving new reports
</Checkbox>
{$t('routes.admin.config.emailAdminsOnApplication')}
</Switch>
<Switch bind:checked={formData.reports_email_admins} defaultValue={true}>
{$t('routes.admin.config.emailAdminsOnReport')}
</Switch>
<Select
label="Listing Type"
label={$t('routes.admin.config.listingType.label')}
bind:value={formData.default_post_listing_type}
class="w-max"
>
<option value="All">All</option>
<option value="Local">Local</option>
<option value="All">{$t('routes.admin.config.listingType.all')}</option>
<option value="Local">
{$t('routes.admin.config.listingType.local')}
</option>
</Select>
<Checkbox bind:checked={formData.private_instance} defaultValue={true}>
Private instance
</Checkbox>
<Checkbox bind:checked={formData.hide_modlog_mod_names} defaultValue={true}>
Hide modlog mod names
</Checkbox>
<Switch bind:checked={formData.private_instance} defaultValue={true}>
{$t('routes.admin.config.private')}
</Switch>
<Switch bind:checked={formData.hide_modlog_mod_names} defaultValue={true}>
{$t('routes.admin.config.hideModlogModNames')}
</Switch>
<TextInput
bind:value={formData.slur_filter_regex}
label="Slur filter regex"
label={$t('routes.admin.config.slurFilter')}
placeholder="(word1|word2)"
/>
<Checkbox bind:checked={formData.federation_enabled} defaultValue={true}>
Federation enabled
</Checkbox>
<Checkbox bind:checked={formData.federation_debug} defaultValue={false}>
Federation debug mode
</Checkbox>
<Checkbox bind:checked={formData.captcha_enabled} defaultValue={false}>
Captcha enabled
</Checkbox>
<Switch bind:checked={formData.federation_enabled} defaultValue={true}>
{$t('routes.admin.config.federation')}
</Switch>
<Switch bind:checked={formData.federation_debug} defaultValue={false}>
{$t('routes.admin.config.federationDebug')}
</Switch>
<Switch bind:checked={formData.captcha_enabled} defaultValue={false}>
{$t('routes.admin.config.captcha.enabled')}
</Switch>
{/if}
<Button color="primary" size="lg" loading={saving} disabled={saving} submit>
Save
{$t('common.save')}
</Button>
</form>
+23 -27
View File
@@ -5,6 +5,7 @@
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
import { publishedToDate } from '$lib/components/util/date.js'
import { getClient } from '$lib/lemmy.js'
import { t } from '$lib/translations.js'
import { trycatch } from '$lib/util.js'
import type { Instance } from 'lemmy-js-client'
import {
@@ -108,7 +109,7 @@
if (res) {
toast({
content: 'Edited your site.',
content: $t('toast.updatedSite'),
type: 'success',
})
}
@@ -126,8 +127,7 @@
if (!data.federated_instances?.federated_instances?.blocked)
throw new Error('Missing instance')
const content = e.target?.result
if (!content)
toast({ content: 'No content in that file', type: 'warning' })
if (!content) toast({ content: $t('toast.failCSV'), type: 'warning' })
try {
const instances: Instance[] = []
@@ -151,12 +151,12 @@
data.federated_instances.federated_instances.blocked = instances
} catch (err) {
toast({ content: err as 'Failed to parse CSV', type: 'error' })
toast({ content: $t('toast.failCSV'), type: 'error' })
}
}
reader.onerror = (e) =>
toast({ content: 'Failed to read file.', type: 'error' })
toast({ content: $t('toast.failCSV'), type: 'error' })
reader.readAsText(files[0])
}
@@ -167,24 +167,20 @@
</script>
<svelte:head>
<title>Federation</title>
<title>{$t('routes.admin.federation.title')}</title>
</svelte:head>
<h1 class="font-bold text-2xl flex items-center justify-between">
Federation <Button
color="primary"
on:click={save}
loading={saving}
disabled={saving}
>
Save
{$t('routes.admin.federation.title')}
<Button color="primary" on:click={save} loading={saving} disabled={saving}>
{$t('common.save')}
</Button>
</h1>
{#if data.site && data.federated_instances?.federated_instances?.blocked}
<FileInput preview={false} bind:files={csv}>
<Button class="w-max" slot="button">
<Icon src={Plus} mini size="18" slot="prefix" />
Upload a CSV
{$t('routes.admin.federation.csv')}
</Button>
<svelte:fragment slot="choose">
{''}
@@ -192,14 +188,14 @@
</FileInput>
<div class="flex flex-col md:flex-row gap-4">
<div class="flex-1 w-full max-h-[42rem] h-full flex flex-col gap-2">
<h2 class="font-bold text-lg">Blocked Instances</h2>
<h2 class="font-bold text-lg">{$t('routes.admin.federation.blocked')}</h2>
<form
on:submit|preventDefault={() =>
moderateInstance(blockInstance.instance, true)}
class="flex flex-row gap-2"
>
<TextInput
placeholder="Block an instance..."
placeholder={$t('routes.admin.federation.blockplaceholder')}
class="flex-1"
bind:value={blockInstance.instance}
/>
@@ -208,7 +204,7 @@
loading={blockInstance.loading}
disabled={blockInstance.loading}
>
Block
{$t('routes.admin.federation.block')}
</Button>
</form>
<Material class="h-full overflow-auto" color="distinct">
@@ -252,8 +248,8 @@
{:else}
<Placeholder
icon={Check}
title="No blocked instances"
description="Blocking an instance will hide submissions from that instance."
title={$t('routes.admin.federation.emptyBlock.title')}
description={$t('routes.admin.federation.emptyBlock.description')}
/>
{/if}
</EditableList>
@@ -261,7 +257,7 @@
</div>
<div class="md:flex-1 w-full max-h-[42rem] flex flex-col gap-2">
<h2 class="font-bold text-lg flex items-center space-x-1">
<span>Allowed Instances</span>
<span>{$t('routes.admin.federation.allowed')}</span>
{#if allowInstance.instance || !(data.federated_instances.federated_instances.allowed?.length == 0)}
<Popover openOnHover placement="bottom-end">
<Icon
@@ -272,9 +268,7 @@
size="20"
/>
<p class="font-normal">
Adding items to "Allowed Instances" will <strong>
block every other instance.
</strong>
{$t('routes.admin.federation.emptyAllow.description')}
</p>
</Popover>
{/if}
@@ -285,7 +279,7 @@
class="flex flex-row gap-2"
>
<TextInput
placeholder="Allow an instance..."
placeholder={$t('routes.admin.federation.allowplaceholder')}
class="flex-1"
bind:value={allowInstance.instance}
/>
@@ -294,7 +288,7 @@
loading={allowInstance.loading}
disabled={allowInstance.loading}
>
Allow
{$t('routes.admin.federation.allow')}
</Button>
</form>
<Material class="h-full overflow-auto" color="distinct">
@@ -335,8 +329,10 @@
<div class="my-auto h-max">
<Placeholder
icon={Check}
title="No allowed instances"
description="Adding an item to this will block every other instance."
title={$t('routes.admin.federation.emptyAllow.title')}
description={$t(
'routes.admin.federation.emptyAllow.description'
)}
/>
</div>
{/if}
+12 -14
View File
@@ -9,6 +9,8 @@
import type { Tagline } from 'lemmy-js-client'
import { Button } from 'mono-svelte'
import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/translations.js'
export let data
@@ -27,7 +29,7 @@
taglines: taglines,
})
toast({
content: 'Successfully saved taglines.',
content: $t('toast.updatedSite'),
type: 'success',
})
} catch (err) {
@@ -43,7 +45,7 @@
{#if taglines.length > 0}
<div class="flex flex-row justify-between items-center">
<h1 class="font-bold text-2xl">Taglines</h1>
<Header>{$t('routes.admin.taglines.title')}</Header>
<Button
color="primary"
on:click={save}
@@ -52,7 +54,7 @@
size="lg"
class="h-max"
>
Save
{$t('common.save')}
</Button>
</div>
<EditableList
@@ -89,23 +91,19 @@
newTagline = ''
}}
>
<MarkdownEditor
bind:value={newTagline}
placeholder="Add a tagline"
images={false}
/>
<MarkdownEditor bind:value={newTagline} images={false} />
<Button size="lg" submit>
<Icon src={Plus} size="16" mini slot="prefix" />
Add
{$t('common.add')}
</Button>
</form>
{:else}
<div class="my-auto">
<Placeholder
icon={Plus}
title="No taglines"
description="A random tagline will appear when users visit your instance."
title={$t('routes.admin.taglines.empty.title')}
description={$t('routes.admin.taglines.empty.description')}
>
<div class="mt-4 max-w-xl w-full flex flex-col gap-2">
<form
@@ -120,18 +118,18 @@
>
<MarkdownEditor
bind:value={newTagline}
placeholder="Add a tagline"
placeholder={$t('routes.admin.taglines.add')}
images={false}
/>
<Button size="lg" submit>
<Icon src={Plus} size="16" mini slot="prefix" />
Add
{$t('common.add')}
</Button>
</form>
<Button on:click={save} color="primary" size="lg" class="w-full">
Save
{$t('common.save')}
</Button>
</div>
</Placeholder>
+8 -10
View File
@@ -10,6 +10,8 @@
import { removeItem, trycatch } from '$lib/util.js'
import { Button, TextInput } from 'mono-svelte'
import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/translations.js'
export let data
@@ -19,7 +21,7 @@
async function removeAdmin(id: number, confirm: boolean): Promise<any> {
if (!confirm)
return toast({
content: 'Are you sure you want to remove that admin?',
content: $t('toast.removeAdminWarning'),
action: () => removeAdmin(id, true),
})
@@ -35,25 +37,21 @@
if (result) {
data.site!.admins = result.admins
toast({
content: 'Removed that admin.',
content: $t('toast.removeAdmin'),
type: 'success',
})
}
}
</script>
<svelte:head>
<title>Admin Team</title>
</svelte:head>
<h1 class="font-bold text-2xl">Admins</h1>
<Header>{$t('routes.admin.team.title')}</Header>
{#if data.site}
<EditableList let:action on:action={(e) => removeAdmin(e.detail, false)}>
{#if data.site.admins.length <= 0}
<Placeholder
icon={QuestionMarkCircle}
title="No admins"
description="Somehow there's no admins of this site. How?!"
title={$t('routes.admin.team.empty.title')}
description={$t('routes.admin.team.empty.description')}
/>
{:else}
{#each data.site?.admins ?? [] as admin}
@@ -96,7 +94,7 @@
/>
<Button loading={adding} disabled={adding} size="md" class="h-full" submit>
<Icon src={Plus} mini size="16" slot="prefix" />
Add Admin
{$t('common.add')}
</Button>
</form>
{/if}
Loaded 100 of 138 files, more files were not shown because too many files have changed in this diff. Show more