1
0

Finished BlogPost

This commit is contained in:
Mike Schwörer 2014-07-19 18:25:35 +02:00
parent c2a829ac6a
commit 09488796d8
6 changed files with 70 additions and 7 deletions

View File

@ -635,4 +635,36 @@ ul.nav li.dropdown-append:hover > ul.dropdown-menu {
margin-bottom: 28px; margin-bottom: 28px;
border-radius: 6px 6px 0px 0px; border-radius: 6px 6px 0px 0px;
}
/* blog/view
-------------------------------------------------- */
.blogOwner {
border: 1px solid #D7E0E2;
padding-top: 0px;
}
.blogFooter {
background-color: #D7E0E2;
margin-top: 40px;
margin-bottom: -19px;
margin-left: -19px;
margin-right: -19px;
min-height: 22px;
padding: 2px 8px;
}
.blogFooterLeft {
float:left;
font-weight: bold;
}
.blogFooterRight {
float: right;
} }

View File

@ -88,6 +88,7 @@ return ArrayX::merge(
'blog/index' => 'blogPost/index', 'blog/index' => 'blogPost/index',
'blog/update' => 'blogPost/update', 'blog/update' => 'blogPost/update',
'blog/<id>' => 'blogPost/view/id/<id>', 'blog/<id>' => 'blogPost/view/id/<id>',
'blog/<id>/<name>' => 'blogPost/view/id/<id>',
'downloads/details.php' => 'programs/index', // Compatibility 'downloads/details.php' => 'programs/index', // Compatibility
'downloads/downloads.php' => 'programs/index', // Compatibility 'downloads/downloads.php' => 'programs/index', // Compatibility

View File

@ -97,10 +97,26 @@ class BlogPost extends CActiveRecord
return parent::model($className); return parent::model($className);
} }
//####################################
//########### MY FUNCTIONS ###########
//####################################
/**
* @return DateTime
*/
public function getDateTime() {
return new DateTime($this->Date);
}
/** /**
* @return string * @return string
*/ */
public function getLink() { public function getLink() {
return '/blog/' . $this->ID; $name = $this->Title;
$name = str_replace(' ', '_', $name);
$name = preg_replace("/[^A-Za-z0-9_]/", '', $name);
return '/blog/' . $this->ID . '/' . $name;
} }
} }

View File

@ -15,8 +15,19 @@ $this->breadcrumbs = array(
<div class="container"> <div class="container">
<div class="well markdownOwner" id="markdownAjaxContent"> <?php echo MsHtml::pageHeader("Blog", "My personal programming blog"); ?>
<div class="blogOwner well markdownOwner" id="markdownAjaxContent">
<?php echo ParsedownHelper::parse($model->Content); ?> <?php echo ParsedownHelper::parse($model->Content); ?>
<div class="blogFooter">
<div class="blogFooterLeft">
<?php echo $model->Title; ?>
</div>
<div class="blogFooterRight">
<?php echo $model->getDateTime()->format('d.m.Y'); ?>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -55,15 +55,15 @@ $this->breadcrumbs =
); ?> ); ?>
</div> </div>
<div class="span3" style="display: none"> <div class="span3">
<?php <?php
echo MsHtml::lead('Programs'); echo MsHtml::lead('BlogPosts');
echo MsHtml::stackedTabs( echo MsHtml::stackedTabs(
[ [
['label' => 'Home', 'url' => '#'], ['label' => 'Show', 'url' => '/blog'],
['label' => 'Profile', 'url' => '#'], ['label' => 'Manage', 'url' => '/blog/admin'],
['label' => 'Messages', 'url' => '#'], ['label' => 'Create', 'url' => '/blog/create'],
] ]
); ?> ); ?>
</div> </div>

View File

@ -10,3 +10,6 @@ require_once($yiic);
// TODO-MS BefunGen -> MS.de // TODO-MS BefunGen -> MS.de
// TODO-MS jClipCorn -> MS.de // TODO-MS jClipCorn -> MS.de
// TODO-MS jQCCounter (OLD DATE !) -> MS.de // TODO-MS jQCCounter (OLD DATE !) -> MS.de
//TODO-MS Add Guest counter