Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2875334
D25301.1736978887.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25301.1736978887.diff
View Options
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
@@ -193,6 +193,7 @@
$corpus = $engine->newDocumentView($ref);
$this->corpusButtons[] = $this->renderFileButton();
+ $this->corpusButtons[] = $this->renderPermalinkButton($drequest);
}
}
@@ -599,6 +600,39 @@
return $button;
}
+ /**
+ * Render a button that points to the Permalink version of this file.
+ *
+ * @param DiffusionRequest $drequest
+ * @return PHUIButtonView
+ */
+ private function renderPermalinkButton(DiffusionRequest $drequest) {
+
+ $text = pht('Permalink');
+ $icon = 'fa-link';
+
+ $href = (string)$drequest->generateURI(
+ array(
+ 'action' => 'browse',
+ 'stable' => 'true',
+ ));
+
+ $selected = $drequest->getSymbolicCommit() === $drequest->getStableCommit();
+
+ $button = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setText($text)
+ ->setHref($href)
+ ->setIcon($icon)
+ ->setSelected($selected)
+ ->setColor(PHUIButtonView::GREY);
+
+ // TODO: Somehow change the URL of the page without reloading the page.
+ // Similar dark magic is probably in the "Hide Blame" button.
+
+ return $button;
+ }
+
private function renderGitLFSButton() {
$viewer = $this->getViewer();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 15, 22:08 (2 d, 3 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1116241
Default Alt Text
D25301.1736978887.diff (1 KB)
Attached To
Mode
D25301: Diffusion: add "Permalink" button
Attached
Detach File
Event Timeline
Log In to Comment