Permalink
Browse files

use signals for enable/disable posts

  • Loading branch information...
chemix committed Jun 25, 2014
1 parent a13d6a0 commit 24c0c4154122f8a35f283a4fdf16b083ef51d264
Showing with 6 additions and 6 deletions.
  1. +2 −2 app/presenters/AdminPresenter.php
  2. +4 −4 app/templates/Admin/default.latte
@@ -22,7 +22,7 @@ public function renderDefault()
$this->template->wallPosts = $this->wallposts->getAllPosts();
}
public function actionEnablePost($postId)
public function handleEnablePost($postId)
{
if ($this->wallposts->enablePost($postId)) {
if ($this->isAjax()) {
@@ -39,7 +39,7 @@ public function actionEnablePost($postId)
}
public function actionDisablePost($postId)
public function handleDisablePost($postId)
{
if ($this->wallposts->disablePost($postId)) {
if ($this->isAjax()) {
@@ -24,13 +24,13 @@
<ul class="inline-list">
<li><strong>{$post->type}</strong></li>
{ifset $post->link}
<li><a href="{$post->link}">{$post->link}</a></li>
{/ifset}
<li><a href="{$post->link}">{$post->link}</a></li>
{/ifset}
<li><small>{$post->id}</small></li>
<li><small>{$post->created_time}</small></li>
<li n:class="disable, !$post->status ? hide"><a n:href="Admin:disablePost $post->id" class="ajax button alert">disable</a></li>
<li n:class="enable, $post->status ? hide"><a n:href="Admin:enablePost $post->id" class="ajax button">enable</a></li>
<li n:class="disable, !$post->status ? hide"><a n:href="disablePost! $post->id" class="ajax button alert">disable</a></li>
<li n:class="enable, $post->status ? hide"><a n:href="enablePost! $post->id" class="ajax button">enable</a></li>
</ul>
</div>

0 comments on commit 24c0c41

Please sign in to comment.