]> source.dussan.org Git - nextcloud-server.git/commitdiff
WIP: Start off with attribution for shipped backgrounds
authorJulius Härtl <jus@bitgrid.net>
Mon, 17 Aug 2020 19:38:33 +0000 (21:38 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 19 Aug 2020 15:07:28 +0000 (17:07 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/dashboard/lib/Service/BackgroundService.php
apps/dashboard/src/components/BackgroundSettings.vue

index d4de491aeaa075e1a1522acf3f2b02ef6caa96cf..2b59bef65d9ac5f2e2db0953d94810cfd84e762a 100644 (file)
@@ -36,17 +36,50 @@ use OCP\IConfig;
 
 class BackgroundService {
 
+       const THEMING_MODE_LIGHT = 'light';
+       const THEMING_MODE_DARK = 'dark';
+
        const SHIPPED_BACKGROUNDS = [
-               'anatoly-mikhaltsov-butterfly-wing-scale.jpg',
-               'bernie-cetonia-aurata-take-off-composition.jpg',
-               'dejan-krsmanovic-ribbed-red-metal.jpg',
-               'eduardo-neves-pedra-azul.jpg',
-               'european-space-agency-barents-bloom.jpg',
-               'european-space-agency-namib-desert.jpg',
-               'hannes-fritz-flippity-floppity.jpg',
-               'hannes-fritz-roulette.jpg',
-               'hannes-fritz-sea-spray.jpg',
-               'kamil-porembinski-clouds.jpg',
+               'anatoly-mikhaltsov-butterfly-wing-scale.jpg' => [
+                       'attribution' => 'Butterfly',
+                       'attribution_url' => 'https://',
+               ],
+               'bernie-cetonia-aurata-take-off-composition.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ],
+               'dejan-krsmanovic-ribbed-red-metal.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ],
+               'eduardo-neves-pedra-azul.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ],
+               'european-space-agency-barents-bloom.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ],
+               'european-space-agency-namib-desert.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ],
+               'hannes-fritz-flippity-floppity.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ],
+               'hannes-fritz-roulette.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ],
+               'hannes-fritz-sea-spray.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ],
+               'kamil-porembinski-clouds.jpg' => [
+                       'attribution' => '',
+                       'attribution_url' => '',
+               ]
        ];
 
        public function __construct(IRootFolder $rootFolder, IAppData $appData, IConfig $config, $userId) {
index 757711f96bbcf2ddea29c2e2fe5645c6d76c6de7..accc094f52318c86a63f54a60fe6d506ed8e3a38 100644 (file)
@@ -52,6 +52,7 @@
                </a>
                <a v-for="background in shippedBackgrounds"
                        :key="background.name"
+                       v-tooltip="background.details.attribution"
                        tabindex="0"
                        class="background"
                        :class="{ 'icon-loading': loading === background.name }"
@@ -81,10 +82,11 @@ export default {
        },
        computed: {
                shippedBackgrounds() {
-                       return shippedBackgroundList.map((item) => {
+                       return Object.keys(shippedBackgroundList).map((item) => {
                                return {
                                        name: item,
                                        url: prefixWithBaseUrl(item),
+                                       details: shippedBackgroundList[item],
                                }
                        })
                },