Page MenuHomePhabricator

D19660.diff
No OneTemporary

D19660.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -146,7 +146,7 @@
'rsrc/css/phui/phui-comment-panel.css' => 'f50152ad',
'rsrc/css/phui/phui-crumbs-view.css' => '10728aaa',
'rsrc/css/phui/phui-curtain-view.css' => '2bdaf026',
- 'rsrc/css/phui/phui-document-pro.css' => '1a08ef4b',
+ 'rsrc/css/phui/phui-document-pro.css' => 'd033e8d5',
'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf',
'rsrc/css/phui/phui-document.css' => 'c4ac41f9',
'rsrc/css/phui/phui-feed-story.css' => '44a9c8e9',
@@ -814,7 +814,7 @@
'phui-curtain-view-css' => '2bdaf026',
'phui-document-summary-view-css' => '9ca48bdf',
'phui-document-view-css' => 'c4ac41f9',
- 'phui-document-view-pro-css' => '1a08ef4b',
+ 'phui-document-view-pro-css' => 'd033e8d5',
'phui-feed-story-css' => '44a9c8e9',
'phui-font-icon-base-css' => '870a7360',
'phui-fontkit-css' => '1320ed01',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -5021,6 +5021,7 @@
'PhrictionDocumentController' => 'applications/phriction/controller/PhrictionDocumentController.php',
'PhrictionDocumentDatasource' => 'applications/phriction/typeahead/PhrictionDocumentDatasource.php',
'PhrictionDocumentDeleteTransaction' => 'applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php',
+ 'PhrictionDocumentEditEngine' => 'applications/phriction/editor/PhrictionDocumentEditEngine.php',
'PhrictionDocumentFerretEngine' => 'applications/phriction/search/PhrictionDocumentFerretEngine.php',
'PhrictionDocumentFulltextEngine' => 'applications/phriction/search/PhrictionDocumentFulltextEngine.php',
'PhrictionDocumentHeraldAdapter' => 'applications/phriction/herald/PhrictionDocumentHeraldAdapter.php',
@@ -5042,6 +5043,7 @@
'PhrictionDocumentVersionTransaction' => 'applications/phriction/xaction/PhrictionDocumentVersionTransaction.php',
'PhrictionEditConduitAPIMethod' => 'applications/phriction/conduit/PhrictionEditConduitAPIMethod.php',
'PhrictionEditController' => 'applications/phriction/controller/PhrictionEditController.php',
+ 'PhrictionEditEngineController' => 'applications/phriction/controller/PhrictionEditEngineController.php',
'PhrictionHistoryConduitAPIMethod' => 'applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php',
'PhrictionHistoryController' => 'applications/phriction/controller/PhrictionHistoryController.php',
'PhrictionInfoConduitAPIMethod' => 'applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php',
@@ -11140,6 +11142,7 @@
'PhrictionDocumentController' => 'PhrictionController',
'PhrictionDocumentDatasource' => 'PhabricatorTypeaheadDatasource',
'PhrictionDocumentDeleteTransaction' => 'PhrictionDocumentVersionTransaction',
+ 'PhrictionDocumentEditEngine' => 'PhabricatorEditEngine',
'PhrictionDocumentFerretEngine' => 'PhabricatorFerretEngine',
'PhrictionDocumentFulltextEngine' => 'PhabricatorFulltextEngine',
'PhrictionDocumentHeraldAdapter' => 'HeraldAdapter',
@@ -11161,6 +11164,7 @@
'PhrictionDocumentVersionTransaction' => 'PhrictionDocumentTransactionType',
'PhrictionEditConduitAPIMethod' => 'PhrictionConduitAPIMethod',
'PhrictionEditController' => 'PhrictionController',
+ 'PhrictionEditEngineController' => 'PhrictionController',
'PhrictionHistoryConduitAPIMethod' => 'PhrictionConduitAPIMethod',
'PhrictionHistoryController' => 'PhrictionController',
'PhrictionInfoConduitAPIMethod' => 'PhrictionConduitAPIMethod',
diff --git a/src/applications/phriction/application/PhabricatorPhrictionApplication.php b/src/applications/phriction/application/PhabricatorPhrictionApplication.php
--- a/src/applications/phriction/application/PhabricatorPhrictionApplication.php
+++ b/src/applications/phriction/application/PhabricatorPhrictionApplication.php
@@ -63,6 +63,9 @@
'preview/(?P<slug>.*/)' => 'PhrictionMarkupPreviewController',
'diff/(?P<id>[1-9]\d*)/' => 'PhrictionDiffController',
+
+ $this->getEditRoutePattern('document/edit/')
+ => 'PhrictionEditEngineController',
),
);
}
diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php
--- a/src/applications/phriction/controller/PhrictionDocumentController.php
+++ b/src/applications/phriction/controller/PhrictionDocumentController.php
@@ -352,6 +352,13 @@
$document,
new PhrictionTransactionQuery());
+ $edit_engine = id(new PhrictionDocumentEditEngine())
+ ->setViewer($viewer)
+ ->setTargetObject($document);
+
+ $comment_view = $edit_engine
+ ->buildEditEngineCommentView($document);
+
return $this->newPage()
->setTitle($page_title)
->setCrumbs($crumbs)
@@ -368,6 +375,7 @@
array(
$children,
$timeline,
+ $comment_view,
)),
));
diff --git a/src/applications/phriction/controller/PhrictionEditEngineController.php b/src/applications/phriction/controller/PhrictionEditEngineController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phriction/controller/PhrictionEditEngineController.php
@@ -0,0 +1,14 @@
+<?php
+
+final class PhrictionEditEngineController
+ extends PhrictionController {
+
+ public function handleRequest(AphrontRequest $request) {
+ // NOTE: For now, this controller is only used to handle comments.
+
+ return id(new PhrictionDocumentEditEngine())
+ ->setController($this)
+ ->buildResponse();
+ }
+
+}
diff --git a/src/applications/phriction/editor/PhrictionDocumentEditEngine.php b/src/applications/phriction/editor/PhrictionDocumentEditEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phriction/editor/PhrictionDocumentEditEngine.php
@@ -0,0 +1,85 @@
+<?php
+
+final class PhrictionDocumentEditEngine
+ extends PhabricatorEditEngine {
+
+ const ENGINECONST = 'phriction.document';
+
+ public function isEngineConfigurable() {
+ return false;
+ }
+
+ public function getEngineName() {
+ return pht('Phriction Document');
+ }
+
+ public function getSummaryHeader() {
+ return pht('Edit Phriction Document Configurations');
+ }
+
+ public function getSummaryText() {
+ return pht('This engine is used to edit Phriction documents.');
+ }
+
+ public function getEngineApplicationClass() {
+ return 'PhabricatorPhrictionApplication';
+ }
+
+ protected function newEditableObject() {
+ $viewer = $this->getViewer();
+ return PhrictionDocument::initializeNewDocument(
+ $viewer,
+ '/');
+ }
+
+ protected function newObjectQuery() {
+ return id(new PhrictionDocumentQuery())
+ ->needContent(true);
+ }
+
+ protected function getObjectCreateTitleText($object) {
+ return pht('Create Document');
+ }
+
+ protected function getObjectCreateButtonText($object) {
+ return pht('Create Document');
+ }
+
+ protected function getObjectEditTitleText($object) {
+ return pht('Edit Document: %s', $object->getContent()->getTitle());
+ }
+
+ protected function getObjectEditShortText($object) {
+ return pht('Edit Document');
+ }
+
+ protected function getObjectCreateShortText() {
+ return pht('Create Document');
+ }
+
+ protected function getObjectName() {
+ return pht('Document');
+ }
+
+ protected function getEditorURI() {
+ return '/phriction/document/edit/';
+ }
+
+ protected function getObjectCreateCancelURI($object) {
+ return '/phriction/document/';
+ }
+
+ protected function getObjectViewURI($object) {
+ return $object->getURI();
+ }
+
+ protected function getCreateNewObjectPolicy() {
+ // NOTE: For now, this engine is only to support commenting.
+ return PhabricatorPolicies::POLICY_NOONE;
+ }
+
+ protected function buildCustomEditFields($object) {
+ return array();
+ }
+
+}
diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
--- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
+++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
@@ -243,6 +243,7 @@
$comment_box = id(new PHUIObjectBoxView())
->setFlush(true)
+ ->setNoBorder(true)
->addClass('phui-comment-form-view')
->addSigil('phui-comment-form')
->appendChild(
diff --git a/src/view/phui/PHUIObjectBoxView.php b/src/view/phui/PHUIObjectBoxView.php
--- a/src/view/phui/PHUIObjectBoxView.php
+++ b/src/view/phui/PHUIObjectBoxView.php
@@ -25,6 +25,7 @@
private $showHideHref;
private $showHideContent;
private $showHideOpen;
+ private $noBorder;
private $propertyLists = array();
@@ -147,6 +148,11 @@
return $this;
}
+ public function setNoBorder($no_border) {
+ $this->noBorder = $no_border;
+ return $this;
+ }
+
public function setValidationException(
PhabricatorApplicationTransactionValidationException $ex = null) {
$this->validationException = $ex;
@@ -156,7 +162,9 @@
protected function getTagAttributes() {
$classes = array();
$classes[] = 'phui-box';
- $classes[] = 'phui-box-border';
+ if (!$this->noBorder) {
+ $classes[] = 'phui-box-border';
+ }
$classes[] = 'phui-object-box';
$classes[] = 'mlt mll mlr';
diff --git a/webroot/rsrc/css/phui/phui-document-pro.css b/webroot/rsrc/css/phui/phui-document-pro.css
--- a/webroot/rsrc/css/phui/phui-document-pro.css
+++ b/webroot/rsrc/css/phui/phui-document-pro.css
@@ -241,10 +241,13 @@
}
}
+.phui-document-view-pro-box {
+ margin-bottom: 24px;
+}
+
.phui-document-view-pro-box .phui-timeline-view {
padding: 16px 0 0 0;
background: none;
- border-top: 1px solid rgba({$alphablue}, 0.20);
}
.phui-document-view-pro-box .phui-timeline-wedge {

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 7:50 AM (18 h, 19 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6920896
Default Alt Text
D19660.diff (9 KB)

Event Timeline