[Cover] Added temporary css

This commit is contained in:
Daniel 2020-11-28 17:56:09 +00:00 committed by Hugo Sales
parent aeec9149fc
commit e2ce1a8070
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
4 changed files with 46 additions and 9 deletions

View File

@ -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()];

View File

@ -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;

View File

@ -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;

View File

@ -1,6 +1,8 @@
<div class="Cover">
<a href="{{ path('settings_avatar') }}">
<img src='{{ vars.href }}' alt="Your cover." class="">
</a>
</div>
<a class="cover">
{% if vars is not empty %}
<img class="cover-img" src='{{ vars.img }}' alt="Your cover." class="">
{% else %}
<div class="no-cover" ></div>
{% endif %}
</a>