Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14623490
D18434.id44292.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
10 KB
Referenced Files
None
Subscribers
None
D18434.id44292.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -75,7 +75,7 @@
'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6',
'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec',
'rsrc/css/application/diffusion/diffusion-source.css' => '750add59',
- 'rsrc/css/application/diffusion/diffusion.css' => '34d507b9',
+ 'rsrc/css/application/diffusion/diffusion.css' => '58e0704b',
'rsrc/css/application/feed/feed.css' => 'ecd4ec57',
'rsrc/css/application/files/global-drag-and-drop.css' => 'b556a948',
'rsrc/css/application/flag/flag.css' => 'bba8f811',
@@ -570,7 +570,7 @@
'differential-revision-history-css' => '0e8eb855',
'differential-revision-list-css' => 'f3c47d33',
'differential-table-of-contents-css' => 'ae4b7a55',
- 'diffusion-css' => '34d507b9',
+ 'diffusion-css' => '58e0704b',
'diffusion-icons-css' => '0c15255e',
'diffusion-readme-css' => '419dd5b6',
'diffusion-repository-css' => 'ee6f20ec',
diff --git a/src/applications/diffusion/controller/DiffusionBranchTableController.php b/src/applications/diffusion/controller/DiffusionBranchTableController.php
--- a/src/applications/diffusion/controller/DiffusionBranchTableController.php
+++ b/src/applications/diffusion/controller/DiffusionBranchTableController.php
@@ -71,6 +71,11 @@
->setHeader(pht('Branches'))
->setHeaderIcon('fa-code-fork');
+ if (!$repository->isSVN()) {
+ $branch_tag = $this->renderBranchTag($drequest);
+ $header->addTag($branch_tag);
+ }
+
$tabs = $this->buildTabsView('branch');
$view = id(new PHUITwoColumnView())
diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseController.php
@@ -76,8 +76,11 @@
));
$crumbs->setBorder(true);
+ $tabs = $this->buildTabsView('code');
+
$view = id(new PHUITwoColumnView())
->setHeader($header)
+ ->setTabs($tabs)
->setFooter(
array(
$search_form,
@@ -291,9 +294,11 @@
$crumbs->setBorder(true);
$basename = basename($this->getDiffusionRequest()->getPath());
+ $tabs = $this->buildTabsView('code');
$view = id(new PHUITwoColumnView())
->setHeader($header)
+ ->setTabs($tabs)
->setCurtain($curtain)
->setMainColumn(array(
$content,
@@ -387,9 +392,11 @@
));
$crumbs->setBorder(true);
+ $tabs = $this->buildTabsView('code');
$view = id(new PHUITwoColumnView())
->setHeader($header)
+ ->setTabs($tabs)
->setFooter(
array(
$branch_panel,
@@ -1491,8 +1498,10 @@
protected function buildHeaderView(DiffusionRequest $drequest) {
$viewer = $this->getViewer();
+ $repository = $drequest->getRepository();
+
+ $commit_tag = $this->renderCommitHashTag($drequest);
- $tag = $this->renderCommitHashTag($drequest);
$path = nonempty(basename($drequest->getPath()), '/');
$search = $this->renderSearchForm($path);
@@ -1500,9 +1509,14 @@
->setUser($viewer)
->setHeader($this->renderPathLinks($drequest, $mode = 'browse'))
->addActionItem($search)
- ->addTag($tag)
+ ->addTag($commit_tag)
->addClass('diffusion-browse-header');
+ if (!$repository->isSVN()) {
+ $branch_tag = $this->renderBranchTag($drequest);
+ $header->addTag($branch_tag);
+ }
+
return $header;
}
diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php
--- a/src/applications/diffusion/controller/DiffusionController.php
+++ b/src/applications/diffusion/controller/DiffusionController.php
@@ -343,6 +343,38 @@
return $tag;
}
+ protected function renderBranchTag(DiffusionRequest $drequest) {
+ $branch = $drequest->getBranch();
+ $branch = id(new PhutilUTF8StringTruncator())
+ ->setMaximumGlyphs(24)
+ ->truncateString($branch);
+
+ $tag = id(new PHUITagView())
+ ->setName($branch)
+ ->setColor(PHUITagView::COLOR_INDIGO)
+ ->setBorder(PHUITagView::BORDER_NONE)
+ ->setType(PHUITagView::TYPE_OUTLINE)
+ ->addClass('diffusion-header-branch-tag');
+
+ return $tag;
+ }
+
+ protected function renderSymbolicCommit(DiffusionRequest $drequest) {
+ $symbolic_tag = $drequest->getSymbolicCommit();
+ $symbolic_tag = id(new PhutilUTF8StringTruncator())
+ ->setMaximumGlyphs(24)
+ ->truncateString($symbolic_tag);
+
+ $tag = id(new PHUITagView())
+ ->setName($symbolic_tag)
+ ->setIcon('fa-tag')
+ ->setColor(PHUITagView::COLOR_INDIGO)
+ ->setBorder(PHUITagView::BORDER_NONE)
+ ->setType(PHUITagView::TYPE_SHADE);
+
+ return $tag;
+ }
+
protected function renderDirectoryReadme(DiffusionBrowseResultSet $browse) {
$readme_path = $browse->getReadmePath();
if ($readme_path === null) {
@@ -470,15 +502,15 @@
$view->addMenuItem(
id(new PHUIListItemView())
- ->setKey('home')
- ->setName(pht('Home'))
- ->setIcon('fa-home')
+ ->setKey('code')
+ ->setName(pht('Code'))
+ ->setIcon('fa-code')
->setHref($drequest->generateURI(
array(
'action' => 'branch',
'path' => '/',
)))
- ->setSelected($key == 'home'));
+ ->setSelected($key == 'code'));
if (!$repository->isSVN()) {
$view->addMenuItem(
diff --git a/src/applications/diffusion/controller/DiffusionGraphController.php b/src/applications/diffusion/controller/DiffusionGraphController.php
--- a/src/applications/diffusion/controller/DiffusionGraphController.php
+++ b/src/applications/diffusion/controller/DiffusionGraphController.php
@@ -11,6 +11,7 @@
if ($response) {
return $response;
}
+ require_celerity_resource('diffusion-css');
$viewer = $this->getViewer();
$drequest = $this->getDiffusionRequest();
@@ -83,6 +84,7 @@
private function buildHeader(DiffusionRequest $drequest) {
$viewer = $this->getViewer();
+ $repository = $drequest->getRepository();
$no_path = !strlen($drequest->getPath());
if ($no_path) {
@@ -96,6 +98,11 @@
->setHeader($header_text)
->setHeaderIcon('fa-code-fork');
+ if (!$repository->isSVN()) {
+ $branch_tag = $this->renderBranchTag($drequest);
+ $header->addTag($branch_tag);
+ }
+
return $header;
}
diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php
--- a/src/applications/diffusion/controller/DiffusionHistoryController.php
+++ b/src/applications/diffusion/controller/DiffusionHistoryController.php
@@ -11,6 +11,7 @@
if ($response) {
return $response;
}
+ require_celerity_resource('diffusion-css');
$viewer = $this->getViewer();
$drequest = $this->getDiffusionRequest();
@@ -78,6 +79,7 @@
private function buildHeader(DiffusionRequest $drequest) {
$viewer = $this->getViewer();
+ $repository = $drequest->getRepository();
$no_path = !strlen($drequest->getPath());
if ($no_path) {
@@ -91,6 +93,16 @@
->setHeader($header_text)
->setHeaderIcon('fa-clock-o');
+ if (!$repository->isSVN()) {
+ $branch_tag = $this->renderBranchTag($drequest);
+ $header->addTag($branch_tag);
+ }
+
+ if ($drequest->getSymbolicCommit()) {
+ $symbolic_tag = $this->renderSymbolicCommit($drequest);
+ $header->addTag($symbolic_tag);
+ }
+
return $header;
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php
@@ -98,7 +98,7 @@
->setErrors(array($empty_message));
}
- $tabs = $this->buildTabsView('home');
+ $tabs = $this->buildTabsView('code');
$clone_uri = $drequest->generateURI(
array(
@@ -300,6 +300,7 @@
private function buildHeaderView(PhabricatorRepository $repository) {
$viewer = $this->getViewer();
+ $drequest = $this->getDiffusionRequest();
$search = $this->renderSearchForm();
$header = id(new PHUIHeaderView())
@@ -325,6 +326,14 @@
$header->setStatus('fa-check', 'bluegrey', pht('Active'));
}
+ if (!$repository->isSVN()) {
+ $default = $repository->getDefaultBranch();
+ if ($default != $drequest->getBranch()) {
+ $branch_tag = $this->renderBranchTag($drequest);
+ $header->addTag($branch_tag);
+ }
+ }
+
return $header;
}
diff --git a/src/applications/diffusion/controller/DiffusionTagListController.php b/src/applications/diffusion/controller/DiffusionTagListController.php
--- a/src/applications/diffusion/controller/DiffusionTagListController.php
+++ b/src/applications/diffusion/controller/DiffusionTagListController.php
@@ -11,6 +11,7 @@
if ($response) {
return $response;
}
+ require_celerity_resource('diffusion-css');
$viewer = $this->getViewer();
$drequest = $this->getDiffusionRequest();
@@ -50,6 +51,11 @@
->setHeader(pht('Tags'))
->setHeaderIcon('fa-tags');
+ if (!$repository->isSVN()) {
+ $branch_tag = $this->renderBranchTag($drequest);
+ $header->addTag($branch_tag);
+ }
+
if (!$tags) {
$content = $this->renderStatusMessage(
pht('No Tags'),
diff --git a/webroot/rsrc/css/application/diffusion/diffusion.css b/webroot/rsrc/css/application/diffusion/diffusion.css
--- a/webroot/rsrc/css/application/diffusion/diffusion.css
+++ b/webroot/rsrc/css/application/diffusion/diffusion.css
@@ -122,6 +122,12 @@
margin-right: 4px;
}
+.diffusion-header-branch-tag.phui-tag-view.phui-tag-type-outline
+ .phui-tag-core {
+ padding: 3px 12px 2px;
+ font-size: {$normalfontsize};
+}
+
/* - Browse Styles ----------------------------------------------------------*/
.diffusion-browse-table .commit-detail {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 1:54 PM (20 h, 30 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6985158
Default Alt Text
D18434.id44292.diff (10 KB)
Attached To
Mode
D18434: Add branch, tag info to Diffusion Headers
Attached
Detach File
Event Timeline
Log In to Comment