]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Some UI improvements for blocking and unblocking
authorEvan Prodromou <evan@controlyourself.ca>
Sun, 14 Jun 2009 22:54:22 +0000 (15:54 -0700)
committerEvan Prodromou <evan@controlyourself.ca>
Sun, 14 Jun 2009 22:54:22 +0000 (15:54 -0700)
Add unblock to the router table, so unblocking will work at all.

Block form and unblock form return to subscribers list, not
subscriptions list, by default.

showstream action sends its parameters to block and unblock forms to
better return to the right page.

actions/block.php
actions/showstream.php
actions/unblock.php
lib/router.php

index 34f991dc6126024451004e3115ad45c88106b1eb..0efee5932c101901d6945eb11d08681881d2f08f 100644 (file)
@@ -180,7 +180,7 @@ class BlockAction extends Action
         if ($action) {
             common_redirect(common_local_url($action, $args), 303);
         } else {
-            common_redirect(common_local_url('subscriptions',
+            common_redirect(common_local_url('subscribers',
                                              array('nickname' => $cur->nickname)),
                             303);
         }
index c1a2c337a0da3ab070c05a75ddb5bca728226c17..641228bc731d90f97139ea8316e95f0203dee69c 100644 (file)
@@ -308,10 +308,14 @@ class ShowstreamAction extends ProfileAction
             $blocked = $cur->hasBlocked($this->profile);
             $this->elementStart('li', 'entity_block');
             if ($blocked) {
-                $ubf = new UnblockForm($this, $this->profile);
+                $ubf = new UnblockForm($this, $this->profile,
+                                       array('action' => 'showstream',
+                                             'nickname' => $this->profile->nickname));
                 $ubf->show();
             } else {
-                $bf = new BlockForm($this, $this->profile);
+                $bf = new BlockForm($this, $this->profile,
+                                    array('action' => 'showstream',
+                                          'nickname' => $this->profile->nickname));
                 $bf->show();
             }
             $this->elementEnd('li');
index 8573b2a873e2285492e45ee8fec5e8cbbac9bf6a..6e671c9dd257fa7ee2e6e0e2b10a546252ae8f5c 100644 (file)
@@ -118,7 +118,7 @@ class UnblockAction extends Action
         if ($action) {
             common_redirect(common_local_url($action, $args), 303);
         } else {
-            common_redirect(common_local_url('subscriptions',
+            common_redirect(common_local_url('subscribers',
                                              array('nickname' => $cur->nickname)),
                             303);
         }
index 12590b790d0806e36970984bd36fc2286e876d18..748966567f9ab86717e6a43ff1ae9277b29924e4 100644 (file)
@@ -101,7 +101,7 @@ class Router
         $main = array('login', 'logout', 'register', 'subscribe',
                       'unsubscribe', 'confirmaddress', 'recoverpassword',
                       'invite', 'favor', 'disfavor', 'sup',
-                      'block', 'subedit');
+                      'block', 'unblock', 'subedit');
 
         foreach ($main as $a) {
             $m->connect('main/'.$a, array('action' => $a));