mirror of
https://github.com/go-vikunja/vikunja.git
synced 2025-12-05 18:57:47 -06:00
feat: add logo change toggle setting (#1031)
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
// It has to be the full url, including the last /api/v1 part and port.
|
||||
// You can change this if your api is not reachable on the same port as the frontend.
|
||||
window.API_URL = '/api/v1'
|
||||
window.ALLOW_ICON_CHANGES = true
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useNow } from '@vueuse/core'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
|
||||
import LogoFull from '@/assets/logo-full.svg?component'
|
||||
import LogoFullPride from '@/assets/logo-full-pride.svg?component'
|
||||
@@ -9,7 +10,13 @@ import {MILLISECONDS_A_HOUR} from '@/constants/date'
|
||||
const now = useNow({
|
||||
interval: MILLISECONDS_A_HOUR,
|
||||
})
|
||||
const Logo = computed(() => window.ALLOW_ICON_CHANGES && now.value.getMonth() === 5 ? LogoFullPride : LogoFull)
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const Logo = computed(() => window.ALLOW_ICON_CHANGES
|
||||
&& authStore.settings.frontendSettings.allowIconChanges
|
||||
&& now.value.getMonth() === 5
|
||||
? LogoFullPride
|
||||
: LogoFull)
|
||||
const CustomLogo = computed(() => window.CUSTOM_LOGO_URL)
|
||||
</script>
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
"discoverableByName": "Allow other users to add me as a member to teams or projects when they search for my name",
|
||||
"discoverableByEmail": "Allow other users to add me as a member to teams or projects when they search for my full email",
|
||||
"playSoundWhenDone": "Play a sound when marking tasks as done",
|
||||
"allowIconChanges": "Show special logos during certain times",
|
||||
"weekStart": "Week starts on",
|
||||
"weekStartSunday": "Sunday",
|
||||
"weekStartMonday": "Monday",
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface IFrontendSettings {
|
||||
playSoundWhenDone: boolean
|
||||
quickAddMagicMode: PrefixMode
|
||||
colorSchema: BasicColorSchema
|
||||
allowIconChanges: boolean
|
||||
filterIdUsedOnOverview: IProject['id'] | null
|
||||
defaultView?: DefaultProjectViewKind
|
||||
minimumPriority: Priority
|
||||
|
||||
@@ -21,6 +21,7 @@ export default class UserSettingsModel extends AbstractModel<IUserSettings> impl
|
||||
playSoundWhenDone: true,
|
||||
quickAddMagicMode: PrefixMode.Default,
|
||||
colorSchema: 'auto',
|
||||
allowIconChanges: true,
|
||||
defaultView: DEFAULT_PROJECT_VIEW_SETTINGS.FIRST,
|
||||
minimumPriority: PRIORITIES.MEDIUM,
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
playSoundWhenDone: true,
|
||||
quickAddMagicMode: PrefixMode.Default,
|
||||
colorSchema: 'auto',
|
||||
allowIconChanges: true,
|
||||
...newSettings.frontendSettings,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -123,6 +123,15 @@
|
||||
{{ $t('user.settings.general.playSoundWhenDone') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="checkbox">
|
||||
<input
|
||||
v-model="settings.frontendSettings.allowIconChanges"
|
||||
type="checkbox"
|
||||
>
|
||||
{{ $t('user.settings.general.allowIconChanges') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="checkbox">
|
||||
<input
|
||||
@@ -295,6 +304,8 @@ const settings = ref<IUserSettings>({
|
||||
defaultView: authStore.settings.frontendSettings.defaultView ?? DEFAULT_PROJECT_VIEW_SETTINGS.FIRST,
|
||||
// Add fallback for old settings that don't have the minimum priority set
|
||||
minimumPriority: authStore.settings.frontendSettings.minimumPriority ?? PRIORITIES.MEDIUM,
|
||||
// Add fallback for old settings that don't have the logo change setting set
|
||||
allowIconChanges: authStore.settings.frontendSettings.allowIconChanges ?? true,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user