Page MenuHomePhabricator

D19040.diff
No OneTemporary

D19040.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -12,7 +12,7 @@
'core.pkg.css' => 'ce8c2a58',
'core.pkg.js' => '4c79d74f',
'darkconsole.pkg.js' => '1f9a31bc',
- 'differential.pkg.css' => '45951e9e',
+ 'differential.pkg.css' => '1522c3ad',
'differential.pkg.js' => '19ee9979',
'diffusion.pkg.css' => 'a2d17c7d',
'diffusion.pkg.js' => '6134c5a1',
@@ -121,7 +121,7 @@
'rsrc/css/font/font-awesome.css' => 'e838e088',
'rsrc/css/font/font-lato.css' => 'c7ccd872',
'rsrc/css/font/phui-font-icon-base.css' => '870a7360',
- 'rsrc/css/layout/phabricator-filetree-view.css' => 'fccf9f82',
+ 'rsrc/css/layout/phabricator-filetree-view.css' => 'ea5b30a9',
'rsrc/css/layout/phabricator-source-code-view.css' => 'aea41829',
'rsrc/css/phui/button/phui-button-bar.css' => 'f1ff5494',
'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68',
@@ -784,7 +784,7 @@
'phabricator-favicon' => '1fe2510c',
'phabricator-feed-css' => 'ecd4ec57',
'phabricator-file-upload' => '680ea2c8',
- 'phabricator-filetree-view-css' => 'fccf9f82',
+ 'phabricator-filetree-view-css' => 'ea5b30a9',
'phabricator-flag-css' => 'bba8f811',
'phabricator-keyboard-shortcut' => '1ae869f2',
'phabricator-keyboard-shortcut-manager' => 'c19dd9b9',
diff --git a/src/applications/differential/storage/DifferentialChangeset.php b/src/applications/differential/storage/DifferentialChangeset.php
--- a/src/applications/differential/storage/DifferentialChangeset.php
+++ b/src/applications/differential/storage/DifferentialChangeset.php
@@ -221,6 +221,51 @@
return $this->assertAttached($this->diff);
}
+ public function newFileTreeIcon() {
+ $file_type = $this->getFileType();
+ $change_type = $this->getChangeType();
+
+ $change_icons = array(
+ DifferentialChangeType::TYPE_DELETE => 'fa-file-o',
+ );
+
+ if (isset($change_icons[$change_type])) {
+ $icon = $change_icons[$change_type];
+ } else {
+ $icon = DifferentialChangeType::getIconForFileType($file_type);
+ }
+
+ $change_colors = array(
+ DifferentialChangeType::TYPE_ADD => 'green',
+ DifferentialChangeType::TYPE_DELETE => 'red',
+ DifferentialChangeType::TYPE_MOVE_AWAY => 'orange',
+ DifferentialChangeType::TYPE_MOVE_HERE => 'orange',
+ DifferentialChangeType::TYPE_COPY_HERE => 'orange',
+ DifferentialChangeType::TYPE_MULTICOPY => 'orange',
+ );
+
+ $color = idx($change_colors, $change_type, 'bluetext');
+
+ return id(new PHUIIconView())
+ ->setIcon($icon.' '.$color);
+ }
+
+ public function getFileTreeClass() {
+ switch ($this->getChangeType()) {
+ case DifferentialChangeType::TYPE_ADD:
+ return 'filetree-added';
+ case DifferentialChangeType::TYPE_DELETE:
+ return 'filetree-deleted';
+ case DifferentialChangeType::TYPE_MOVE_AWAY:
+ case DifferentialChangeType::TYPE_MOVE_HERE:
+ case DifferentialChangeType::TYPE_COPY_HERE:
+ case DifferentialChangeType::TYPE_MULTICOPY:
+ return 'filetree-movecopy';
+ }
+
+ return null;
+ }
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
--- a/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
+++ b/src/applications/differential/view/DifferentialChangesetFileTreeSideNavBuilder.php
@@ -83,6 +83,9 @@
while (($path = $path->getNextNode())) {
$data = $path->getData();
+ $classes = array();
+ $classes[] = 'phabricator-filetree-item';
+
$name = $path->getName();
$style = 'padding-left: '.(2 + (3 * $path->getDepth())).'px';
@@ -90,8 +93,9 @@
if ($data) {
$href = '#'.$data->getAnchorName();
$title = $name;
- $icon = id(new PHUIIconView())
- ->setIcon('fa-file-text-o bluetext');
+
+ $icon = $data->newFileTreeIcon();
+ $classes[] = $data->getFileTreeClass();
} else {
$name .= '/';
$title = $path->getFullPath().'/';
@@ -112,7 +116,7 @@
'href' => $href,
'style' => $style,
'title' => $title,
- 'class' => 'phabricator-filetree-item',
+ 'class' => implode(' ', $classes),
),
array($icon, $name_element));
}
diff --git a/webroot/rsrc/css/layout/phabricator-filetree-view.css b/webroot/rsrc/css/layout/phabricator-filetree-view.css
--- a/webroot/rsrc/css/layout/phabricator-filetree-view.css
+++ b/webroot/rsrc/css/layout/phabricator-filetree-view.css
@@ -54,3 +54,15 @@
background-color: {$hovergrey};
border-left: 4px solid {$sky};
}
+
+.phabricator-filetree .filetree-added {
+ background: {$sh-greenbackground};
+}
+
+.phabricator-filetree .filetree-deleted {
+ background: {$sh-redbackground};
+}
+
+.phabricator-filetree .filetree-movecopy {
+ background: {$sh-orangebackground};
+}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 12, 2:06 PM (3 d, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6748348
Default Alt Text
D19040.diff (5 KB)

Event Timeline