Separate icon from translatable text

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-06-23 17:01:55 +02:00
parent 829bf1ad11
commit a0cd760481
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
2 changed files with 6 additions and 32 deletions

View File

@ -1,24 +0,0 @@
<?php
/**
* @copyright Copyright (c) 2020 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$app = new \OCP\AppFramework\App('dashboard');

View File

@ -1,6 +1,6 @@
<template>
<div id="app-dashboard">
<h2>{{ greeting }}, {{ name }}</h2>
<h2>{{ greeting.icon }} {{ greeting.text }}, {{ name }}</h2>
<div class="panels">
<div v-for="panel in panels" :key="panel.id" class="panel">
@ -22,8 +22,6 @@ import { getCurrentUser } from '@nextcloud/auth'
const panels = loadState('dashboard', 'panels')
console.debug('Loading dashboard panels', panels)
export default {
name: 'App',
data() {
@ -39,18 +37,18 @@ export default {
const time = this.timer.getHours()
if (time > 18) {
return t('dashboard', '🌙 Time to call it a day')
return { icon: '🌙', text: t('dashboard', 'Good evening') }
}
if (time > 12) {
return t('dashboard', 'Good afternoon')
return { icon: '☀', text: t('dashboard', 'Good afternoon') }
}
if (time === 12) {
return t('dashboard', '🍽 Time for lunch')
return { icon: '🍽', text: t('dashboard', 'Time for lunch') }
}
if (time > 5) {
return t('dashboard', '🌄 Good morning')
return { icon: '🌄', text: t('dashboard', 'Good morning') }
}
return t('dashboard', '🦉 Have a night owl')
return { icon: '🦉', text: t('dashboard', 'Have a night owl') }
},
},
watch: {