Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionCommitController.php
| Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | if ($is_foreign) { | ||||
| $icon = $status->getIcon(); | $icon = $status->getIcon(); | ||||
| $color = $status->getColor(); | $color = $status->getColor(); | ||||
| $status = $status->getName(); | $status = $status->getName(); | ||||
| $header->setStatus($icon, $color, $status); | $header->setStatus($icon, $color, $status); | ||||
| } | } | ||||
| $curtain = $this->buildCurtain($commit, $repository); | $curtain = $this->buildCurtain($commit, $repository); | ||||
| $subheader = $this->buildSubheaderView($commit, $commit_data); | |||||
| $details = $this->buildPropertyListView( | $details = $this->buildPropertyListView( | ||||
| $commit, | $commit, | ||||
| $commit_data, | $commit_data, | ||||
| $audit_requests); | $audit_requests); | ||||
| $message = $commit_data->getCommitMessage(); | $message = $commit_data->getCommitMessage(); | ||||
| $revision = $commit->getCommitIdentifier(); | $revision = $commit->getCommitIdentifier(); | ||||
| ▲ Show 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $detail_box = id(new PHUIObjectBoxView()) | $detail_box = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Details')) | ->setHeaderText(pht('Details')) | ||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->appendChild($details); | ->appendChild($details); | ||||
| $view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
| ->setHeader($header) | ->setHeader($header) | ||||
| ->setSubheader($subheader) | |||||
| ->setCurtain($curtain) | ->setCurtain($curtain) | ||||
| ->setMainColumn( | ->setMainColumn( | ||||
| array( | array( | ||||
| $unpublished_panel, | $unpublished_panel, | ||||
| $error_panel, | $error_panel, | ||||
| $description_box, | $description_box, | ||||
| $detail_box, | $detail_box, | ||||
| $timeline, | $timeline, | ||||
| ▲ Show 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | if ($task_phids) { | ||||
| $view->addProperty( | $view->addProperty( | ||||
| pht('Tasks'), | pht('Tasks'), | ||||
| $task_list); | $task_list); | ||||
| } | } | ||||
| return $view; | return $view; | ||||
| } | } | ||||
| private function buildSubheaderView( | |||||
| PhabricatorRepositoryCommit $commit, | |||||
| PhabricatorRepositoryCommitData $data) { | |||||
| $viewer = $this->getViewer(); | |||||
| $drequest = $this->getDiffusionRequest(); | |||||
| $repository = $drequest->getRepository(); | |||||
| if ($repository->isSVN()) { | |||||
| return null; | |||||
| } | |||||
| $author_phid = $commit->getAuthorDisplayPHID(); | |||||
| $author_name = $data->getAuthorName(); | |||||
| $author_epoch = $data->getCommitDetail('authorEpoch'); | |||||
| $date = null; | |||||
| if ($author_epoch !== null) { | |||||
| $date = phabricator_datetime($author_epoch, $viewer); | |||||
| } | |||||
| if ($author_phid) { | |||||
| $handles = $viewer->loadHandles(array($author_phid)); | |||||
| $image_uri = $handles[$author_phid]->getImageURI(); | |||||
| $image_href = $handles[$author_phid]->getURI(); | |||||
| $author = $handles[$author_phid]->renderLink(); | |||||
| } else if (strlen($author_name)) { | |||||
| $author = $author_name; | |||||
| $image_uri = null; | |||||
| $image_href = null; | |||||
| } else { | |||||
| return null; | |||||
| } | |||||
| $author = phutil_tag('strong', array(), $author); | |||||
| if ($date) { | |||||
| $content = pht('Authored by %s on %s.', $author, $date); | |||||
| } else { | |||||
| $content = pht('Authored by %s.', $author); | |||||
| } | |||||
| return id(new PHUIHeadThingView()) | |||||
| ->setImage($image_uri) | |||||
| ->setImageHref($image_href) | |||||
| ->setContent($content); | |||||
| } | |||||
| private function buildComments(PhabricatorRepositoryCommit $commit) { | private function buildComments(PhabricatorRepositoryCommit $commit) { | ||||
| $timeline = $this->buildTransactionTimeline( | $timeline = $this->buildTransactionTimeline( | ||||
| $commit, | $commit, | ||||
| new PhabricatorAuditTransactionQuery()); | new PhabricatorAuditTransactionQuery()); | ||||
| $timeline->setQuoteRef($commit->getMonogram()); | $timeline->setQuoteRef($commit->getMonogram()); | ||||
| return $timeline; | return $timeline; | ||||
| ▲ Show 20 Lines • Show All 405 Lines • Show Last 20 Lines | |||||