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;
line-height: 1.33em;
font-size: 90%;
}
img,
embed {
.post-type-image img,
.post-type-video video {
max-width: 100%;
}
.post-type-image img {
/*background: url('../img/bk-image.png') lemonchiffon;*/
}
.post-type-flash iframe {
.post-type-youtube iframe {
width: 800px;
height: 600px;
border: 0;
/*background: url('../img/bk-swf.png') lemonchiffon;*/
}
#sidebar .relations ul,

View file

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

View file

@ -18,12 +18,19 @@ $this->assets->addStylesheet('static-main.css');
<div class="body">
<?php
$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 if ($this->context->featuredPost->getType()->toInteger() == PostType::Image): ?>
</a>
<?php endif ?>
</div>
<div class="footer">