Skip to content
This repository has been archived by the owner on Nov 12, 2017. It is now read-only.

Commit

Permalink
Update FrontEnd for TWBS
Browse files Browse the repository at this point in the history
  • Loading branch information
KANekT committed Apr 13, 2014
1 parent a49f402 commit 68eda77
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 52 deletions.
1 change: 1 addition & 0 deletions css/frontend.css
@@ -0,0 +1 @@
.margin10{margin-bottom:10px; margin-right:10px;}
4 changes: 2 additions & 2 deletions news.plugin.php
Expand Up @@ -17,7 +17,7 @@
Plugin::register( __FILE__,
__('News', 'news'),
__('News plugin for Monstra', 'news'),
'2.1.0',
'2.1.b',
'KANekT',
'http://kanekt.ru/',
'news');
Expand Down Expand Up @@ -46,11 +46,11 @@
}

Registry::set('dev_valid_backend', 1);
Registry::set('dev_bootstrap_file_upload', 1);
Registry::set('dev_fancy_frontend', 1);

Shortcode::add('news', 'News::_shortcode');
Javascript::add('plugins/news/js/admin.js', 'backend', 15);
Stylesheet::add('plugins/news/css/frontend.css', 'frontend',15);

class News extends Frontend {

Expand Down
8 changes: 4 additions & 4 deletions views/frontend/breadcrumbs.view.php
@@ -1,7 +1,7 @@
<ul class="breadcrumb">
<li><a href="<?php echo $opt["site_url"];?>news"><?php echo __('News', 'news');?></a> <span class="divider">/</span></li>
<ol class="breadcrumb">
<li><a href="<?php echo $opt["site_url"];?>news"><?php echo __('News', 'news');?></a></li>
<?php if ($item['parent'] != ""):
echo '<li><a href="'.$opt["site_url"].'news/'.$item['parent'].'">'.$item['parent_name'].'</a> <span class="divider">/</span></li>';
echo '<li><a href="'.$opt["site_url"].'news/'.$item['parent'].'">'.$item['parent_name'].'</a></li>';
endif; ?>
<li class="active"><?php echo $item['name'] ?></li>
</ul>
</ol>
7 changes: 7 additions & 0 deletions views/frontend/children.view.php
@@ -1,6 +1,13 @@
<?php
if (count($items) > 0) :
?>
<p>
<b><?php echo __('Children news', 'news'); ?>:</b>
<div>
<?php foreach($items as $item) { ?>
<a href="<?php echo Option::get('siteurl'); ?>news/<?php echo $item['parent'].'/'.$item['slug']; ?>"><?php echo $item['name']; ?></a><br>
<?php } ?>
</div>
</p>
<?php
endif;
36 changes: 19 additions & 17 deletions views/frontend/index.view.php
Expand Up @@ -4,9 +4,11 @@

<?php if(count($records)>0):?>

<ul class="thumbnails">
<?php
foreach($records as $item):
?>
<div class="row">
<?php
if ($item['parent'] != "")
{
$parent = $item['parent'] . DS;
Expand All @@ -20,24 +22,24 @@

$url_item = $opt["site_url"].'news/'.$item["slug"];
?>
<li class="span12">
<div class="thumbnail media">
<?php if ($listPic != null) { ?>
<a class="pull-left" href="<?php echo $url_item; ?>"><img class="img-polaroid" alt="<?php echo $item['name'] ?>" src="<?php echo $opt["url"].$item['parent'].$item["slug"].'/'.'thumbnail/'.$listPic[0] ?>"></a>
<?php }
else{ ?>
<a class="pull-left" href="<?php echo $url_item; ?>"><img class="img-polaroid" alt="<?php echo $item['name'] ?>" src="<?php echo $opt["url"].'no_item.jpg';?>"></a>
<?php }?>
<div class="media-body breadcrumb">
<h4 class="media-heading"><?php echo $item['name'] ?></h4>
<p><?php echo News::ContentById($item['id'], true); ?></p>
<p><i class="icon-calendar"></i><?php echo Date::format($item['date'], "d.m.Y H:i:s"); ?> <a href="<?php echo $url_item; ?>"><?php echo __('Read more', 'news') ?></a></p>
</div>
</div>
</li>
<div class="col-md-12 newsShort">
<h1><?php echo $item['name'] ?></h1>
<?php if ($listPic != null) { ?>
<a class="pull-left" href="<?php echo $url_item; ?>"><img class="pull-left img-responsive thumb margin10 img-thumbnail" alt="<?php echo $item['name'] ?>" src="<?php echo $opt["url"].$item['parent'].$item["slug"].'/'.'thumbnail/'.$listPic[0] ?>"></a>
<?php }
else{ ?>
<a class="pull-left" href="<?php echo $url_item; ?>"><img class="pull-left img-responsive thumb margin10 img-thumbnail" alt="<?php echo $item['name'] ?>" src="<?php echo $opt["url"].'no_item.jpg';?>"></a>
<?php }?>

<em><i class="glyphicon glyphicon-calendar"></i><?php echo Date::format($item['date'], "d.m.Y H:i:s"); ?></em>
<article><p>
<?php echo News::ContentById($item['id'], true); ?>
</p></article>
<p><a href="<?php echo $url_item; ?>"><?php echo __('Read more', 'news') ?></a></p>
</div>
</div><!-- /newsRow -->
<?php
endforeach; ?>
</ul>
<?php endif;
echo News::Tags();
if (Request::get('tag')) {
Expand Down
45 changes: 24 additions & 21 deletions views/frontend/item.view.php
@@ -1,8 +1,9 @@
<?php if(!isset($opt['display'])) {
echo News::Breadcrumbs($item, $opt);
} ?>
}
?>
<div id="news">
<div class="media">
<h1><?php echo $item['name'] ?></h1>
<?php
if ($item['parent'] != "")
{
Expand All @@ -15,28 +16,30 @@
}
$listPic = File::scan($opt['dir'] . $parent . $item['slug'] . DS . 'thumbnail');
if ($listPic != null) : ?>
<ul class="thumbnails span3">
<?php foreach($listPic as $pic) : ?><li class="span3">
<a class="cImg pull-left" rel="<?php echo $item["slug"] ?>" href="<?php echo $opt["url"].$item['parent'].$item["slug"].'/'.$pic ?>"><img class="img-polaroid" alt="<?php echo $item['name'] ?>" src="<?php echo $opt["url"].$item['parent'].$item["slug"].'/'.'thumbnail/'.$pic ?>"></a>
<ul class="thumbnails col-md-3">
<?php foreach($listPic as $pic) : ?><li class="col-md-3">
<a class="cImg pull-left" rel="<?php echo $item["slug"] ?>" href="<?php echo $opt["url"].$item['parent'].$item["slug"].'/'.$pic ?>"><img class="pull-left img-responsive thumb margin10 img-thumbnail" alt="<?php echo $item['name'] ?>" src="<?php echo $opt["url"].$item['parent'].$item["slug"].'/'.'thumbnail/'.$pic ?>"></a>
</li><?php endforeach;?>
</ul>
<?php else: ?>
<a class="cImg pull-left" href="<?php echo $opt["url"].'no_item.jpg';?>"><img class="img-polaroid" alt="<?php echo $item['name'] ?>" src="<?php echo $opt["url"].'no_item.jpg';?>"></a>
<a class="cImg pull-left" href="<?php echo $opt["url"].'no_item.jpg';?>"><img class="pull-left img-responsive thumb margin10 img-thumbnail" alt="<?php echo $item['name'] ?>" src="<?php echo $opt["url"].'no_item.jpg';?>"></a>
<?php endif;?>
<div class="media-body breadcrumb">
<h4 class="media-heading"><?php echo $item['name'] ?></h4>
<p><?php echo News::ContentById($item['id']); ?></p>
</div>
</div>
<em><i class="glyphicon glyphicon-calendar"></i><?php echo Date::format($item['date'], "d.m.Y H:i:s"); ?></em>
<article><p>
<?php echo News::ContentById($item['id'], true); ?>
</p></article>
</div>
<?php if(!isset($opt['display'])) { ?>
<p><br /><? echo News::Tags($item['slug']);?>
<? echo News::Children($item['slug']); ?>
<? echo News::Related(); ?>
<div class="clearfix"></div><div>
<?php if(!isset($opt['display'])) :?>
<? echo News::Tags($item['slug']);?>
<? echo News::Children($item['slug']); ?>
<? echo News::Related(); ?>
<br />
<ul class="breadcrumb">
<li><?php echo Date::format($item['date'], 'd.m.Y'); ?> <span class="divider">/</span></li>
<li class="active"><?php echo __('Hits count', 'news').$item['hits'] ?></li>
</ul>
<?php }
?>
<ul class="breadcrumb">
<li><?php echo Date::format($item['date'], 'd.m.Y'); ?></li>
<li class="active"><?php echo __('Hits count', 'news').$item['hits'] ?></li>
</ul>
</div>
<?php endif;
?>
</div>
15 changes: 8 additions & 7 deletions views/frontend/related.view.php
Expand Up @@ -2,12 +2,13 @@
if (count($related_posts) > 0)
{
?>
<br><br>
<b><?php echo __('Related', 'news'); ?>:</b>
<div>
<?php foreach($related_posts as $related_post) { ?>
<a href="<?php echo Option::get('siteurl'); ?>news/<?php echo $related_post['slug']; ?>"><?php echo $related_post['name']; ?></a><br>
<?php } ?>
</div>
<p>
<b><?php echo __('Related', 'news'); ?>:</b>
<div>
<?php foreach($related_posts as $related_post) { ?>
<a href="<?php echo Option::get('siteurl'); ?>news/<?php echo $related_post['slug']; ?>"><?php echo $related_post['name']; ?></a><br>
<?php } ?>
</div>
</p>
<?php
}
2 changes: 1 addition & 1 deletion views/frontend/tags.view.php
@@ -1,3 +1,3 @@
<?php foreach($tags as $tag) { ?>
<a href="<?php echo Option::get('siteurl'); ?>news?tag=<?php echo $tag; ?>"><span class="label label-important" data-original-title=""><?php echo $tag; ?></span></a>
<a href="<?php echo Option::get('siteurl'); ?>news?tag=<?php echo $tag; ?>"><span class="label label-primary" data-original-title="<?php echo $tag; ?>"><?php echo $tag; ?></span></a>
<?php } ?>

0 comments on commit 68eda77

Please sign in to comment.