Done some code cleanup

This commit is contained in:
Marcin Kurczewski 2014-08-09 19:20:00 +02:00
parent 68c34a9f93
commit abbaa35188
3 changed files with 18 additions and 25 deletions

View file

@ -1,20 +1,18 @@
#sidebar { sidebar {
width: 224px; width: 224px;
line-height: 1.33em; line-height: 1.33em;
font-size: 90%; font-size: 90%;
} }
img, .post-type-image img,
embed { .post-type-video video {
max-width: 100%; max-width: 100%;
} }
.post-type-image img { .post-type-youtube iframe {
/*background: url('../img/bk-image.png') lemonchiffon;*/ width: 800px;
} height: 600px;
.post-type-flash iframe {
border: 0; border: 0;
/*background: url('../img/bk-swf.png') lemonchiffon;*/
} }
#sidebar .relations ul, #sidebar .relations ul,

View file

@ -7,19 +7,11 @@ $post = $this->context->transport->post;
<?php if ($post->getType()->toInteger() == PostType::Image): ?> <?php if ($post->getType()->toInteger() == PostType::Image): ?>
<?php if (!empty($this->context->imageLink)): ?>
<a href="<?= $this->context->imageLink ?>">
<?php endif ?>
<img alt="<?= $post->getName() ?>" <img alt="<?= $post->getName() ?>"
src="<?= Core::getRouter()->linkTo( src="<?= Core::getRouter()->linkTo(
['PostController', 'fileView'], ['PostController', 'fileView'],
['name' => $post->getName()]) ?>"/> ['name' => $post->getName()]) ?>"/>
<?php if (!empty($this->context->imageLink)): ?>
</a>
<?php endif ?>
<?php elseif ($post->getType()->toInteger() == PostType::Flash): ?> <?php elseif ($post->getType()->toInteger() == PostType::Flash): ?>
<object <object
@ -39,16 +31,12 @@ $post = $this->context->transport->post;
<?php elseif ($post->getType()->toInteger() == PostType::Youtube): ?> <?php elseif ($post->getType()->toInteger() == PostType::Youtube): ?>
<iframe <iframe src="//www.youtube.com/embed/<?= $post->getFileHash() ?>?wmode=opaque" allowfullscreen>
style="width: 800px; height: 600px; border: 0;"
src="//www.youtube.com/embed/<?= $post->getFileHash() ?>?wmode=opaque"
allowfullscreen>
</iframe> </iframe>
<?php elseif ($post->getType()->toInteger() == PostType::Video): ?> <?php elseif ($post->getType()->toInteger() == PostType::Video): ?>
<video style="max-width: 100%" controls> <video controls>
<source <source
type="<?= $post->getMimeType() ?>" type="<?= $post->getMimeType() ?>"
src="<?= Core::getRouter()->linkTo( src="<?= Core::getRouter()->linkTo(

View file

@ -18,12 +18,19 @@ $this->assets->addStylesheet('static-main.css');
<div class="body"> <div class="body">
<?php <?php
$this->context->transport->post = $this->context->featuredPost; $this->context->transport->post = $this->context->featuredPost;
$this->context->imageLink = Core::getRouter()->linkTo(
['PostController', 'genericView'],
['identifier' => $this->context->featuredPost->getId()]);
?> ?>
<?php if ($this->context->featuredPost->getType()->toInteger() == PostType::Image): ?>
<a href="<?= Core::getRouter()->linkTo(
['PostController', 'genericView'],
['identifier' => $this->context->featuredPost->getId()]) ?>">
<?php endif ?>
<?php $this->renderExternal('post-file-render') ?> <?php $this->renderExternal('post-file-render') ?>
<?php if ($this->context->featuredPost->getType()->toInteger() == PostType::Image): ?>
</a>
<?php endif ?>
</div> </div>
<div class="footer"> <div class="footer">