Improve profile layout

This commit is contained in:
Dennis Eichhorn 2017-09-28 11:00:44 +02:00
parent 113e03d379
commit 270308822a
2 changed files with 5 additions and 5 deletions

View File

@ -15,6 +15,7 @@ declare(strict_types=1);
namespace Modules\Profile\Models;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\NullAccount;
use Modules\Media\Models\Media;
use Modules\Media\Models\NullMedia;
@ -78,7 +79,7 @@ class Profile
public function getAccount() : Account
{
return $this->account;
return $this->account ?? new NullAccount();
}
public function setBirthday(\DateTime $birthday) /* : void */

View File

@ -29,13 +29,12 @@ echo $this->getData('nav')->render();
<div class="row">
<div class="col-xs-12 col-md-6">
<section itemscope itemtype="http://schema.org/Person" class="box wf-100">
<header><h1><?= $this->getHtml('Profile') ?></h1></header>
<header><h1><span itemprop="familyName"><?= $this->printHtml($account->getAccount()->getName3()); ?></span>, <span itemprop="givenName"><?= $this->printHtml($account->getAccount()->getName1()); ?></span></h1></header>
<div class="inner">
<!-- @formatter:off -->
<span class="rf"><img class="m-profile rf" alt="<?= $this->getHtml('ProfileImage'); ?>" src="<?= $account->getImage() instanceof \Modules\Media\Models\NullMedia ? \phpOMS\Uri\UriFactory::build('{/base}/Web/Backend/img/user_default_' . mt_rand(1, 6) .'.png') : \phpOMS\Uri\UriFactory::build('{/base}/' . $account->getImage()->getPath()); ?>">
</span>
<table class="list">
<tr>
<th><?= $this->getHtml('Name') ?><img class="m-profile" alt="<?= $this->getHtml('ProfileImage'); ?>" src="<?= $account->getImage() instanceof \Modules\Media\Models\NullMedia ? \phpOMS\Uri\UriFactory::build('{/base}/Web/Backend/img/user_default_' . mt_rand(1, 6) .'.png') : \phpOMS\Uri\UriFactory::build('{/base}/' . $account->getImage()->getPath()); ?>">
<td><span itemprop="familyName"><?= $this->printHtml($account->getAccount()->getName3()); ?></span>, <span itemprop="givenName"><?= $this->printHtml($account->getAccount()->getName1()); ?></span>
<tr>
<th><?= $this->getHtml('Occupation') ?>
<td itemprop="jobTitle">Sailor