mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Tidy up PhameBlogManage
Summary: Remove unneeded actions, fix archive controller, adds some icons. Ref T9897 Test Plan: Archive a blog, unarchive a blog Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9897 Differential Revision: https://secure.phabricator.com/D14709
This commit is contained in:
parent
ec2ad5ed66
commit
e275964f43
3 changed files with 26 additions and 33 deletions
|
@ -20,7 +20,7 @@ final class PhameBlogArchiveController
|
|||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$view_uri = $this->getApplicationURI('blog/view/'.$blog->getID().'/');
|
||||
$view_uri = $this->getApplicationURI('blog/manage/'.$blog->getID().'/');
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
if ($blog->isArchived()) {
|
||||
|
|
|
@ -82,12 +82,12 @@ final class PhameBlogManageController extends PhameBlogController {
|
|||
|
||||
$skin = $blog->getSkin();
|
||||
if (!$skin) {
|
||||
$skin = pht('(No external skin)');
|
||||
$skin = phutil_tag('em', array(), pht('No external skin'));
|
||||
}
|
||||
|
||||
$domain = $blog->getDomain();
|
||||
if (!$domain) {
|
||||
$domain = pht('(No external domain)');
|
||||
$domain = phutil_tag('em', array(), pht('No external domain'));
|
||||
}
|
||||
|
||||
$properties->addProperty(pht('Skin'), $skin);
|
||||
|
@ -148,21 +148,6 @@ final class PhameBlogManageController extends PhameBlogController {
|
|||
$blog,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$actions->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setIcon('fa-plus')
|
||||
->setHref($this->getApplicationURI('post/edit/?blog='.$blog->getID()))
|
||||
->setName(pht('Write Post'))
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit));
|
||||
|
||||
$actions->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setUser($viewer)
|
||||
->setIcon('fa-globe')
|
||||
->setHref($blog->getLiveURI())
|
||||
->setName(pht('View Live')));
|
||||
|
||||
$actions->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setIcon('fa-pencil')
|
||||
|
|
|
@ -32,6 +32,7 @@ final class PhameBlogTransaction
|
|||
|
||||
public function getIcon() {
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
if ($old === null) {
|
||||
|
@ -44,11 +45,33 @@ final class PhameBlogTransaction
|
|||
case self::TYPE_DOMAIN:
|
||||
case self::TYPE_SKIN:
|
||||
return 'fa-pencil';
|
||||
case self::TYPE_STATUS:
|
||||
if ($new == PhameBlog::STATUS_ARCHIVED) {
|
||||
return 'fa-ban';
|
||||
} else {
|
||||
return 'fa-check';
|
||||
}
|
||||
break;
|
||||
}
|
||||
return parent::getIcon();
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
|
||||
$old = $this->getOldValue();
|
||||
$new = $this->getNewValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_STATUS:
|
||||
if ($new == PhameBlog::STATUS_ARCHIVED) {
|
||||
return 'red';
|
||||
} else {
|
||||
return 'green';
|
||||
}
|
||||
}
|
||||
return parent::getColor();
|
||||
}
|
||||
|
||||
public function getMailTags() {
|
||||
$tags = parent::getMailTags();
|
||||
|
||||
|
@ -184,21 +207,6 @@ final class PhameBlogTransaction
|
|||
return parent::getTitleForFeed();
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
$old = $this->getOldValue();
|
||||
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_NAME:
|
||||
if ($old === null) {
|
||||
return PhabricatorTransactions::COLOR_GREEN;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return parent::getColor();
|
||||
}
|
||||
|
||||
|
||||
public function hasChangeDetails() {
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_DESCRIPTION:
|
||||
|
|
Loading…
Reference in a new issue