Add theme thumbnail in personal settings, fix #161

This commit is contained in:
Magnus Walbeck 2020-10-18 14:11:01 +02:00
parent 76511e26b3
commit acd8d70dfe
No known key found for this signature in database
GPG Key ID: CCB78CFF3F950769
13 changed files with 36 additions and 202 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
release
node_modules
translationfiles
translationtool.phar

View File

@ -2,6 +2,10 @@
## [Unreleased]
### Added
- [#161](https://github.com/mwalbeck/nextcloud-breeze-dark/issues/164) Add thumbnail image in personal settings
## 20.0.0 - 2020-10-17
### Added

BIN
img/theme-breeze-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -3,10 +3,11 @@ OC.L10N.register(
{
"Breeze Dark" : "Breeze Dark",
"Breeze Dark theme for Nextcloud, based on the theme by KDE" : "Breeze Dark tema til Nextcloud, baseret på temaet lavet af KDE",
"This is a breeze dark theme for Nextcloud, based on the theme by the KDE project." : "Dette er et breeze dark tema til Nextcloud, baseret på temaet lavet af KDE",
"A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect." : "Et mørkt tema baseret på Breeze Dark temaet der er lavet af KDE projektet. Genindlæs venligst siden for at ændringen kan tage effekt.",
"This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference" : "Denne indstilling aktiverer temaet som standard, for alle brugere der ikke er logget ind og brugere der ikke har indstillet deres præference",
"This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference." : "Denne indstilling aktiverer temaet som standard, for alle brugere der ikke er logget ind og brugere der ikke har indstillet deres præference.",
"Enable Breeze Dark theme by default" : "Aktiver Breeze Dark temaet som standard",
"A Breeze Dark theme for Nextcloud." : "Et Breeze Dark tema til Nextcloud.",
"Breeze Dark theme" : "Breeze Dark tema",
"Enable Breeze Dark theme" : "Aktiver Breeze Dark temaet"
},
"");

View File

@ -1,10 +1,11 @@
{ "translations": {
"Breeze Dark" : "Breeze Dark",
"Breeze Dark theme for Nextcloud, based on the theme by KDE" : "Breeze Dark tema til Nextcloud, baseret på temaet lavet af KDE",
"This is a breeze dark theme for Nextcloud, based on the theme by the KDE project." : "Dette er et breeze dark tema til Nextcloud, baseret på temaet lavet af KDE",
"A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect." : "Et mørkt tema baseret på Breeze Dark temaet der er lavet af KDE projektet. Genindlæs venligst siden for at ændringen kan tage effekt.",
"This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference" : "Denne indstilling aktiverer temaet som standard, for alle brugere der ikke er logget ind og brugere der ikke har indstillet deres præference",
"This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference." : "Denne indstilling aktiverer temaet som standard, for alle brugere der ikke er logget ind og brugere der ikke har indstillet deres præference.",
"Enable Breeze Dark theme by default" : "Aktiver Breeze Dark temaet som standard",
"A Breeze Dark theme for Nextcloud." : "Et Breeze Dark tema til Nextcloud.",
"Breeze Dark theme" : "Breeze Dark tema",
"Enable Breeze Dark theme" : "Aktiver Breeze Dark temaet"
},"pluralForm" :""
}

View File

@ -1,12 +0,0 @@
OC.L10N.register(
"breezedark",
{
"Breeze Dark" : "Breeze Dark",
"Breeze Dark theme for Nextcloud, based on the theme by KDE" : "Breeze Dark theme for Nextcloud, based on the theme by KDE",
"This is a breeze dark theme for Nextcloud, based on the theme by the KDE project." : "This is a breeze dark theme for Nextcloud, based on the theme by the KDE project.",
"A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect." : "A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect.",
"This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference" : "This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference",
"Enable Breeze Dark theme by default" : "Enable Breeze Dark theme by default",
"Enable Breeze Dark theme" : "Enable Breeze Dark theme"
},
"");

View File

@ -1,10 +0,0 @@
{ "translations": {
"Breeze Dark" : "Breeze Dark",
"Breeze Dark theme for Nextcloud, based on the theme by KDE" : "Breeze Dark theme for Nextcloud, based on the theme by KDE",
"This is a breeze dark theme for Nextcloud, based on the theme by the KDE project." : "This is a breeze dark theme for Nextcloud, based on the theme by the KDE project.",
"A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect." : "A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect.",
"This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference" : "This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference",
"Enable Breeze Dark theme by default" : "Enable Breeze Dark theme by default",
"Enable Breeze Dark theme" : "Enable Breeze Dark theme"
},"pluralForm" :""
}

View File

@ -30,6 +30,7 @@ use OCP\Settings\ISettings;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IUserSession;
use OCP\App\IAppManager;
class Personal implements ISettings {
@ -39,20 +40,26 @@ class Personal implements ISettings {
/** @var IConfig */
private $config;
/** @var IUserSession */
/** @var string */
private $userId;
/** @var string */
private $appPath;
/**
* @param string $appName
* @param IConfig $config
* @param IUserSession $userSession
* @param IAppManager $appManager
*/
public function __construct(string $appName,
IConfig $config,
IUserSession $userSession) {
IUserSession $userSession,
IAppManager $appManager) {
$this->appName = $appName;
$this->config = $config;
$this->userId = $userSession->getUser()->getUID();
$this->appWebPath = $appManager->getAppWebPath($appName);
}
/**
@ -62,7 +69,8 @@ class Personal implements ISettings {
$default = $this->config->getAppValue($this->appName, 'theme_enabled', "0");
$themeEnabled = $this->config->getUserValue($this->userId, $this->appName, 'theme_enabled', $default);
return new TemplateResponse('breezedark', 'personal', [
"themeEnabled" => $themeEnabled
"themeEnabled" => $themeEnabled,
"appWebPath" => $this->appWebPath
]);
}

View File

@ -30,7 +30,7 @@ script('breezedark', 'settings-admin');
<div id="breezedark" class="section">
<h2><?php p($l->t("Breeze Dark")); ?></h2>
<p><?php p($l->t("A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect.")); ?></p>
<p><?php p($l->t("This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference")); ?></p>
<p><?php p($l->t("This setting will enable the theme by default, for any unauthenticated users and users who haven't set a preference.")); ?></p>
<input type="checkbox" class="checkbox" id="breezedark-enabled" <?php p($themeEnabled ? "checked" : ""); ?>>
<label for="breezedark-enabled"><?php p($l->t("Enable Breeze Dark theme by default")); ?></label>
</div>

View File

@ -29,7 +29,16 @@ script('breezedark', 'settings-personal');
<div id="breezedark" class="section">
<h2><?php p($l->t("Breeze Dark")); ?></h2>
<p><?php p($l->t("A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect.")); ?></p>
<input type="checkbox" class="checkbox" id="breezedark-enabled" <?php p($themeEnabled ? "checked" : ""); ?>>
<label for="breezedark-enabled"><?php p($l->t("Enable Breeze Dark theme")); ?></label>
<p><?php p($l->t("A Breeze Dark theme for Nextcloud.")); ?></p>
<div class="preview-list">
<div class="preview">
<div class="preview-image" style='background-image: url("<?php p($appWebPath); ?>/img/theme-breeze-dark.png");'></div>
<div class="preview-description">
<h3><?php p($l->t("Breeze Dark theme")); ?></h3>
<p><?php p($l->t("A Dark theme based on Breeze Dark by the KDE project. Please refresh the page for changes to take effect.")); ?></p>
<input type="checkbox" class="checkbox" id="breezedark-enabled" <?php p($themeEnabled ? "checked" : ""); ?>>
<label for="breezedark-enabled"><?php p($l->t("Enable Breeze Dark theme")); ?></label>
</div>
</div>
</div>
</div>

View File

@ -1,56 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the Nextcloud package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: breezedark\n"
"Report-Msgid-Bugs-To: translations\\@example.com\n"
"POT-Creation-Date: 2020-04-26 16:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Danish\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:2
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:31
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:31
msgid "Breeze Dark"
msgstr "Breeze Dark"
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:3
msgid "Breeze Dark theme for Nextcloud, based on the theme by KDE"
msgstr "Breeze Dark tema til Nextcloud, baseret på temaet lavet af KDE"
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:4
msgid ""
"This is a breeze dark theme for Nextcloud, based on the theme by the KDE "
"project."
msgstr "Dette er et breeze dark tema til Nextcloud, baseret på temaet lavet af KDE"
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:32
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:32
msgid ""
"A Dark theme based on Breeze Dark by the KDE project. Please refresh the "
"page for changes to take effect."
msgstr "Et mørkt tema baseret på Breeze Dark temaet der er lavet af KDE projektet. Genindlæs venligst siden for at ændringen kan tage effekt."
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:33
msgid ""
"This setting will enable the theme by default, for any unauthenticated users "
"and users who haven't set a preference"
msgstr "Denne indstilling aktiverer temaet som standard, for alle brugere der ikke er logget ind og "
"brugere der ikke har indstillet deres præference"
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:35
msgid "Enable Breeze Dark theme by default"
msgstr "Aktiver Breeze Dark temaet som standard"
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:34
msgid "Enable Breeze Dark theme"
msgstr "Aktiver Breeze Dark temaet"

View File

@ -1,58 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the Nextcloud package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: breezedark\n"
"Report-Msgid-Bugs-To: translations\\@example.com\n"
"POT-Creation-Date: 2020-04-26 16:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: English\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:2
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:31
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:31
msgid "Breeze Dark"
msgstr "Breeze Dark"
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:3
msgid "Breeze Dark theme for Nextcloud, based on the theme by KDE"
msgstr "Breeze Dark theme for Nextcloud, based on the theme by KDE"
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:4
msgid ""
"This is a breeze dark theme for Nextcloud, based on the theme by the KDE "
"project."
msgstr "This is a breeze dark theme for Nextcloud, based on the theme by the KDE "
"project."
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:32
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:32
msgid ""
"A Dark theme based on Breeze Dark by the KDE project. Please refresh the "
"page for changes to take effect."
msgstr "A Dark theme based on Breeze Dark by the KDE project. Please refresh the "
"page for changes to take effect."
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:33
msgid ""
"This setting will enable the theme by default, for any unauthenticated users "
"and users who haven't set a preference"
msgstr "This setting will enable the theme by default, for any unauthenticated users "
"and users who haven't set a preference"
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:35
msgid "Enable Breeze Dark theme by default"
msgstr "Enable Breeze Dark theme by default"
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:34
msgid "Enable Breeze Dark theme"
msgstr "Enable Breeze Dark theme"

View File

@ -1,55 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the Nextcloud package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Nextcloud 3.14159\n"
"Report-Msgid-Bugs-To: translations\\@example.com\n"
"POT-Creation-Date: 2020-04-26 16:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:2
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:31
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:31
msgid "Breeze Dark"
msgstr ""
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:3
msgid "Breeze Dark theme for Nextcloud, based on the theme by KDE"
msgstr ""
#: /home/magnus/projects/personal/nextcloud/breezedark/specialAppInfoFakeDummyForL10nScript.php:4
msgid ""
"This is a breeze dark theme for Nextcloud, based on the theme by the KDE "
"project."
msgstr ""
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:32
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:32
msgid ""
"A Dark theme based on Breeze Dark by the KDE project. Please refresh the "
"page for changes to take effect."
msgstr ""
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:33
msgid ""
"This setting will enable the theme by default, for any unauthenticated users "
"and users who haven't set a preference"
msgstr ""
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/admin.php:35
msgid "Enable Breeze Dark theme by default"
msgstr ""
#: /home/magnus/projects/personal/nextcloud/breezedark/templates/personal.php:34
msgid "Enable Breeze Dark theme"
msgstr ""