diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index b46df97744..8507342823 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1938,7 +1938,6 @@ phutil_register_library_map(array( 'ReleephAuthorFieldSpecification' => 'applications/releeph/field/specification/ReleephAuthorFieldSpecification.php', 'ReleephBranch' => 'applications/releeph/storage/ReleephBranch.php', 'ReleephBranchAccessController' => 'applications/releeph/controller/branch/ReleephBranchAccessController.php', - 'ReleephBranchBoxView' => 'applications/releeph/view/branch/ReleephBranchBoxView.php', 'ReleephBranchCommitFieldSpecification' => 'applications/releeph/field/specification/ReleephBranchCommitFieldSpecification.php', 'ReleephBranchCreateController' => 'applications/releeph/controller/branch/ReleephBranchCreateController.php', 'ReleephBranchEditController' => 'applications/releeph/controller/branch/ReleephBranchEditController.php', @@ -1948,6 +1947,7 @@ phutil_register_library_map(array( 'ReleephBranchQuery' => 'applications/releeph/query/ReleephBranchQuery.php', 'ReleephBranchSearchEngine' => 'applications/releeph/query/ReleephBranchSearchEngine.php', 'ReleephBranchTemplate' => 'applications/releeph/view/branch/ReleephBranchTemplate.php', + 'ReleephBranchTransaction' => 'applications/releeph/storage/ReleephBranchTransaction.php', 'ReleephBranchViewController' => 'applications/releeph/controller/branch/ReleephBranchViewController.php', 'ReleephCommitFinder' => 'applications/releeph/commitfinder/ReleephCommitFinder.php', 'ReleephCommitFinderException' => 'applications/releeph/commitfinder/ReleephCommitFinderException.php', @@ -1980,6 +1980,7 @@ phutil_register_library_map(array( 'ReleephProjectListController' => 'applications/releeph/controller/project/ReleephProjectListController.php', 'ReleephProjectQuery' => 'applications/releeph/query/ReleephProjectQuery.php', 'ReleephProjectSearchEngine' => 'applications/releeph/query/ReleephProjectSearchEngine.php', + 'ReleephProjectTransaction' => 'applications/releeph/storage/ReleephProjectTransaction.php', 'ReleephProjectViewController' => 'applications/releeph/controller/project/ReleephProjectViewController.php', 'ReleephReasonFieldSpecification' => 'applications/releeph/field/specification/ReleephReasonFieldSpecification.php', 'ReleephRequest' => 'applications/releeph/storage/ReleephRequest.php', @@ -4119,7 +4120,6 @@ phutil_register_library_map(array( 1 => 'PhabricatorPolicyInterface', ), 'ReleephBranchAccessController' => 'ReleephProjectController', - 'ReleephBranchBoxView' => 'AphrontView', 'ReleephBranchCommitFieldSpecification' => 'ReleephFieldSpecification', 'ReleephBranchCreateController' => 'ReleephProjectController', 'ReleephBranchEditController' => 'ReleephProjectController', @@ -4128,6 +4128,7 @@ phutil_register_library_map(array( 'ReleephBranchPreviewView' => 'AphrontFormControl', 'ReleephBranchQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'ReleephBranchSearchEngine' => 'PhabricatorApplicationSearchEngine', + 'ReleephBranchTransaction' => 'PhabricatorApplicationTransaction', 'ReleephBranchViewController' => array( 0 => 'ReleephProjectController', @@ -4172,6 +4173,7 @@ phutil_register_library_map(array( ), 'ReleephProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'ReleephProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', + 'ReleephProjectTransaction' => 'PhabricatorApplicationTransaction', 'ReleephProjectViewController' => array( 0 => 'ReleephProjectController', diff --git a/src/applications/releeph/view/branch/ReleephBranchBoxView.php b/src/applications/releeph/view/branch/ReleephBranchBoxView.php deleted file mode 100644 index 8161c4c42a..0000000000 --- a/src/applications/releeph/view/branch/ReleephBranchBoxView.php +++ /dev/null @@ -1,226 +0,0 @@ -releephBranch = $br; - return $this; - } - - // Primary highlighted branch - public function setLatest() { - $this->isLatest = true; - return $this; - } - - // Secondary highlighted branch(es) - public function setNamed() { - $this->isNamed = true; - return $this; - } - - public function setHandles($handles) { - $this->handles = $handles; - return $this; - } - - public function render() { - $br = $this->releephBranch; - - require_celerity_resource('releeph-branch'); - return phutil_tag( - 'div', - array( - 'class' => 'releeph-branch-box'. - ($this->isNamed ? ' releeph-branch-box-named' : ''). - ($this->isLatest ? ' releeph-branch-box-latest' : ''), - ), - array( - $this->renderNames(), - $this->renderDatesTable(), - // "float: right" means the ordering here is weird - $this->renderButtons(), - $this->renderStatisticsTable(), - phutil_tag( - 'div', - array( - 'style' => 'clear:both;', - ), - ''))); - } - - private function renderNames() { - $br = $this->releephBranch; - - return phutil_tag( - 'div', - array( - 'class' => 'names', - ), - array( - phutil_tag( - 'h1', - array(), - $br->getDisplayName()), - phutil_tag( - 'h2', - array(), - $br->getName()))); - } - - private function renderDatesTable() { - $br = $this->releephBranch; - $branch_commit_handle = $this->handles[$br->getCutPointCommitPHID()]; - - $properties = array(); - $properties['Created by'] = - - $cut_age = phabricator_format_relative_time( - time() - $branch_commit_handle->getTimestamp()); - - return phutil_tag( - 'div', - array( - 'class' => 'date-info', - ), - array( - $this->handles[$br->getCreatedByUserPHID()]->renderLink(), - phutil_tag('br'), - phutil_tag( - 'a', - array( - 'href' => $branch_commit_handle->getURI(), - ), - $cut_age.' old'))); - } - - private function renderStatisticsTable() { - $statistics = array(); - - $requests = $this->releephBranch->loadReleephRequests($this->getUser()); - foreach ($requests as $request) { - $status = $request->getStatus(); - if (!isset($statistics[$status])) { - $statistics[$status] = 0; - } - $statistics[$status]++; - } - - static $col_groups = 3; - - $cells = array(); - foreach ($statistics as $status => $count) { - $description = ReleephRequestStatus::getStatusDescriptionFor($status); - $cells[] = phutil_tag('th', array(), $count); - $cells[] = phutil_tag('td', array(), $description); - } - - $rows = array(); - while ($cells) { - $row_cells = array(); - for ($ii = 0; $ii < 2 * $col_groups; $ii++) { - $row_cells[] = array_shift($cells); - } - $rows[] = phutil_tag('tr', array(), $row_cells); - } - - if (!$rows) { - $rows = hsprintf('