fix issue #51: add link on the logo

This commit is contained in:
Simon Vieille 2020-12-03 13:33:28 +01:00
parent 48d80edb0a
commit 6984efdafd
Signed by: deblan
GPG Key ID: 03383D15A1D31745
7 changed files with 40 additions and 3 deletions

View File

@ -97,6 +97,7 @@ class JsController extends Controller
$targetBlankApps = $this->config->getAppValueArray('target-blank-apps', '[]');
$useAvatar = $this->config->getAppValueBool('use-avatar', '0');
$isForced = $this->config->getAppValueBool('force', '0');
$addLogoLink = $this->config->getAppValueBool('add-logo-link', '1');
$avatar = null;
$settings = null;
@ -141,6 +142,8 @@ class JsController extends Controller
}
}
$indexUrl = OC::$server->getURLGenerator()->linkTo('', 'index.php');
return [
'opener-position' => $this->config->getAppValue('opener-position', 'before'),
'opener-hover' => $this->config->getAppValueBool('opener-hover', '0'),
@ -156,6 +159,7 @@ class JsController extends Controller
'target-blank-apps' => $targetBlankApps,
'settings' => $settings,
'logo' => $this->themingDefaults->getLogo(),
'logo-link' => $addLogoLink ? $indexUrl : null,
];
}
}

View File

@ -79,6 +79,7 @@ class Admin implements ISettings
'big-menu' => $this->config->getAppValue('big-menu', '0'),
'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'),
'display-logo' => $this->config->getAppValue('display-logo', '1'),
'add-logo-link' => $this->config->getAppValue('add-logo-link', '1'),
'use-avatar' => $this->config->getAppValue('use-avatar', '0'),
'opener-position' => $this->config->getAppValue('opener-position', 'before'),
'opener-hover' => $this->config->getAppValue('opener-hover', '0'),

View File

@ -16,7 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template>
<div v-bind:class="classes">
<img v-bind:src="image">
<a v-if="link !== null" v-bind:href="link">
<img v-bind:src="image">
</a>
<img v-else v-bind:src="image">
</div>
</template>
@ -28,6 +31,10 @@ export default {
type: String,
required: true
},
link: {
type: String,
required: false
},
classes: {
type: Object,
required: true

View File

@ -25,8 +25,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<OpenerButton />
<Logo v-if="!avatar && logo" v-bind:classes="{'side-menu-logo': true, 'avatardiv': false}" v-bind:image="logo" />
<Logo v-if="avatar" v-bind:classes="{'side-menu-logo': true, 'avatardiv': true}" v-bind:image="avatar" />
<Logo
v-if="!avatar && logo" v-bind:classes="{'side-menu-logo': true, 'avatardiv': false}"
v-bind:image="logo"
v-bind:link="logoLink"
/>
<Logo
v-if="avatar" v-bind:classes="{'side-menu-logo': true, 'avatardiv': true}"
v-bind:image="avatar"
v-bind:link="logoLink"
/>
</div>
<ul class="side-menu-apps-list">
@ -62,6 +71,7 @@ export default {
return {
apps: [],
logo: null,
logoLink: null,
avatar: null,
forceLightIcon: false,
targetBlankApps: [],
@ -135,6 +145,7 @@ export default {
that.forceLightIcon = config['force-light-icon']
that.avatar = config['avatar']
that.logo = config['logo']
that.logoLink = config['logo-link']
that.settings = config['settings']
});
},

View File

@ -66,3 +66,4 @@
"Except when the configuration is forced.": "Außer wenn die Konfiguration erzwungen wird."
"Apps that should not be displayed in the menu": "Apps, die nicht im Menü angezeigt werden sollen"
"This feature is only compatible with the <code>big menu</code> display.": "Kompatibel mit der Anzeige <code> Großes Menü </ code>."
"The logo is a link to the default app": "Das Logo ist ein Link zur Standard-App"

View File

@ -66,3 +66,4 @@
"Except when the configuration is forced.": "Sauf lorsque la configuration est forcée."
"Apps that should not be displayed in the menu": "Applications qui ne doivent pas être affichées dans le menu"
"This feature is only compatible with the <code>big menu</code> display.": "Compatible avec l'affichage <code>Menu large</code>."
"The logo is a link to the default app": "Le logo est un lien vers l'application par défaut"

View File

@ -359,6 +359,18 @@ $choicesSizes = [
</select>
</div>
<p><em><?php p($l->t('The logo is a link to the default app')); ?></em></p>
<div>
<select id="side-menu-add-logo-link" name="add-logo-link" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['add-logo-link']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-top-menu-apps">
<?php p($l->t('Apps that should not be displayed in the menu')); ?>