Browse Source

add var for theming images , advanced options

Signed-off-by: Guillaume COMPAGNON <gcompagnon@outlook.com>
pull/16815/head
Guillaume COMPAGNON 6 years ago
committed by Daniel Kesselberg
parent
commit
ed399a31bd
No known key found for this signature in database GPG Key ID: 36E3664E099D0614
  1. 4
      apps/theming/css/theming.scss
  2. 2
      apps/theming/lib/Capabilities.php
  3. 6
      apps/theming/lib/ThemingDefaults.php
  4. 4
      apps/theming/tests/ThemingDefaultsTest.php
  5. 2
      core/css/css-variables.scss
  6. 2
      core/css/variables.scss

4
apps/theming/css/theming.scss

@ -153,7 +153,7 @@ $invert: luma($color-primary) > 0.6;
@if variable_exists('theming-logoheader-mime') and $theming-logoheader-mime != '' {
#theming .advanced-option-logoheader .image-preview,
body:not(#body-login) #header .logo {
background-image: url(#{$image-logoheader});
background-image: $image-logoheader;
}
} @else {
#theming .advanced-option-favicon .image-preview {
@ -163,7 +163,7 @@ $invert: luma($color-primary) > 0.6;
@if variable_exists('theming-favicon-mime') and $theming-favicon-mime != '' {
#theming .advanced-option-favicon .image-preview {
background-image: url(#{$image-favicon});
background-image: $image-favicon;
}
} @else {
#theming .advanced-option-favicon .image-preview {

2
apps/theming/lib/Capabilities.php

@ -83,6 +83,8 @@ class Capabilities implements IPublicCapability {
$this->url->getAbsoluteURL($this->theming->getBackground()),
'background-plain' => $backgroundLogo === 'backgroundColor',
'background-default' => !$this->util->isBackgroundThemed(),
'logoheader' => $this->url->getAbsoluteURL($this->theming->getLogo()),
'favicon' => $this->url->getAbsoluteURL($this->theming->getLogo()),
],
];
}

6
apps/theming/lib/ThemingDefaults.php

@ -285,10 +285,10 @@ class ThemingDefaults extends \OC_Defaults {
'theming-logoheader-mime' => "'" . $this->config->getAppValue('theming', 'logoheaderMime') . "'",
'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'"
];
$variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')";
$variables['image-logoheader'] = "'".$this->imageManager->getImageUrl('logoheader')."'";
$variables['image-favicon'] = "'".$this->imageManager->getImageUrl('favicon')."'";
$variables['image-logoheader'] = "url('".$this->imageManager->getImageUrl('logoheader')."')";
$variables['image-favicon'] = "url('".$this->imageManager->getImageUrl('favicon')."')";
$variables['image-login-background'] = "url('".$this->imageManager->getImageUrl('background')."')";
$variables['image-login-plain'] = 'false';

4
apps/theming/tests/ThemingDefaultsTest.php

@ -680,8 +680,8 @@ class ThemingDefaultsTest extends TestCase {
'color-primary-element' => '#aaaaaa',
'theming-logoheader-mime' => '\'jpeg\'',
'theming-favicon-mime' => '\'jpeg\'',
'image-logoheader' => '\'custom-logoheader?v=0\'',
'image-favicon' => '\'custom-favicon?v=0\'',
'image-logoheader' => "url('custom-logoheader?v=0')",
'image-favicon' => "url('custom-favicon?v=0')",
'has-legal-links' => 'false'
];
$this->assertEquals($expected, $this->template->getScssVariables());

2
core/css/css-variables.scss

@ -27,6 +27,8 @@
--image-logo: $image-logo;
--image-login-background: $image-login-background;
--image-logoheader: $image-logoheader;
--image-favicon: $image-favicon;
--color-loading-light: $color-loading-light;
--color-loading-dark: $color-loading-dark;

2
core/css/variables.scss

@ -65,6 +65,8 @@ $color-text-lighter: nc-lighten($color-main-text, 30%) !default;
$image-logo: url('../img/logo/logo.svg?v=1') !default;
$image-login-background: url('../img/background.png?v=2') !default;
$image-logoheader: url('../img/logo/logo.svg?v=1') !default;
$image-favicon: url('../img/logo/logo.svg?v=1') !default;
$color-loading-light: #ccc !default;
$color-loading-dark: #444 !default;

Loading…
Cancel
Save