From e2ce1a8070b6e63846de08633b99ce0dc71aff6d Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 28 Nov 2020 17:56:09 +0000 Subject: [PATCH] [Cover] Added temporary css --- plugins/Cover/Controller/Cover.php | 5 +++-- plugins/Cover/Cover.php | 9 +++++++-- public/assets/css/left/left.css | 29 +++++++++++++++++++++++++++++ templates/cover/view.html.twig | 12 +++++++----- 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/plugins/Cover/Controller/Cover.php b/plugins/Cover/Controller/Cover.php index 609be8d41e..c03dbada79 100644 --- a/plugins/Cover/Controller/Cover.php +++ b/plugins/Cover/Controller/Cover.php @@ -27,6 +27,7 @@ use function App\Core\I18n\_m; use App\Entity\Cover as CoverEntity; use App\Util\Common; use App\Util\Exception\ClientException; +use App\Util\Exception\RedirectException; use Component\Media\Media; use Component\Media\Media as M; use Symfony\Component\Form\Extension\Core\Type\FileType; @@ -77,8 +78,8 @@ class Cover if ($old_file != null) { @unlink($old_file); } - - var_dump($cover->getFilePath()); + throw new RedirectException(); + //var_dump($cover->getFilePath()); } return ['_template' => 'cover/cover.html.twig', 'form' => $form->createView()]; diff --git a/plugins/Cover/Cover.php b/plugins/Cover/Cover.php index b725e5891c..b18c1ee152 100644 --- a/plugins/Cover/Cover.php +++ b/plugins/Cover/Cover.php @@ -55,12 +55,17 @@ class Cover extends Module $vars['profile_tabs'] = [['title' => 'Cover', 'href' => 'settings_cover', ]]; - $vars['profile_temp'] = []; //fixme if (Common::user() != null) { + if (array_key_exists('profile_temp',$vars)) { + $vars['profile_temp'] = []; + } + $cover = DB::find('cover', ['gsactor_id' => Common::user()->getId()]); if ($cover != null) { - $vars['profile_temp'][] = ['name' => 'cover', 'vars' => ['href' => '/cover']]; + $vars['profile_temp'][] = ['name' => 'cover', 'vars' => ['img' => '/cover']]; + } else { + $vars['profile_temp'][] = ['name' => 'cover', 'vars' => []]; } } return Event::next; diff --git a/public/assets/css/left/left.css b/public/assets/css/left/left.css index 9d9b6bc8e1..fc6139ca22 100644 --- a/public/assets/css/left/left.css +++ b/public/assets/css/left/left.css @@ -77,6 +77,35 @@ margin-bottom: var(--unit-size); vertical-align: middle; } +/*teisitn*/ +.cover{ + width: 100%; + height: 100%; + position: absolute; + top:0; + left: 0; + z-index: -1; +} + +.cover-img{ + width: 100%; + height: 100%; + object-fit: cover; +} + +.no-cover{ + width: 100%; + height: 100%; + background-color: var(--bg2); +} + +.profile{ + position:relative; + background-color: transparent !important; +} + + +/**/ .icon-avatar { order: 1; diff --git a/templates/cover/view.html.twig b/templates/cover/view.html.twig index 93763de6d9..1274454de7 100644 --- a/templates/cover/view.html.twig +++ b/templates/cover/view.html.twig @@ -1,6 +1,8 @@ -
- - Your cover. - -
\ No newline at end of file + + {% if vars is not empty %} + Your cover. + {% else %} +
+ {% endif %} +
\ No newline at end of file