Separate icon from translatable text
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
829bf1ad11
commit
a0cd760481
|
@ -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');
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="app-dashboard">
|
<div id="app-dashboard">
|
||||||
<h2>{{ greeting }}, {{ name }}</h2>
|
<h2>{{ greeting.icon }} {{ greeting.text }}, {{ name }}</h2>
|
||||||
|
|
||||||
<div class="panels">
|
<div class="panels">
|
||||||
<div v-for="panel in panels" :key="panel.id" class="panel">
|
<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')
|
const panels = loadState('dashboard', 'panels')
|
||||||
|
|
||||||
console.debug('Loading dashboard panels', panels)
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
data() {
|
data() {
|
||||||
|
@ -39,18 +37,18 @@ export default {
|
||||||
const time = this.timer.getHours()
|
const time = this.timer.getHours()
|
||||||
|
|
||||||
if (time > 18) {
|
if (time > 18) {
|
||||||
return t('dashboard', '🌙 Time to call it a day')
|
return { icon: '🌙', text: t('dashboard', 'Good evening') }
|
||||||
}
|
}
|
||||||
if (time > 12) {
|
if (time > 12) {
|
||||||
return t('dashboard', '☀ Good afternoon')
|
return { icon: '☀', text: t('dashboard', 'Good afternoon') }
|
||||||
}
|
}
|
||||||
if (time === 12) {
|
if (time === 12) {
|
||||||
return t('dashboard', '🍽 Time for lunch')
|
return { icon: '🍽', text: t('dashboard', 'Time for lunch') }
|
||||||
}
|
}
|
||||||
if (time > 5) {
|
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: {
|
watch: {
|
||||||
|
|
Loading…
Reference in New Issue