diff --git a/.env.example b/.env.example index a21e7f83..c3cc17d0 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,8 @@ NUXT_CLOUDFLARE_API_TOKEN= NUXT_STORAGE_DRIVER= NUXT_STORAGE_FS_BASE= +NUXT_ADMIN_KEY= + NUXT_PUBLIC_DISABLE_VERSION_CHECK= NUXT_GITHUB_CLIENT_ID= diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..2189ced5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ + + +### Description + + + +### Additional context + + + +--- + +### What is the purpose of this pull request? + +- [ ] Bug fix +- [ ] New Feature +- [ ] Documentation update +- [ ] Translations update +- [ ] Other + +### Before submitting the PR, please make sure you do the following + +- [ ] Read the [Contributing Guidelines](https://github.com/elk-zone/elk/blob/main/CONTRIBUTING.md). +- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate. +- [ ] Provide related snapshots or videos. +- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 99f0edb0..31e43a9d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,9 +93,9 @@ We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://i 1. Add a new file in [locales](./locales) folder with the language code as the filename. 2. Copy [en-US](./locales/en-US.json) and translate the strings. -3. Add the language to the `locales` array in [config/i18n.ts](./config/i18n.ts#L13) -4. If the language is `right-to-left`, add `dir` option with `rtl` value, for example, for [ar-EG](./config/i18n.ts#L79) -5. If the language requires special pluralization rules, add `pluralRule` callback option, for example, for [ar-EG](./config/i18n.ts#L80) +3. Add the language to the `locales` array in [config/i18n.ts](./config/i18n.ts#L12), below `en` variants and `ar-EG`. +4. If the language is `right-to-left`, add `dir` option with `rtl` value, for example, for [ar-EG](./config/i18n.ts#L27) +5. If the language requires special pluralization rules, add `pluralRule` callback option, for example, for [ar-EG](./config/i18n.ts#L27) Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essentials/pluralization.html#custom-pluralization) for more info. diff --git a/README.md b/README.md index b43e52cd..9d8360d8 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,20 @@ A nimble Mastodon web client It is already quite usable, but it isn't ready for wide adoption yet. We recommend you use it if you would like to help us build it. We appreciate your feedback and contributions. Check out the [Open Issues](https://github.com/elk-zone/elk/issues) and jump in the action. Join the [Elk discord server](https://chat.elk.zone) to chat with us and learn more about the project. -The client is deployed on: +## Official Deployment + +The Elk team maintains a deployment at: - 🦌 Production: [elk.zone](https://elk.zone) - 🐙 Canary: [main.elk.zone](https://main.elk.zone) (deploys on every commit to `main` branch) +## Ecosystem + +These are known deployments using Elk as an alternative Web client for Mastodon servers or as a base for other projects in the fediverse: + +- [elk.h4.io](https://elk.h4.io) - Use Elk for the `h4.io` Server +- [elk.universeodon.com](https://elk.universeodon.com) - Use Elk for the Universeodon Server + ## 💖 Sponsors We are grateful for the generous sponsorship and help of: diff --git a/app.vue b/app.vue index cc034a6b..3ce0a951 100644 --- a/app.vue +++ b/app.vue @@ -3,6 +3,7 @@ setupPageHeader() provideGlobalCommands() const route = useRoute() + if (process.server && !route.path.startsWith('/settings')) { useHead({ meta: [ diff --git a/components/account/AccountFollowButton.vue b/components/account/AccountFollowButton.vue index 7b79778e..f1ef9f0b 100644 --- a/components/account/AccountFollowButton.vue +++ b/components/account/AccountFollowButton.vue @@ -8,15 +8,15 @@ const { account, command, context, ...props } = defineProps<{ command?: boolean }>() -const isSelf = $computed(() => currentUser.value?.account.id === account.id) +const isSelf = $(useSelfAccount(() => account)) const enable = $computed(() => !isSelf && currentUser.value) const relationship = $computed(() => props.relationship || useRelationship(account).value) -const masto = useMasto() +const { client } = $(useMasto()) async function toggleFollow() { relationship!.following = !relationship!.following try { - const newRel = await masto.v1.accounts[relationship!.following ? 'follow' : 'unfollow'](account.id) + const newRel = await client.v1.accounts[relationship!.following ? 'follow' : 'unfollow'](account.id) Object.assign(relationship!, newRel) } catch (err) { @@ -29,7 +29,7 @@ async function toggleFollow() { async function unblock() { relationship!.blocking = false try { - const newRel = await masto.v1.accounts.unblock(account.id) + const newRel = await client.v1.accounts.unblock(account.id) Object.assign(relationship!, newRel) } catch (err) { @@ -42,7 +42,7 @@ async function unblock() { async function unmute() { relationship!.muting = false try { - const newRel = await masto.v1.accounts.unmute(account.id) + const newRel = await client.v1.accounts.unmute(account.id) Object.assign(relationship!, newRel) } catch (err) { diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue index 9e9f9c7a..aaed93b2 100644 --- a/components/account/AccountHeader.vue +++ b/components/account/AccountHeader.vue @@ -6,6 +6,8 @@ const { account } = defineProps<{ command?: boolean }>() +const { client } = $(useMasto()) + const { t } = useI18n() const createdAt = $(useFormattedDateTime(() => account.createdAt, { @@ -14,6 +16,8 @@ const createdAt = $(useFormattedDateTime(() => account.createdAt, { year: 'numeric', })) +const relationship = $(useRelationship(account)) + const namedFields = ref([]) const iconFields = ref([]) @@ -39,6 +43,18 @@ function previewAvatar() { }]) } +async function toggleNotifications() { + relationship!.notifying = !relationship?.notifying + try { + const newRel = await client.v1.accounts.follow(account.id, { notify: relationship?.notifying }) + Object.assign(relationship!, newRel) + } + catch { + // TODO error handling + relationship!.notifying = !relationship?.notifying + } +} + watchEffect(() => { const named: mastodon.v1.AccountField[] = [] const icons: mastodon.v1.AccountField[] = [] @@ -59,7 +75,8 @@ watchEffect(() => { iconFields.value = icons }) -const isSelf = $computed(() => currentUser.value?.account.id === account.id) +const isSelf = $(useSelfAccount(() => account)) +const isNotifiedOnPost = $computed(() => !!relationship?.notifying) diff --git a/components/account/AccountPaginator.vue b/components/account/AccountPaginator.vue index ecb92d7d..86bcccb8 100644 --- a/components/account/AccountPaginator.vue +++ b/components/account/AccountPaginator.vue @@ -1,10 +1,19 @@ + diff --git a/components/account/AccountPostsFollowers.vue b/components/account/AccountPostsFollowers.vue index 98dcd4c2..d647bd62 100644 --- a/components/account/AccountPostsFollowers.vue +++ b/components/account/AccountPostsFollowers.vue @@ -40,7 +40,7 @@ const userSettings = useUserSettings() { w-full h-full > -
-
-
+ + + -
-
-
+ + + + diff --git a/components/common/CommonPaginator.vue b/components/common/CommonPaginator.vue index 1191f17d..52feb76a 100644 --- a/components/common/CommonPaginator.vue +++ b/components/common/CommonPaginator.vue @@ -42,7 +42,7 @@ defineSlots<{ const { t } = useI18n() -const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, stream, eventType, preprocess) +const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, $$(stream), eventType, preprocess)