Merge pull request 'Let (foreign) user profiles override current wallpaper' (#3498) from profile-bg into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma-fe/pulls/3498
This commit is contained in:
commit
9c22077e39
10 changed files with 35 additions and 3 deletions
1
changelog.d/profilebg.add
Normal file
1
changelog.d/profilebg.add
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
displaying other user's backgrounds (if supported by BE)
|
||||||
12
src/App.js
12
src/App.js
|
|
@ -149,13 +149,23 @@ export default {
|
||||||
userBackground() {
|
userBackground() {
|
||||||
return this.currentUser.background_image
|
return this.currentUser.background_image
|
||||||
},
|
},
|
||||||
|
foreignProfileBackground() {
|
||||||
|
return (
|
||||||
|
useMergedConfigStore().mergedConfig.allowForeignUserBackground &&
|
||||||
|
useInterfaceStore().foreignProfileBackground
|
||||||
|
)
|
||||||
|
},
|
||||||
instanceBackground() {
|
instanceBackground() {
|
||||||
return useMergedConfigStore().mergedConfig.hideInstanceWallpaper
|
return useMergedConfigStore().mergedConfig.hideInstanceWallpaper
|
||||||
? null
|
? null
|
||||||
: this.instanceBackgroundUrl
|
: this.instanceBackgroundUrl
|
||||||
},
|
},
|
||||||
background() {
|
background() {
|
||||||
return this.userBackground || this.instanceBackground
|
return (
|
||||||
|
this.foreignProfileBackground ||
|
||||||
|
this.userBackground ||
|
||||||
|
this.instanceBackground
|
||||||
|
)
|
||||||
},
|
},
|
||||||
bgStyle() {
|
bgStyle() {
|
||||||
if (this.background) {
|
if (this.background) {
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,7 @@ nav {
|
||||||
background-color: var(--wallpaper);
|
background-color: var(--wallpaper);
|
||||||
background-image: var(--body-background-image);
|
background-image: var(--body-background-image);
|
||||||
background-position: 50%;
|
background-position: 50%;
|
||||||
|
transition: background-image 1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.underlay {
|
.underlay {
|
||||||
|
|
|
||||||
|
|
@ -263,6 +263,11 @@
|
||||||
{{ $t('settings.hide_wallpaper') }}
|
{{ $t('settings.hide_wallpaper') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<BooleanSetting path="allowForeignUserBackground">
|
||||||
|
{{ $t('settings.foreign_user_background') }}
|
||||||
|
</BooleanSetting>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<BooleanSetting path="compactProfiles">
|
<BooleanSetting path="compactProfiles">
|
||||||
{{ $t('settings.compact_profiles') }}
|
{{ $t('settings.compact_profiles') }}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
:button="button"
|
:button="button"
|
||||||
:status="status"
|
:status="status"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@emojiPickerShown="e => $emit('emojiPickerShown', e)"
|
@emoji-picker-shown="e => $emit('emojiPickerShown', e)"
|
||||||
/>
|
/>
|
||||||
<teleport to="#modal">
|
<teleport to="#modal">
|
||||||
<MuteConfirm
|
<MuteConfirm
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
:get-component="getComponent"
|
:get-component="getComponent"
|
||||||
:close="() => { /* no-op */ }"
|
:close="() => { /* no-op */ }"
|
||||||
:do-action="doAction"
|
:do-action="doAction"
|
||||||
@emojiPickerShown="onEmojiPickerShown"
|
@emoji-picker-shown="onEmojiPickerShown"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
v-if="showPin && currentUser"
|
v-if="showPin && currentUser"
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import UserCard from '../user_card/user_card.vue'
|
||||||
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
|
@ -56,9 +57,14 @@ const UserProfile = {
|
||||||
const routeParams = this.$route.params
|
const routeParams = this.$route.params
|
||||||
this.load({ name: routeParams.name, id: routeParams.id })
|
this.load({ name: routeParams.name, id: routeParams.id })
|
||||||
this.tab = get(this.$route, 'query.tab', defaultTabKey)
|
this.tab = get(this.$route, 'query.tab', defaultTabKey)
|
||||||
|
useInterfaceStore().setForeignProfileBackground(this.user?.background_image)
|
||||||
|
},
|
||||||
|
updated() {
|
||||||
|
useInterfaceStore().setForeignProfileBackground(this.user?.background_image)
|
||||||
},
|
},
|
||||||
unmounted() {
|
unmounted() {
|
||||||
this.stopFetching()
|
this.stopFetching()
|
||||||
|
useInterfaceStore().setForeignProfileBackground(null)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
timeline() {
|
timeline() {
|
||||||
|
|
|
||||||
|
|
@ -636,6 +636,7 @@
|
||||||
"navbar_column_stretch": "Stretch navbar to columns width",
|
"navbar_column_stretch": "Stretch navbar to columns width",
|
||||||
"always_show_post_button": "Always show floating New Post button",
|
"always_show_post_button": "Always show floating New Post button",
|
||||||
"hide_wallpaper": "Hide instance wallpaper",
|
"hide_wallpaper": "Hide instance wallpaper",
|
||||||
|
"foreign_user_background": "Allow other user's profiles to override wallpaper",
|
||||||
"preload_images": "Preload images",
|
"preload_images": "Preload images",
|
||||||
"use_one_click_nsfw": "Open NSFW attachments with just one click",
|
"use_one_click_nsfw": "Open NSFW attachments with just one click",
|
||||||
"hide_post_stats": "Hide post statistics (e.g. the number of favorites)",
|
"hide_post_stats": "Hide post statistics (e.g. the number of favorites)",
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,10 @@ export const INSTANCE_DEFAULT_CONFIG_DEFINITIONS = {
|
||||||
description: 'Hide Instance-specific panel',
|
description: 'Hide Instance-specific panel',
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
allowForeignUserBackground: {
|
||||||
|
description: "Allow other user's profiles to override wallpaper",
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
hideInstanceWallpaper: {
|
hideInstanceWallpaper: {
|
||||||
description: 'Hide Instance default background',
|
description: 'Hide Instance default background',
|
||||||
default: false,
|
default: false,
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ export const useInterfaceStore = defineStore('interface', {
|
||||||
globalNotices: [],
|
globalNotices: [],
|
||||||
layoutHeight: 0,
|
layoutHeight: 0,
|
||||||
lastTimeline: null,
|
lastTimeline: null,
|
||||||
|
foreignProfileBackground: null,
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
setTemporaryChanges({ confirm, revert }) {
|
setTemporaryChanges({ confirm, revert }) {
|
||||||
|
|
@ -96,6 +97,9 @@ export const useInterfaceStore = defineStore('interface', {
|
||||||
console.error(`${error}`)
|
console.error(`${error}`)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
setForeignProfileBackground(url) {
|
||||||
|
this.foreignProfileBackground = url
|
||||||
|
},
|
||||||
settingsSaved({ success, error }) {
|
settingsSaved({ success, error }) {
|
||||||
if (success) {
|
if (success) {
|
||||||
if (this.noticeClearTimeout) {
|
if (this.noticeClearTimeout) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue