Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group pholio
|
|
|
|
*/
|
|
|
|
final class PholioMockViewController extends PholioController {
|
|
|
|
|
|
|
|
private $id;
|
2013-03-05 03:43:29 +01:00
|
|
|
private $imageID;
|
2013-07-20 00:59:29 +02:00
|
|
|
private $maniphestTaskPHIDs = array();
|
|
|
|
|
|
|
|
private function setManiphestTaskPHIDs($maniphest_task_phids) {
|
|
|
|
$this->maniphestTaskPHIDs = $maniphest_task_phids;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
private function getManiphestTaskPHIDs() {
|
|
|
|
return $this->maniphestTaskPHIDs;
|
|
|
|
}
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
|
2013-03-07 22:02:36 +01:00
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
$this->id = $data['id'];
|
2013-03-05 03:43:29 +01:00
|
|
|
$this->imageID = idx($data, 'imageID');
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
$mock = id(new PholioMockQuery())
|
|
|
|
->setViewer($user)
|
|
|
|
->withIDs(array($this->id))
|
2013-01-25 22:27:49 +01:00
|
|
|
->needImages(true)
|
|
|
|
->needCoverFiles(true)
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
->executeOne();
|
|
|
|
|
|
|
|
if (!$mock) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
|
2012-11-22 02:27:20 +01:00
|
|
|
$xactions = id(new PholioTransactionQuery())
|
2012-12-11 22:59:20 +01:00
|
|
|
->setViewer($user)
|
|
|
|
->withObjectPHIDs(array($mock->getPHID()))
|
2012-11-22 02:27:20 +01:00
|
|
|
->execute();
|
|
|
|
|
2013-07-20 00:59:29 +02:00
|
|
|
$phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
|
|
|
|
$mock->getPHID(),
|
|
|
|
PhabricatorEdgeConfig::TYPE_MOCK_HAS_TASK);
|
|
|
|
$this->setManiphestTaskPHIDs($phids);
|
|
|
|
$phids[] = $mock->getAuthorPHID();
|
2012-11-22 02:24:01 +01:00
|
|
|
$this->loadHandles($phids);
|
|
|
|
|
|
|
|
$engine = id(new PhabricatorMarkupEngine())
|
|
|
|
->setViewer($user);
|
|
|
|
$engine->addObject($mock, PholioMock::MARKUP_FIELD_DESCRIPTION);
|
2012-11-22 02:27:20 +01:00
|
|
|
foreach ($xactions as $xaction) {
|
2012-12-11 22:59:20 +01:00
|
|
|
if ($xaction->getComment()) {
|
|
|
|
$engine->addObject(
|
|
|
|
$xaction->getComment(),
|
2012-12-11 23:02:29 +01:00
|
|
|
PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
|
2012-12-11 22:59:20 +01:00
|
|
|
}
|
2012-11-22 02:27:20 +01:00
|
|
|
}
|
2012-11-22 02:24:01 +01:00
|
|
|
$engine->process();
|
|
|
|
|
2013-02-22 15:53:35 +01:00
|
|
|
$title = $mock->getName();
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
|
2013-09-17 18:12:37 +02:00
|
|
|
$header = id(new PHUIHeaderView())
|
|
|
|
->setHeader($title)
|
2013-09-19 20:56:58 +02:00
|
|
|
->setUser($user)
|
|
|
|
->setPolicyObject($mock);
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
|
2012-11-22 02:24:01 +01:00
|
|
|
$actions = $this->buildActionView($mock);
|
2013-10-11 16:53:56 +02:00
|
|
|
$properties = $this->buildPropertyView($mock, $engine, $actions);
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
|
2013-01-20 18:29:34 +01:00
|
|
|
require_celerity_resource('pholio-css');
|
2013-02-22 15:39:08 +01:00
|
|
|
require_celerity_resource('pholio-inline-comments-css');
|
2013-01-20 18:29:34 +01:00
|
|
|
|
2013-07-26 01:59:25 +02:00
|
|
|
$image_status = $this->getImageStatus($mock, $this->imageID);
|
|
|
|
|
2013-06-25 00:41:59 +02:00
|
|
|
$comment_form_id = celerity_generate_unique_node_id();
|
2013-03-07 22:02:36 +01:00
|
|
|
$output = id(new PholioMockImagesView())
|
|
|
|
->setRequestURI($request->getRequestURI())
|
2013-06-25 00:41:59 +02:00
|
|
|
->setCommentFormID($comment_form_id)
|
2013-03-07 22:02:36 +01:00
|
|
|
->setUser($user)
|
|
|
|
->setMock($mock)
|
|
|
|
->setImageID($this->imageID);
|
2013-01-20 18:29:34 +01:00
|
|
|
|
2013-03-10 04:23:50 +01:00
|
|
|
$xaction_view = id(new PholioTransactionView())
|
2012-12-21 14:51:33 +01:00
|
|
|
->setUser($this->getRequest()->getUser())
|
2013-07-29 03:21:22 +02:00
|
|
|
->setObjectPHID($mock->getPHID())
|
2012-12-11 23:02:29 +01:00
|
|
|
->setTransactions($xactions)
|
|
|
|
->setMarkupEngine($engine);
|
2012-11-22 02:27:20 +01:00
|
|
|
|
2013-06-25 00:41:59 +02:00
|
|
|
$add_comment = $this->buildAddCommentView($mock, $comment_form_id);
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
|
2013-07-22 21:21:15 +02:00
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
2013-04-10 22:08:36 +02:00
|
|
|
$crumbs->setActionList($actions);
|
2013-12-19 02:47:34 +01:00
|
|
|
$crumbs->addTextCrumb('M'.$mock->getID(), '/M'.$mock->getID());
|
2013-02-15 19:17:31 +01:00
|
|
|
|
2013-09-29 00:55:38 +02:00
|
|
|
$object_box = id(new PHUIObjectBoxView())
|
|
|
|
->setHeader($header)
|
2013-10-11 16:53:56 +02:00
|
|
|
->addPropertyList($properties);
|
2013-09-29 00:55:38 +02:00
|
|
|
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
$content = array(
|
2013-02-15 19:17:31 +01:00
|
|
|
$crumbs,
|
2013-07-26 01:59:25 +02:00
|
|
|
$image_status,
|
2013-09-29 00:55:38 +02:00
|
|
|
$object_box,
|
2013-01-28 20:18:50 +01:00
|
|
|
$output->render(),
|
2012-11-22 02:27:20 +01:00
|
|
|
$xaction_view,
|
2012-11-22 02:24:01 +01:00
|
|
|
$add_comment,
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
return $this->buildApplicationPage(
|
|
|
|
$content,
|
|
|
|
array(
|
2013-02-22 15:53:35 +01:00
|
|
|
'title' => 'M'.$mock->getID().' '.$title,
|
2012-11-22 02:24:01 +01:00
|
|
|
'device' => true,
|
2013-02-21 23:35:07 +01:00
|
|
|
'pageObjects' => array($mock->getPHID()),
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2013-07-26 01:59:25 +02:00
|
|
|
private function getImageStatus(PholioMock $mock, $image_id) {
|
|
|
|
$status = null;
|
|
|
|
$images = $mock->getImages();
|
|
|
|
foreach ($images as $image) {
|
|
|
|
if ($image->getID() == $image_id) {
|
|
|
|
return $status;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$images = $mock->getAllImages();
|
|
|
|
$images = mpull($images, null, 'getID');
|
|
|
|
$image = idx($images, $image_id);
|
|
|
|
|
|
|
|
if ($image) {
|
2013-07-26 18:45:55 +02:00
|
|
|
$history = $mock->getImageHistorySet($image_id);
|
2013-07-26 01:59:25 +02:00
|
|
|
$latest_image = last($history);
|
|
|
|
$href = $this->getApplicationURI(
|
|
|
|
'image/history/'.$latest_image->getID().'/');
|
|
|
|
$status = id(new AphrontErrorView())
|
|
|
|
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
|
|
|
|
->setTitle(pht('The requested image is obsolete.'))
|
|
|
|
->appendChild(phutil_tag(
|
|
|
|
'p',
|
|
|
|
array(),
|
|
|
|
array(
|
|
|
|
pht('You are viewing this mock with the latest image set.'),
|
|
|
|
' ',
|
|
|
|
phutil_tag(
|
|
|
|
'a',
|
|
|
|
array('href' => $href),
|
|
|
|
pht(
|
|
|
|
'Click here to see the history of the now obsolete image.')))));
|
|
|
|
}
|
|
|
|
|
|
|
|
return $status;
|
|
|
|
}
|
|
|
|
|
2012-11-22 02:24:01 +01:00
|
|
|
private function buildActionView(PholioMock $mock) {
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$actions = id(new PhabricatorActionListView())
|
|
|
|
->setUser($user)
|
2013-07-12 20:39:47 +02:00
|
|
|
->setObjectURI($this->getRequest()->getRequestURI())
|
2012-11-22 02:24:01 +01:00
|
|
|
->setObject($mock);
|
|
|
|
|
|
|
|
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
|
|
|
$user,
|
|
|
|
$mock,
|
|
|
|
PhabricatorPolicyCapability::CAN_EDIT);
|
|
|
|
|
|
|
|
$actions->addAction(
|
|
|
|
id(new PhabricatorActionView())
|
2013-07-20 00:59:29 +02:00
|
|
|
->setIcon('edit')
|
|
|
|
->setName(pht('Edit Mock'))
|
|
|
|
->setHref($this->getApplicationURI('/edit/'.$mock->getID().'/'))
|
|
|
|
->setDisabled(!$can_edit)
|
|
|
|
->setWorkflow(!$can_edit));
|
|
|
|
|
|
|
|
$actions->addAction(
|
|
|
|
id(new PhabricatorActionView())
|
|
|
|
->setIcon('attach')
|
|
|
|
->setName(pht('Edit Maniphest Tasks'))
|
|
|
|
->setHref("/search/attach/{$mock->getPHID()}/TASK/edge/")
|
|
|
|
->setDisabled(!$user->isLoggedIn())
|
|
|
|
->setWorkflow(true));
|
2012-11-22 02:24:01 +01:00
|
|
|
|
|
|
|
return $actions;
|
|
|
|
}
|
|
|
|
|
|
|
|
private function buildPropertyView(
|
|
|
|
PholioMock $mock,
|
2013-10-11 16:53:56 +02:00
|
|
|
PhabricatorMarkupEngine $engine,
|
|
|
|
PhabricatorActionListView $actions) {
|
2012-11-22 02:24:01 +01:00
|
|
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
2013-10-11 16:53:56 +02:00
|
|
|
$properties = id(new PHUIPropertyListView())
|
2013-02-15 16:47:14 +01:00
|
|
|
->setUser($user)
|
2013-10-11 16:53:56 +02:00
|
|
|
->setObject($mock)
|
|
|
|
->setActionList($actions);
|
2012-11-22 02:24:01 +01:00
|
|
|
|
|
|
|
$properties->addProperty(
|
|
|
|
pht('Author'),
|
|
|
|
$this->getHandle($mock->getAuthorPHID())->renderLink());
|
|
|
|
|
|
|
|
$properties->addProperty(
|
|
|
|
pht('Created'),
|
|
|
|
phabricator_datetime($mock->getDateCreated(), $user));
|
|
|
|
|
2013-07-20 00:59:29 +02:00
|
|
|
if ($this->getManiphestTaskPHIDs()) {
|
|
|
|
$properties->addProperty(
|
|
|
|
pht('Maniphest Tasks'),
|
|
|
|
$this->renderHandlesForPHIDs($this->getManiphestTaskPHIDs()));
|
|
|
|
}
|
|
|
|
|
2013-02-15 16:47:14 +01:00
|
|
|
$properties->invokeWillRenderEvent();
|
|
|
|
|
2014-02-10 20:57:25 +01:00
|
|
|
$properties->addSectionHeader(
|
|
|
|
pht('Description'),
|
|
|
|
PHUIPropertyListView::ICON_SUMMARY);
|
|
|
|
|
2013-02-28 05:10:30 +01:00
|
|
|
$properties->addImageContent(
|
2013-10-11 16:53:56 +02:00
|
|
|
$engine->getOutput($mock, PholioMock::MARKUP_FIELD_DESCRIPTION));
|
2012-11-22 02:24:01 +01:00
|
|
|
|
|
|
|
return $properties;
|
|
|
|
}
|
|
|
|
|
2013-06-25 00:41:59 +02:00
|
|
|
private function buildAddCommentView(PholioMock $mock, $comment_form_id) {
|
2012-11-22 02:24:01 +01:00
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
2012-12-21 14:57:14 +01:00
|
|
|
$draft = PhabricatorDraft::newFromUserAndKey($user, $mock->getPHID());
|
|
|
|
|
2012-11-22 02:24:01 +01:00
|
|
|
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
|
|
|
|
|
|
|
|
$title = $is_serious
|
|
|
|
? pht('Add Comment')
|
|
|
|
: pht('History Beckons');
|
|
|
|
|
2012-12-21 14:51:33 +01:00
|
|
|
$button_name = $is_serious
|
2012-11-22 02:24:01 +01:00
|
|
|
? pht('Add Comment')
|
|
|
|
: pht('Answer The Call');
|
|
|
|
|
2012-12-21 14:51:33 +01:00
|
|
|
$form = id(new PhabricatorApplicationTransactionCommentView())
|
2012-11-22 02:24:01 +01:00
|
|
|
->setUser($user)
|
2013-07-29 03:21:22 +02:00
|
|
|
->setObjectPHID($mock->getPHID())
|
2013-06-25 00:41:59 +02:00
|
|
|
->setFormID($comment_form_id)
|
2012-12-21 14:57:14 +01:00
|
|
|
->setDraft($draft)
|
2013-11-22 01:09:04 +01:00
|
|
|
->setHeaderText($title)
|
2012-12-21 14:51:33 +01:00
|
|
|
->setSubmitButtonName($button_name)
|
2013-03-07 22:02:36 +01:00
|
|
|
->setAction($this->getApplicationURI('/comment/'.$mock->getID().'/'))
|
|
|
|
->setRequestURI($this->getRequest()->getRequestURI());
|
2012-11-22 02:24:01 +01:00
|
|
|
|
2013-11-22 01:09:04 +01:00
|
|
|
return $form;
|
2012-11-22 02:24:01 +01:00
|
|
|
}
|
|
|
|
|
Add very basic scaffolding for Pholio
Summary:
I'm not going to land this until it's a bit more fleshed out since it would just confuse users, but this is probably more reviewable as a few diffs adding a couple features than one ULTRA-diff adding everything. Implement application basics for Pholio. This does more or less nothing, but adds storage, subscribe, flag, markup, indexing, query basics, PHIDs, handle loads, a couple of realy really basic controllers, etc.
Basic hierarchy is:
- **Moleskine**: Top-level object like a Differential Revision, like "Ponder Feed Ideas".
- **Image**: Each Moleskine has one or more images, like the unexpanded / expanded / mobile / empty states of feed.
- **Transaction**: Comment or edit, like Maniphest. I generally want to move most apps to a transaction model so we can log edits.
- **PixelComment**: Equivalent of an inline comment.
Test Plan: Created a fake object and viewed it.
Reviewers: btrahan, chad
Reviewed By: btrahan
CC: aran, davidreuss
Maniphest Tasks: T2097
Differential Revision: https://secure.phabricator.com/D3817
2012-11-22 02:22:36 +01:00
|
|
|
}
|