From f639f4ee572d59cc4a7eefaef160687a1b54b4b9 Mon Sep 17 00:00:00 2001 From: Sergio Brighenti Date: Wed, 28 Nov 2018 14:57:04 +0100 Subject: [PATCH] Improved user gallery Small layout changes updated dependencies --- CHANGELOG.md | 9 +++++ app/Web/Lang.php | 9 +++++ bootstrap/app.php | 2 +- composer.lock | 22 ++++++------- resources/lang/it.lang.php | 4 +-- resources/templates/base.twig | 2 +- resources/templates/comp/navbar.twig | 4 +-- resources/templates/dashboard/admin.twig | 9 +++-- resources/templates/dashboard/home.twig | 40 ++++++++++++++--------- resources/templates/dashboard/system.twig | 12 +++---- resources/templates/upload/public.twig | 8 ++--- resources/templates/user/create.twig | 2 +- resources/templates/user/edit.twig | 4 +-- resources/templates/user/index.twig | 2 +- src/css/app.css | 22 ++++++------- src/js/app.js | 10 ++++-- 16 files changed, 95 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11c9080..7f71601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## v2.3 ++ Improved image scaling in user gallery. ++ Added overlay on user gallery images. ++ Fixed IT translation. ++ Fontawesome icon match the single file mime-type. ++ Enable audio player with video.js. ++ Video and audio now starts with volume at 50%. ++ Minor layout fixes. + ## v2.2 + Added multi-language support. + Improved routing. diff --git a/app/Web/Lang.php b/app/Web/Lang.php index bbf8074..d88be11 100644 --- a/app/Web/Lang.php +++ b/app/Web/Lang.php @@ -67,6 +67,15 @@ class Lang return self::$instance; } + /** + * Recognize the current language from the request. + * @return bool|string + */ + public static function recognize() + { + return substr(@$_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); + } + /** * @param $key diff --git a/bootstrap/app.php b/bootstrap/app.php index 5bdf8b1..28cb90f 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -58,7 +58,7 @@ $container['database'] = function ($container) use (&$config) { return DB::getInstance(); }; -Lang::build(substr(@$_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2), __DIR__. '/../resources/lang/'); +Lang::build(Lang::recognize(), __DIR__. '/../resources/lang/'); $container['view'] = function ($container) use (&$config) { $view = new \Slim\Views\Twig(__DIR__ . '/../resources/templates', [ diff --git a/composer.lock b/composer.lock index ce43ee6..961f044 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "61a3ac382bb0960dd8e44736c0be5178", + "content-hash": "b7bca0067b8963611274642752122ecb", "packages": [ { "name": "container-interop/container-interop", @@ -174,16 +174,16 @@ }, { "name": "league/flysystem", - "version": "1.0.48", + "version": "1.0.49", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a6ded5b2f6055e2db97b4b859fdfca2b952b78aa" + "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a6ded5b2f6055e2db97b4b859fdfca2b952b78aa", - "reference": "a6ded5b2f6055e2db97b4b859fdfca2b952b78aa", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a63cc83d8a931b271be45148fa39ba7156782ffd", + "reference": "a63cc83d8a931b271be45148fa39ba7156782ffd", "shasum": "" }, "require": { @@ -254,7 +254,7 @@ "sftp", "storage" ], - "time": "2018-10-15T13:53:10+00:00" + "time": "2018-11-23T23:41:29+00:00" }, { "name": "monolog/monolog", @@ -531,16 +531,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -574,7 +574,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "slim/slim", diff --git a/resources/lang/it.lang.php b/resources/lang/it.lang.php index 8f2fcd0..736f0a8 100644 --- a/resources/lang/it.lang.php +++ b/resources/lang/it.lang.php @@ -28,7 +28,7 @@ return [ 'public.delete_text' => 'Sei sicuro di voler eliminare questo elemento? AndrĂ  perso per sempre!', 'preview' => 'Anteprima', - 'filename' => 'Filename', + 'filename' => 'Nome file', 'size' => 'Dimensione', 'public' => 'Pubblico', 'owner' => 'Proprietario', @@ -57,7 +57,7 @@ return [ 'copy' => 'Copia', 'update' => 'Aggiorna', 'edit' => 'Modifica', - 'client_config' => 'Configurazione del Client', + 'client_config' => 'Config. client', 'user_code' => 'Codice Utente', 'active' => 'Attivo', 'admin' => 'Amministratore', diff --git a/resources/templates/base.twig b/resources/templates/base.twig index 1823a93..831a688 100644 --- a/resources/templates/base.twig +++ b/resources/templates/base.twig @@ -17,7 +17,7 @@ - + {% block head %}{% endblock %} diff --git a/resources/templates/comp/navbar.twig b/resources/templates/comp/navbar.twig index 34a28f5..18d155f 100644 --- a/resources/templates/comp/navbar.twig +++ b/resources/templates/comp/navbar.twig @@ -1,4 +1,4 @@ -