Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15444013
D17966.id43213.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D17966.id43213.diff
View Options
diff --git a/src/applications/project/xaction/PhabricatorProjectSlugsTransaction.php b/src/applications/project/xaction/PhabricatorProjectSlugsTransaction.php
--- a/src/applications/project/xaction/PhabricatorProjectSlugsTransaction.php
+++ b/src/applications/project/xaction/PhabricatorProjectSlugsTransaction.php
@@ -40,26 +40,29 @@
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
+ $add = $this->renderHashtags($add);
+ $rem = $this->renderHashtags($rem);
+
if ($add && $rem) {
return pht(
'%s changed project hashtag(s), added %d: %s; removed %d: %s.',
$this->renderAuthor(),
count($add),
- $this->renderSlugList($add),
+ $this->renderValueList($add),
count($rem),
- $this->renderSlugList($rem));
+ $this->renderValueList($rem));
} else if ($add) {
return pht(
'%s added %d project hashtag(s): %s.',
$this->renderAuthor(),
count($add),
- $this->renderSlugList($add));
+ $this->renderValueList($add));
} else if ($rem) {
return pht(
'%s removed %d project hashtag(s): %s.',
$this->renderAuthor(),
count($rem),
- $this->renderSlugList($rem));
+ $this->renderValueList($rem));
}
}
@@ -70,29 +73,32 @@
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
+ $add = $this->renderHashtags($add);
+ $rem = $this->renderHashtags($rem);
+
if ($add && $rem) {
return pht(
'%s changed %s hashtag(s), added %d: %s; removed %d: %s.',
$this->renderAuthor(),
$this->renderObject(),
count($add),
- $this->renderSlugList($add),
+ $this->renderValueList($add),
count($rem),
- $this->renderSlugList($rem));
+ $this->renderValueList($rem));
} else if ($add) {
return pht(
'%s added %d %s hashtag(s): %s.',
$this->renderAuthor(),
count($add),
$this->renderObject(),
- $this->renderSlugList($add));
+ $this->renderValueList($add));
} else if ($rem) {
return pht(
'%s removed %d %s hashtag(s): %s.',
$this->renderAuthor(),
count($rem),
$this->renderObject(),
- $this->renderSlugList($rem));
+ $this->renderValueList($rem));
}
}
@@ -157,8 +163,12 @@
return $errors;
}
- private function renderSlugList($slugs) {
- return implode(', ', $slugs);
+ private function renderHashtags(array $tags) {
+ $result = array();
+ foreach ($tags as $tag) {
+ $result[] = '#'.$tag;
+ }
+ return $result;
}
}
diff --git a/src/applications/transactions/storage/PhabricatorModularTransactionType.php b/src/applications/transactions/storage/PhabricatorModularTransactionType.php
--- a/src/applications/transactions/storage/PhabricatorModularTransactionType.php
+++ b/src/applications/transactions/storage/PhabricatorModularTransactionType.php
@@ -208,6 +208,19 @@
$value);
}
+ final protected function renderValueList(array $values) {
+ $result = array();
+ foreach ($values as $value) {
+ $result[] = $this->renderValue($value);
+ }
+
+ if ($this->isTextMode()) {
+ return implode(', ', $result);
+ }
+
+ return phutil_implode_html(', ', $result);
+ }
+
final protected function renderOldValue() {
return $this->renderValue($this->getOldValue());
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 28, 7:20 AM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7725215
Default Alt Text
D17966.id43213.diff (3 KB)
Attached To
Mode
D17966: Make Project slug/hashtag transactions render a little more nicely
Attached
Detach File
Event Timeline
Log In to Comment