Some UI improvements for blocking and unblocking
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.
This commit is contained in:
parent
1c41afbd36
commit
203a5aba67
@ -180,7 +180,7 @@ class BlockAction extends Action
|
|||||||
if ($action) {
|
if ($action) {
|
||||||
common_redirect(common_local_url($action, $args), 303);
|
common_redirect(common_local_url($action, $args), 303);
|
||||||
} else {
|
} else {
|
||||||
common_redirect(common_local_url('subscriptions',
|
common_redirect(common_local_url('subscribers',
|
||||||
array('nickname' => $cur->nickname)),
|
array('nickname' => $cur->nickname)),
|
||||||
303);
|
303);
|
||||||
}
|
}
|
||||||
|
@ -308,10 +308,14 @@ class ShowstreamAction extends ProfileAction
|
|||||||
$blocked = $cur->hasBlocked($this->profile);
|
$blocked = $cur->hasBlocked($this->profile);
|
||||||
$this->elementStart('li', 'entity_block');
|
$this->elementStart('li', 'entity_block');
|
||||||
if ($blocked) {
|
if ($blocked) {
|
||||||
$ubf = new UnblockForm($this, $this->profile);
|
$ubf = new UnblockForm($this, $this->profile,
|
||||||
|
array('action' => 'showstream',
|
||||||
|
'nickname' => $this->profile->nickname));
|
||||||
$ubf->show();
|
$ubf->show();
|
||||||
} else {
|
} else {
|
||||||
$bf = new BlockForm($this, $this->profile);
|
$bf = new BlockForm($this, $this->profile,
|
||||||
|
array('action' => 'showstream',
|
||||||
|
'nickname' => $this->profile->nickname));
|
||||||
$bf->show();
|
$bf->show();
|
||||||
}
|
}
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
|
@ -118,7 +118,7 @@ class UnblockAction extends Action
|
|||||||
if ($action) {
|
if ($action) {
|
||||||
common_redirect(common_local_url($action, $args), 303);
|
common_redirect(common_local_url($action, $args), 303);
|
||||||
} else {
|
} else {
|
||||||
common_redirect(common_local_url('subscriptions',
|
common_redirect(common_local_url('subscribers',
|
||||||
array('nickname' => $cur->nickname)),
|
array('nickname' => $cur->nickname)),
|
||||||
303);
|
303);
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ class Router
|
|||||||
$main = array('login', 'logout', 'register', 'subscribe',
|
$main = array('login', 'logout', 'register', 'subscribe',
|
||||||
'unsubscribe', 'confirmaddress', 'recoverpassword',
|
'unsubscribe', 'confirmaddress', 'recoverpassword',
|
||||||
'invite', 'favor', 'disfavor', 'sup',
|
'invite', 'favor', 'disfavor', 'sup',
|
||||||
'block', 'subedit');
|
'block', 'unblock', 'subedit');
|
||||||
|
|
||||||
foreach ($main as $a) {
|
foreach ($main as $a) {
|
||||||
$m->connect('main/'.$a, array('action' => $a));
|
$m->connect('main/'.$a, array('action' => $a));
|
||||||
|
Loading…
Reference in New Issue
Block a user