1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Remove PHUIDocumentView

Summary: Converts final call site to PHUIDocumentViewPro.

Test Plan: grep for PHUIDocumentView, view new Welcome Page

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16379
This commit is contained in:
Chad Little 2016-08-07 20:04:57 -07:00
parent 3a002b6b83
commit 679fbada44
7 changed files with 16 additions and 426 deletions

View file

@ -41,7 +41,7 @@ return array(
'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4', 'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4',
'rsrc/css/application/config/config-options.css' => '0ede4c9b', 'rsrc/css/application/config/config-options.css' => '0ede4c9b',
'rsrc/css/application/config/config-template.css' => '8e6c6fcd', 'rsrc/css/application/config/config-template.css' => '8e6c6fcd',
'rsrc/css/application/config/config-welcome.css' => '6abd79be', 'rsrc/css/application/config/config-welcome.css' => '035aa483',
'rsrc/css/application/config/setup-issue.css' => 'db7e9c40', 'rsrc/css/application/config/setup-issue.css' => 'db7e9c40',
'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a',
'rsrc/css/application/conpherence/durable-column.css' => '86396117', 'rsrc/css/application/conpherence/durable-column.css' => '86396117',
@ -131,7 +131,7 @@ return array(
'rsrc/css/phui/phui-curtain-view.css' => '7148ae25', 'rsrc/css/phui/phui-curtain-view.css' => '7148ae25',
'rsrc/css/phui/phui-document-pro.css' => 'dc3d46ed', 'rsrc/css/phui/phui-document-pro.css' => 'dc3d46ed',
'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf', 'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf',
'rsrc/css/phui/phui-document.css' => '715aedfb', 'rsrc/css/phui/phui-document.css' => 'c32e8dec',
'rsrc/css/phui/phui-feed-story.css' => 'aa49845d', 'rsrc/css/phui/phui-feed-story.css' => 'aa49845d',
'rsrc/css/phui/phui-fontkit.css' => '9cda225e', 'rsrc/css/phui/phui-fontkit.css' => '9cda225e',
'rsrc/css/phui/phui-form-view.css' => 'fab0a10f', 'rsrc/css/phui/phui-form-view.css' => 'fab0a10f',
@ -546,7 +546,7 @@ return array(
'changeset-view-manager' => 'a2828756', 'changeset-view-manager' => 'a2828756',
'conduit-api-css' => '7bc725c4', 'conduit-api-css' => '7bc725c4',
'config-options-css' => '0ede4c9b', 'config-options-css' => '0ede4c9b',
'config-welcome-css' => '6abd79be', 'config-welcome-css' => '035aa483',
'conpherence-durable-column-view' => '86396117', 'conpherence-durable-column-view' => '86396117',
'conpherence-menu-css' => 'f99fee4c', 'conpherence-menu-css' => 'f99fee4c',
'conpherence-message-pane-css' => '5897d3ac', 'conpherence-message-pane-css' => '5897d3ac',
@ -835,7 +835,7 @@ return array(
'phui-crumbs-view-css' => '9dac418c', 'phui-crumbs-view-css' => '9dac418c',
'phui-curtain-view-css' => '7148ae25', 'phui-curtain-view-css' => '7148ae25',
'phui-document-summary-view-css' => '9ca48bdf', 'phui-document-summary-view-css' => '9ca48bdf',
'phui-document-view-css' => '715aedfb', 'phui-document-view-css' => 'c32e8dec',
'phui-document-view-pro-css' => 'dc3d46ed', 'phui-document-view-pro-css' => 'dc3d46ed',
'phui-feed-story-css' => 'aa49845d', 'phui-feed-story-css' => 'aa49845d',
'phui-font-icon-base-css' => '6449bce8', 'phui-font-icon-base-css' => '6449bce8',

View file

@ -1622,9 +1622,7 @@ phutil_register_library_map(array(
'PHUIDiffTableOfContentsItemView' => 'infrastructure/diff/view/PHUIDiffTableOfContentsItemView.php', 'PHUIDiffTableOfContentsItemView' => 'infrastructure/diff/view/PHUIDiffTableOfContentsItemView.php',
'PHUIDiffTableOfContentsListView' => 'infrastructure/diff/view/PHUIDiffTableOfContentsListView.php', 'PHUIDiffTableOfContentsListView' => 'infrastructure/diff/view/PHUIDiffTableOfContentsListView.php',
'PHUIDiffTwoUpInlineCommentRowScaffold' => 'infrastructure/diff/view/PHUIDiffTwoUpInlineCommentRowScaffold.php', 'PHUIDiffTwoUpInlineCommentRowScaffold' => 'infrastructure/diff/view/PHUIDiffTwoUpInlineCommentRowScaffold.php',
'PHUIDocumentExample' => 'applications/uiexample/examples/PHUIDocumentExample.php',
'PHUIDocumentSummaryView' => 'view/phui/PHUIDocumentSummaryView.php', 'PHUIDocumentSummaryView' => 'view/phui/PHUIDocumentSummaryView.php',
'PHUIDocumentView' => 'view/phui/PHUIDocumentView.php',
'PHUIDocumentViewPro' => 'view/phui/PHUIDocumentViewPro.php', 'PHUIDocumentViewPro' => 'view/phui/PHUIDocumentViewPro.php',
'PHUIFeedStoryExample' => 'applications/uiexample/examples/PHUIFeedStoryExample.php', 'PHUIFeedStoryExample' => 'applications/uiexample/examples/PHUIFeedStoryExample.php',
'PHUIFeedStoryView' => 'view/phui/PHUIFeedStoryView.php', 'PHUIFeedStoryView' => 'view/phui/PHUIFeedStoryView.php',
@ -6270,9 +6268,7 @@ phutil_register_library_map(array(
'PHUIDiffTableOfContentsItemView' => 'AphrontView', 'PHUIDiffTableOfContentsItemView' => 'AphrontView',
'PHUIDiffTableOfContentsListView' => 'AphrontView', 'PHUIDiffTableOfContentsListView' => 'AphrontView',
'PHUIDiffTwoUpInlineCommentRowScaffold' => 'PHUIDiffInlineCommentRowScaffold', 'PHUIDiffTwoUpInlineCommentRowScaffold' => 'PHUIDiffInlineCommentRowScaffold',
'PHUIDocumentExample' => 'PhabricatorUIExample',
'PHUIDocumentSummaryView' => 'AphrontTagView', 'PHUIDocumentSummaryView' => 'AphrontTagView',
'PHUIDocumentView' => 'AphrontTagView',
'PHUIDocumentViewPro' => 'AphrontTagView', 'PHUIDocumentViewPro' => 'AphrontTagView',
'PHUIFeedStoryExample' => 'PhabricatorUIExample', 'PHUIFeedStoryExample' => 'PhabricatorUIExample',
'PHUIFeedStoryView' => 'AphrontView', 'PHUIFeedStoryView' => 'AphrontView',

View file

@ -358,7 +358,7 @@ final class PhabricatorConfigWelcomeController
$quick_header = new PHUIRemarkupView( $quick_header = new PHUIRemarkupView(
$viewer, pht('=Quick Start Guide')); $viewer, pht('=Quick Start Guide'));
return id(new PHUIDocumentView()) $document = id(new PHUIDocumentViewPro())
->setHeader($header) ->setHeader($header)
->setFluid(true) ->setFluid(true)
->appendChild($setup_header) ->appendChild($setup_header)
@ -367,6 +367,11 @@ final class PhabricatorConfigWelcomeController
->appendChild($explore) ->appendChild($explore)
->appendChild($quick_header) ->appendChild($quick_header)
->appendChild($quick); ->appendChild($quick);
return id(new PHUIBoxView())
->setBorder(true)
->appendChild($document)
->addClass('mlb');
} }
private function newItem(AphrontRequest $request, $icon, $content) { private function newItem(AphrontRequest $request, $icon, $content) {

View file

@ -1,199 +0,0 @@
<?php
final class PHUIDocumentExample extends PhabricatorUIExample {
public function getName() {
return pht('Document View');
}
public function getDescription() {
return pht('Useful for areas of large content navigation');
}
public function renderExample() {
$request = $this->getRequest();
$user = $request->getUser();
$action = id(new PHUIListItemView())
->setName(pht('Actions'))
->setType(PHUIListItemView::TYPE_LABEL);
$action1 = id(new PHUIListItemView())
->setName(pht('Edit Document'))
->setHref('#')
->setIcon('fa-edit')
->setType(PHUIListItemView::TYPE_LINK);
$action2 = id(new PHUIListItemView())
->setName(pht('Move Document'))
->setHref('#')
->setIcon('fa-arrows')
->setType(PHUIListItemView::TYPE_LINK);
$action3 = id(new PHUIListItemView())
->setName(pht('Delete Document'))
->setHref('#')
->setIcon('fa-times')
->setType(PHUIListItemView::TYPE_LINK);
$action4 = id(new PHUIListItemView())
->setName(pht('View History'))
->setHref('#')
->setIcon('fa-list')
->setType(PHUIListItemView::TYPE_LINK);
$action5 = id(new PHUIListItemView())
->setName(pht('Subscribe'))
->setHref('#')
->setIcon('fa-plus-circle')
->setType(PHUIListItemView::TYPE_LINK);
$divider = id(new PHUIListItemView())
->setType(PHUIListItemView::TYPE_DIVIDER);
$header = id(new PHUIHeaderView())
->setHeader(pht('Installation'));
$label1 = id(new PHUIListItemView())
->setName(pht('Getting Started'))
->setType(PHUIListItemView::TYPE_LABEL);
$label2 = id(new PHUIListItemView())
->setName(pht('Documentation'))
->setType(PHUIListItemView::TYPE_LABEL);
$item1 = id(new PHUIListItemView())
->setName(pht('Installation'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item3 = id(new PHUIListItemView())
->setName(pht('Adding Users'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item4 = id(new PHUIListItemView())
->setName(pht('Debugging'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$sidenav = id(new PHUIListView())
->setType(PHUIListView::SIDENAV_LIST)
->addMenuItem($action)
->addMenuItem($action1)
->addMenuItem($action2)
->addMenuItem($action3)
->addMenuItem($action4)
->addMenuItem($action5)
->addMenuItem($divider)
->addMenuItem($label1)
->addMenuItem($item1)
->addMenuItem($item2)
->addMenuItem($item3)
->addMenuItem($item4)
->addMenuItem($label2)
->addMenuItem($item2)
->addMenuItem($item3)
->addMenuItem($item4)
->addMenuItem($item1);
$home = id(new PHUIListItemView())
->setIcon('fa-home')
->setHref('#')
->setType(PHUIListItemView::TYPE_ICON);
$item1 = id(new PHUIListItemView())
->setName(pht('Installation'))
->setHref('#')
->setSelected(true)
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item3 = id(new PHUIListItemView())
->setName(pht('Adding Users'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item4 = id(new PHUIListItemView())
->setName(pht('Debugging'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$topnav = id(new PHUIListView())
->setType(PHUIListView::NAVBAR_LIST)
->addMenuItem($home)
->addMenuItem($item1)
->addMenuItem($item2)
->addMenuItem($item3)
->addMenuItem($item4);
$document = hsprintf(
'<p class="pl">Lorem ipsum dolor sit amet, consectetur adipisicing, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>'.
'<p class="plr pll plb">Lorem ipsum dolor sit amet, consectetur, '.
'sed do eiusmod tempor incididunt ut labore et dolore magna '.
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation '.
'ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis '.
'aute irure dolor in reprehenderit in voluptate velit esse cillum '.
'dolore eu fugiat nulla pariatur. Excepteur sint occaecat '.
'cupidatat non proident, sunt in culpa qui officia deserunt '.
'mollit anim id est laborum.</p>');
$content = new PHUIDocumentView();
$content->setBook(pht('Book or Project Name'), pht('Article'));
$content->setHeader($header);
$content->setFluid(true);
$content->setTopNav($topnav);
$content->setSidenav($sidenav);
$content->appendChild($document);
return $content;
}
}

View file

@ -1,162 +0,0 @@
<?php
final class PHUIDocumentView extends AphrontTagView {
/* For mobile displays, where do you want the sidebar */
const NAV_BOTTOM = 'nav_bottom';
const NAV_TOP = 'nav_top';
private $offset;
private $header;
private $sidenav;
private $topnav;
private $crumbs;
private $bookname;
private $bookdescription;
private $mobileview;
private $fluid;
public function setOffset($offset) {
$this->offset = $offset;
return $this;
}
public function setHeader(PHUIHeaderView $header) {
$header->setTall(true);
$this->header = $header;
return $this;
}
public function setSideNav(PHUIListView $list, $display = self::NAV_BOTTOM) {
$list->setType(PHUIListView::SIDENAV_LIST);
$this->sidenav = $list;
$this->mobileview = $display;
return $this;
}
public function setTopNav(PHUIListView $list) {
$list->setType(PHUIListView::NAVBAR_LIST);
$this->topnav = $list;
return $this;
}
public function setCrumbs(PHUIListView $list) {
$this->crumbs = $list;
return $this;
}
public function setBook($name, $description) {
$this->bookname = $name;
$this->bookdescription = $description;
return $this;
}
public function setFluid($fluid) {
$this->fluid = $fluid;
return $this;
}
protected function getTagAttributes() {
$classes = array();
if ($this->offset) {
$classes[] = 'phui-document-offset';
}
if ($this->fluid) {
$classes[] = 'phui-document-fluid';
}
return array(
'class' => $classes,
);
}
protected function getTagContent() {
require_celerity_resource('phui-document-view-css');
$classes = array();
$classes[] = 'phui-document-view';
if ($this->offset) {
$classes[] = 'phui-offset-view';
}
if ($this->sidenav) {
$classes[] = 'phui-sidenav-view';
}
$sidenav = null;
if ($this->sidenav) {
$sidenav = phutil_tag(
'div',
array(
'class' => 'phui-document-sidenav',
),
$this->sidenav);
}
$book = null;
if ($this->bookname) {
$book = pht('%s (%s)', $this->bookname, $this->bookdescription);
}
$topnav = null;
if ($this->topnav) {
$topnav = phutil_tag(
'div',
array(
'class' => 'phui-document-topnav',
),
$this->topnav);
}
$crumbs = null;
if ($this->crumbs) {
$crumbs = phutil_tag(
'div',
array(
'class' => 'phui-document-crumbs',
),
$this->bookName);
}
$main_content = $this->renderChildren();
if ($book) {
$this->header->setSubheader($book);
}
$content_inner = phutil_tag(
'div',
array(
'class' => 'phui-document-inner',
),
array(
$this->header,
$topnav,
$main_content,
$crumbs,
));
if ($this->mobileview == self::NAV_BOTTOM) {
$order = array($content_inner, $sidenav);
} else {
$order = array($sidenav, $content_inner);
}
$content = phutil_tag(
'div',
array(
'class' => 'phui-document-content',
),
$order);
$view = phutil_tag(
'div',
array(
'class' => implode(' ', $classes),
),
$content);
return $view;
}
}

View file

@ -19,5 +19,10 @@
width: 32px; width: 32px;
float: left; float: left;
text-align: center; text-align: center;
margin-left: 16px;
} }
.phui-document-view-pro .phui-document-content .config-welcome-box
.phabricator-remarkup {
margin: 0;
padding: 0;
}

View file

@ -8,15 +8,6 @@
position: relative; position: relative;
} }
.phui-document-view .phui-header-shell {
padding: 16px;
background-color: {$bluebackground};
}
.phui-document-content {
border-radius: 3px;
}
.device-desktop .phui-document-view { .device-desktop .phui-document-view {
border: 1px solid {$lightblueborder}; border: 1px solid {$lightblueborder};
max-width: 960px; max-width: 960px;
@ -33,44 +24,11 @@
margin: 16px; margin: 16px;
} }
.phui-crumbs-view + .phui-document-fluid .phui-document-view {
margin-top: 0;
}
.device-desktop .phui-document-view.phui-offset-view {
max-width: 800px;
}
/* Fix so that Phriction Document preview is the same width as the document */ /* Fix so that Phriction Document preview is the same width as the document */
.device-desktop .phui-remarkup-preview .phui-document-view { .device-desktop .phui-remarkup-preview .phui-document-view {
width: 800px; width: 800px;
} }
.phui-document-sidenav {
position:absolute;
width: 200px;
text-overflow: ellipsis;
top: 0;
right: 0;
}
.device-phone .phui-document-sidenav {
position: static;
width: auto;
border-top: 1px solid {$thinblueborder};
border-bottom: 1px solid {$thinblueborder};
}
.device-phone .phui-sidenav-view .phui-document-inner {
margin: 0;
}
.phui-sidenav-view .phui-document-inner {
margin-right: 200px;
border-right: 1px solid {$thinblueborder};
background: #fff;
}
.phui-document-content .phui-header-shell { .phui-document-content .phui-header-shell {
border-top: none; border-top: none;
border-bottom: 1px solid {$lightblueborder}; border-bottom: 1px solid {$lightblueborder};
@ -88,11 +46,6 @@
padding: 8px 0 4px; padding: 8px 0 4px;
} }
.phui-document-content .phui-property-list-container {
border-bottom: 1px solid {$thinblueborder};
background-color: {$lightgreybackground};
}
.legalpad .phui-document-content .phui-property-list-view { .legalpad .phui-document-content .phui-property-list-view {
border: none; border: none;
box-shadow: none; box-shadow: none;
@ -127,18 +80,10 @@
margin: 16px 0; margin: 16px 0;
} }
.device-desktop .phui-document-offset {
padding-right: 120px;
}
.phui-document-view .phui-info-severity-nodata { .phui-document-view .phui-info-severity-nodata {
background-color: {$lightgreybackground}; background-color: {$lightgreybackground};
} }
body .phui-document-view .phui-header-shell.phui-bleed-header {
padding: 0;
}
.phui-document-view .phui-property-list-section-header { .phui-document-view .phui-property-list-section-header {
padding: 20px 24px 0px; padding: 20px 24px 0px;
border-top: none; border-top: none;