Permalink
Browse files

basics for admin init

  • Loading branch information...
chemix committed Jun 21, 2014
1 parent 0cabe53 commit 66ac9176ea8ae548d8e5c0b658d9e655a811613f
@@ -46,6 +46,13 @@ public function getLastPosts($count = 5)
->fetchAll();
}
public function getAllPosts()
{
return $this->database->table('facebook_wallposts')
->order('created_time DESC')
->fetchAll();
}
public function importPostFromFacebook()
{
try {
@@ -0,0 +1,25 @@
<?php
namespace App\Presenters;
use Nette,
App\Model;
/**
* Admin presenter.
*/
class AdminPresenter extends BasePresenter
{
/**
* @var \App\Model\FacebookWallposts @inject
*/
public $wallposts;
public function renderDefault()
{
$this->template->wallPosts = $this->wallposts->getAllPosts();
}
}
@@ -45,6 +45,9 @@
<li>
<a n:href="Import:default">Importer</a>
</li>
<li>
<a n:href="Admin:default">Admin</a>
</li>
</ul>
</section>
</nav>
@@ -0,0 +1,43 @@
{block content}
<div class="row">
<div class="column">
{foreach $wallPosts as $post}
<div class="row">
<div class="large-2 columns small-3">
{ifset $post->picture}
<img src="{$post->picture}">
{/ifset}
</div>
<div class="large-10 columns">
{ifset $post->name}
<h3>{$post->name}</h3>
{/ifset}
{ifset $post->message}
<p>{$post->message} </p>
{/ifset}
<ul class="inline-list">
<li><strong>{$post->type}</strong></li>
{ifset $post->link}
<li><a href="{$post->link}">{$post->link}</a></li>
{/ifset}
<li><small>{$post->id}</small></li>
<li><small>{$post->created_time}</small></li>
{if $post->status == '1'}
<li><a href="#" class="button alert">disable</a></li>
{else}
<li><a href="#" class="button">enable</a></li>
{/if}
</ul>
</div>
</div>
<hr>
{/foreach}
</div>
</div>

0 comments on commit 66ac917

Please sign in to comment.