diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 4dedae2fec..0745c41d4d 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -1,2391 +1,2391 @@ array( 'conpherence.pkg.css' => 'ff161f2d', 'conpherence.pkg.js' => 'b5b51108', - 'core.pkg.css' => '5284a0e0', + 'core.pkg.css' => '1a935531', 'core.pkg.js' => '1475bd91', 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '1ccbf3a9', 'differential.pkg.js' => '889ab0ab', 'diffusion.pkg.css' => 'b93d9b8c', 'diffusion.pkg.js' => '84c8f8fd', 'favicon.ico' => '30672e08', 'maniphest.pkg.css' => '4845691a', 'maniphest.pkg.js' => '5ab2753f', 'rsrc/audio/basic/alert.mp3' => '98461568', 'rsrc/audio/basic/bing.mp3' => 'ab8603a5', 'rsrc/audio/basic/pock.mp3' => '0cc772f5', 'rsrc/audio/basic/tap.mp3' => 'fc2fd796', 'rsrc/audio/basic/ting.mp3' => '17660001', 'rsrc/css/aphront/aphront-bars.css' => '231ac33c', 'rsrc/css/aphront/dark-console.css' => '53798a6d', 'rsrc/css/aphront/dialog-view.css' => '685c7e2d', 'rsrc/css/aphront/list-filter-view.css' => '5d6f0526', 'rsrc/css/aphront/multi-column.css' => '84cc6640', 'rsrc/css/aphront/notification.css' => '3f6c89c9', 'rsrc/css/aphront/panel-view.css' => '8427b78d', 'rsrc/css/aphront/phabricator-nav-view.css' => 'faf6a6fc', 'rsrc/css/aphront/table-view.css' => '34cf86b4', 'rsrc/css/aphront/tokenizer.css' => '15d5ff71', 'rsrc/css/aphront/tooltip.css' => '173b9431', 'rsrc/css/aphront/typeahead-browse.css' => '4f82e510', 'rsrc/css/aphront/typeahead.css' => '8a84cc7d', 'rsrc/css/application/almanac/almanac.css' => 'dbb9b3af', 'rsrc/css/application/auth/auth.css' => '0877ed6e', 'rsrc/css/application/base/main-menu-view.css' => '16053029', 'rsrc/css/application/base/notification-menu.css' => '6a697e43', 'rsrc/css/application/base/phui-theme.css' => '9f261c6b', 'rsrc/css/application/base/standard-page-view.css' => 'eb5b80c5', 'rsrc/css/application/chatlog/chatlog.css' => 'd295b020', 'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4', 'rsrc/css/application/config/config-options.css' => '0ede4c9b', 'rsrc/css/application/config/config-page.css' => 'c1d5121b', 'rsrc/css/application/config/config-template.css' => '8f18fa41', 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', 'rsrc/css/application/conpherence/color.css' => 'abb4c358', 'rsrc/css/application/conpherence/durable-column.css' => '89ea6bef', 'rsrc/css/application/conpherence/header-pane.css' => 'cb6f4e19', 'rsrc/css/application/conpherence/menu.css' => '6953e7ec', 'rsrc/css/application/conpherence/message-pane.css' => 'b0f55ecc', 'rsrc/css/application/conpherence/notification.css' => 'cef0a3fc', 'rsrc/css/application/conpherence/participant-pane.css' => '26a3ce56', 'rsrc/css/application/conpherence/transaction.css' => '85129c68', 'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4', 'rsrc/css/application/countdown/timer.css' => '16c52f5c', 'rsrc/css/application/daemon/bulk-job.css' => 'df9c1d4a', 'rsrc/css/application/dashboard/dashboard.css' => 'fe5b1869', 'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a', 'rsrc/css/application/differential/add-comment.css' => 'c47f8c40', 'rsrc/css/application/differential/changeset-view.css' => 'c3f44655', 'rsrc/css/application/differential/core.css' => '5b7b8ff4', 'rsrc/css/application/differential/phui-inline-comment.css' => 'ffd1a542', 'rsrc/css/application/differential/revision-comment.css' => '14b8565a', 'rsrc/css/application/differential/revision-history.css' => '0e8eb855', 'rsrc/css/application/differential/revision-list.css' => 'f3c47d33', 'rsrc/css/application/differential/table-of-contents.css' => 'ae4b7a55', 'rsrc/css/application/diffusion/diffusion-history.css' => 'cc283766', 'rsrc/css/application/diffusion/diffusion-icons.css' => 'a6a1e2ba', 'rsrc/css/application/diffusion/diffusion-readme.css' => '18bd3910', 'rsrc/css/application/diffusion/diffusion-source.css' => '750add59', 'rsrc/css/application/feed/feed.css' => 'ecd4ec57', 'rsrc/css/application/files/global-drag-and-drop.css' => '5c1b47c2', 'rsrc/css/application/flag/flag.css' => 'bba8f811', 'rsrc/css/application/harbormaster/harbormaster.css' => 'f491c9f4', 'rsrc/css/application/herald/herald-test.css' => 'a52e323e', 'rsrc/css/application/herald/herald.css' => 'dc31f6e9', 'rsrc/css/application/maniphest/batch-editor.css' => 'b0f0b6d5', 'rsrc/css/application/maniphest/report.css' => '9b9580b7', 'rsrc/css/application/maniphest/task-edit.css' => 'fda62a9b', 'rsrc/css/application/maniphest/task-summary.css' => '11cc5344', 'rsrc/css/application/objectselector/object-selector.css' => '85ee8ce6', 'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b', 'rsrc/css/application/paste/paste.css' => '1898e534', 'rsrc/css/application/people/people-picture-menu-item.css' => 'a06f7f34', 'rsrc/css/application/people/people-profile.css' => '4df76faf', 'rsrc/css/application/phame/phame.css' => 'b3a0b3a3', 'rsrc/css/application/pholio/pholio-edit.css' => '07676f51', 'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49', 'rsrc/css/application/pholio/pholio.css' => 'ca89d380', 'rsrc/css/application/phortune/phortune-credit-card-form.css' => '8391eb02', 'rsrc/css/application/phortune/phortune-invoice.css' => '476055e2', 'rsrc/css/application/phortune/phortune.css' => '5b99dae0', 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', 'rsrc/css/application/phriction/phriction-document-css.css' => '4282e4ad', 'rsrc/css/application/policy/policy-edit.css' => '815c66f7', 'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43', 'rsrc/css/application/policy/policy.css' => '957ea14c', 'rsrc/css/application/ponder/ponder-view.css' => 'fbd45f96', 'rsrc/css/application/project/project-card-view.css' => '3d3c1f91', 'rsrc/css/application/project/project-view.css' => '792c9057', 'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733', 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', 'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd', 'rsrc/css/application/releeph/releeph-request-typeahead.css' => '667a48ae', 'rsrc/css/application/search/application-search-view.css' => '66ee5d46', 'rsrc/css/application/search/search-results.css' => '8f8e08ed', 'rsrc/css/application/slowvote/slowvote.css' => 'a94b7230', 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', 'rsrc/css/core/core.css' => '23beb330', 'rsrc/css/core/remarkup.css' => 'd1a5e11e', 'rsrc/css/core/syntax.css' => 'cae95e89', 'rsrc/css/core/z-index.css' => '9d8f7c4b', 'rsrc/css/diviner/diviner-shared.css' => '896f1d43', '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-source-code-view.css' => '4383192f', 'rsrc/css/phui/button/phui-button-bar.css' => '39fe680c', - 'rsrc/css/phui/button/phui-button-simple.css' => '081cfeea', - 'rsrc/css/phui/button/phui-button.css' => '9f13ddcc', + 'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68', + 'rsrc/css/phui/button/phui-button.css' => '022581b4', 'rsrc/css/phui/calendar/phui-calendar-day.css' => '572b1893', 'rsrc/css/phui/calendar/phui-calendar-list.css' => '576be600', 'rsrc/css/phui/calendar/phui-calendar-month.css' => '8e10e92c', 'rsrc/css/phui/calendar/phui-calendar.css' => '477acfaa', 'rsrc/css/phui/object-item/phui-oi-big-ui.css' => '19f9369b', 'rsrc/css/phui/object-item/phui-oi-color.css' => 'cd2b9b77', 'rsrc/css/phui/object-item/phui-oi-drag-ui.css' => '08f4ccc3', 'rsrc/css/phui/object-item/phui-oi-flush-ui.css' => '9d9685d6', 'rsrc/css/phui/object-item/phui-oi-list-view.css' => '43752968', 'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => 'a8beebea', 'rsrc/css/phui/phui-action-list.css' => 'c01858f4', 'rsrc/css/phui/phui-action-panel.css' => '91c7b835', 'rsrc/css/phui/phui-badge.css' => '22c0cf4f', 'rsrc/css/phui/phui-basic-nav-view.css' => 'a0705f53', 'rsrc/css/phui/phui-big-info-view.css' => 'bd903741', 'rsrc/css/phui/phui-box.css' => '269cbc99', 'rsrc/css/phui/phui-chart.css' => '6bf6f78e', 'rsrc/css/phui/phui-cms.css' => '504b4b23', 'rsrc/css/phui/phui-comment-form.css' => '57af2e14', 'rsrc/css/phui/phui-comment-panel.css' => 'f50152ad', 'rsrc/css/phui/phui-crumbs-view.css' => '6ece3bbb', 'rsrc/css/phui/phui-curtain-view.css' => '55dd0e59', 'rsrc/css/phui/phui-document-pro.css' => '8af7ea27', 'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf', 'rsrc/css/phui/phui-document.css' => 'c32e8dec', 'rsrc/css/phui/phui-feed-story.css' => '44a9c8e9', 'rsrc/css/phui/phui-fontkit.css' => '1320ed01', 'rsrc/css/phui/phui-form-view.css' => '6175808d', 'rsrc/css/phui/phui-form.css' => 'a5570f70', 'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f', 'rsrc/css/phui/phui-header-view.css' => '73edce66', 'rsrc/css/phui/phui-hovercard.css' => 'f0592bcf', 'rsrc/css/phui/phui-icon-set-selector.css' => '87db8fee', 'rsrc/css/phui/phui-icon.css' => '4c46b6ba', 'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c', 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 'rsrc/css/phui/phui-info-view.css' => '6e217679', 'rsrc/css/phui/phui-invisible-character-view.css' => '6993d9f0', 'rsrc/css/phui/phui-lightbox.css' => '0a035e40', 'rsrc/css/phui/phui-list.css' => '12eb8ce6', 'rsrc/css/phui/phui-object-box.css' => '9cff003c', 'rsrc/css/phui/phui-pager.css' => '77d8a794', 'rsrc/css/phui/phui-pinboard-view.css' => '2495140e', 'rsrc/css/phui/phui-property-list-view.css' => '2dc7993f', 'rsrc/css/phui/phui-remarkup-preview.css' => '54a34863', 'rsrc/css/phui/phui-segment-bar-view.css' => 'b1d1b892', 'rsrc/css/phui/phui-spacing.css' => '042804d6', 'rsrc/css/phui/phui-status.css' => 'd5263e49', 'rsrc/css/phui/phui-tag-view.css' => '93b084cf', 'rsrc/css/phui/phui-timeline-view.css' => '313c7f22', 'rsrc/css/phui/phui-two-column-view.css' => 'ce9fa0b7', 'rsrc/css/phui/workboards/phui-workboard-color.css' => '783cdff5', 'rsrc/css/phui/workboards/phui-workboard.css' => '3bc85455', 'rsrc/css/phui/workboards/phui-workcard.css' => 'cca5fa92', 'rsrc/css/phui/workboards/phui-workpanel.css' => 'a3a63478', 'rsrc/css/sprite-login.css' => '587d92d7', 'rsrc/css/sprite-tokens.css' => '9cdfd599', 'rsrc/css/syntax/syntax-default.css' => '9923583c', 'rsrc/externals/d3/d3.min.js' => 'a11a5ff2', 'rsrc/externals/font/fontawesome/fontawesome-webfont.eot' => '24a7064f', 'rsrc/externals/font/fontawesome/fontawesome-webfont.ttf' => '0039fe26', 'rsrc/externals/font/fontawesome/fontawesome-webfont.woff' => 'de978a43', 'rsrc/externals/font/fontawesome/fontawesome-webfont.woff2' => '2a832057', 'rsrc/externals/font/lato/lato-bold.eot' => '99fbcf8c', 'rsrc/externals/font/lato/lato-bold.svg' => '2aa83045', 'rsrc/externals/font/lato/lato-bold.ttf' => '0a7141f7', 'rsrc/externals/font/lato/lato-bold.woff' => 'f5db2061', 'rsrc/externals/font/lato/lato-bold.woff2' => '37a94ecd', 'rsrc/externals/font/lato/lato-bolditalic.eot' => 'b93389d0', 'rsrc/externals/font/lato/lato-bolditalic.svg' => '5442e1ef', 'rsrc/externals/font/lato/lato-bolditalic.ttf' => 'dad31252', 'rsrc/externals/font/lato/lato-bolditalic.woff' => 'e53bcf47', 'rsrc/externals/font/lato/lato-bolditalic.woff2' => 'd035007f', 'rsrc/externals/font/lato/lato-italic.eot' => '6a903f5d', 'rsrc/externals/font/lato/lato-italic.svg' => '0dc7cf2f', 'rsrc/externals/font/lato/lato-italic.ttf' => '629f64f0', 'rsrc/externals/font/lato/lato-italic.woff' => '678dc4bb', 'rsrc/externals/font/lato/lato-italic.woff2' => '7c8dd650', 'rsrc/externals/font/lato/lato-regular.eot' => '848dfb1e', 'rsrc/externals/font/lato/lato-regular.svg' => 'cbd5fd6b', 'rsrc/externals/font/lato/lato-regular.ttf' => 'e270165b', 'rsrc/externals/font/lato/lato-regular.woff' => '13d39fe2', 'rsrc/externals/font/lato/lato-regular.woff2' => '57a9f742', 'rsrc/externals/javelin/core/Event.js' => '2ee659ce', 'rsrc/externals/javelin/core/Stratcom.js' => '6ad39b6f', 'rsrc/externals/javelin/core/__tests__/event-stop-and-kill.js' => '717554e4', 'rsrc/externals/javelin/core/__tests__/install.js' => 'c432ee85', 'rsrc/externals/javelin/core/__tests__/stratcom.js' => '88bf7313', 'rsrc/externals/javelin/core/__tests__/util.js' => 'e251703d', 'rsrc/externals/javelin/core/init.js' => '3010e992', 'rsrc/externals/javelin/core/init_node.js' => 'c234aded', 'rsrc/externals/javelin/core/install.js' => '05270951', 'rsrc/externals/javelin/core/util.js' => '93cc50d6', 'rsrc/externals/javelin/docs/Base.js' => '74676256', 'rsrc/externals/javelin/docs/onload.js' => 'e819c479', 'rsrc/externals/javelin/ext/fx/Color.js' => '7e41274a', 'rsrc/externals/javelin/ext/fx/FX.js' => '54b612ba', 'rsrc/externals/javelin/ext/reactor/core/DynVal.js' => 'f6555212', 'rsrc/externals/javelin/ext/reactor/core/Reactor.js' => '2b8de964', 'rsrc/externals/javelin/ext/reactor/core/ReactorNode.js' => '1ad0a787', 'rsrc/externals/javelin/ext/reactor/core/ReactorNodeCalmer.js' => '76f4ebed', 'rsrc/externals/javelin/ext/reactor/dom/RDOM.js' => 'c90a04fc', 'rsrc/externals/javelin/ext/view/HTMLView.js' => 'fe287620', 'rsrc/externals/javelin/ext/view/View.js' => '0f764c35', 'rsrc/externals/javelin/ext/view/ViewInterpreter.js' => 'f829edb3', 'rsrc/externals/javelin/ext/view/ViewPlaceholder.js' => '47830651', 'rsrc/externals/javelin/ext/view/ViewRenderer.js' => '6c2b09a2', 'rsrc/externals/javelin/ext/view/ViewVisitor.js' => 'efe49472', 'rsrc/externals/javelin/ext/view/__tests__/HTMLView.js' => 'f92d7bcb', 'rsrc/externals/javelin/ext/view/__tests__/View.js' => '6450b38b', 'rsrc/externals/javelin/ext/view/__tests__/ViewInterpreter.js' => '7a94d6a5', 'rsrc/externals/javelin/ext/view/__tests__/ViewRenderer.js' => '6ea96ac9', 'rsrc/externals/javelin/lib/Cookie.js' => '62dfea03', 'rsrc/externals/javelin/lib/DOM.js' => '4976858c', 'rsrc/externals/javelin/lib/History.js' => 'd4505101', 'rsrc/externals/javelin/lib/JSON.js' => '69adf288', 'rsrc/externals/javelin/lib/Leader.js' => '7f243deb', 'rsrc/externals/javelin/lib/Mask.js' => '8a41885b', 'rsrc/externals/javelin/lib/Quicksand.js' => '6b8ef10b', 'rsrc/externals/javelin/lib/Request.js' => '94b750d2', 'rsrc/externals/javelin/lib/Resource.js' => '44959b73', 'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692', 'rsrc/externals/javelin/lib/Router.js' => '29274e2b', 'rsrc/externals/javelin/lib/Scrollbar.js' => '9065f639', 'rsrc/externals/javelin/lib/Sound.js' => '949c0fe5', 'rsrc/externals/javelin/lib/URI.js' => 'c989ade3', 'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8', 'rsrc/externals/javelin/lib/WebSocket.js' => '3ffe32d6', 'rsrc/externals/javelin/lib/Workflow.js' => '1e911d0f', 'rsrc/externals/javelin/lib/__tests__/Cookie.js' => '5ed109e8', 'rsrc/externals/javelin/lib/__tests__/DOM.js' => 'c984504b', 'rsrc/externals/javelin/lib/__tests__/JSON.js' => '837a7d68', 'rsrc/externals/javelin/lib/__tests__/URI.js' => '1e45fda9', 'rsrc/externals/javelin/lib/__tests__/behavior.js' => '1ea62783', 'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a', 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '8d3bc1b2', 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => '70baed2f', 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => '185bbd53', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '013ffff9', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js' => '54f314a0', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js' => '0fcf201c', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadStaticSource.js' => '6c0e62fa', 'rsrc/favicons/apple-touch-icon-114x114.png' => '12a24178', 'rsrc/favicons/apple-touch-icon-120x120.png' => '0d1543c7', 'rsrc/favicons/apple-touch-icon-144x144.png' => '8043b5a5', 'rsrc/favicons/apple-touch-icon-152x152.png' => '65905ecd', 'rsrc/favicons/apple-touch-icon-57x57.png' => '2bfc7b0a', 'rsrc/favicons/apple-touch-icon-60x60.png' => '8ff52925', 'rsrc/favicons/apple-touch-icon-72x72.png' => 'a2bb65d6', 'rsrc/favicons/apple-touch-icon-76x76.png' => '2d061a11', 'rsrc/favicons/favicon-128.png' => '72f7e812', 'rsrc/favicons/favicon-16x16.png' => 'fc6275ba', 'rsrc/favicons/favicon-196x196.png' => '95db275e', 'rsrc/favicons/favicon-32x32.png' => '5bd18b6c', 'rsrc/favicons/favicon-96x96.png' => '7242c8e9', 'rsrc/favicons/favicon-mention.ico' => '1fdd0fa4', 'rsrc/favicons/favicon-message.ico' => '115bc010', 'rsrc/favicons/favicon.ico' => 'cdb11121', 'rsrc/favicons/mask-icon.svg' => 'e132a80f', 'rsrc/favicons/mstile-144x144.png' => '310c2ee5', 'rsrc/favicons/mstile-150x150.png' => '74bf5133', 'rsrc/favicons/mstile-310x150.png' => '4a49d3ee', 'rsrc/favicons/mstile-310x310.png' => 'a52ab264', 'rsrc/favicons/mstile-70x70.png' => '5edce7b8', 'rsrc/image/BFCFDA.png' => 'd5ec91f4', 'rsrc/image/actions/edit.png' => '2fc41442', 'rsrc/image/avatar.png' => '17d346a4', 'rsrc/image/checker_dark.png' => 'd8e65881', 'rsrc/image/checker_light.png' => 'a0155918', 'rsrc/image/checker_lighter.png' => 'd5da91b6', 'rsrc/image/d5d8e1.png' => '0c2a1497', 'rsrc/image/darkload.gif' => '1ffd3ec6', 'rsrc/image/divot.png' => '94dded62', 'rsrc/image/examples/hero.png' => '979a86ae', 'rsrc/image/grippy_texture.png' => 'aca81e2f', 'rsrc/image/icon/fatcow/arrow_branch.png' => '2537c01c', 'rsrc/image/icon/fatcow/arrow_merge.png' => '21b660e0', 'rsrc/image/icon/fatcow/calendar_edit.png' => '24632275', 'rsrc/image/icon/fatcow/document_black.png' => '45fe1c60', 'rsrc/image/icon/fatcow/flag_blue.png' => 'a01abb1d', 'rsrc/image/icon/fatcow/flag_finish.png' => '67825cee', 'rsrc/image/icon/fatcow/flag_ghost.png' => '20ca8783', 'rsrc/image/icon/fatcow/flag_green.png' => '7e0eaa7a', 'rsrc/image/icon/fatcow/flag_orange.png' => '9e73df66', 'rsrc/image/icon/fatcow/flag_pink.png' => '7e92f3b2', 'rsrc/image/icon/fatcow/flag_purple.png' => 'cc517522', 'rsrc/image/icon/fatcow/flag_red.png' => '04ec726f', 'rsrc/image/icon/fatcow/flag_yellow.png' => '73946fd4', 'rsrc/image/icon/fatcow/key_question.png' => '52a0c26a', 'rsrc/image/icon/fatcow/link.png' => '7afd4d5e', 'rsrc/image/icon/fatcow/page_white_edit.png' => '39a2eed8', 'rsrc/image/icon/fatcow/page_white_put.png' => '08c95a0c', 'rsrc/image/icon/fatcow/source/conduit.png' => '4ea01d2f', 'rsrc/image/icon/fatcow/source/email.png' => '9bab3239', 'rsrc/image/icon/fatcow/source/fax.png' => '04195e68', 'rsrc/image/icon/fatcow/source/mobile.png' => 'f1321264', 'rsrc/image/icon/fatcow/source/tablet.png' => '49396799', 'rsrc/image/icon/fatcow/source/web.png' => '136ccb5d', 'rsrc/image/icon/subscribe.png' => 'd03ed5a5', 'rsrc/image/icon/tango/attachment.png' => 'ecc8022e', 'rsrc/image/icon/tango/edit.png' => '929a1363', 'rsrc/image/icon/tango/go-down.png' => '96d95e43', 'rsrc/image/icon/tango/log.png' => 'b08cc63a', 'rsrc/image/icon/tango/upload.png' => '7bbb7984', 'rsrc/image/icon/unsubscribe.png' => '25725013', 'rsrc/image/lightblue-header.png' => '5c168b6d', 'rsrc/image/logo/light-eye.png' => '1a576ddd', 'rsrc/image/main_texture.png' => '29a2c5ad', 'rsrc/image/menu_texture.png' => '5a17580d', 'rsrc/image/people/harding.png' => '45aa614e', 'rsrc/image/people/jefferson.png' => 'afca0e53', 'rsrc/image/people/lincoln.png' => '9369126d', 'rsrc/image/people/mckinley.png' => 'fb8f16ce', 'rsrc/image/people/taft.png' => 'd7bc402c', 'rsrc/image/people/user0.png' => '03dacaea', 'rsrc/image/people/user1.png' => '4a4e7702', 'rsrc/image/people/user2.png' => '47a0ee40', 'rsrc/image/people/user3.png' => '835ff627', 'rsrc/image/people/user4.png' => 'b0e830f1', 'rsrc/image/people/user5.png' => '9c95b369', 'rsrc/image/people/user6.png' => 'ba3fbfb0', 'rsrc/image/people/user7.png' => 'da613924', 'rsrc/image/people/user8.png' => 'f1035edf', 'rsrc/image/people/user9.png' => '66730be3', 'rsrc/image/people/washington.png' => '40dd301c', 'rsrc/image/phrequent_active.png' => 'a466a8ed', 'rsrc/image/phrequent_inactive.png' => 'bfc15a69', 'rsrc/image/resize.png' => 'fd476de4', 'rsrc/image/sprite-login-X2.png' => '4abee916', 'rsrc/image/sprite-login.png' => '2b9663fd', 'rsrc/image/sprite-tokens-X2.png' => '804a5232', 'rsrc/image/sprite-tokens.png' => 'b41d03da', 'rsrc/image/texture/card-gradient.png' => '815f26e8', 'rsrc/image/texture/dark-menu-hover.png' => '5fa7ece8', 'rsrc/image/texture/dark-menu.png' => '7e22296e', 'rsrc/image/texture/grip.png' => '719404f3', 'rsrc/image/texture/panel-header-gradient.png' => 'e3b8dcfe', 'rsrc/image/texture/phlnx-bg.png' => '8d819209', 'rsrc/image/texture/pholio-background.gif' => 'ba29239c', 'rsrc/image/texture/table_header.png' => '5c433037', 'rsrc/image/texture/table_header_hover.png' => '038ec3b9', 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 'rsrc/js/application/aphlict/Aphlict.js' => 'e1d4b11a', 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'caade6f2', 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '3c547a81', 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '5e2634b9', 'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => 'd5a2d665', 'rsrc/js/application/calendar/behavior-day-view.js' => '4b3c4443', 'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9', 'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256', 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '4d863052', 'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762', 'rsrc/js/application/conpherence/behavior-durable-column.js' => '2ae077e1', 'rsrc/js/application/conpherence/behavior-menu.js' => 'c9b99b77', 'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8', 'rsrc/js/application/conpherence/behavior-pontificate.js' => '55616e04', 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', 'rsrc/js/application/conpherence/behavior-toggle-widget.js' => '3dbf94d5', 'rsrc/js/application/countdown/timer.js' => 'e4cc26b3', 'rsrc/js/application/daemon/behavior-bulk-job-reload.js' => 'edf8a145', 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e', 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 'rsrc/js/application/diff/DiffChangeset.js' => 'd498bddb', 'rsrc/js/application/diff/DiffChangesetList.js' => '0db8cdca', 'rsrc/js/application/diff/DiffInline.js' => '1d17130f', 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 'rsrc/js/application/differential/behavior-populate.js' => '5e41c819', 'rsrc/js/application/differential/behavior-user-select.js' => 'a8d8459d', 'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => 'c93358e3', 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a', 'rsrc/js/application/diffusion/behavior-commit-branches.js' => 'bdaf4d04', 'rsrc/js/application/diffusion/behavior-commit-graph.js' => '49ae8328', 'rsrc/js/application/diffusion/behavior-diffusion-browse-file.js' => '054a0f0b', 'rsrc/js/application/diffusion/behavior-jump-to.js' => '73d09eef', 'rsrc/js/application/diffusion/behavior-load-blame.js' => '42126667', 'rsrc/js/application/diffusion/behavior-locate-file.js' => '6d3e1947', 'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'f01586dc', 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => 'e5822781', 'rsrc/js/application/drydock/drydock-live-operation-status.js' => '901935ef', 'rsrc/js/application/files/behavior-icon-composer.js' => '8499b6ab', 'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888', 'rsrc/js/application/herald/HeraldRuleEditor.js' => 'd6a7e717', 'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec', 'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3', 'rsrc/js/application/maniphest/behavior-batch-editor.js' => '782ab6e7', 'rsrc/js/application/maniphest/behavior-batch-selector.js' => '0825c27a', 'rsrc/js/application/maniphest/behavior-line-chart.js' => 'e4232876', 'rsrc/js/application/maniphest/behavior-list-edit.js' => 'a9f88de2', 'rsrc/js/application/maniphest/behavior-subpriorityeditor.js' => '71237763', 'rsrc/js/application/owners/OwnersPathEditor.js' => 'aa1733d0', 'rsrc/js/application/owners/owners-path-editor.js' => '7a68dda3', 'rsrc/js/application/passphrase/passphrase-credential-control.js' => '3cb0b2fc', 'rsrc/js/application/pholio/behavior-pholio-mock-edit.js' => 'bee502c8', 'rsrc/js/application/pholio/behavior-pholio-mock-view.js' => 'fbe497e7', 'rsrc/js/application/phortune/behavior-stripe-payment-form.js' => 'a6b98425', 'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'fc91ab6c', 'rsrc/js/application/phortune/phortune-credit-card-form.js' => '2290aeef', 'rsrc/js/application/policy/behavior-policy-control.js' => 'd0c516d5', 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '5e9f347c', 'rsrc/js/application/projects/WorkboardBoard.js' => '8935deef', 'rsrc/js/application/projects/WorkboardCard.js' => 'c587b80f', 'rsrc/js/application/projects/WorkboardColumn.js' => '758b4758', 'rsrc/js/application/projects/WorkboardController.js' => '26167537', 'rsrc/js/application/projects/behavior-project-boards.js' => '4250a34e', 'rsrc/js/application/projects/behavior-project-create.js' => '065227cc', 'rsrc/js/application/projects/behavior-reorder-columns.js' => 'e1d25dfb', 'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf', 'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8', 'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f', 'rsrc/js/application/repository/repository-crossreference.js' => 'e5339c43', 'rsrc/js/application/search/behavior-reorder-profile-menu-items.js' => 'e2e0a072', 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', 'rsrc/js/application/transactions/behavior-comment-actions.js' => '9a6dd75c', 'rsrc/js/application/transactions/behavior-reorder-configs.js' => 'd7a74243', 'rsrc/js/application/transactions/behavior-reorder-fields.js' => 'b59e1e96', 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'ae95d984', 'rsrc/js/application/transactions/behavior-transaction-comment-form.js' => 'b23b49e6', 'rsrc/js/application/transactions/behavior-transaction-list.js' => '1f6794f6', 'rsrc/js/application/typeahead/behavior-typeahead-browse.js' => '635de1ec', 'rsrc/js/application/typeahead/behavior-typeahead-search.js' => '93d0c9e3', 'rsrc/js/application/uiexample/gesture-example.js' => '558829c2', 'rsrc/js/application/uiexample/notification-example.js' => '8ce821c5', 'rsrc/js/core/Busy.js' => '59a7976a', 'rsrc/js/core/DragAndDropFileUpload.js' => '58dea2fa', 'rsrc/js/core/DraggableList.js' => 'bea6e7f4', 'rsrc/js/core/Favicon.js' => '1fe2510c', 'rsrc/js/core/FileUpload.js' => '680ea2c8', 'rsrc/js/core/Hovercard.js' => '1bd28176', 'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2', 'rsrc/js/core/KeyboardShortcutManager.js' => 'c19dd9b9', 'rsrc/js/core/MultirowRowManager.js' => 'b5d57730', 'rsrc/js/core/Notification.js' => 'ccf1cbf8', 'rsrc/js/core/Prefab.js' => 'c5af80a2', 'rsrc/js/core/ShapedRequest.js' => '7cbe244b', 'rsrc/js/core/TextAreaUtils.js' => '320810c8', 'rsrc/js/core/Title.js' => '485aaa6c', 'rsrc/js/core/ToolTip.js' => '358b8c04', 'rsrc/js/core/behavior-active-nav.js' => 'e379b58e', 'rsrc/js/core/behavior-audio-source.js' => '59b251eb', 'rsrc/js/core/behavior-autofocus.js' => '7319e029', 'rsrc/js/core/behavior-badge-view.js' => '8ff5e24c', 'rsrc/js/core/behavior-choose-control.js' => '327a00d1', 'rsrc/js/core/behavior-copy.js' => 'b0b8f86d', 'rsrc/js/core/behavior-detect-timezone.js' => '4c193c96', 'rsrc/js/core/behavior-device.js' => 'bb1dd507', 'rsrc/js/core/behavior-drag-and-drop-textarea.js' => '484a6e22', 'rsrc/js/core/behavior-error-log.js' => '6882e80a', 'rsrc/js/core/behavior-fancy-datepicker.js' => 'a9210d03', 'rsrc/js/core/behavior-file-tree.js' => '88236f00', 'rsrc/js/core/behavior-form.js' => '5c54cbf3', 'rsrc/js/core/behavior-gesture.js' => '3ab51e2c', 'rsrc/js/core/behavior-global-drag-and-drop.js' => '960f6a39', 'rsrc/js/core/behavior-high-security-warning.js' => 'a464fe03', 'rsrc/js/core/behavior-history-install.js' => '7ee2b591', 'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64', 'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', 'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0', 'rsrc/js/core/behavior-lightbox-attachments.js' => '560f41da', 'rsrc/js/core/behavior-line-linker.js' => '1499a8cb', 'rsrc/js/core/behavior-more.js' => 'a80d0378', 'rsrc/js/core/behavior-object-selector.js' => 'e0ec7f2f', 'rsrc/js/core/behavior-oncopy.js' => '2926fff2', 'rsrc/js/core/behavior-phabricator-nav.js' => '947753e0', 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'acd29eee', 'rsrc/js/core/behavior-read-only-warning.js' => 'ba158207', 'rsrc/js/core/behavior-refresh-csrf.js' => 'ab2f381b', 'rsrc/js/core/behavior-remarkup-preview.js' => '4b700e9e', 'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e', 'rsrc/js/core/behavior-reveal-content.js' => '60821bc7', 'rsrc/js/core/behavior-scrollbar.js' => '834a1173', 'rsrc/js/core/behavior-search-typeahead.js' => 'd0a99ab4', 'rsrc/js/core/behavior-select-content.js' => 'bf5374ef', 'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6', 'rsrc/js/core/behavior-setup-check-https.js' => '491416b3', 'rsrc/js/core/behavior-time-typeahead.js' => '522431f7', 'rsrc/js/core/behavior-toggle-class.js' => '92b9ec77', 'rsrc/js/core/behavior-tokenizer.js' => 'b3a4b884', 'rsrc/js/core/behavior-tooltip.js' => 'c420b0b9', 'rsrc/js/core/behavior-user-menu.js' => '31420f77', 'rsrc/js/core/behavior-watch-anchor.js' => '9f36c42d', 'rsrc/js/core/behavior-workflow.js' => '0a3f3021', 'rsrc/js/core/darkconsole/DarkLog.js' => 'c8e1ffe3', 'rsrc/js/core/darkconsole/DarkMessage.js' => 'c48cccdd', 'rsrc/js/core/darkconsole/behavior-dark-console.js' => '17bb8539', 'rsrc/js/core/phtize.js' => 'd254d646', 'rsrc/js/phui/behavior-phui-dropdown-menu.js' => 'b95d6f7d', 'rsrc/js/phui/behavior-phui-file-upload.js' => 'b003d4fb', 'rsrc/js/phui/behavior-phui-submenu.js' => 'a6f7a73b', 'rsrc/js/phui/behavior-phui-tab-group.js' => '0a0b10e9', 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 'rsrc/js/phuix/PHUIXActionView.js' => 'b3465b9b', 'rsrc/js/phuix/PHUIXAutocomplete.js' => 'f6699267', - 'rsrc/js/phuix/PHUIXButtonView.js' => 'b3c515be', + 'rsrc/js/phuix/PHUIXButtonView.js' => 'a37126bd', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => '8018ee50', 'rsrc/js/phuix/PHUIXExample.js' => '68af71ca', 'rsrc/js/phuix/PHUIXFormControl.js' => '83e03671', 'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b', ), 'symbols' => array( 'almanac-css' => 'dbb9b3af', 'aphront-bars' => '231ac33c', 'aphront-dark-console-css' => '53798a6d', 'aphront-dialog-view-css' => '685c7e2d', 'aphront-list-filter-view-css' => '5d6f0526', 'aphront-multi-column-view-css' => '84cc6640', 'aphront-panel-view-css' => '8427b78d', 'aphront-table-view-css' => '34cf86b4', 'aphront-tokenizer-control-css' => '15d5ff71', 'aphront-tooltip-css' => '173b9431', 'aphront-typeahead-control-css' => '8a84cc7d', 'application-search-view-css' => '66ee5d46', 'auth-css' => '0877ed6e', 'bulk-job-css' => 'df9c1d4a', 'conduit-api-css' => '7bc725c4', 'config-options-css' => '0ede4c9b', 'config-page-css' => 'c1d5121b', 'conpherence-color-css' => 'abb4c358', 'conpherence-durable-column-view' => '89ea6bef', 'conpherence-header-pane-css' => 'cb6f4e19', 'conpherence-menu-css' => '6953e7ec', 'conpherence-message-pane-css' => 'b0f55ecc', 'conpherence-notification-css' => 'cef0a3fc', 'conpherence-participant-pane-css' => '26a3ce56', 'conpherence-thread-manager' => '4d863052', 'conpherence-transaction-css' => '85129c68', 'd3' => 'a11a5ff2', 'differential-changeset-view-css' => 'c3f44655', 'differential-core-view-css' => '5b7b8ff4', 'differential-revision-add-comment-css' => 'c47f8c40', 'differential-revision-comment-css' => '14b8565a', 'differential-revision-history-css' => '0e8eb855', 'differential-revision-list-css' => 'f3c47d33', 'differential-table-of-contents-css' => 'ae4b7a55', 'diffusion-history-css' => 'cc283766', 'diffusion-icons-css' => 'a6a1e2ba', 'diffusion-readme-css' => '18bd3910', 'diffusion-source-css' => '750add59', 'diviner-shared-css' => '896f1d43', 'font-fontawesome' => 'e838e088', 'font-lato' => 'c7ccd872', 'global-drag-and-drop-css' => '5c1b47c2', 'harbormaster-css' => 'f491c9f4', 'herald-css' => 'dc31f6e9', 'herald-rule-editor' => 'd6a7e717', 'herald-test-css' => 'a52e323e', 'inline-comment-summary-css' => '51efda3a', 'javelin-aphlict' => 'e1d4b11a', 'javelin-behavior' => '61cbc29a', 'javelin-behavior-aphlict-dropdown' => 'caade6f2', 'javelin-behavior-aphlict-listen' => '3c547a81', 'javelin-behavior-aphlict-status' => '5e2634b9', 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', 'javelin-behavior-aphront-drag-and-drop-textarea' => '484a6e22', 'javelin-behavior-aphront-form-disable-on-submit' => '5c54cbf3', 'javelin-behavior-aphront-more' => 'a80d0378', 'javelin-behavior-audio-source' => '59b251eb', 'javelin-behavior-audit-preview' => 'd835b03a', 'javelin-behavior-badge-view' => '8ff5e24c', 'javelin-behavior-bulk-job-reload' => 'edf8a145', 'javelin-behavior-calendar-month-view' => 'fe33e256', 'javelin-behavior-choose-control' => '327a00d1', 'javelin-behavior-comment-actions' => '9a6dd75c', 'javelin-behavior-config-reorder-fields' => 'b6993408', 'javelin-behavior-conpherence-menu' => 'c9b99b77', 'javelin-behavior-conpherence-participant-pane' => '8604caa8', 'javelin-behavior-conpherence-pontificate' => '55616e04', 'javelin-behavior-conpherence-search' => '9bbf3762', 'javelin-behavior-countdown-timer' => 'e4cc26b3', 'javelin-behavior-dark-console' => '17bb8539', 'javelin-behavior-dashboard-async-panel' => '469c0d9e', 'javelin-behavior-dashboard-move-panels' => '408bf173', 'javelin-behavior-dashboard-query-panel-select' => '453c5375', 'javelin-behavior-dashboard-tab-panel' => 'd4eecc63', 'javelin-behavior-day-view' => '4b3c4443', 'javelin-behavior-desktop-notifications-control' => 'd5a2d665', 'javelin-behavior-detect-timezone' => '4c193c96', 'javelin-behavior-device' => 'bb1dd507', 'javelin-behavior-diff-preview-link' => '051c7832', 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 'javelin-behavior-differential-feedback-preview' => '51c5ad07', 'javelin-behavior-differential-populate' => '5e41c819', 'javelin-behavior-differential-user-select' => 'a8d8459d', 'javelin-behavior-diffusion-browse-file' => '054a0f0b', 'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04', 'javelin-behavior-diffusion-commit-graph' => '49ae8328', 'javelin-behavior-diffusion-jump-to' => '73d09eef', 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc', 'javelin-behavior-doorkeeper-tag' => 'e5822781', 'javelin-behavior-drydock-live-operation-status' => '901935ef', 'javelin-behavior-durable-column' => '2ae077e1', 'javelin-behavior-editengine-reorder-configs' => 'd7a74243', 'javelin-behavior-editengine-reorder-fields' => 'b59e1e96', 'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-event-all-day' => 'b41537c9', 'javelin-behavior-fancy-datepicker' => 'a9210d03', 'javelin-behavior-global-drag-and-drop' => '960f6a39', 'javelin-behavior-herald-rule-editor' => '7ebaeed3', 'javelin-behavior-high-security-warning' => 'a464fe03', 'javelin-behavior-history-install' => '7ee2b591', 'javelin-behavior-icon-composer' => '8499b6ab', 'javelin-behavior-launch-icon-composer' => '48086888', 'javelin-behavior-lightbox-attachments' => '560f41da', 'javelin-behavior-line-chart' => 'e4232876', 'javelin-behavior-load-blame' => '42126667', 'javelin-behavior-maniphest-batch-editor' => '782ab6e7', 'javelin-behavior-maniphest-batch-selector' => '0825c27a', 'javelin-behavior-maniphest-list-editor' => 'a9f88de2', 'javelin-behavior-maniphest-subpriority-editor' => '71237763', 'javelin-behavior-owners-path-editor' => '7a68dda3', 'javelin-behavior-passphrase-credential-control' => '3cb0b2fc', 'javelin-behavior-phabricator-active-nav' => 'e379b58e', 'javelin-behavior-phabricator-autofocus' => '7319e029', 'javelin-behavior-phabricator-clipboard-copy' => 'b0b8f86d', 'javelin-behavior-phabricator-file-tree' => '88236f00', 'javelin-behavior-phabricator-gesture' => '3ab51e2c', 'javelin-behavior-phabricator-gesture-example' => '558829c2', 'javelin-behavior-phabricator-keyboard-pager' => 'a8da01f0', 'javelin-behavior-phabricator-keyboard-shortcuts' => '01fca1f0', 'javelin-behavior-phabricator-line-linker' => '1499a8cb', 'javelin-behavior-phabricator-nav' => '947753e0', 'javelin-behavior-phabricator-notification-example' => '8ce821c5', 'javelin-behavior-phabricator-object-selector' => 'e0ec7f2f', 'javelin-behavior-phabricator-oncopy' => '2926fff2', 'javelin-behavior-phabricator-remarkup-assist' => 'acd29eee', 'javelin-behavior-phabricator-reveal-content' => '60821bc7', 'javelin-behavior-phabricator-search-typeahead' => 'd0a99ab4', 'javelin-behavior-phabricator-show-older-transactions' => 'ae95d984', 'javelin-behavior-phabricator-tooltips' => 'c420b0b9', 'javelin-behavior-phabricator-transaction-comment-form' => 'b23b49e6', 'javelin-behavior-phabricator-transaction-list' => '1f6794f6', 'javelin-behavior-phabricator-watch-anchor' => '9f36c42d', 'javelin-behavior-pholio-mock-edit' => 'bee502c8', 'javelin-behavior-pholio-mock-view' => 'fbe497e7', 'javelin-behavior-phui-dropdown-menu' => 'b95d6f7d', 'javelin-behavior-phui-file-upload' => 'b003d4fb', 'javelin-behavior-phui-hovercards' => 'bcaccd64', 'javelin-behavior-phui-submenu' => 'a6f7a73b', 'javelin-behavior-phui-tab-group' => '0a0b10e9', 'javelin-behavior-phuix-example' => '68af71ca', 'javelin-behavior-policy-control' => 'd0c516d5', 'javelin-behavior-policy-rule-editor' => '5e9f347c', 'javelin-behavior-project-boards' => '4250a34e', 'javelin-behavior-project-create' => '065227cc', 'javelin-behavior-quicksand-blacklist' => '7927a7d3', 'javelin-behavior-read-only-warning' => 'ba158207', 'javelin-behavior-refresh-csrf' => 'ab2f381b', 'javelin-behavior-releeph-preview-branch' => 'b2b4fbaf', 'javelin-behavior-releeph-request-state-change' => 'a0b57eb8', 'javelin-behavior-releeph-request-typeahead' => 'de2e896f', 'javelin-behavior-remarkup-preview' => '4b700e9e', 'javelin-behavior-reorder-applications' => '76b9fc3e', 'javelin-behavior-reorder-columns' => 'e1d25dfb', 'javelin-behavior-reorder-profile-menu-items' => 'e2e0a072', 'javelin-behavior-repository-crossreference' => 'e5339c43', 'javelin-behavior-scrollbar' => '834a1173', 'javelin-behavior-search-reorder-queries' => 'e9581f08', 'javelin-behavior-select-content' => 'bf5374ef', 'javelin-behavior-select-on-click' => '4e3e79a6', 'javelin-behavior-setup-check-https' => '491416b3', 'javelin-behavior-slowvote-embed' => '887ad43f', 'javelin-behavior-stripe-payment-form' => 'a6b98425', 'javelin-behavior-test-payment-form' => 'fc91ab6c', 'javelin-behavior-time-typeahead' => '522431f7', 'javelin-behavior-toggle-class' => '92b9ec77', 'javelin-behavior-toggle-widget' => '3dbf94d5', 'javelin-behavior-typeahead-browse' => '635de1ec', 'javelin-behavior-typeahead-search' => '93d0c9e3', 'javelin-behavior-user-menu' => '31420f77', 'javelin-behavior-view-placeholder' => '47830651', 'javelin-behavior-workflow' => '0a3f3021', 'javelin-color' => '7e41274a', 'javelin-cookie' => '62dfea03', 'javelin-diffusion-locate-file-source' => 'c93358e3', 'javelin-dom' => '4976858c', 'javelin-dynval' => 'f6555212', 'javelin-event' => '2ee659ce', 'javelin-fx' => '54b612ba', 'javelin-history' => 'd4505101', 'javelin-install' => '05270951', 'javelin-json' => '69adf288', 'javelin-leader' => '7f243deb', 'javelin-magical-init' => '3010e992', 'javelin-mask' => '8a41885b', 'javelin-quicksand' => '6b8ef10b', 'javelin-reactor' => '2b8de964', 'javelin-reactor-dom' => 'c90a04fc', 'javelin-reactor-node-calmer' => '76f4ebed', 'javelin-reactornode' => '1ad0a787', 'javelin-request' => '94b750d2', 'javelin-resource' => '44959b73', 'javelin-routable' => 'b3e7d692', 'javelin-router' => '29274e2b', 'javelin-scrollbar' => '9065f639', 'javelin-sound' => '949c0fe5', 'javelin-stratcom' => '6ad39b6f', 'javelin-tokenizer' => '8d3bc1b2', 'javelin-typeahead' => '70baed2f', 'javelin-typeahead-composite-source' => '503e17fd', 'javelin-typeahead-normalizer' => '185bbd53', 'javelin-typeahead-ondemand-source' => '013ffff9', 'javelin-typeahead-preloaded-source' => '54f314a0', 'javelin-typeahead-source' => '0fcf201c', 'javelin-typeahead-static-source' => '6c0e62fa', 'javelin-uri' => 'c989ade3', 'javelin-util' => '93cc50d6', 'javelin-vector' => '2caa8fb8', 'javelin-view' => '0f764c35', 'javelin-view-html' => 'fe287620', 'javelin-view-interpreter' => 'f829edb3', 'javelin-view-renderer' => '6c2b09a2', 'javelin-view-visitor' => 'efe49472', 'javelin-websocket' => '3ffe32d6', 'javelin-workboard-board' => '8935deef', 'javelin-workboard-card' => 'c587b80f', 'javelin-workboard-column' => '758b4758', 'javelin-workboard-controller' => '26167537', 'javelin-workflow' => '1e911d0f', 'maniphest-batch-editor' => 'b0f0b6d5', 'maniphest-report-css' => '9b9580b7', 'maniphest-task-edit-css' => 'fda62a9b', 'maniphest-task-summary-css' => '11cc5344', 'multirow-row-manager' => 'b5d57730', 'owners-path-editor' => 'aa1733d0', 'owners-path-editor-css' => '2f00933b', 'paste-css' => '1898e534', 'path-typeahead' => 'f7fc67ec', 'people-picture-menu-item-css' => 'a06f7f34', 'people-profile-css' => '4df76faf', 'phabricator-action-list-view-css' => 'c01858f4', 'phabricator-busy' => '59a7976a', 'phabricator-chatlog-css' => 'd295b020', 'phabricator-content-source-view-css' => '4b8b05d4', 'phabricator-core-css' => '23beb330', 'phabricator-countdown-css' => '16c52f5c', 'phabricator-darklog' => 'c8e1ffe3', 'phabricator-darkmessage' => 'c48cccdd', 'phabricator-dashboard-css' => 'fe5b1869', 'phabricator-diff-changeset' => 'd498bddb', 'phabricator-diff-changeset-list' => '0db8cdca', 'phabricator-diff-inline' => '1d17130f', 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 'phabricator-draggable-list' => 'bea6e7f4', 'phabricator-fatal-config-template-css' => '8f18fa41', 'phabricator-favicon' => '1fe2510c', 'phabricator-feed-css' => 'ecd4ec57', 'phabricator-file-upload' => '680ea2c8', 'phabricator-filetree-view-css' => 'fccf9f82', 'phabricator-flag-css' => 'bba8f811', 'phabricator-keyboard-shortcut' => '1ae869f2', 'phabricator-keyboard-shortcut-manager' => 'c19dd9b9', 'phabricator-main-menu-view' => '16053029', 'phabricator-nav-view-css' => 'faf6a6fc', 'phabricator-notification' => 'ccf1cbf8', 'phabricator-notification-css' => '3f6c89c9', 'phabricator-notification-menu-css' => '6a697e43', 'phabricator-object-selector-css' => '85ee8ce6', 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => 'c5af80a2', 'phabricator-remarkup-css' => 'd1a5e11e', 'phabricator-search-results-css' => '8f8e08ed', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-slowvote-css' => 'a94b7230', 'phabricator-source-code-view-css' => '4383192f', 'phabricator-standard-page-view' => 'eb5b80c5', 'phabricator-textareautils' => '320810c8', 'phabricator-title' => '485aaa6c', 'phabricator-tooltip' => '358b8c04', 'phabricator-ui-example-css' => '528b19de', 'phabricator-zindex-css' => '9d8f7c4b', 'phame-css' => 'b3a0b3a3', 'pholio-css' => 'ca89d380', 'pholio-edit-css' => '07676f51', 'pholio-inline-comments-css' => '8e545e49', 'phortune-credit-card-form' => '2290aeef', 'phortune-credit-card-form-css' => '8391eb02', 'phortune-css' => '5b99dae0', 'phortune-invoice-css' => '476055e2', 'phrequent-css' => 'ffc185ad', 'phriction-document-css' => '4282e4ad', 'phui-action-panel-css' => '91c7b835', 'phui-badge-view-css' => '22c0cf4f', 'phui-basic-nav-view-css' => 'a0705f53', 'phui-big-info-view-css' => 'bd903741', 'phui-box-css' => '269cbc99', 'phui-button-bar-css' => '39fe680c', - 'phui-button-css' => '9f13ddcc', - 'phui-button-simple-css' => '081cfeea', + 'phui-button-css' => '022581b4', + 'phui-button-simple-css' => '8e1baf68', 'phui-calendar-css' => '477acfaa', 'phui-calendar-day-css' => '572b1893', 'phui-calendar-list-css' => '576be600', 'phui-calendar-month-css' => '8e10e92c', 'phui-chart-css' => '6bf6f78e', 'phui-cms-css' => '504b4b23', 'phui-comment-form-css' => '57af2e14', 'phui-comment-panel-css' => 'f50152ad', 'phui-crumbs-view-css' => '6ece3bbb', 'phui-curtain-view-css' => '55dd0e59', 'phui-document-summary-view-css' => '9ca48bdf', 'phui-document-view-css' => 'c32e8dec', 'phui-document-view-pro-css' => '8af7ea27', 'phui-feed-story-css' => '44a9c8e9', 'phui-font-icon-base-css' => '870a7360', 'phui-fontkit-css' => '1320ed01', 'phui-form-css' => 'a5570f70', 'phui-form-view-css' => '6175808d', 'phui-head-thing-view-css' => 'fd311e5f', 'phui-header-view-css' => '73edce66', 'phui-hovercard' => '1bd28176', 'phui-hovercard-view-css' => 'f0592bcf', 'phui-icon-set-selector-css' => '87db8fee', 'phui-icon-view-css' => '4c46b6ba', 'phui-image-mask-css' => 'a8498f9c', 'phui-info-panel-css' => '27ea50a1', 'phui-info-view-css' => '6e217679', 'phui-inline-comment-view-css' => 'ffd1a542', 'phui-invisible-character-view-css' => '6993d9f0', 'phui-lightbox-css' => '0a035e40', 'phui-list-view-css' => '12eb8ce6', 'phui-object-box-css' => '9cff003c', 'phui-oi-big-ui-css' => '19f9369b', 'phui-oi-color-css' => 'cd2b9b77', 'phui-oi-drag-ui-css' => '08f4ccc3', 'phui-oi-flush-ui-css' => '9d9685d6', 'phui-oi-list-view-css' => '43752968', 'phui-oi-simple-ui-css' => 'a8beebea', 'phui-pager-css' => '77d8a794', 'phui-pinboard-view-css' => '2495140e', 'phui-property-list-view-css' => '2dc7993f', 'phui-remarkup-preview-css' => '54a34863', 'phui-segment-bar-view-css' => 'b1d1b892', 'phui-spacing-css' => '042804d6', 'phui-status-list-view-css' => 'd5263e49', 'phui-tag-view-css' => '93b084cf', 'phui-theme-css' => '9f261c6b', 'phui-timeline-view-css' => '313c7f22', 'phui-two-column-view-css' => 'ce9fa0b7', 'phui-workboard-color-css' => '783cdff5', 'phui-workboard-view-css' => '3bc85455', 'phui-workcard-view-css' => 'cca5fa92', 'phui-workpanel-view-css' => 'a3a63478', 'phuix-action-list-view' => 'b5c256b8', 'phuix-action-view' => 'b3465b9b', 'phuix-autocomplete' => 'f6699267', - 'phuix-button-view' => 'b3c515be', + 'phuix-button-view' => 'a37126bd', 'phuix-dropdown-menu' => '8018ee50', 'phuix-form-control-view' => '83e03671', 'phuix-icon-view' => 'bff6884b', 'policy-css' => '957ea14c', 'policy-edit-css' => '815c66f7', 'policy-transaction-detail-css' => '82100a43', 'ponder-view-css' => 'fbd45f96', 'project-card-view-css' => '3d3c1f91', 'project-view-css' => '792c9057', 'releeph-core' => '9b3c5733', 'releeph-preview-branch' => 'b7a6f4a5', 'releeph-request-differential-create-dialog' => '8d8b92cd', 'releeph-request-typeahead-css' => '667a48ae', 'setup-issue-css' => 'f794cfc3', 'sprite-login-css' => '587d92d7', 'sprite-tokens-css' => '9cdfd599', 'syntax-default-css' => '9923583c', 'syntax-highlighting-css' => 'cae95e89', 'tokens-css' => '3d0f239e', 'typeahead-browse-css' => '4f82e510', 'unhandled-exception-css' => '4c96257a', ), 'requires' => array( '013ffff9' => array( 'javelin-install', 'javelin-util', 'javelin-request', 'javelin-typeahead-source', ), '01fca1f0' => array( 'javelin-behavior', 'javelin-workflow', 'javelin-json', 'javelin-dom', 'phabricator-keyboard-shortcut', ), '051c7832' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), '05270951' => array( 'javelin-util', 'javelin-magical-init', ), '054a0f0b' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'phabricator-tooltip', ), '065227cc' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-workflow', ), - '081cfeea' => array( - 'phui-button-css', - ), '0825c27a' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-util', ), '08f4ccc3' => array( 'phui-oi-list-view-css', ), '0a0b10e9' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), '0a3f3021' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'javelin-router', ), '0db8cdca' => array( 'javelin-install', 'phuix-button-view', ), '0f764c35' => array( 'javelin-install', 'javelin-util', ), '0fcf201c' => array( 'javelin-install', 'javelin-util', 'javelin-dom', 'javelin-typeahead-normalizer', ), '1499a8cb' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-history', ), '15d5ff71' => array( 'aphront-typeahead-control-css', 'phui-tag-view-css', ), 16053029 => array( 'phui-theme-css', ), '17bb8539' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-util', 'javelin-dom', 'javelin-request', 'phabricator-keyboard-shortcut', 'phabricator-darklog', 'phabricator-darkmessage', ), '185bbd53' => array( 'javelin-install', ), '19f9369b' => array( 'phui-oi-list-view-css', ), '1ad0a787' => array( 'javelin-install', 'javelin-reactor', 'javelin-util', 'javelin-reactor-node-calmer', ), '1ae869f2' => array( 'javelin-install', 'javelin-util', 'phabricator-keyboard-shortcut-manager', ), '1bd28176' => array( 'javelin-install', 'javelin-dom', 'javelin-vector', 'javelin-request', 'javelin-uri', ), '1d17130f' => array( 'javelin-dom', ), '1e911d0f' => array( 'javelin-stratcom', 'javelin-request', 'javelin-dom', 'javelin-vector', 'javelin-install', 'javelin-util', 'javelin-mask', 'javelin-uri', 'javelin-routable', ), '1f6794f6' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'javelin-uri', 'phabricator-textareautils', ), '1fe2510c' => array( 'javelin-install', 'javelin-dom', ), '2290aeef' => array( 'javelin-install', 'javelin-dom', 'javelin-json', 'javelin-workflow', 'javelin-util', ), 26167537 => array( 'javelin-install', 'javelin-dom', 'javelin-util', 'javelin-vector', 'javelin-stratcom', 'javelin-workflow', 'phabricator-drag-and-drop-file-upload', 'javelin-workboard-board', ), '2926fff2' => array( 'javelin-behavior', 'javelin-dom', ), '29274e2b' => array( 'javelin-install', 'javelin-util', ), '2ae077e1' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-behavior-device', 'javelin-scrollbar', 'javelin-quicksand', 'phabricator-keyboard-shortcut', 'conpherence-thread-manager', ), '2b8de964' => array( 'javelin-install', 'javelin-util', ), '2caa8fb8' => array( 'javelin-install', 'javelin-event', ), '2ee659ce' => array( 'javelin-install', ), '31420f77' => array( 'javelin-behavior', ), '320810c8' => array( 'javelin-install', 'javelin-dom', 'javelin-vector', ), '327a00d1' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-workflow', ), '358b8c04' => array( 'javelin-install', 'javelin-util', 'javelin-dom', 'javelin-vector', ), '39fe680c' => array( 'phui-button-css', 'phui-button-simple-css', ), '3ab51e2c' => array( 'javelin-behavior', 'javelin-behavior-device', 'javelin-stratcom', 'javelin-vector', 'javelin-dom', 'javelin-magical-init', ), '3c547a81' => array( 'javelin-behavior', 'javelin-aphlict', 'javelin-stratcom', 'javelin-request', 'javelin-uri', 'javelin-dom', 'javelin-json', 'javelin-router', 'javelin-util', 'javelin-leader', 'javelin-sound', 'phabricator-notification', ), '3cb0b2fc' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-workflow', 'javelin-util', 'javelin-uri', ), '3dbf94d5' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-workflow', 'javelin-stratcom', ), '3ffe32d6' => array( 'javelin-install', ), '408bf173' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-stratcom', 'javelin-workflow', 'phabricator-draggable-list', ), 42126667 => array( 'javelin-behavior', 'javelin-dom', 'javelin-request', ), '4250a34e' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-vector', 'javelin-stratcom', 'javelin-workflow', 'javelin-workboard-controller', ), '44959b73' => array( 'javelin-util', 'javelin-uri', 'javelin-install', ), '453c5375' => array( 'javelin-behavior', 'javelin-dom', ), '469c0d9e' => array( 'javelin-behavior', 'javelin-dom', 'javelin-workflow', ), 47830651 => array( 'javelin-behavior', 'javelin-dom', 'javelin-view-renderer', 'javelin-install', ), 48086888 => array( 'javelin-behavior', 'javelin-dom', 'javelin-workflow', ), '484a6e22' => array( 'javelin-behavior', 'javelin-dom', 'phabricator-drag-and-drop-file-upload', 'phabricator-textareautils', ), '485aaa6c' => array( 'javelin-install', ), '491416b3' => array( 'javelin-behavior', 'javelin-uri', 'phabricator-notification', ), '4976858c' => array( 'javelin-magical-init', 'javelin-install', 'javelin-util', 'javelin-vector', 'javelin-stratcom', ), '49ae8328' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', ), '4b3c4443' => array( 'phuix-icon-view', ), '4b700e9e' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'phabricator-shaped-request', ), '4c193c96' => array( 'javelin-behavior', 'javelin-uri', 'phabricator-notification', ), '4d863052' => array( 'javelin-dom', 'javelin-util', 'javelin-stratcom', 'javelin-install', 'javelin-aphlict', 'javelin-workflow', 'javelin-router', 'javelin-behavior-device', 'javelin-vector', ), '4e3e79a6' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), '503e17fd' => array( 'javelin-install', 'javelin-typeahead-source', 'javelin-util', ), '51c5ad07' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-request', 'javelin-util', 'phabricator-shaped-request', ), '522431f7' => array( 'javelin-behavior', 'javelin-util', 'javelin-dom', 'javelin-stratcom', 'javelin-vector', 'javelin-typeahead-static-source', ), '54b612ba' => array( 'javelin-color', 'javelin-install', 'javelin-util', ), '54f314a0' => array( 'javelin-install', 'javelin-util', 'javelin-request', 'javelin-typeahead-source', ), '55616e04' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-workflow', 'javelin-stratcom', 'conpherence-thread-manager', ), '558829c2' => array( 'javelin-stratcom', 'javelin-behavior', 'javelin-vector', 'javelin-dom', ), '560f41da' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-mask', 'javelin-util', 'phuix-icon-view', 'phabricator-busy', ), '58dea2fa' => array( 'javelin-install', 'javelin-util', 'javelin-request', 'javelin-dom', 'javelin-uri', 'phabricator-file-upload', ), '59a7976a' => array( 'javelin-install', 'javelin-dom', 'javelin-fx', ), '59b251eb' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-vector', 'javelin-dom', ), '5c54cbf3' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), '5e2634b9' => array( 'javelin-behavior', 'javelin-aphlict', 'phabricator-phtize', 'javelin-dom', ), '5e41c819' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'phabricator-tooltip', 'phabricator-diff-changeset-list', 'phabricator-diff-changeset', ), '5e9f347c' => array( 'javelin-behavior', 'multirow-row-manager', 'javelin-dom', 'javelin-util', 'phabricator-prefab', 'javelin-json', ), '60821bc7' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), '61cbc29a' => array( 'javelin-magical-init', 'javelin-util', ), '62dfea03' => array( 'javelin-install', 'javelin-util', ), '635de1ec' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', ), '680ea2c8' => array( 'javelin-install', 'javelin-dom', 'phabricator-notification', ), '6882e80a' => array( 'javelin-dom', ), '68af71ca' => array( 'javelin-install', 'javelin-dom', 'phuix-button-view', ), '69adf288' => array( 'javelin-install', ), '6ad39b6f' => array( 'javelin-install', 'javelin-event', 'javelin-util', 'javelin-magical-init', ), '6b8ef10b' => array( 'javelin-install', ), '6c0e62fa' => array( 'javelin-install', 'javelin-typeahead-source', ), '6c2b09a2' => array( 'javelin-install', 'javelin-util', ), '6d3e1947' => array( 'javelin-behavior', 'javelin-diffusion-locate-file-source', 'javelin-dom', 'javelin-typeahead', 'javelin-uri', ), '70baed2f' => array( 'javelin-install', 'javelin-dom', 'javelin-vector', 'javelin-util', ), 71237763 => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-workflow', 'phabricator-draggable-list', ), '7319e029' => array( 'javelin-behavior', 'javelin-dom', ), '73d09eef' => array( 'javelin-behavior', 'javelin-vector', 'javelin-dom', ), '758b4758' => array( 'javelin-install', 'javelin-workboard-card', ), '76b9fc3e' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'phabricator-draggable-list', ), '76f4ebed' => array( 'javelin-install', 'javelin-reactor', 'javelin-util', ), '782ab6e7' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'phabricator-prefab', 'multirow-row-manager', 'javelin-json', ), '7927a7d3' => array( 'javelin-behavior', 'javelin-quicksand', ), '7a68dda3' => array( 'owners-path-editor', 'javelin-behavior', ), '7cbe244b' => array( 'javelin-install', 'javelin-util', 'javelin-request', 'javelin-router', ), '7e41274a' => array( 'javelin-install', ), '7ebaeed3' => array( 'herald-rule-editor', 'javelin-behavior', ), '7ee2b591' => array( 'javelin-behavior', 'javelin-history', ), '7f243deb' => array( 'javelin-install', ), '8018ee50' => array( 'javelin-install', 'javelin-util', 'javelin-dom', 'javelin-vector', 'javelin-stratcom', ), '834a1173' => array( 'javelin-behavior', 'javelin-scrollbar', ), '83e03671' => array( 'javelin-install', 'javelin-dom', ), '8499b6ab' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', ), '85ee8ce6' => array( 'aphront-dialog-view-css', ), '8604caa8' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-workflow', 'javelin-util', 'phabricator-notification', 'conpherence-thread-manager', ), '88236f00' => array( 'javelin-behavior', 'phabricator-keyboard-shortcut', 'javelin-stratcom', ), '887ad43f' => array( 'javelin-behavior', 'javelin-request', 'javelin-stratcom', 'javelin-dom', ), '8935deef' => array( 'javelin-install', 'javelin-dom', 'javelin-util', 'javelin-stratcom', 'javelin-workflow', 'phabricator-draggable-list', 'javelin-workboard-column', ), '8a41885b' => array( 'javelin-install', 'javelin-dom', ), '8ce821c5' => array( 'phabricator-notification', 'javelin-stratcom', 'javelin-behavior', ), '8d3bc1b2' => array( 'javelin-dom', 'javelin-util', 'javelin-stratcom', 'javelin-install', ), + '8e1baf68' => array( + 'phui-button-css', + ), '8ff5e24c' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), '901935ef' => array( 'javelin-behavior', 'javelin-dom', 'javelin-request', ), '9065f639' => array( 'javelin-install', 'javelin-dom', 'javelin-stratcom', 'javelin-vector', ), '92b9ec77' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), '93d0c9e3' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', ), '947753e0' => array( 'javelin-behavior', 'javelin-behavior-device', 'javelin-stratcom', 'javelin-dom', 'javelin-magical-init', 'javelin-vector', 'javelin-request', 'javelin-util', ), '949c0fe5' => array( 'javelin-install', ), '94b750d2' => array( 'javelin-install', 'javelin-stratcom', 'javelin-util', 'javelin-behavior', 'javelin-json', 'javelin-dom', 'javelin-resource', 'javelin-routable', ), '960f6a39' => array( 'javelin-behavior', 'javelin-dom', 'javelin-uri', 'javelin-mask', 'phabricator-drag-and-drop-file-upload', ), '9a6dd75c' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'phuix-form-control-view', 'phuix-icon-view', 'javelin-behavior-phabricator-gesture', ), '9bbf3762' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-workflow', 'javelin-stratcom', ), '9d9685d6' => array( 'phui-oi-list-view-css', ), '9f36c42d' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-vector', ), 'a0b57eb8' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-workflow', 'javelin-util', 'phabricator-keyboard-shortcut', ), + 'a37126bd' => array( + 'javelin-install', + 'javelin-dom', + ), 'a3a63478' => array( 'phui-workcard-view-css', ), 'a464fe03' => array( 'javelin-behavior', 'javelin-uri', 'phabricator-notification', ), 'a6b98425' => array( 'javelin-behavior', 'javelin-dom', 'phortune-credit-card-form', ), 'a6f7a73b' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), 'a80d0378' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), 'a8beebea' => array( 'phui-oi-list-view-css', ), 'a8d8459d' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', ), 'a8da01f0' => array( 'javelin-behavior', 'javelin-uri', 'phabricator-keyboard-shortcut', ), 'a9210d03' => array( 'javelin-behavior', 'javelin-util', 'javelin-dom', 'javelin-stratcom', 'javelin-vector', ), 'a9f88de2' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-workflow', 'javelin-fx', 'javelin-util', ), 'aa1733d0' => array( 'multirow-row-manager', 'javelin-install', 'path-typeahead', 'javelin-dom', 'javelin-util', 'phabricator-prefab', ), 'ab2f381b' => array( 'javelin-request', 'javelin-behavior', 'javelin-dom', 'javelin-router', 'javelin-util', 'phabricator-busy', ), 'acd29eee' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'phabricator-phtize', 'phabricator-textareautils', 'javelin-workflow', 'javelin-vector', 'phuix-autocomplete', 'javelin-mask', ), 'ae95d984' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'phabricator-busy', ), 'b003d4fb' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'phuix-dropdown-menu', ), 'b0b8f86d' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', ), 'b23b49e6' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-request', 'phabricator-shaped-request', ), 'b2b4fbaf' => array( 'javelin-behavior', 'javelin-dom', 'javelin-uri', 'javelin-request', ), 'b3465b9b' => array( 'javelin-install', 'javelin-dom', 'javelin-util', ), 'b3a4b884' => array( 'javelin-behavior', 'phabricator-prefab', ), - 'b3c515be' => array( - 'javelin-install', - 'javelin-dom', - ), 'b3e7d692' => array( 'javelin-install', ), 'b59e1e96' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'phabricator-draggable-list', ), 'b5c256b8' => array( 'javelin-install', 'javelin-dom', ), 'b5d57730' => array( 'javelin-install', 'javelin-stratcom', 'javelin-dom', 'javelin-util', ), 'b6993408' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-json', 'phabricator-draggable-list', ), 'b95d6f7d' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'phuix-dropdown-menu', ), 'ba158207' => array( 'javelin-behavior', 'javelin-uri', 'phabricator-notification', ), 'bb1dd507' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-vector', 'javelin-install', ), 'bcaccd64' => array( 'javelin-behavior', 'javelin-behavior-device', 'javelin-stratcom', 'javelin-vector', 'phui-hovercard', ), 'bdaf4d04' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-request', ), 'bea6e7f4' => array( 'javelin-install', 'javelin-dom', 'javelin-stratcom', 'javelin-util', 'javelin-vector', 'javelin-magical-init', ), 'bee502c8' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-workflow', 'javelin-quicksand', 'phabricator-phtize', 'phabricator-drag-and-drop-file-upload', 'phabricator-draggable-list', ), 'bf5374ef' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), 'bff6884b' => array( 'javelin-install', 'javelin-dom', ), 'c19dd9b9' => array( 'javelin-install', 'javelin-util', 'javelin-stratcom', 'javelin-dom', 'javelin-vector', ), 'c3f44655' => array( 'phui-inline-comment-view-css', ), 'c420b0b9' => array( 'javelin-behavior', 'javelin-behavior-device', 'javelin-stratcom', 'phabricator-tooltip', ), 'c587b80f' => array( 'javelin-install', ), 'c5af80a2' => array( 'javelin-install', 'javelin-util', 'javelin-dom', 'javelin-typeahead', 'javelin-tokenizer', 'javelin-typeahead-preloaded-source', 'javelin-typeahead-ondemand-source', 'javelin-dom', 'javelin-stratcom', 'javelin-util', ), 'c7ccd872' => array( 'phui-fontkit-css', ), 'c90a04fc' => array( 'javelin-dom', 'javelin-dynval', 'javelin-reactor', 'javelin-reactornode', 'javelin-install', 'javelin-util', ), 'c93358e3' => array( 'javelin-install', 'javelin-dom', 'javelin-typeahead-preloaded-source', 'javelin-util', ), 'c989ade3' => array( 'javelin-install', 'javelin-util', 'javelin-stratcom', ), 'c9b99b77' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-stratcom', 'javelin-workflow', 'javelin-behavior-device', 'javelin-history', 'javelin-vector', 'javelin-scrollbar', 'phabricator-title', 'phabricator-shaped-request', 'conpherence-thread-manager', ), 'caade6f2' => array( 'javelin-behavior', 'javelin-request', 'javelin-stratcom', 'javelin-vector', 'javelin-dom', 'javelin-uri', 'javelin-behavior-device', 'phabricator-title', 'phabricator-favicon', ), 'cae95e89' => array( 'syntax-default-css', ), 'ccf1cbf8' => array( 'javelin-install', 'javelin-dom', 'javelin-stratcom', 'javelin-util', 'phabricator-notification-css', ), 'cd2b9b77' => array( 'phui-oi-list-view-css', ), 'd0a99ab4' => array( 'javelin-behavior', 'javelin-typeahead-ondemand-source', 'javelin-typeahead', 'javelin-dom', 'javelin-uri', 'javelin-util', 'javelin-stratcom', 'phabricator-prefab', 'phuix-icon-view', ), 'd0c516d5' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'phuix-dropdown-menu', 'phuix-action-list-view', 'phuix-action-view', 'javelin-workflow', 'phuix-icon-view', ), 'd254d646' => array( 'javelin-util', ), 'd4505101' => array( 'javelin-stratcom', 'javelin-install', 'javelin-uri', 'javelin-util', ), 'd498bddb' => array( 'javelin-dom', 'javelin-util', 'javelin-stratcom', 'javelin-install', 'javelin-workflow', 'javelin-router', 'javelin-behavior-device', 'javelin-vector', 'phabricator-diff-inline', ), 'd4eecc63' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', ), 'd5a2d665' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', 'javelin-uri', 'phabricator-notification', ), 'd6a7e717' => array( 'multirow-row-manager', 'javelin-install', 'javelin-util', 'javelin-dom', 'javelin-stratcom', 'javelin-json', 'phabricator-prefab', ), 'd7a74243' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'phabricator-draggable-list', ), 'd835b03a' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'phabricator-shaped-request', ), 'de2e896f' => array( 'javelin-behavior', 'javelin-dom', 'javelin-typeahead', 'javelin-typeahead-ondemand-source', 'javelin-dom', ), 'e0ec7f2f' => array( 'javelin-behavior', 'javelin-dom', 'javelin-request', 'javelin-util', ), 'e1d25dfb' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'phabricator-draggable-list', ), 'e1d4b11a' => array( 'javelin-install', 'javelin-util', 'javelin-websocket', 'javelin-leader', 'javelin-json', ), 'e1ff79b1' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', ), 'e2e0a072' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'phabricator-draggable-list', ), 'e379b58e' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-vector', 'javelin-dom', 'javelin-uri', ), 'e4232876' => array( 'javelin-behavior', 'javelin-dom', 'javelin-vector', 'phui-chart-css', ), 'e4cc26b3' => array( 'javelin-behavior', 'javelin-dom', ), 'e5339c43' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', 'javelin-uri', ), 'e5822781' => array( 'javelin-behavior', 'javelin-dom', 'javelin-json', 'javelin-workflow', 'javelin-magical-init', ), 'e9581f08' => array( 'javelin-behavior', 'javelin-stratcom', 'javelin-workflow', 'javelin-dom', 'phabricator-draggable-list', ), 'edf8a145' => array( 'javelin-behavior', 'javelin-uri', ), 'efe49472' => array( 'javelin-install', 'javelin-util', ), 'f01586dc' => array( 'javelin-behavior', 'javelin-dom', 'javelin-util', 'javelin-workflow', 'javelin-json', ), 'f50152ad' => array( 'phui-timeline-view-css', ), 'f6555212' => array( 'javelin-install', 'javelin-reactornode', 'javelin-util', 'javelin-reactor', ), 'f6699267' => array( 'javelin-install', 'javelin-dom', 'phuix-icon-view', 'phabricator-prefab', ), 'f7fc67ec' => array( 'javelin-install', 'javelin-typeahead', 'javelin-dom', 'javelin-request', 'javelin-typeahead-ondemand-source', 'javelin-util', ), 'f829edb3' => array( 'javelin-view', 'javelin-install', 'javelin-dom', ), 'fbe497e7' => array( 'javelin-behavior', 'javelin-util', 'javelin-stratcom', 'javelin-dom', 'javelin-vector', 'javelin-magical-init', 'javelin-request', 'javelin-history', 'javelin-workflow', 'javelin-mask', 'javelin-behavior-device', 'phabricator-keyboard-shortcut', ), 'fc91ab6c' => array( 'javelin-behavior', 'javelin-dom', 'phortune-credit-card-form', ), 'fe287620' => array( 'javelin-install', 'javelin-dom', 'javelin-view-visitor', 'javelin-util', ), ), 'packages' => array( 'conpherence.pkg.css' => array( 'conpherence-durable-column-view', 'conpherence-menu-css', 'conpherence-color-css', 'conpherence-message-pane-css', 'conpherence-notification-css', 'conpherence-transaction-css', 'conpherence-participant-pane-css', 'conpherence-header-pane-css', ), 'conpherence.pkg.js' => array( 'javelin-behavior-conpherence-menu', 'javelin-behavior-conpherence-participant-pane', 'javelin-behavior-conpherence-pontificate', 'javelin-behavior-toggle-widget', ), 'core.pkg.css' => array( 'phabricator-core-css', 'phabricator-zindex-css', 'phui-button-css', 'phui-button-simple-css', 'phui-theme-css', 'phabricator-standard-page-view', 'aphront-dialog-view-css', 'phui-form-view-css', 'aphront-panel-view-css', 'aphront-table-view-css', 'aphront-tokenizer-control-css', 'aphront-typeahead-control-css', 'aphront-list-filter-view-css', 'application-search-view-css', 'phabricator-remarkup-css', 'syntax-highlighting-css', 'syntax-default-css', 'phui-pager-css', 'aphront-tooltip-css', 'phabricator-flag-css', 'phui-info-view-css', 'phabricator-main-menu-view', 'phabricator-notification-css', 'phabricator-notification-menu-css', 'phui-lightbox-css', 'phui-comment-panel-css', 'phui-header-view-css', 'phabricator-nav-view-css', 'phui-basic-nav-view-css', 'phui-crumbs-view-css', 'phui-oi-list-view-css', 'phui-oi-color-css', 'phui-oi-big-ui-css', 'phui-oi-drag-ui-css', 'phui-oi-simple-ui-css', 'phui-oi-flush-ui-css', 'global-drag-and-drop-css', 'phui-spacing-css', 'phui-form-css', 'phui-icon-view-css', 'phabricator-action-list-view-css', 'phui-property-list-view-css', 'phui-tag-view-css', 'phui-list-view-css', 'font-fontawesome', 'font-lato', 'phui-font-icon-base-css', 'phui-fontkit-css', 'phui-box-css', 'phui-object-box-css', 'phui-timeline-view-css', 'phui-two-column-view-css', 'phui-curtain-view-css', 'sprite-login-css', 'sprite-tokens-css', 'tokens-css', 'auth-css', 'phui-status-list-view-css', 'phui-feed-story-css', 'phabricator-feed-css', 'phabricator-dashboard-css', 'aphront-multi-column-view-css', ), 'core.pkg.js' => array( 'javelin-util', 'javelin-install', 'javelin-event', 'javelin-stratcom', 'javelin-behavior', 'javelin-resource', 'javelin-request', 'javelin-vector', 'javelin-dom', 'javelin-json', 'javelin-uri', 'javelin-workflow', 'javelin-mask', 'javelin-typeahead', 'javelin-typeahead-normalizer', 'javelin-typeahead-source', 'javelin-typeahead-preloaded-source', 'javelin-typeahead-ondemand-source', 'javelin-tokenizer', 'javelin-history', 'javelin-router', 'javelin-routable', 'javelin-behavior-aphront-basic-tokenizer', 'javelin-behavior-workflow', 'javelin-behavior-aphront-form-disable-on-submit', 'phabricator-keyboard-shortcut-manager', 'phabricator-keyboard-shortcut', 'javelin-behavior-phabricator-keyboard-shortcuts', 'javelin-behavior-refresh-csrf', 'javelin-behavior-phabricator-watch-anchor', 'javelin-behavior-phabricator-autofocus', 'phuix-dropdown-menu', 'phuix-action-list-view', 'phuix-action-view', 'phuix-icon-view', 'phabricator-phtize', 'javelin-behavior-phabricator-oncopy', 'phabricator-tooltip', 'javelin-behavior-phabricator-tooltips', 'phabricator-prefab', 'javelin-behavior-device', 'javelin-behavior-toggle-class', 'javelin-behavior-lightbox-attachments', 'phabricator-busy', 'javelin-sound', 'javelin-aphlict', 'phabricator-notification', 'javelin-behavior-aphlict-listen', 'javelin-behavior-phabricator-search-typeahead', 'javelin-behavior-aphlict-dropdown', 'javelin-behavior-history-install', 'javelin-behavior-phabricator-gesture', 'javelin-behavior-phabricator-active-nav', 'javelin-behavior-phabricator-nav', 'javelin-behavior-phabricator-remarkup-assist', 'phabricator-textareautils', 'phabricator-file-upload', 'javelin-behavior-global-drag-and-drop', 'javelin-behavior-phabricator-reveal-content', 'phui-hovercard', 'javelin-behavior-phui-hovercards', 'javelin-color', 'javelin-fx', 'phabricator-draggable-list', 'javelin-behavior-phabricator-transaction-list', 'javelin-behavior-phabricator-show-older-transactions', 'javelin-behavior-phui-dropdown-menu', 'javelin-behavior-doorkeeper-tag', 'phabricator-title', 'javelin-leader', 'javelin-websocket', 'javelin-behavior-dashboard-async-panel', 'javelin-behavior-dashboard-tab-panel', 'javelin-quicksand', 'javelin-behavior-quicksand-blacklist', 'javelin-behavior-high-security-warning', 'javelin-behavior-read-only-warning', 'javelin-scrollbar', 'javelin-behavior-scrollbar', 'javelin-behavior-durable-column', 'conpherence-thread-manager', 'javelin-behavior-detect-timezone', 'javelin-behavior-setup-check-https', 'javelin-behavior-aphlict-status', 'javelin-behavior-user-menu', 'phabricator-favicon', ), 'darkconsole.pkg.js' => array( 'javelin-behavior-dark-console', 'javelin-behavior-error-log', ), 'differential.pkg.css' => array( 'differential-core-view-css', 'differential-changeset-view-css', 'differential-revision-history-css', 'differential-revision-list-css', 'differential-table-of-contents-css', 'differential-revision-comment-css', 'differential-revision-add-comment-css', 'phabricator-object-selector-css', 'phabricator-content-source-view-css', 'inline-comment-summary-css', 'phui-inline-comment-view-css', 'phabricator-filetree-view-css', ), 'differential.pkg.js' => array( 'phabricator-drag-and-drop-file-upload', 'phabricator-shaped-request', 'javelin-behavior-differential-feedback-preview', 'javelin-behavior-differential-populate', 'javelin-behavior-differential-diff-radios', 'javelin-behavior-aphront-drag-and-drop-textarea', 'javelin-behavior-phabricator-object-selector', 'javelin-behavior-repository-crossreference', 'javelin-behavior-load-blame', 'javelin-behavior-differential-user-select', 'javelin-behavior-aphront-more', 'phabricator-diff-inline', 'phabricator-diff-changeset', 'phabricator-diff-changeset-list', ), 'diffusion.pkg.css' => array( 'diffusion-icons-css', ), 'diffusion.pkg.js' => array( 'javelin-behavior-diffusion-pull-lastmodified', 'javelin-behavior-diffusion-commit-graph', 'javelin-behavior-audit-preview', ), 'maniphest.pkg.css' => array( 'maniphest-task-summary-css', ), 'maniphest.pkg.js' => array( 'javelin-behavior-maniphest-batch-selector', 'javelin-behavior-maniphest-subpriority-editor', 'javelin-behavior-maniphest-list-editor', ), ), ); diff --git a/src/applications/almanac/controller/AlmanacController.php b/src/applications/almanac/controller/AlmanacController.php index e4d9921660..d6d7188511 100644 --- a/src/applications/almanac/controller/AlmanacController.php +++ b/src/applications/almanac/controller/AlmanacController.php @@ -1,214 +1,214 @@ getViewer(); $properties = $object->getAlmanacProperties(); $this->requireResource('almanac-css'); Javelin::initBehavior('phabricator-tooltips', array()); $can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, $object, PhabricatorPolicyCapability::CAN_EDIT); $properties = $object->getAlmanacProperties(); $icon_builtin = id(new PHUIIconView()) ->setIcon('fa-circle') ->addSigil('has-tooltip') ->setMetadata( array( 'tip' => pht('Builtin Property'), 'align' => 'E', )); $icon_custom = id(new PHUIIconView()) ->setIcon('fa-circle-o grey') ->addSigil('has-tooltip') ->setMetadata( array( 'tip' => pht('Custom Property'), 'align' => 'E', )); $builtins = $object->getAlmanacPropertyFieldSpecifications(); $defaults = mpull($builtins, null, 'getValueForTransaction'); // Sort fields so builtin fields appear first, then fields are ordered // alphabetically. $properties = msort($properties, 'getFieldName'); $head = array(); $tail = array(); foreach ($properties as $property) { $key = $property->getFieldName(); if (isset($builtins[$key])) { $head[$key] = $property; } else { $tail[$key] = $property; } } $properties = $head + $tail; $delete_base = $this->getApplicationURI('property/delete/'); $edit_base = $this->getApplicationURI('property/update/'); $rows = array(); foreach ($properties as $key => $property) { $value = $property->getFieldValue(); $is_builtin = isset($builtins[$key]); $delete_uri = id(new PhutilURI($delete_base)) ->setQueryParams( array( 'key' => $key, 'objectPHID' => $object->getPHID(), )); $edit_uri = id(new PhutilURI($edit_base)) ->setQueryParams( array( 'key' => $key, 'objectPHID' => $object->getPHID(), )); $delete = javelin_tag( 'a', array( 'class' => ($can_edit - ? 'button grey small' - : 'button grey small disabled'), + ? 'button button-grey small' + : 'button button-grey small disabled'), 'sigil' => 'workflow', 'href' => $delete_uri, ), $is_builtin ? pht('Reset') : pht('Delete')); $default = idx($defaults, $key); $is_default = ($default !== null && $default === $value); $display_value = PhabricatorConfigJSON::prettyPrintJSON($value); if ($is_default) { $display_value = phutil_tag( 'span', array( 'class' => 'almanac-default-property-value', ), $display_value); } $display_key = $key; if ($can_edit) { $display_key = javelin_tag( 'a', array( 'href' => $edit_uri, 'sigil' => 'workflow', ), $display_key); } $rows[] = array( ($is_builtin ? $icon_builtin : $icon_custom), $display_key, $display_value, $delete, ); } $table = id(new AphrontTableView($rows)) ->setNoDataString(pht('No properties.')) ->setHeaders( array( null, pht('Name'), pht('Value'), null, )) ->setColumnClasses( array( null, null, 'wide', 'action', )); $phid = $object->getPHID(); $add_uri = id(new PhutilURI($edit_base)) ->setQueryParam('objectPHID', $object->getPHID()); $can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, $object, PhabricatorPolicyCapability::CAN_EDIT); $add_button = id(new PHUIButtonView()) ->setTag('a') ->setHref($add_uri) ->setWorkflow(true) ->setDisabled(!$can_edit) ->setText(pht('Add Property')) ->setIcon('fa-plus'); $header = id(new PHUIHeaderView()) ->setHeader(pht('Properties')) ->addActionLink($add_button); return id(new PHUIObjectBoxView()) ->setHeader($header) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setTable($table); } protected function addClusterMessage( $positive, $negative) { $can_manage = $this->hasApplicationCapability( AlmanacManageClusterServicesCapability::CAPABILITY); $doc_link = phutil_tag( 'a', array( 'href' => PhabricatorEnv::getDoclink( 'Clustering Introduction'), 'target' => '_blank', ), pht('Learn More')); if ($can_manage) { $severity = PHUIInfoView::SEVERITY_NOTICE; $message = $positive; } else { $severity = PHUIInfoView::SEVERITY_WARNING; $message = $negative; } $icon = id(new PHUIIconView()) ->setIcon('fa-sitemap'); return id(new PHUIInfoView()) ->setSeverity($severity) ->setErrors( array( array($icon, ' ', $message, ' ', $doc_link), )); } protected function getPropertyDeleteURI($object) { return null; } protected function getPropertyUpdateURI($object) { return null; } } diff --git a/src/applications/almanac/view/AlmanacBindingTableView.php b/src/applications/almanac/view/AlmanacBindingTableView.php index 06797c912d..746d3de5c2 100644 --- a/src/applications/almanac/view/AlmanacBindingTableView.php +++ b/src/applications/almanac/view/AlmanacBindingTableView.php @@ -1,119 +1,119 @@ noDataString = $no_data_string; return $this; } public function getNoDataString() { return $this->noDataString; } public function setBindings(array $bindings) { $this->bindings = $bindings; return $this; } public function getBindings() { return $this->bindings; } public function setHideServiceColumn($hide_service_column) { $this->hideServiceColumn = $hide_service_column; return $this; } public function getHideServiceColumn() { return $this->hideServiceColumn; } public function render() { $bindings = $this->getBindings(); $viewer = $this->getUser(); $phids = array(); foreach ($bindings as $binding) { $phids[] = $binding->getServicePHID(); $phids[] = $binding->getDevicePHID(); $phids[] = $binding->getInterface()->getNetworkPHID(); } $handles = $viewer->loadHandles($phids); $icon_disabled = id(new PHUIIconView()) ->setIcon('fa-ban') ->addSigil('has-tooltip') ->setMetadata( array( 'tip' => pht('Disabled'), )); $icon_active = id(new PHUIIconView()) ->setIcon('fa-check') ->addSigil('has-tooltip') ->setMetadata( array( 'tip' => pht('Active'), )); $rows = array(); foreach ($bindings as $binding) { $addr = $binding->getInterface()->getAddress(); $port = $binding->getInterface()->getPort(); $rows[] = array( $binding->getID(), ($binding->getIsDisabled() ? $icon_disabled : $icon_active), $handles->renderHandle($binding->getServicePHID()), $handles->renderHandle($binding->getDevicePHID()), $handles->renderHandle($binding->getInterface()->getNetworkPHID()), $binding->getInterface()->renderDisplayAddress(), phutil_tag( 'a', array( - 'class' => 'small grey button', + 'class' => 'small button button-grey', 'href' => '/almanac/binding/'.$binding->getID().'/', ), pht('Details')), ); } $table = id(new AphrontTableView($rows)) ->setNoDataString($this->getNoDataString()) ->setHeaders( array( pht('ID'), null, pht('Service'), pht('Device'), pht('Network'), pht('Interface'), null, )) ->setColumnClasses( array( '', 'icon', '', '', '', 'wide', 'action', )) ->setColumnVisibility( array( true, true, !$this->getHideServiceColumn(), )); return $table; } } diff --git a/src/applications/almanac/view/AlmanacInterfaceTableView.php b/src/applications/almanac/view/AlmanacInterfaceTableView.php index f937e34f44..1fdcd0bf35 100644 --- a/src/applications/almanac/view/AlmanacInterfaceTableView.php +++ b/src/applications/almanac/view/AlmanacInterfaceTableView.php @@ -1,89 +1,89 @@ interfaces = $interfaces; return $this; } public function getInterfaces() { return $this->interfaces; } public function setCanEdit($can_edit) { $this->canEdit = $can_edit; return $this; } public function getCanEdit() { return $this->canEdit; } public function render() { $interfaces = $this->getInterfaces(); $viewer = $this->getUser(); $can_edit = $this->getCanEdit(); if ($can_edit) { - $button_class = 'small grey button'; + $button_class = 'small button button-grey'; } else { - $button_class = 'small grey button disabled'; + $button_class = 'small button button-grey disabled'; } $handles = $viewer->loadHandles(mpull($interfaces, 'getNetworkPHID')); $rows = array(); foreach ($interfaces as $interface) { $rows[] = array( $interface->getID(), $handles->renderHandle($interface->getNetworkPHID()), $interface->getAddress(), $interface->getPort(), javelin_tag( 'a', array( 'class' => $button_class, 'href' => '/almanac/interface/edit/'.$interface->getID().'/', 'sigil' => ($can_edit ? null : 'workflow'), ), pht('Edit')), javelin_tag( 'a', array( 'class' => $button_class, 'href' => '/almanac/interface/delete/'.$interface->getID().'/', 'sigil' => 'workflow', ), pht('Delete')), ); } $table = id(new AphrontTableView($rows)) ->setHeaders( array( pht('ID'), pht('Network'), pht('Address'), pht('Port'), null, null, )) ->setColumnClasses( array( '', 'wide', '', '', 'action', 'action', )); return $table; } } diff --git a/src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php b/src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php index 59161d2814..fc89d310e1 100644 --- a/src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php +++ b/src/applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php @@ -1,116 +1,116 @@ getUser()->getIsMailingList()) { return false; } return true; } public function getPanelKey() { return 'apitokens'; } public function getPanelName() { return pht('Conduit API Tokens'); } public function getPanelGroupKey() { return PhabricatorSettingsLogsPanelGroup::PANELGROUPKEY; } public function isEnabled() { return true; } public function processRequest(AphrontRequest $request) { $viewer = $this->getViewer(); $user = $this->getUser(); $tokens = id(new PhabricatorConduitTokenQuery()) ->setViewer($viewer) ->withObjectPHIDs(array($user->getPHID())) ->withExpired(false) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->execute(); $rows = array(); foreach ($tokens as $token) { $rows[] = array( javelin_tag( 'a', array( 'href' => '/conduit/token/edit/'.$token->getID().'/', 'sigil' => 'workflow', ), $token->getPublicTokenName()), PhabricatorConduitToken::getTokenTypeName($token->getTokenType()), phabricator_datetime($token->getDateCreated(), $viewer), ($token->getExpires() ? phabricator_datetime($token->getExpires(), $viewer) : pht('Never')), javelin_tag( 'a', array( - 'class' => 'button small grey', + 'class' => 'button small button-grey', 'href' => '/conduit/token/terminate/'.$token->getID().'/', 'sigil' => 'workflow', ), pht('Terminate')), ); } $table = new AphrontTableView($rows); $table->setNoDataString(pht("You don't have any active API tokens.")); $table->setHeaders( array( pht('Token'), pht('Type'), pht('Created'), pht('Expires'), null, )); $table->setColumnClasses( array( 'wide pri', '', 'right', 'right', 'action', )); $generate_button = id(new PHUIButtonView()) ->setText(pht('Generate API Token')) ->setHref('/conduit/token/edit/?objectPHID='.$user->getPHID()) ->setTag('a') ->setWorkflow(true) ->setIcon('fa-plus'); $terminate_button = id(new PHUIButtonView()) ->setText(pht('Terminate All Tokens')) ->setHref('/conduit/token/terminate/?objectPHID='.$user->getPHID()) ->setTag('a') ->setWorkflow(true) ->setIcon('fa-exclamation-triangle'); $header = id(new PHUIHeaderView()) ->setHeader(pht('Active API Tokens')) ->addActionLink($generate_button) ->addActionLink($terminate_button); $panel = id(new PHUIObjectBoxView()) ->setHeader($header) ->setTable($table); return $panel; } } diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php index 10e802eb3f..71bdb9d8dc 100644 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -1,605 +1,605 @@ issue = $issue; return $this; } public function getIssue() { return $this->issue; } public function renderInFlight() { $issue = $this->getIssue(); return id(new PhabricatorInFlightErrorView()) ->setMessage($issue->getName()) ->render(); } public function render() { $issue = $this->getIssue(); $description = array(); $description[] = phutil_tag( 'div', array( 'class' => 'setup-issue-instructions', ), phutil_escape_html_newlines($issue->getMessage())); $configs = $issue->getPHPConfig(); if ($configs) { $description[] = $this->renderPHPConfig($configs, $issue); } $configs = $issue->getMySQLConfig(); if ($configs) { $description[] = $this->renderMySQLConfig($configs); } $configs = $issue->getPhabricatorConfig(); if ($configs) { $description[] = $this->renderPhabricatorConfig($configs); } $related_configs = $issue->getRelatedPhabricatorConfig(); if ($related_configs) { $description[] = $this->renderPhabricatorConfig($related_configs, $related = true); } $commands = $issue->getCommands(); if ($commands) { $run_these = pht('Run these %d command(s):', count($commands)); $description[] = phutil_tag( 'div', array( 'class' => 'setup-issue-config', ), array( phutil_tag('p', array(), $run_these), phutil_tag('pre', array(), phutil_implode_html("\n", $commands)), )); } $extensions = $issue->getPHPExtensions(); if ($extensions) { $install_these = pht( 'Install these %d PHP extension(s):', count($extensions)); $install_info = pht( 'You can usually install a PHP extension using %s or %s. Common '. 'package names are %s or %s. Try commands like these:', phutil_tag('tt', array(), 'apt-get'), phutil_tag('tt', array(), 'yum'), hsprintf('php-%s', pht('extname')), hsprintf('php5-%s', pht('extname'))); // TODO: We should do a better job of detecting how to install extensions // on the current system. $install_commands = hsprintf( "\$ sudo apt-get install php5-extname ". "# Debian / Ubuntu\n". "\$ sudo yum install php-extname ". "# Red Hat / Derivatives"); $fallback_info = pht( "If those commands don't work, try Google. The process of installing ". "PHP extensions is not specific to Phabricator, and any instructions ". "you can find for installing them on your system should work. On Mac ". "OS X, you might want to try Homebrew."); $restart_info = pht( 'After installing new PHP extensions, restart Phabricator '. 'for the changes to take effect. For help with restarting '. 'Phabricator, see %s in the documentation.', $this->renderRestartLink()); $description[] = phutil_tag( 'div', array( 'class' => 'setup-issue-config', ), array( phutil_tag('p', array(), $install_these), phutil_tag('pre', array(), implode("\n", $extensions)), phutil_tag('p', array(), $install_info), phutil_tag('pre', array(), $install_commands), phutil_tag('p', array(), $fallback_info), phutil_tag('p', array(), $restart_info), )); } $related_links = $issue->getLinks(); if ($related_links) { $description[] = $this->renderRelatedLinks($related_links); } $actions = array(); if (!$issue->getIsFatal()) { if ($issue->getIsIgnored()) { $actions[] = javelin_tag( 'a', array( 'href' => '/config/unignore/'.$issue->getIssueKey().'/', 'sigil' => 'workflow', - 'class' => 'button grey', + 'class' => 'button button-grey', ), pht('Unignore Setup Issue')); } else { $actions[] = javelin_tag( 'a', array( 'href' => '/config/ignore/'.$issue->getIssueKey().'/', 'sigil' => 'workflow', - 'class' => 'button grey', + 'class' => 'button button-grey', ), pht('Ignore Setup Issue')); } $actions[] = javelin_tag( 'a', array( 'href' => '/config/issue/'.$issue->getIssueKey().'/', - 'class' => 'button grey', + 'class' => 'button button-grey', 'style' => 'float: right', ), pht('Reload Page')); } if ($actions) { $actions = phutil_tag( 'div', array( 'class' => 'setup-issue-actions', ), $actions); } if ($issue->getIsIgnored()) { $status = phutil_tag( 'div', array( 'class' => 'setup-issue-status', ), pht( 'This issue is currently ignored, and does not show a global '. 'warning.')); $next = null; } else { $status = null; $next = phutil_tag( 'div', array( 'class' => 'setup-issue-next', ), pht('To continue, resolve this problem and reload the page.')); } $name = phutil_tag( 'div', array( 'class' => 'setup-issue-name', ), $issue->getName()); $head = phutil_tag( 'div', array( 'class' => 'setup-issue-head', ), array($name, $status)); $tail = phutil_tag( 'div', array( 'class' => 'setup-issue-tail', ), array($actions)); $issue = phutil_tag( 'div', array( 'class' => 'setup-issue', ), array( $head, $description, $tail, )); $debug_info = phutil_tag( 'div', array( 'class' => 'setup-issue-debug', ), pht('Host: %s', php_uname('n'))); return phutil_tag( 'div', array( 'class' => 'setup-issue-shell', ), array( $issue, $next, $debug_info, )); } private function renderPhabricatorConfig(array $configs, $related = false) { $issue = $this->getIssue(); $table_info = phutil_tag( 'p', array(), pht( 'The current Phabricator configuration has these %d value(s):', count($configs))); $options = PhabricatorApplicationConfigOptions::loadAllOptions(); $hidden = array(); foreach ($options as $key => $option) { if ($option->getHidden()) { $hidden[$key] = true; } } $table = null; $dict = array(); foreach ($configs as $key) { if (isset($hidden[$key])) { $dict[$key] = null; } else { $dict[$key] = PhabricatorEnv::getUnrepairedEnvConfig($key); } } $table = $this->renderValueTable($dict, $hidden); if ($this->getIssue()->getIsFatal()) { $update_info = phutil_tag( 'p', array(), pht( 'To update these %d value(s), run these command(s) from the command '. 'line:', count($configs))); $update = array(); foreach ($configs as $key) { $update[] = hsprintf( 'phabricator/ $ ./bin/config set %s value', $key); } $update = phutil_tag('pre', array(), phutil_implode_html("\n", $update)); } else { $update = array(); foreach ($configs as $config) { if (idx($options, $config) && $options[$config]->getLocked()) { $name = pht('View "%s"', $config); } else { $name = pht('Edit "%s"', $config); } $link = phutil_tag( 'a', array( 'href' => '/config/edit/'.$config.'/?issue='.$issue->getIssueKey(), ), $name); $update[] = phutil_tag('li', array(), $link); } if ($update) { $update = phutil_tag('ul', array(), $update); if (!$related) { $update_info = phutil_tag( 'p', array(), pht('You can update these %d value(s) here:', count($configs))); } else { $update_info = phutil_tag( 'p', array(), pht('These %d configuration value(s) are related:', count($configs))); } } else { $update = null; $update_info = null; } } return phutil_tag( 'div', array( 'class' => 'setup-issue-config', ), array( $table_info, $table, $update_info, $update, )); } private function renderPHPConfig(array $configs, $issue) { $table_info = phutil_tag( 'p', array(), pht( 'The current PHP configuration has these %d value(s):', count($configs))); $dict = array(); foreach ($configs as $key) { $dict[$key] = $issue->getPHPConfigOriginalValue( $key, ini_get($key)); } $table = $this->renderValueTable($dict); ob_start(); phpinfo(); $phpinfo = ob_get_clean(); $rex = '@Loaded Configuration File\s*(.*?)@i'; $matches = null; $ini_loc = null; if (preg_match($rex, $phpinfo, $matches)) { $ini_loc = trim($matches[1]); } $rex = '@Additional \.ini files parsed\s*(.*?)@i'; $more_loc = array(); if (preg_match($rex, $phpinfo, $matches)) { $more_loc = trim($matches[1]); if ($more_loc == '(none)') { $more_loc = array(); } else { $more_loc = preg_split('/\s*,\s*/', $more_loc); } } $info = array(); if (!$ini_loc) { $info[] = phutil_tag( 'p', array(), pht( 'To update these %d value(s), edit your PHP configuration file.', count($configs))); } else { $info[] = phutil_tag( 'p', array(), pht( 'To update these %d value(s), edit your PHP configuration file, '. 'located here:', count($configs))); $info[] = phutil_tag( 'pre', array(), $ini_loc); } if ($more_loc) { $info[] = phutil_tag( 'p', array(), pht( 'PHP also loaded these %s configuration file(s):', phutil_count($more_loc))); $info[] = phutil_tag( 'pre', array(), implode("\n", $more_loc)); } $show_standard = false; $show_opcache = false; foreach ($configs as $key) { if (preg_match('/^opcache\./', $key)) { $show_opcache = true; } else { $show_standard = true; } } if ($show_standard) { $info[] = phutil_tag( 'p', array(), pht( 'You can find more information about PHP configuration values '. 'in the %s.', phutil_tag( 'a', array( 'href' => 'http://php.net/manual/ini.list.php', 'target' => '_blank', ), pht('PHP Documentation')))); } if ($show_opcache) { $info[] = phutil_tag( 'p', array(), pht( 'You can find more information about configuring OPCache in '. 'the %s.', phutil_tag( 'a', array( 'href' => 'http://php.net/manual/opcache.configuration.php', 'target' => '_blank', ), pht('PHP OPCache Documentation')))); } $info[] = phutil_tag( 'p', array(), pht( 'After editing the PHP configuration, restart Phabricator for '. 'the changes to take effect. For help with restarting '. 'Phabricator, see %s in the documentation.', $this->renderRestartLink())); return phutil_tag( 'div', array( 'class' => 'setup-issue-config', ), array( $table_info, $table, $info, )); } private function renderMySQLConfig(array $config) { $values = array(); $issue = $this->getIssue(); $ref = $issue->getDatabaseRef(); if ($ref) { foreach ($config as $key) { $value = $ref->loadRawMySQLConfigValue($key); if ($value === null) { $value = phutil_tag( 'em', array(), pht('(Not Supported)')); } $values[$key] = $value; } } $table = $this->renderValueTable($values); $doc_href = PhabricatorEnv::getDoclink('User Guide: Amazon RDS'); $doc_link = phutil_tag( 'a', array( 'href' => $doc_href, 'target' => '_blank', ), pht('User Guide: Amazon RDS')); $info = array(); $info[] = phutil_tag( 'p', array(), pht( 'If you are using Amazon RDS, some of the instructions above may '. 'not apply to you. See %s for discussion of Amazon RDS.', $doc_link)); $table_info = phutil_tag( 'p', array(), pht( 'The current MySQL configuration has these %d value(s):', count($config))); return phutil_tag( 'div', array( 'class' => 'setup-issue-config', ), array( $table_info, $table, $info, )); } private function renderValueTable(array $dict, array $hidden = array()) { $rows = array(); foreach ($dict as $key => $value) { if (isset($hidden[$key])) { $value = phutil_tag('em', array(), 'hidden'); } else { $value = $this->renderValueForDisplay($value); } $cols = array( phutil_tag('th', array(), $key), phutil_tag('td', array(), $value), ); $rows[] = phutil_tag('tr', array(), $cols); } return phutil_tag('table', array(), $rows); } private function renderValueForDisplay($value) { if ($value === null) { return phutil_tag('em', array(), 'null'); } else if ($value === false) { return phutil_tag('em', array(), 'false'); } else if ($value === true) { return phutil_tag('em', array(), 'true'); } else if ($value === '') { return phutil_tag('em', array(), 'empty string'); } else if ($value instanceof PhutilSafeHTML) { return $value; } else { return PhabricatorConfigJSON::prettyPrintJSON($value); } } private function renderRelatedLinks(array $links) { $link_info = phutil_tag( 'p', array(), pht( '%d related link(s):', count($links))); $link_list = array(); foreach ($links as $link) { $link_tag = phutil_tag( 'a', array( 'target' => '_blank', 'href' => $link['href'], ), $link['name']); $link_item = phutil_tag('li', array(), $link_tag); $link_list[] = $link_item; } $link_list = phutil_tag('ul', array(), $link_list); return phutil_tag( 'div', array( 'class' => 'setup-issue-config', ), array( $link_info, $link_list, )); } private function renderRestartLink() { $doc_href = PhabricatorEnv::getDoclink('Restarting Phabricator'); return phutil_tag( 'a', array( 'href' => $doc_href, 'target' => '_blank', ), pht('Restarting Phabricator')); } } diff --git a/src/applications/conpherence/controller/ConpherenceController.php b/src/applications/conpherence/controller/ConpherenceController.php index 9d7473e159..f47e7bf1ad 100644 --- a/src/applications/conpherence/controller/ConpherenceController.php +++ b/src/applications/conpherence/controller/ConpherenceController.php @@ -1,229 +1,229 @@ conpherence = $conpherence; return $this; } public function getConpherence() { return $this->conpherence; } public function buildApplicationMenu() { $nav = new PHUIListView(); $conpherence = $this->conpherence; // Local Links if ($conpherence) { $nav->addMenuItem( id(new PHUIListItemView()) ->setName(pht('Joined Rooms')) ->setType(PHUIListItemView::TYPE_LINK) ->setHref($this->getApplicationURI())); $nav->addMenuItem( id(new PHUIListItemView()) ->setName(pht('Edit Room')) ->setType(PHUIListItemView::TYPE_LINK) ->setHref( $this->getApplicationURI('update/'.$conpherence->getID()).'/') ->setWorkflow(true)); $nav->addMenuItem( id(new PHUIListItemView()) ->setName(pht('Add Participants')) ->setType(PHUIListItemView::TYPE_LINK) ->setHref('#') ->addSigil('conpherence-widget-adder') ->setMetadata(array('widget' => 'widgets-people'))); } // Global Links $nav->newLabel(pht('Conpherence')); $nav->newLink( pht('New Room'), $this->getApplicationURI('new/')); $nav->newLink( pht('Search Rooms'), $this->getApplicationURI('search/')); return $nav; } protected function buildHeaderPaneContent( ConpherenceThread $conpherence) { $viewer = $this->getViewer(); $header = null; $id = $conpherence->getID(); if ($id) { $data = $conpherence->getDisplayData($this->getViewer()); $header = id(new PHUIHeaderView()) ->setViewer($viewer) ->setHeader($data['title']) ->setPolicyObject($conpherence) ->setImage($data['image']); if (strlen($data['topic'])) { $topic = id(new PHUITagView()) ->setName($data['topic']) ->setColor(PHUITagView::COLOR_VIOLET) ->setType(PHUITagView::TYPE_SHADE) ->addClass('conpherence-header-topic'); $header->addTag($topic); } $can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, $conpherence, PhabricatorPolicyCapability::CAN_EDIT); if ($can_edit) { $header->setImageURL( $this->getApplicationURI("picture/{$id}/")); } $participating = $conpherence->getParticipantIfExists($viewer->getPHID()); $header->addActionItem( id(new PHUIIconCircleView()) ->setHref( $this->getApplicationURI('edit/'.$conpherence->getID()).'/') ->setIcon('fa-pencil') ->addClass('hide-on-device') ->setColor('violet') ->setWorkflow(true)); $header->addActionItem( id(new PHUIIconCircleView()) ->setHref($this->getApplicationURI("preferences/{$id}/")) ->setIcon('fa-gear') ->addClass('hide-on-device') ->setColor('pink') ->setWorkflow(true)); $widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY; $widget_view = (bool)$viewer->getUserSetting($widget_key, false); Javelin::initBehavior( 'toggle-widget', array( 'show' => (int)$widget_view, 'settingsURI' => '/settings/adjust/?key='.$widget_key, )); $header->addActionItem( id(new PHUIIconCircleView()) ->addSigil('conpherence-widget-toggle') ->setIcon('fa-group') ->setHref('#') ->addClass('conpherence-participant-toggle')); Javelin::initBehavior('conpherence-search'); $header->addActionItem( id(new PHUIIconCircleView()) ->addSigil('conpherence-search-toggle') ->setIcon('fa-search') ->setHref('#') ->setColor('green') ->addClass('conpherence-search-toggle')); if (!$participating) { $action = ConpherenceUpdateActions::JOIN_ROOM; $uri = $this->getApplicationURI("update/{$id}/"); $button = phutil_tag( 'button', array( 'type' => 'SUBMIT', - 'class' => 'button green mlr', + 'class' => 'button button-green mlr', ), pht('Join Room')); $hidden = phutil_tag( 'input', array( 'type' => 'hidden', 'name' => 'action', 'value' => ConpherenceUpdateActions::JOIN_ROOM, )); $form = phabricator_form( $viewer, array( 'method' => 'POST', 'action' => (string)$uri, ), array( $hidden, $button, )); $header->addActionItem($form); } } return $header; } public function buildSearchForm() { $viewer = $this->getViewer(); $conpherence = $this->conpherence; $name = $conpherence->getTitle(); $bar = javelin_tag( 'input', array( 'type' => 'text', 'id' => 'conpherence-search-input', 'name' => 'fulltext', 'class' => 'conpherence-search-input', 'sigil' => 'conpherence-search-input', 'placeholder' => pht('Search %s...', $name), )); $id = $conpherence->getID(); $form = phabricator_form( $viewer, array( 'method' => 'POST', 'action' => '/conpherence/threadsearch/'.$id.'/', 'sigil' => 'conpherence-search-form', 'class' => 'conpherence-search-form', 'id' => 'conpherence-search-form', ), array( $bar, )); $form_view = phutil_tag( 'div', array( 'class' => 'conpherence-search-form-view', ), $form); $results = phutil_tag( 'div', array( 'id' => 'conpherence-search-results', 'class' => 'conpherence-search-results', )); $view = phutil_tag( 'div', array( 'class' => 'conpherence-search-window', ), array( $form_view, $results, )); return $view; } } diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php index 5d6a5eaaec..83c40aa32e 100644 --- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php +++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php @@ -1,494 +1,494 @@ conpherences = $conpherences; return $this; } public function getConpherences() { return $this->conpherences; } public function setDraft(PhabricatorDraft $draft) { $this->draft = $draft; return $this; } public function getDraft() { return $this->draft; } public function setSelectedConpherence( ConpherenceThread $conpherence = null) { $this->selectedConpherence = $conpherence; return $this; } public function getSelectedConpherence() { return $this->selectedConpherence; } public function setTransactions(array $transactions) { assert_instances_of($transactions, 'ConpherenceTransaction'); $this->transactions = $transactions; return $this; } public function getTransactions() { return $this->transactions; } public function setVisible($visible) { $this->visible = $visible; return $this; } public function getVisible() { return $this->visible; } public function setMinimize($minimize) { $this->minimize = $minimize; return $this; } public function getMinimize() { return $this->minimize; } public function setInitialLoad($bool) { $this->initialLoad = $bool; return $this; } public function getInitialLoad() { return $this->initialLoad; } public function setPolicyObjects(array $objects) { assert_instances_of($objects, 'PhabricatorPolicy'); $this->policyObjects = $objects; return $this; } public function getPolicyObjects() { return $this->policyObjects; } public function setQuicksandConfig(array $config) { $this->quicksandConfig = $config; return $this; } public function getQuicksandConfig() { return $this->quicksandConfig; } protected function getTagAttributes() { if ($this->getVisible()) { $style = null; } else { $style = 'display: none;'; } $classes = array('conpherence-durable-column'); if ($this->getInitialLoad()) { $classes[] = 'loading'; } return array( 'id' => 'conpherence-durable-column', 'class' => implode(' ', $classes), 'style' => $style, 'sigil' => 'conpherence-durable-column', ); } protected function getTagContent() { $column_key = PhabricatorConpherenceColumnVisibleSetting::SETTINGKEY; $minimize_key = PhabricatorConpherenceColumnMinimizeSetting::SETTINGKEY; Javelin::initBehavior( 'durable-column', array( 'visible' => $this->getVisible(), 'minimize' => $this->getMinimize(), 'visibleURI' => '/settings/adjust/?key='.$column_key, 'minimizeURI' => '/settings/adjust/?key='.$minimize_key, 'quicksandConfig' => $this->getQuicksandConfig(), )); $policy_objects = ConpherenceThread::loadViewPolicyObjects( $this->getUser(), $this->getConpherences()); $this->setPolicyObjects($policy_objects); $classes = array(); $classes[] = 'conpherence-durable-column-header'; $classes[] = 'grouped'; $header = phutil_tag( 'div', array( 'class' => implode(' ', $classes), 'data-sigil' => 'conpherence-minimize-window', ), $this->buildHeader()); $icon_bar = null; if ($this->conpherences) { $icon_bar = $this->buildIconBar(); } $icon_bar = phutil_tag( 'div', array( 'class' => 'conpherence-durable-column-icon-bar', ), $icon_bar); $transactions = $this->buildTransactions(); $content = javelin_tag( 'div', array( 'class' => 'conpherence-durable-column-main', 'sigil' => 'conpherence-durable-column-main', ), phutil_tag( 'div', array( 'id' => 'conpherence-durable-column-content', 'class' => 'conpherence-durable-column-frame', ), javelin_tag( 'div', array( 'class' => 'conpherence-durable-column-transactions', 'sigil' => 'conpherence-durable-column-transactions', ), $transactions))); $input = $this->buildTextInput(); return array( $header, javelin_tag( 'div', array( 'class' => 'conpherence-durable-column-body', 'sigil' => 'conpherence-durable-column-body', ), array( $icon_bar, $content, $input, )), ); } private function buildIconBar() { $icons = array(); $selected_conpherence = $this->getSelectedConpherence(); $conpherences = $this->getConpherences(); foreach ($conpherences as $conpherence) { $classes = array('conpherence-durable-column-thread-icon'); if ($selected_conpherence->getID() == $conpherence->getID()) { $classes[] = 'selected'; } $data = $conpherence->getDisplayData($this->getUser()); $thread_title = phutil_tag( 'span', array(), array( $data['title'], )); $image = $data['image']; Javelin::initBehavior('phabricator-tooltips'); $icons[] = javelin_tag( 'a', array( 'href' => '/conpherence/columnview/', 'class' => implode(' ', $classes), 'sigil' => 'conpherence-durable-column-thread-icon has-tooltip', 'meta' => array( 'threadID' => $conpherence->getID(), 'threadTitle' => hsprintf('%s', $thread_title), 'tip' => $data['title'], 'align' => 'W', ), ), phutil_tag( 'span', array( 'style' => 'background-image: url('.$image.')', ), '')); } return $icons; } private function buildHeader() { $conpherence = $this->getSelectedConpherence(); $bubble_id = celerity_generate_unique_node_id(); $dropdown_id = celerity_generate_unique_node_id(); $settings_list = new PHUIListView(); $header_actions = $this->getHeaderActionsConfig($conpherence); foreach ($header_actions as $action) { $settings_list->addMenuItem( id(new PHUIListItemView()) ->setHref($action['href']) ->setName($action['name']) ->setIcon($action['icon']) ->setDisabled($action['disabled']) ->addSigil('conpherence-durable-column-header-action') ->setMetadata(array( 'action' => $action['key'], ))); } $settings_menu = phutil_tag( 'div', array( 'id' => $dropdown_id, 'class' => 'phabricator-main-menu-dropdown phui-list-sidenav '. 'conpherence-settings-dropdown', 'sigil' => 'phabricator-notification-menu', 'style' => 'display: none', ), $settings_list); Javelin::initBehavior( 'aphlict-dropdown', array( 'bubbleID' => $bubble_id, 'dropdownID' => $dropdown_id, 'local' => true, 'containerDivID' => 'conpherence-durable-column', )); $bars = id(new PHUIListItemView()) ->setName(pht('Room Actions')) ->setIcon('fa-gear') ->addClass('core-menu-item') ->addClass('conpherence-settings-icon') ->addSigil('conpherence-settings-menu') ->setID($bubble_id) ->setHref('#') ->setAural(pht('Room Actions')) ->setOrder(400); $minimize = id(new PHUIListItemView()) ->setName(pht('Minimize Window')) ->setIcon('fa-toggle-down') ->addClass('core-menu-item') ->addClass('conpherence-minimize-icon') ->addSigil('conpherence-minimize-window') ->setHref('#') ->setAural(pht('Minimize Window')) ->setOrder(300); $settings_button = id(new PHUIListView()) ->addMenuItem($bars) ->addMenuItem($minimize) ->addClass('phabricator-application-menu'); if ($conpherence) { $data = $conpherence->getDisplayData($this->getUser()); $header = phutil_tag( 'span', array(), $data['title']); } else { $header = phutil_tag( 'span', array(), pht('Conpherence')); } $status = new PhabricatorNotificationStatusView(); return phutil_tag( 'div', array( 'class' => 'conpherence-durable-column-header-inner', ), array( $status, javelin_tag( 'div', array( 'sigil' => 'conpherence-durable-column-header-text', 'class' => 'conpherence-durable-column-header-text', ), $header), $settings_button, $settings_menu, )); } private function getHeaderActionsConfig($conpherence) { $actions = array(); if ($conpherence) { $can_edit = PhabricatorPolicyFilter::hasCapability( $this->getUser(), $conpherence, PhabricatorPolicyCapability::CAN_EDIT); $actions[] = array( 'name' => pht('Add Participants'), 'disabled' => !$can_edit, 'href' => '/conpherence/update/'.$conpherence->getID().'/', 'icon' => 'fa-plus', 'key' => ConpherenceUpdateActions::ADD_PERSON, ); $actions[] = array( 'name' => pht('Edit Room'), 'disabled' => !$can_edit, 'href' => '/conpherence/edit/'.$conpherence->getID().'/', 'icon' => 'fa-pencil', 'key' => 'go_edit', ); $actions[] = array( 'name' => pht('View in Conpherence'), 'disabled' => false, 'href' => '/'.$conpherence->getMonogram(), 'icon' => 'fa-comments', 'key' => 'go_conpherence', ); } $actions[] = array( 'name' => pht('Hide Window'), 'disabled' => false, 'href' => '#', 'icon' => 'fa-times', 'key' => 'hide_column', ); return $actions; } private function buildTransactions() { $conpherence = $this->getSelectedConpherence(); if (!$conpherence) { if (!$this->getVisible() || $this->getInitialLoad()) { return pht('Loading...'); } $view = array( phutil_tag( 'div', array( 'class' => 'column-no-rooms-text', ), pht('You have not joined any rooms yet.')), javelin_tag( 'a', array( 'href' => '/conpherence/search/', - 'class' => 'button grey', + 'class' => 'button button-grey', ), pht('Find Rooms')), ); return phutil_tag_div('column-no-rooms', $view); } $data = ConpherenceTransactionRenderer::renderTransactions( $this->getUser(), $conpherence); $messages = ConpherenceTransactionRenderer::renderMessagePaneContent( $data['transactions'], $data['oldest_transaction_id'], $data['newest_transaction_id']); return $messages; } private function buildTextInput() { $conpherence = $this->getSelectedConpherence(); if (!$conpherence) { return null; } $draft = $this->getDraft(); $draft_value = null; if ($draft) { $draft_value = $draft->getDraft(); } $textarea_id = celerity_generate_unique_node_id(); $textarea = javelin_tag( 'textarea', array( 'id' => $textarea_id, 'name' => 'text', 'class' => 'conpherence-durable-column-textarea', 'sigil' => 'conpherence-durable-column-textarea', 'placeholder' => pht('Send a message...'), ), $draft_value); Javelin::initBehavior( 'aphront-drag-and-drop-textarea', array( 'target' => $textarea_id, 'activatedClass' => 'aphront-textarea-drag-and-drop', 'uri' => '/file/dropupload/', )); $id = $conpherence->getID(); return phabricator_form( $this->getUser(), array( 'method' => 'POST', 'action' => '/conpherence/update/'.$id.'/', 'sigil' => 'conpherence-message-form', ), array( $textarea, phutil_tag( 'input', array( 'type' => 'hidden', 'name' => 'action', 'value' => ConpherenceUpdateActions::MESSAGE, )), )); } private function buildStatusText() { return null; } private function buildSendButton() { $conpherence = $this->getSelectedConpherence(); if (!$conpherence) { return null; } return javelin_tag( 'button', array( 'class' => 'grey', 'sigil' => 'conpherence-send-message', ), pht('Send')); } } diff --git a/src/applications/console/plugin/DarkConsoleServicesPlugin.php b/src/applications/console/plugin/DarkConsoleServicesPlugin.php index ea5a100550..7d779027da 100644 --- a/src/applications/console/plugin/DarkConsoleServicesPlugin.php +++ b/src/applications/console/plugin/DarkConsoleServicesPlugin.php @@ -1,292 +1,293 @@ getServiceCallLog(); foreach ($log as $key => $entry) { $config = idx($entry, 'config', array()); unset($log[$key]['config']); if (!$should_analyze) { $log[$key]['explain'] = array( 'sev' => 7, 'size' => null, 'reason' => pht('Disabled'), ); // Query analysis is disabled for this request, so don't do any of it. continue; } if ($entry['type'] != 'query') { continue; } // For each SELECT query, go issue an EXPLAIN on it so we can flag stuff // causing table scans, etc. if (preg_match('/^\s*SELECT\b/i', $entry['query'])) { $conn = PhabricatorDatabaseRef::newRawConnection($entry['config']); try { $explain = queryfx_all( $conn, 'EXPLAIN %Q', $entry['query']); $badness = 0; $size = 1; $reason = null; foreach ($explain as $table) { $size *= (int)$table['rows']; switch ($table['type']) { case 'index': $cur_badness = 1; $cur_reason = 'Index'; break; case 'const': $cur_badness = 1; $cur_reason = 'Const'; break; case 'eq_ref'; $cur_badness = 2; $cur_reason = 'EqRef'; break; case 'range': $cur_badness = 3; $cur_reason = 'Range'; break; case 'ref': $cur_badness = 3; $cur_reason = 'Ref'; break; case 'fulltext': $cur_badness = 3; $cur_reason = 'Fulltext'; break; case 'ALL': if (preg_match('/Using where/', $table['Extra'])) { if ($table['rows'] < 256 && !empty($table['possible_keys'])) { $cur_badness = 2; $cur_reason = pht('Small Table Scan'); } else { $cur_badness = 6; $cur_reason = pht('TABLE SCAN!'); } } else { $cur_badness = 3; $cur_reason = pht('Whole Table'); } break; default: if (preg_match('/No tables used/i', $table['Extra'])) { $cur_badness = 1; $cur_reason = pht('No Tables'); } else if (preg_match('/Impossible/i', $table['Extra'])) { $cur_badness = 1; $cur_reason = pht('Empty'); } else { $cur_badness = 4; $cur_reason = pht("Can't Analyze"); } break; } if ($cur_badness > $badness) { $badness = $cur_badness; $reason = $cur_reason; } } $log[$key]['explain'] = array( 'sev' => $badness, 'size' => $size, 'reason' => $reason, ); } catch (Exception $ex) { $log[$key]['explain'] = array( 'sev' => 5, 'size' => null, 'reason' => $ex->getMessage(), ); } } } return array( 'start' => PhabricatorStartup::getStartTime(), 'end' => microtime(true), 'log' => $log, 'analyzeURI' => (string)$this ->getRequestURI() ->alter('__analyze__', true), 'didAnalyze' => $should_analyze, ); } public function renderPanel() { $data = $this->getData(); $log = $data['log']; $results = array(); $results[] = phutil_tag( 'div', array('class' => 'dark-console-panel-header'), array( phutil_tag( 'a', array( 'href' => $data['analyzeURI'], - 'class' => $data['didAnalyze'] ? 'disabled button' : 'green button', + 'class' => $data['didAnalyze'] ? + 'disabled button' : 'button button-green', ), pht('Analyze Query Plans')), phutil_tag('h1', array(), pht('Calls to External Services')), phutil_tag('div', array('style' => 'clear: both;')), )); $page_total = $data['end'] - $data['start']; $totals = array(); $counts = array(); foreach ($log as $row) { $totals[$row['type']] = idx($totals, $row['type'], 0) + $row['duration']; $counts[$row['type']] = idx($counts, $row['type'], 0) + 1; } $totals['All Services'] = array_sum($totals); $counts['All Services'] = array_sum($counts); $totals['Entire Page'] = $page_total; $counts['Entire Page'] = 0; $summary = array(); foreach ($totals as $type => $total) { $summary[] = array( $type, number_format($counts[$type]), pht('%s us', new PhutilNumber((int)(1000000 * $totals[$type]))), sprintf('%.1f%%', 100 * $totals[$type] / $page_total), ); } $summary_table = new AphrontTableView($summary); $summary_table->setColumnClasses( array( '', 'n', 'n', 'wide', )); $summary_table->setHeaders( array( pht('Type'), pht('Count'), pht('Total Cost'), pht('Page Weight'), )); $results[] = $summary_table->render(); $rows = array(); foreach ($log as $row) { $analysis = null; switch ($row['type']) { case 'query': $info = $row['query']; $info = wordwrap($info, 128, "\n", true); if (!empty($row['explain'])) { $analysis = phutil_tag( 'span', array( 'class' => 'explain-sev-'.$row['explain']['sev'], ), $row['explain']['reason']); } break; case 'connect': $info = $row['host'].':'.$row['database']; break; case 'exec': $info = $row['command']; break; case 's3': case 'conduit': $info = $row['method']; break; case 'http': $info = $row['uri']; break; default: $info = '-'; break; } $offset = ($row['begin'] - $data['start']); $rows[] = array( $row['type'], pht('+%s ms', new PhutilNumber(1000 * $offset)), pht('%s us', new PhutilNumber(1000000 * $row['duration'])), $info, $analysis, ); } $table = new AphrontTableView($rows); $table->setColumnClasses( array( null, 'n', 'n', 'wide', '', )); $table->setHeaders( array( pht('Event'), pht('Start'), pht('Duration'), pht('Details'), pht('Analysis'), )); $results[] = $table->render(); return phutil_implode_html("\n", $results); } } diff --git a/src/applications/console/plugin/DarkConsoleXHProfPlugin.php b/src/applications/console/plugin/DarkConsoleXHProfPlugin.php index f751cc31a5..f76b77c850 100644 --- a/src/applications/console/plugin/DarkConsoleXHProfPlugin.php +++ b/src/applications/console/plugin/DarkConsoleXHProfPlugin.php @@ -1,107 +1,107 @@ getData(); if ($data['profileFilePHID']) { return '#ff00ff'; } return null; } public function getDescription() { return pht('Provides detailed PHP profiling information through XHProf.'); } public function generateData() { return array( 'profileFilePHID' => $this->profileFilePHID, 'profileURI' => (string)$this ->getRequestURI() ->alter('__profile__', 'page'), ); } public function getXHProfRunID() { return $this->profileFilePHID; } public function renderPanel() { $data = $this->getData(); $run = $data['profileFilePHID']; $profile_uri = $data['profileURI']; if (!DarkConsoleXHProfPluginAPI::isProfilerAvailable()) { $href = PhabricatorEnv::getDoclink('Installation Guide'); $install_guide = phutil_tag( 'a', array( 'href' => $href, 'class' => 'bright-link', ), pht('Installation Guide')); return hsprintf( '
%s
', pht( 'The "xhprof" PHP extension is not available. Install xhprof '. 'to enable the XHProf console plugin. You can find instructions in '. 'the %s.', $install_guide)); } $result = array(); $header = phutil_tag( 'div', array('class' => 'dark-console-panel-header'), array( phutil_tag( 'a', array( 'href' => $profile_uri, - 'class' => $run ? 'disabled button' : 'green button', + 'class' => $run ? 'disabled button' : 'button button-green', ), pht('Profile Page')), phutil_tag('h1', array(), pht('XHProf Profiler')), )); $result[] = $header; if ($run) { $result[] = phutil_tag( 'a', array( 'href' => "/xhprof/profile/$run/", 'class' => 'bright-link', 'style' => 'float: right; margin: 1em 2em 0 0; font-weight: bold;', 'target' => '_blank', ), pht('Profile Permalink')); $result[] = phutil_tag( 'iframe', array('src' => "/xhprof/profile/$run/?frame=true")); } else { $result[] = phutil_tag( 'div', array('class' => 'dark-console-no-content'), pht( 'Profiling was not enabled for this page. Use the button above '. 'to enable it.')); } return phutil_implode_html("\n", $result); } public function willShutdown() { $this->profileFilePHID = DarkConsoleXHProfPluginAPI::getProfileFilePHID(); } } diff --git a/src/applications/daemon/view/PhabricatorDaemonTasksTableView.php b/src/applications/daemon/view/PhabricatorDaemonTasksTableView.php index 4fded0b68a..440610be25 100644 --- a/src/applications/daemon/view/PhabricatorDaemonTasksTableView.php +++ b/src/applications/daemon/view/PhabricatorDaemonTasksTableView.php @@ -1,79 +1,79 @@ tasks = $tasks; return $this; } public function getTasks() { return $this->tasks; } public function setNoDataString($no_data_string) { $this->noDataString = $no_data_string; return $this; } public function getNoDataString() { return $this->noDataString; } public function render() { $tasks = $this->getTasks(); $rows = array(); foreach ($tasks as $task) { $rows[] = array( $task->getID(), $task->getTaskClass(), $task->getLeaseOwner(), $task->getLeaseExpires() ? phutil_format_relative_time($task->getLeaseExpires() - time()) : '-', $task->getPriority(), $task->getFailureCount(), phutil_tag( 'a', array( 'href' => '/daemon/task/'.$task->getID().'/', - 'class' => 'button small grey', + 'class' => 'button small button-grey', ), pht('View Task')), ); } $table = new AphrontTableView($rows); $table->setHeaders( array( pht('ID'), pht('Class'), pht('Owner'), pht('Expires'), pht('Priority'), pht('Failures'), '', )); $table->setColumnClasses( array( 'n', 'wide', '', '', 'n', 'n', 'action', )); if (strlen($this->getNoDataString())) { $table->setNoDataString($this->getNoDataString()); } return $table; } } diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 769ac37e1a..69e45b377d 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -1,1108 +1,1108 @@ getViewer(); $this->revisionID = $request->getURIData('id'); $viewer_is_anonymous = !$viewer->isLoggedIn(); $revision = id(new DifferentialRevisionQuery()) ->withIDs(array($this->revisionID)) ->setViewer($viewer) ->needReviewers(true) ->needReviewerAuthority(true) ->executeOne(); if (!$revision) { return new Aphront404Response(); } $diffs = id(new DifferentialDiffQuery()) ->setViewer($viewer) ->withRevisionIDs(array($this->revisionID)) ->execute(); $diffs = array_reverse($diffs, $preserve_keys = true); if (!$diffs) { throw new Exception( pht('This revision has no diffs. Something has gone quite wrong.')); } $revision->attachActiveDiff(last($diffs)); $diff_vs = $request->getInt('vs'); $target_id = $request->getInt('id'); $target = idx($diffs, $target_id, end($diffs)); $target_manual = $target; if (!$target_id) { foreach ($diffs as $diff) { if ($diff->getCreationMethod() != 'commit') { $target_manual = $diff; } } } if (empty($diffs[$diff_vs])) { $diff_vs = null; } $repository = null; $repository_phid = $target->getRepositoryPHID(); if ($repository_phid) { if ($repository_phid == $revision->getRepositoryPHID()) { $repository = $revision->getRepository(); } else { $repository = id(new PhabricatorRepositoryQuery()) ->setViewer($viewer) ->withPHIDs(array($repository_phid)) ->executeOne(); } } list($changesets, $vs_map, $vs_changesets, $rendering_references) = $this->loadChangesetsAndVsMap( $target, idx($diffs, $diff_vs), $repository); if ($request->getExists('download')) { return $this->buildRawDiffResponse( $revision, $changesets, $vs_changesets, $vs_map, $repository); } $map = $vs_map; if (!$map) { $map = array_fill_keys(array_keys($changesets), 0); } $old_ids = array(); $new_ids = array(); foreach ($map as $id => $vs) { if ($vs <= 0) { $old_ids[] = $id; $new_ids[] = $id; } else { $new_ids[] = $id; $new_ids[] = $vs; } } $this->loadDiffProperties($diffs); $props = $target_manual->getDiffProperties(); $subscriber_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID( $revision->getPHID()); $object_phids = array_merge( $revision->getReviewerPHIDs(), $subscriber_phids, $revision->loadCommitPHIDs(), array( $revision->getAuthorPHID(), $viewer->getPHID(), )); foreach ($revision->getAttached() as $type => $phids) { foreach ($phids as $phid => $info) { $object_phids[] = $phid; } } $field_list = PhabricatorCustomField::getObjectFields( $revision, PhabricatorCustomField::ROLE_VIEW); $field_list->setViewer($viewer); $field_list->readFieldsFromStorage($revision); $warning_handle_map = array(); foreach ($field_list->getFields() as $key => $field) { $req = $field->getRequiredHandlePHIDsForRevisionHeaderWarnings(); foreach ($req as $phid) { $warning_handle_map[$key][] = $phid; $object_phids[] = $phid; } } $handles = $this->loadViewerHandles($object_phids); $request_uri = $request->getRequestURI(); $limit = 100; $large = $request->getStr('large'); if (count($changesets) > $limit && !$large) { $count = count($changesets); $warning = new PHUIInfoView(); $warning->setTitle(pht('Very Large Diff')); $warning->setSeverity(PHUIInfoView::SEVERITY_WARNING); $warning->appendChild(hsprintf( '%s %s', pht( 'This diff is very large and affects %s files. '. 'You may load each file individually or ', new PhutilNumber($count)), phutil_tag( 'a', array( - 'class' => 'button grey', + 'class' => 'button button-grey', 'href' => $request_uri ->alter('large', 'true') ->setFragment('toc'), ), pht('Show All Files Inline')))); $warning = $warning->render(); $old = array_select_keys($changesets, $old_ids); $new = array_select_keys($changesets, $new_ids); $query = id(new DifferentialInlineCommentQuery()) ->setViewer($viewer) ->needHidden(true) ->withRevisionPHIDs(array($revision->getPHID())); $inlines = $query->execute(); $inlines = $query->adjustInlinesForChangesets( $inlines, $old, $new, $revision); $visible_changesets = array(); foreach ($inlines as $inline) { $changeset_id = $inline->getChangesetID(); if (isset($changesets[$changeset_id])) { $visible_changesets[$changeset_id] = $changesets[$changeset_id]; } } } else { $warning = null; $visible_changesets = $changesets; } $commit_hashes = mpull($diffs, 'getSourceControlBaseRevision'); $local_commits = idx($props, 'local:commits', array()); foreach ($local_commits as $local_commit) { $commit_hashes[] = idx($local_commit, 'tree'); $commit_hashes[] = idx($local_commit, 'local'); } $commit_hashes = array_unique(array_filter($commit_hashes)); if ($commit_hashes) { $commits_for_links = id(new DiffusionCommitQuery()) ->setViewer($viewer) ->withIdentifiers($commit_hashes) ->execute(); $commits_for_links = mpull( $commits_for_links, null, 'getCommitIdentifier'); } else { $commits_for_links = array(); } $header = $this->buildHeader($revision); $subheader = $this->buildSubheaderView($revision); $details = $this->buildDetails($revision, $field_list); $curtain = $this->buildCurtain($revision); $whitespace = $request->getStr( 'whitespace', DifferentialChangesetParser::WHITESPACE_IGNORE_MOST); $repository = $revision->getRepository(); if ($repository) { $symbol_indexes = $this->buildSymbolIndexes( $repository, $visible_changesets); } else { $symbol_indexes = array(); } $revision_warnings = $this->buildRevisionWarnings( $revision, $field_list, $warning_handle_map, $handles); $info_view = null; if ($revision_warnings) { $info_view = id(new PHUIInfoView()) ->setSeverity(PHUIInfoView::SEVERITY_WARNING) ->setErrors($revision_warnings); } $detail_diffs = array_select_keys( $diffs, array($diff_vs, $target->getID())); $detail_diffs = mpull($detail_diffs, null, 'getPHID'); $this->loadHarbormasterData($detail_diffs); $diff_detail_box = $this->buildDiffDetailView( $detail_diffs, $revision, $field_list); $unit_box = $this->buildUnitMessagesView( $target, $revision); $timeline = $this->buildTransactions( $revision, $diff_vs ? $diffs[$diff_vs] : $target, $target, $old_ids, $new_ids); $timeline->setQuoteRef($revision->getMonogram()); $changeset_view = id(new DifferentialChangesetListView()) ->setChangesets($changesets) ->setVisibleChangesets($visible_changesets) ->setStandaloneURI('/differential/changeset/') ->setRawFileURIs( '/differential/changeset/?view=old', '/differential/changeset/?view=new') ->setUser($viewer) ->setDiff($target) ->setRenderingReferences($rendering_references) ->setVsMap($vs_map) ->setWhitespace($whitespace) ->setSymbolIndexes($symbol_indexes) ->setTitle(pht('Diff %s', $target->getID())) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY); if ($repository) { $changeset_view->setRepository($repository); } if (!$viewer_is_anonymous) { $changeset_view->setInlineCommentControllerURI( '/differential/comment/inline/edit/'.$revision->getID().'/'); } $broken_diffs = $this->loadHistoryDiffStatus($diffs); $history = id(new DifferentialRevisionUpdateHistoryView()) ->setUser($viewer) ->setDiffs($diffs) ->setDiffUnitStatuses($broken_diffs) ->setSelectedVersusDiffID($diff_vs) ->setSelectedDiffID($target->getID()) ->setSelectedWhitespace($whitespace) ->setCommitsForLinks($commits_for_links); $local_table = id(new DifferentialLocalCommitsView()) ->setUser($viewer) ->setLocalCommits(idx($props, 'local:commits')) ->setCommitsForLinks($commits_for_links); if ($repository) { $other_revisions = $this->loadOtherRevisions( $changesets, $target, $repository); } else { $other_revisions = array(); } $other_view = null; if ($other_revisions) { $other_view = $this->renderOtherRevisions($other_revisions); } $toc_view = $this->buildTableOfContents( $changesets, $visible_changesets, $target->loadCoverageMap($viewer)); $tab_group = id(new PHUITabGroupView()) ->addTab( id(new PHUITabView()) ->setName(pht('Files')) ->setKey('files') ->appendChild($toc_view)) ->addTab( id(new PHUITabView()) ->setName(pht('History')) ->setKey('history') ->appendChild($history)) ->addTab( id(new PHUITabView()) ->setName(pht('Commits')) ->setKey('commits') ->appendChild($local_table)); $stack_graph = id(new DifferentialRevisionGraph()) ->setViewer($viewer) ->setSeedPHID($revision->getPHID()) ->setLoadEntireGraph(true) ->loadGraph(); if (!$stack_graph->isEmpty()) { $stack_table = $stack_graph->newGraphTable(); $parent_type = DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST; $reachable = $stack_graph->getReachableObjects($parent_type); foreach ($reachable as $key => $reachable_revision) { if ($reachable_revision->isClosed()) { unset($reachable[$key]); } } if ($reachable) { $stack_name = pht('Stack (%s Open)', phutil_count($reachable)); $stack_color = PHUIListItemView::STATUS_FAIL; } else { $stack_name = pht('Stack'); $stack_color = null; } $tab_group->addTab( id(new PHUITabView()) ->setName($stack_name) ->setKey('stack') ->setColor($stack_color) ->appendChild($stack_table)); } if ($other_view) { $tab_group->addTab( id(new PHUITabView()) ->setName(pht('Similar')) ->setKey('similar') ->appendChild($other_view)); } $tab_view = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Revision Contents')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->addTabGroup($tab_group); $signatures = DifferentialRequiredSignaturesField::loadForRevision( $revision); $missing_signatures = false; foreach ($signatures as $phid => $signed) { if (!$signed) { $missing_signatures = true; } } $footer = array(); $signature_message = null; if ($missing_signatures) { $signature_message = id(new PHUIInfoView()) ->setTitle(pht('Content Hidden')) ->appendChild( pht( 'The content of this revision is hidden until the author has '. 'signed all of the required legal agreements.')); } else { $anchor = id(new PhabricatorAnchorView()) ->setAnchorName('toc') ->setNavigationMarker(true); $footer[] = array( $anchor, $warning, $tab_view, $changeset_view, ); } $comment_view = id(new DifferentialRevisionEditEngine()) ->setViewer($viewer) ->buildEditEngineCommentView($revision); $comment_view->setTransactionTimeline($timeline); $review_warnings = array(); foreach ($field_list->getFields() as $field) { $review_warnings[] = $field->getWarningsForDetailView(); } $review_warnings = array_mergev($review_warnings); if ($review_warnings) { $warnings_view = id(new PHUIInfoView()) ->setSeverity(PHUIInfoView::SEVERITY_WARNING) ->setErrors($review_warnings); $comment_view->setInfoView($warnings_view); } $footer[] = $comment_view; $monogram = $revision->getMonogram(); $operations_box = $this->buildOperationsBox($revision); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb($monogram); $crumbs->setBorder(true); $filetree_on = $viewer->compareUserSetting( PhabricatorShowFiletreeSetting::SETTINGKEY, PhabricatorShowFiletreeSetting::VALUE_ENABLE_FILETREE); $nav = null; if ($filetree_on) { $collapsed_key = PhabricatorFiletreeVisibleSetting::SETTINGKEY; $collapsed_value = $viewer->getUserSetting($collapsed_key); $nav = id(new DifferentialChangesetFileTreeSideNavBuilder()) ->setTitle($monogram) ->setBaseURI(new PhutilURI($revision->getURI())) ->setCollapsed((bool)$collapsed_value) ->build($changesets); } Javelin::initBehavior('differential-user-select'); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setSubheader($subheader) ->setCurtain($curtain) ->setMainColumn( array( $operations_box, $info_view, $details, $diff_detail_box, $unit_box, $timeline, $signature_message, )) ->setFooter($footer); $page = $this->newPage() ->setTitle($monogram.' '.$revision->getTitle()) ->setCrumbs($crumbs) ->setPageObjectPHIDs(array($revision->getPHID())) ->appendChild($view); if ($nav) { $page->setNavigation($nav); } return $page; } private function buildHeader(DifferentialRevision $revision) { $view = id(new PHUIHeaderView()) ->setHeader($revision->getTitle($revision)) ->setUser($this->getViewer()) ->setPolicyObject($revision) ->setHeaderIcon('fa-cog'); $status = $revision->getStatus(); $status_name = DifferentialRevisionStatus::renderFullDescription($status); $view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name); return $view; } private function buildSubheaderView(DifferentialRevision $revision) { $viewer = $this->getViewer(); $author_phid = $revision->getAuthorPHID(); $author = $viewer->renderHandle($author_phid)->render(); $date = phabricator_datetime($revision->getDateCreated(), $viewer); $author = phutil_tag('strong', array(), $author); $handles = $viewer->loadHandles(array($author_phid)); $image_uri = $handles[$author_phid]->getImageURI(); $image_href = $handles[$author_phid]->getURI(); $content = pht('Authored by %s on %s.', $author, $date); return id(new PHUIHeadThingView()) ->setImage($image_uri) ->setImageHref($image_href) ->setContent($content); } private function buildDetails( DifferentialRevision $revision, $custom_fields) { $viewer = $this->getViewer(); $properties = id(new PHUIPropertyListView()) ->setUser($viewer); if ($custom_fields) { $custom_fields->appendFieldsToPropertyList( $revision, $viewer, $properties); } $header = id(new PHUIHeaderView()) ->setHeader(pht('Details')); return id(new PHUIObjectBoxView()) ->setHeader($header) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($properties); } private function buildCurtain(DifferentialRevision $revision) { $viewer = $this->getViewer(); $revision_id = $revision->getID(); $revision_phid = $revision->getPHID(); $curtain = $this->newCurtainView($revision); $can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, $revision, PhabricatorPolicyCapability::CAN_EDIT); $curtain->addAction( id(new PhabricatorActionView()) ->setIcon('fa-pencil') ->setHref("/differential/revision/edit/{$revision_id}/") ->setName(pht('Edit Revision')) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit)); $curtain->addAction( id(new PhabricatorActionView()) ->setIcon('fa-upload') ->setHref("/differential/revision/update/{$revision_id}/") ->setName(pht('Update Diff')) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit)); $request_uri = $this->getRequest()->getRequestURI(); $curtain->addAction( id(new PhabricatorActionView()) ->setIcon('fa-download') ->setName(pht('Download Raw Diff')) ->setHref($request_uri->alter('download', 'true'))); $relationship_list = PhabricatorObjectRelationshipList::newForObject( $viewer, $revision); $revision_actions = array( DifferentialRevisionHasParentRelationship::RELATIONSHIPKEY, DifferentialRevisionHasChildRelationship::RELATIONSHIPKEY, ); $revision_submenu = $relationship_list->newActionSubmenu($revision_actions) ->setName(pht('Edit Related Revisions...')) ->setIcon('fa-cog'); $curtain->addAction($revision_submenu); $relationship_submenu = $relationship_list->newActionMenu(); if ($relationship_submenu) { $curtain->addAction($relationship_submenu); } return $curtain; } private function loadHistoryDiffStatus(array $diffs) { assert_instances_of($diffs, 'DifferentialDiff'); $diff_phids = mpull($diffs, 'getPHID'); $bad_unit_status = array( ArcanistUnitTestResult::RESULT_FAIL, ArcanistUnitTestResult::RESULT_BROKEN, ); $message = new HarbormasterBuildUnitMessage(); $target = new HarbormasterBuildTarget(); $build = new HarbormasterBuild(); $buildable = new HarbormasterBuildable(); $broken_diffs = queryfx_all( $message->establishConnection('r'), 'SELECT distinct a.buildablePHID FROM %T m JOIN %T t ON m.buildTargetPHID = t.phid JOIN %T b ON t.buildPHID = b.phid JOIN %T a ON b.buildablePHID = a.phid WHERE a.buildablePHID IN (%Ls) AND m.result in (%Ls)', $message->getTableName(), $target->getTableName(), $build->getTableName(), $buildable->getTableName(), $diff_phids, $bad_unit_status); $unit_status = array(); foreach ($broken_diffs as $broken) { $phid = $broken['buildablePHID']; $unit_status[$phid] = DifferentialUnitStatus::UNIT_FAIL; } return $unit_status; } private function loadChangesetsAndVsMap( DifferentialDiff $target, DifferentialDiff $diff_vs = null, PhabricatorRepository $repository = null) { $load_diffs = array($target); if ($diff_vs) { $load_diffs[] = $diff_vs; } $raw_changesets = id(new DifferentialChangesetQuery()) ->setViewer($this->getRequest()->getUser()) ->withDiffs($load_diffs) ->execute(); $changeset_groups = mgroup($raw_changesets, 'getDiffID'); $changesets = idx($changeset_groups, $target->getID(), array()); $changesets = mpull($changesets, null, 'getID'); $refs = array(); $vs_map = array(); $vs_changesets = array(); if ($diff_vs) { $vs_id = $diff_vs->getID(); $vs_changesets_path_map = array(); foreach (idx($changeset_groups, $vs_id, array()) as $changeset) { $path = $changeset->getAbsoluteRepositoryPath($repository, $diff_vs); $vs_changesets_path_map[$path] = $changeset; $vs_changesets[$changeset->getID()] = $changeset; } foreach ($changesets as $key => $changeset) { $path = $changeset->getAbsoluteRepositoryPath($repository, $target); if (isset($vs_changesets_path_map[$path])) { $vs_map[$changeset->getID()] = $vs_changesets_path_map[$path]->getID(); $refs[$changeset->getID()] = $changeset->getID().'/'.$vs_changesets_path_map[$path]->getID(); unset($vs_changesets_path_map[$path]); } else { $refs[$changeset->getID()] = $changeset->getID(); } } foreach ($vs_changesets_path_map as $path => $changeset) { $changesets[$changeset->getID()] = $changeset; $vs_map[$changeset->getID()] = -1; $refs[$changeset->getID()] = $changeset->getID().'/-1'; } } else { foreach ($changesets as $changeset) { $refs[$changeset->getID()] = $changeset->getID(); } } $changesets = msort($changesets, 'getSortKey'); return array($changesets, $vs_map, $vs_changesets, $refs); } private function buildSymbolIndexes( PhabricatorRepository $repository, array $visible_changesets) { assert_instances_of($visible_changesets, 'DifferentialChangeset'); $engine = PhabricatorSyntaxHighlighter::newEngine(); $langs = $repository->getSymbolLanguages(); $langs = nonempty($langs, array()); $sources = $repository->getSymbolSources(); $sources = nonempty($sources, array()); $symbol_indexes = array(); if ($langs && $sources) { $have_symbols = id(new DiffusionSymbolQuery()) ->existsSymbolsInRepository($repository->getPHID()); if (!$have_symbols) { return $symbol_indexes; } } $repository_phids = array_merge( array($repository->getPHID()), $sources); $indexed_langs = array_fill_keys($langs, true); foreach ($visible_changesets as $key => $changeset) { $lang = $engine->getLanguageFromFilename($changeset->getFilename()); if (empty($indexed_langs) || isset($indexed_langs[$lang])) { $symbol_indexes[$key] = array( 'lang' => $lang, 'repositories' => $repository_phids, ); } } return $symbol_indexes; } private function loadOtherRevisions( array $changesets, DifferentialDiff $target, PhabricatorRepository $repository) { assert_instances_of($changesets, 'DifferentialChangeset'); $paths = array(); foreach ($changesets as $changeset) { $paths[] = $changeset->getAbsoluteRepositoryPath( $repository, $target); } if (!$paths) { return array(); } $path_map = id(new DiffusionPathIDQuery($paths))->loadPathIDs(); if (!$path_map) { return array(); } $recent = (PhabricatorTime::getNow() - phutil_units('30 days in seconds')); $query = id(new DifferentialRevisionQuery()) ->setViewer($this->getRequest()->getUser()) ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) ->withUpdatedEpochBetween($recent, null) ->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED) ->setLimit(10) ->needFlags(true) ->needDrafts(true) ->needReviewers(true); foreach ($path_map as $path => $path_id) { $query->withPath($repository->getID(), $path_id); } $results = $query->execute(); // Strip out *this* revision. foreach ($results as $key => $result) { if ($result->getID() == $this->revisionID) { unset($results[$key]); } } return $results; } private function renderOtherRevisions(array $revisions) { assert_instances_of($revisions, 'DifferentialRevision'); $viewer = $this->getViewer(); $header = id(new PHUIHeaderView()) ->setHeader(pht('Recent Similar Revisions')); $view = id(new DifferentialRevisionListView()) ->setRevisions($revisions) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setNoBox(true) ->setUser($viewer); $phids = $view->getRequiredHandlePHIDs(); $handles = $this->loadViewerHandles($phids); $view->setHandles($handles); return $view; } /** * Note this code is somewhat similar to the buildPatch method in * @{class:DifferentialReviewRequestMail}. * * @return @{class:AphrontRedirectResponse} */ private function buildRawDiffResponse( DifferentialRevision $revision, array $changesets, array $vs_changesets, array $vs_map, PhabricatorRepository $repository = null) { assert_instances_of($changesets, 'DifferentialChangeset'); assert_instances_of($vs_changesets, 'DifferentialChangeset'); $viewer = $this->getViewer(); id(new DifferentialHunkQuery()) ->setViewer($viewer) ->withChangesets($changesets) ->needAttachToChangesets(true) ->execute(); $diff = new DifferentialDiff(); $diff->attachChangesets($changesets); $raw_changes = $diff->buildChangesList(); $changes = array(); foreach ($raw_changes as $changedict) { $changes[] = ArcanistDiffChange::newFromDictionary($changedict); } $loader = id(new PhabricatorFileBundleLoader()) ->setViewer($viewer); $bundle = ArcanistBundle::newFromChanges($changes); $bundle->setLoadFileDataCallback(array($loader, 'loadFileData')); $vcs = $repository ? $repository->getVersionControlSystem() : null; switch ($vcs) { case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: $raw_diff = $bundle->toGitPatch(); break; case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: default: $raw_diff = $bundle->toUnifiedDiff(); break; } $request_uri = $this->getRequest()->getRequestURI(); // this ends up being something like // D123.diff // or the verbose // D123.vs123.id123.whitespaceignore-all.diff // lame but nice to include these options $file_name = ltrim($request_uri->getPath(), '/').'.'; foreach ($request_uri->getQueryParams() as $key => $value) { if ($key == 'download') { continue; } $file_name .= $key.$value.'.'; } $file_name .= 'diff'; $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); $file = PhabricatorFile::newFromFileData( $raw_diff, array( 'name' => $file_name, 'ttl.relative' => phutil_units('24 hours in seconds'), 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE, )); $file->attachToObject($revision->getPHID()); unset($unguarded); return $file->getRedirectResponse(); } private function buildTransactions( DifferentialRevision $revision, DifferentialDiff $left_diff, DifferentialDiff $right_diff, array $old_ids, array $new_ids) { $timeline = $this->buildTransactionTimeline( $revision, new DifferentialTransactionQuery(), $engine = null, array( 'left' => $left_diff->getID(), 'right' => $right_diff->getID(), 'old' => implode(',', $old_ids), 'new' => implode(',', $new_ids), )); return $timeline; } private function buildRevisionWarnings( DifferentialRevision $revision, PhabricatorCustomFieldList $field_list, array $warning_handle_map, array $handles) { $warnings = array(); foreach ($field_list->getFields() as $key => $field) { $phids = idx($warning_handle_map, $key, array()); $field_handles = array_select_keys($handles, $phids); $field_warnings = $field->getWarningsForRevisionHeader($field_handles); foreach ($field_warnings as $warning) { $warnings[] = $warning; } } return $warnings; } private function buildDiffDetailView( array $diffs, DifferentialRevision $revision, PhabricatorCustomFieldList $field_list) { $viewer = $this->getViewer(); $fields = array(); foreach ($field_list->getFields() as $field) { if ($field->shouldAppearInDiffPropertyView()) { $fields[] = $field; } } if (!$fields) { return null; } $property_lists = array(); foreach ($this->getDiffTabLabels($diffs) as $tab) { list($label, $diff) = $tab; $property_lists[] = array( $label, $this->buildDiffPropertyList($diff, $revision, $fields), ); } $tab_group = id(new PHUITabGroupView()) ->setHideSingleTab(true); foreach ($property_lists as $key => $property_list) { list($tab_name, $list_view) = $property_list; $tab = id(new PHUITabView()) ->setKey($key) ->setName($tab_name) ->appendChild($list_view); $tab_group->addTab($tab); $tab_group->selectTab($key); } return id(new PHUIObjectBoxView()) ->setHeaderText(pht('Diff Detail')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setUser($viewer) ->addTabGroup($tab_group); } private function buildDiffPropertyList( DifferentialDiff $diff, DifferentialRevision $revision, array $fields) { $viewer = $this->getViewer(); $view = id(new PHUIPropertyListView()) ->setUser($viewer) ->setObject($diff); foreach ($fields as $field) { $label = $field->renderDiffPropertyViewLabel($diff); $value = $field->renderDiffPropertyViewValue($diff); if ($value !== null) { $view->addProperty($label, $value); } } return $view; } private function buildOperationsBox(DifferentialRevision $revision) { $viewer = $this->getViewer(); // Save a query if we can't possibly have pending operations. $repository = $revision->getRepository(); if (!$repository || !$repository->canPerformAutomation()) { return null; } $operations = id(new DrydockRepositoryOperationQuery()) ->setViewer($viewer) ->withObjectPHIDs(array($revision->getPHID())) ->withIsDismissed(false) ->withOperationTypes( array( DrydockLandRepositoryOperation::OPCONST, )) ->execute(); if (!$operations) { return null; } $state_fail = DrydockRepositoryOperation::STATE_FAIL; // We're going to show the oldest operation which hasn't failed, or the // most recent failure if they're all failures. $operations = msort($operations, 'getID'); foreach ($operations as $operation) { if ($operation->getOperationState() != $state_fail) { break; } } // If we found a completed operation, don't render anything. We don't want // to show an older error after the thing worked properly. if ($operation->isDone()) { return null; } $box_view = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Active Operations')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY); return id(new DrydockRepositoryOperationStatusView()) ->setUser($viewer) ->setBoxView($box_view) ->setOperation($operation); } private function buildUnitMessagesView( $diff, DifferentialRevision $revision) { $viewer = $this->getViewer(); if (!$diff->getBuildable()) { return null; } if (!$diff->getUnitMessages()) { return null; } $interesting_messages = array(); foreach ($diff->getUnitMessages() as $message) { switch ($message->getResult()) { case ArcanistUnitTestResult::RESULT_PASS: case ArcanistUnitTestResult::RESULT_SKIP: break; default: $interesting_messages[] = $message; break; } } if (!$interesting_messages) { return null; } $excuse = null; if ($diff->hasDiffProperty('arc:unit-excuse')) { $excuse = $diff->getProperty('arc:unit-excuse'); } return id(new HarbormasterUnitSummaryView()) ->setUser($viewer) ->setExcuse($excuse) ->setBuildable($diff->getBuildable()) ->setUnitMessages($diff->getUnitMessages()) ->setLimit(5) ->setShowViewAll(true); } } diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php index f113afacf8..25f762ba66 100644 --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -1,387 +1,387 @@ parser = $parser; return $this; } public function getParser() { return $this->parser; } public function setTitle($title) { $this->title = $title; return $this; } private function getTitle() { return $this->title; } public function setBranch($branch) { $this->branch = $branch; return $this; } private function getBranch() { return $this->branch; } public function setChangesets($changesets) { $this->changesets = $changesets; return $this; } public function setVisibleChangesets($visible_changesets) { $this->visibleChangesets = $visible_changesets; return $this; } public function setInlineCommentControllerURI($uri) { $this->inlineURI = $uri; return $this; } public function setRepository(PhabricatorRepository $repository) { $this->repository = $repository; return $this; } public function setDiff(DifferentialDiff $diff) { $this->diff = $diff; return $this; } public function setRenderingReferences(array $references) { $this->references = $references; return $this; } public function setSymbolIndexes(array $indexes) { $this->symbolIndexes = $indexes; return $this; } public function setRenderURI($render_uri) { $this->renderURI = $render_uri; return $this; } public function setWhitespace($whitespace) { $this->whitespace = $whitespace; return $this; } public function setVsMap(array $vs_map) { $this->vsMap = $vs_map; return $this; } public function getVsMap() { return $this->vsMap; } public function setStandaloneURI($uri) { $this->standaloneURI = $uri; return $this; } public function setRawFileURIs($l, $r) { $this->leftRawFileURI = $l; $this->rightRawFileURI = $r; return $this; } public function setBackground($background) { $this->background = $background; return $this; } public function setHeader($header) { $this->header = $header; return $this; } public function render() { $viewer = $this->getViewer(); $this->requireResource('differential-changeset-view-css'); $changesets = $this->changesets; $renderer = DifferentialChangesetParser::getDefaultRendererForViewer( $viewer); $output = array(); $ids = array(); foreach ($changesets as $key => $changeset) { $file = $changeset->getFilename(); $ref = $this->references[$key]; $detail = id(new DifferentialChangesetDetailView()) ->setUser($viewer); $uniq_id = 'diff-'.$changeset->getAnchorName(); $detail->setID($uniq_id); $view_options = $this->renderViewOptionsDropdown( $detail, $ref, $changeset); $detail->setChangeset($changeset); $detail->addButton($view_options); $detail->setSymbolIndex(idx($this->symbolIndexes, $key)); $detail->setVsChangesetID(idx($this->vsMap, $changeset->getID())); $detail->setEditable(true); $detail->setRenderingRef($ref); $detail->setRenderURI($this->renderURI); $detail->setWhitespace($this->whitespace); $detail->setRenderer($renderer); if ($this->getParser()) { $detail->appendChild($this->getParser()->renderChangeset()); $detail->setLoaded(true); } else { $detail->setAutoload(isset($this->visibleChangesets[$key])); if (isset($this->visibleChangesets[$key])) { $load = pht('Loading...'); } else { $load = javelin_tag( 'a', array( - 'class' => 'button grey', + 'class' => 'button button-grey', 'href' => '#'.$uniq_id, 'sigil' => 'differential-load', 'meta' => array( 'id' => $detail->getID(), 'kill' => true, ), 'mustcapture' => true, ), pht('Load File')); } $detail->appendChild( phutil_tag( 'div', array( 'id' => $uniq_id, ), phutil_tag( 'div', array('class' => 'differential-loading'), $load))); } $output[] = $detail->render(); $ids[] = $detail->getID(); } $this->requireResource('aphront-tooltip-css'); $this->initBehavior( 'differential-populate', array( 'changesetViewIDs' => $ids, 'inlineURI' => $this->inlineURI, 'pht' => array( 'Open in Editor' => pht('Open in Editor'), 'Show All Context' => pht('Show All Context'), 'All Context Shown' => pht('All Context Shown'), "Can't Toggle Unloaded File" => pht("Can't Toggle Unloaded File"), 'Expand File' => pht('Expand File'), 'Collapse File' => pht('Collapse File'), 'Browse in Diffusion' => pht('Browse in Diffusion'), 'View Standalone' => pht('View Standalone'), 'Show Raw File (Left)' => pht('Show Raw File (Left)'), 'Show Raw File (Right)' => pht('Show Raw File (Right)'), 'Configure Editor' => pht('Configure Editor'), 'Load Changes' => pht('Load Changes'), 'View Side-by-Side' => pht('View Side-by-Side'), 'View Unified' => pht('View Unified'), 'Change Text Encoding...' => pht('Change Text Encoding...'), 'Highlight As...' => pht('Highlight As...'), 'Loading...' => pht('Loading...'), 'Editing Comment' => pht('Editing Comment'), 'Jump to next change.' => pht('Jump to next change.'), 'Jump to previous change.' => pht('Jump to previous change.'), 'Jump to next file.' => pht('Jump to next file.'), 'Jump to previous file.' => pht('Jump to previous file.'), 'Jump to next inline comment.' => pht('Jump to next inline comment.'), 'Jump to previous inline comment.' => pht('Jump to previous inline comment.'), 'Jump to the table of contents.' => pht('Jump to the table of contents.'), 'Edit selected inline comment.' => pht('Edit selected inline comment.'), 'You must select a comment to edit.' => pht('You must select a comment to edit.'), 'Reply to selected inline comment or change.' => pht('Reply to selected inline comment or change.'), 'You must select a comment or change to reply to.' => pht('You must select a comment or change to reply to.'), 'Reply and quote selected inline comment.' => pht('Reply and quote selected inline comment.'), 'Mark or unmark selected inline comment as done.' => pht('Mark or unmark selected inline comment as done.'), 'You must select a comment to mark done.' => pht('You must select a comment to mark done.'), 'Hide or show inline comment.' => pht('Hide or show inline comment.'), 'You must select a comment to hide.' => pht('You must select a comment to hide.'), 'Jump to next inline comment, including hidden comments.' => pht('Jump to next inline comment, including hidden comments.'), 'Jump to previous inline comment, including hidden comments.' => pht('Jump to previous inline comment, including hidden comments.'), 'This file content has been collapsed.' => pht('This file content has been collapsed.'), 'Show Content' => pht('Show Content'), 'Hide or show the current file.' => pht('Hide or show the current file.'), 'You must select a file to hide or show.' => pht('You must select a file to hide or show.'), 'Unsaved' => pht('Unsaved'), 'Unsubmitted' => pht('Unsubmitted'), 'Comments' => pht('Comments'), ), )); if ($this->header) { $header = $this->header; } else { $header = id(new PHUIHeaderView()) ->setHeader($this->getTitle()); } $content = phutil_tag( 'div', array( 'class' => 'differential-review-stage', 'id' => 'differential-review-stage', ), $output); $object_box = id(new PHUIObjectBoxView()) ->setHeader($header) ->setBackground($this->background) ->setCollapsed(true) ->appendChild($content); return $object_box; } private function renderViewOptionsDropdown( DifferentialChangesetDetailView $detail, $ref, DifferentialChangeset $changeset) { $viewer = $this->getViewer(); $meta = array(); $qparams = array( 'ref' => $ref, 'whitespace' => $this->whitespace, ); if ($this->standaloneURI) { $uri = new PhutilURI($this->standaloneURI); $uri->setQueryParams($uri->getQueryParams() + $qparams); $meta['standaloneURI'] = (string)$uri; } $repository = $this->repository; if ($repository) { try { $meta['diffusionURI'] = (string)$repository->getDiffusionBrowseURIForPath( $viewer, $changeset->getAbsoluteRepositoryPath($repository, $this->diff), idx($changeset->getMetadata(), 'line:first'), $this->getBranch()); } catch (DiffusionSetupException $e) { // Ignore } } $change = $changeset->getChangeType(); if ($this->leftRawFileURI) { if ($change != DifferentialChangeType::TYPE_ADD) { $uri = new PhutilURI($this->leftRawFileURI); $uri->setQueryParams($uri->getQueryParams() + $qparams); $meta['leftURI'] = (string)$uri; } } if ($this->rightRawFileURI) { if ($change != DifferentialChangeType::TYPE_DELETE && $change != DifferentialChangeType::TYPE_MULTICOPY) { $uri = new PhutilURI($this->rightRawFileURI); $uri->setQueryParams($uri->getQueryParams() + $qparams); $meta['rightURI'] = (string)$uri; } } if ($viewer && $repository) { $path = ltrim( $changeset->getAbsoluteRepositoryPath($repository, $this->diff), '/'); $line = idx($changeset->getMetadata(), 'line:first', 1); $editor_link = $viewer->loadEditorLink($path, $line, $repository); if ($editor_link) { $meta['editor'] = $editor_link; } else { $meta['editorConfigure'] = '/settings/panel/display/'; } } $meta['containerID'] = $detail->getID(); return id(new PHUIButtonView()) ->setTag('a') ->setText(pht('View Options')) ->setIcon('fa-bars') ->setColor(PHUIButtonView::GREY) ->setHref(idx($meta, 'detailURI', '#')) ->setMetadata($meta) ->addSigil('differential-view-options'); } } diff --git a/src/applications/files/controller/PhabricatorFileTransformListController.php b/src/applications/files/controller/PhabricatorFileTransformListController.php index 026f60320e..ab5322fc1a 100644 --- a/src/applications/files/controller/PhabricatorFileTransformListController.php +++ b/src/applications/files/controller/PhabricatorFileTransformListController.php @@ -1,147 +1,147 @@ getViewer(); $file = id(new PhabricatorFileQuery()) ->setViewer($viewer) ->withIDs(array($request->getURIData('id'))) ->executeOne(); if (!$file) { return new Aphront404Response(); } $monogram = $file->getMonogram(); $xdst = id(new PhabricatorTransformedFile())->loadAllWhere( 'transformedPHID = %s', $file->getPHID()); $dst_rows = array(); foreach ($xdst as $source) { $dst_rows[] = array( $source->getTransform(), $viewer->renderHandle($source->getOriginalPHID()), ); } $dst_table = id(new AphrontTableView($dst_rows)) ->setHeaders( array( pht('Key'), pht('Source'), )) ->setColumnClasses( array( '', 'wide', )) ->setNoDataString( pht( 'This file was not created by transforming another file.')); $xsrc = id(new PhabricatorTransformedFile())->loadAllWhere( 'originalPHID = %s', $file->getPHID()); $xsrc = mpull($xsrc, 'getTransformedPHID', 'getTransform'); $src_rows = array(); $xforms = PhabricatorFileTransform::getAllTransforms(); foreach ($xforms as $xform) { $dst_phid = idx($xsrc, $xform->getTransformKey()); if ($xform->canApplyTransform($file)) { $can_apply = pht('Yes'); $view_href = $file->getURIForTransform($xform); $view_href = new PhutilURI($view_href); $view_href->setQueryParam('regenerate', 'true'); $view_text = pht('Regenerate'); $view_link = phutil_tag( 'a', array( - 'class' => 'small grey button', + 'class' => 'small button button-grey', 'href' => $view_href, ), $view_text); } else { $can_apply = phutil_tag('em', array(), pht('No')); $view_link = phutil_tag('em', array(), pht('None')); } if ($dst_phid) { $dst_link = $viewer->renderHandle($dst_phid); } else { $dst_link = phutil_tag('em', array(), pht('None')); } $src_rows[] = array( $xform->getTransformName(), $xform->getTransformKey(), $can_apply, $dst_link, $view_link, ); } $src_table = id(new AphrontTableView($src_rows)) ->setHeaders( array( pht('Name'), pht('Key'), pht('Supported'), pht('Transform'), pht('View'), )) ->setColumnClasses( array( 'wide', '', '', '', 'action', )); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb($monogram, '/'.$monogram); $crumbs->addTextCrumb(pht('Transforms')); $crumbs->setBorder(true); $dst_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('File Sources')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setTable($dst_table); $src_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Available Transforms')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setTable($src_table); $title = pht('%s Transforms', $file->getName()); $header = id(new PHUIHeaderView()) ->setHeader($title) ->setHeaderIcon('fa-arrows-alt'); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter(array( $dst_box, $src_box, )); return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) ->appendChild($view); } } diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php index 74ce553f9c..0e7f6b0aa5 100644 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -1,731 +1,731 @@ getViewer(); $id = $request->getURIData('id'); $content_type_map = HeraldAdapter::getEnabledAdapterMap($viewer); $rule_type_map = HeraldRuleTypeConfig::getRuleTypeMap(); if ($id) { $rule = id(new HeraldRuleQuery()) ->setViewer($viewer) ->withIDs(array($id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->executeOne(); if (!$rule) { return new Aphront404Response(); } $cancel_uri = '/'.$rule->getMonogram(); } else { $new_uri = $this->getApplicationURI('new/'); $rule = new HeraldRule(); $rule->setAuthorPHID($viewer->getPHID()); $rule->setMustMatchAll(1); $content_type = $request->getStr('content_type'); $rule->setContentType($content_type); $rule_type = $request->getStr('rule_type'); if (!isset($rule_type_map[$rule_type])) { return $this->newDialog() ->setTitle(pht('Invalid Rule Type')) ->appendParagraph( pht( 'The selected rule type ("%s") is not recognized by Herald.', $rule_type)) ->addCancelButton($new_uri); } $rule->setRuleType($rule_type); try { $adapter = HeraldAdapter::getAdapterForContentType( $rule->getContentType()); } catch (Exception $ex) { return $this->newDialog() ->setTitle(pht('Invalid Content Type')) ->appendParagraph( pht( 'The selected content type ("%s") is not recognized by '. 'Herald.', $rule->getContentType())) ->addCancelButton($new_uri); } if (!$adapter->supportsRuleType($rule->getRuleType())) { return $this->newDialog() ->setTitle(pht('Rule/Content Mismatch')) ->appendParagraph( pht( 'The selected rule type ("%s") is not supported by the selected '. 'content type ("%s").', $rule->getRuleType(), $rule->getContentType())) ->addCancelButton($new_uri); } if ($rule->isObjectRule()) { $rule->setTriggerObjectPHID($request->getStr('targetPHID')); $object = id(new PhabricatorObjectQuery()) ->setViewer($viewer) ->withPHIDs(array($rule->getTriggerObjectPHID())) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->executeOne(); if (!$object) { throw new Exception( pht('No valid object provided for object rule!')); } if (!$adapter->canTriggerOnObject($object)) { throw new Exception( pht('Object is of wrong type for adapter!')); } } $cancel_uri = $this->getApplicationURI(); } if ($rule->isGlobalRule()) { $this->requireApplicationCapability( HeraldManageGlobalRulesCapability::CAPABILITY); } $adapter = HeraldAdapter::getAdapterForContentType($rule->getContentType()); $local_version = id(new HeraldRule())->getConfigVersion(); if ($rule->getConfigVersion() > $local_version) { throw new Exception( pht( 'This rule was created with a newer version of Herald. You can not '. 'view or edit it in this older version. Upgrade your Phabricator '. 'deployment.')); } // Upgrade rule version to our version, since we might add newly-defined // conditions, etc. $rule->setConfigVersion($local_version); $rule_conditions = $rule->loadConditions(); $rule_actions = $rule->loadActions(); $rule->attachConditions($rule_conditions); $rule->attachActions($rule_actions); $e_name = true; $errors = array(); if ($request->isFormPost() && $request->getStr('save')) { list($e_name, $errors) = $this->saveRule($adapter, $rule, $request); if (!$errors) { $id = $rule->getID(); $uri = '/'.$rule->getMonogram(); return id(new AphrontRedirectResponse())->setURI($uri); } } $must_match_selector = $this->renderMustMatchSelector($rule); $repetition_selector = $this->renderRepetitionSelector($rule, $adapter); $handles = $this->loadHandlesForRule($rule); require_celerity_resource('herald-css'); $content_type_name = $content_type_map[$rule->getContentType()]; $rule_type_name = $rule_type_map[$rule->getRuleType()]; $form = id(new AphrontFormView()) ->setUser($viewer) ->setID('herald-rule-edit-form') ->addHiddenInput('content_type', $rule->getContentType()) ->addHiddenInput('rule_type', $rule->getRuleType()) ->addHiddenInput('save', 1) ->appendChild( // Build this explicitly (instead of using addHiddenInput()) // so we can add a sigil to it. javelin_tag( 'input', array( 'type' => 'hidden', 'name' => 'rule', 'sigil' => 'rule', ))) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Rule Name')) ->setName('name') ->setError($e_name) ->setValue($rule->getName())); $trigger_object_control = false; if ($rule->isObjectRule()) { $trigger_object_control = id(new AphrontFormStaticControl()) ->setValue( pht( 'This rule triggers for %s.', $handles[$rule->getTriggerObjectPHID()]->renderLink())); } $form ->appendChild( id(new AphrontFormMarkupControl()) ->setValue(pht( 'This %s rule triggers for %s.', phutil_tag('strong', array(), $rule_type_name), phutil_tag('strong', array(), $content_type_name)))) ->appendChild($trigger_object_control) ->appendChild( id(new PHUIFormInsetView()) ->setTitle(pht('Conditions')) ->setRightButton(javelin_tag( 'a', array( 'href' => '#', - 'class' => 'button green', + 'class' => 'button button-green', 'sigil' => 'create-condition', 'mustcapture' => true, ), pht('New Condition'))) ->setDescription( pht('When %s these conditions are met:', $must_match_selector)) ->setContent(javelin_tag( 'table', array( 'sigil' => 'rule-conditions', 'class' => 'herald-condition-table', ), ''))) ->appendChild( id(new PHUIFormInsetView()) ->setTitle(pht('Action')) ->setRightButton(javelin_tag( 'a', array( 'href' => '#', - 'class' => 'button green', + 'class' => 'button button-green', 'sigil' => 'create-action', 'mustcapture' => true, ), pht('New Action'))) ->setDescription(pht( 'Take these actions %s this rule matches:', $repetition_selector)) ->setContent(javelin_tag( 'table', array( 'sigil' => 'rule-actions', 'class' => 'herald-action-table', ), ''))) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue(pht('Save Rule')) ->addCancelButton($cancel_uri)); $this->setupEditorBehavior($rule, $handles, $adapter); $title = $rule->getID() ? pht('Edit Herald Rule: %s', $rule->getName()) : pht('Create Herald Rule: %s', idx($content_type_map, $content_type)); $icon = $rule->getID() ? 'fa-pencil' : 'fa-plus-square'; $form_box = id(new PHUIObjectBoxView()) ->setFormErrors($errors) ->setForm($form); $crumbs = $this ->buildApplicationCrumbs() ->addTextCrumb($title) ->setBorder(true); $header = id(new PHUIHeaderView()) ->setHeader($title) ->setHeaderIcon('fa-plus-square'); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter($form_box); return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) ->appendChild( array( $view, )); } private function saveRule(HeraldAdapter $adapter, $rule, $request) { $new_name = $request->getStr('name'); $match_all = ($request->getStr('must_match') == 'all'); $repetition_policy_param = $request->getStr('repetition_policy'); $e_name = true; $errors = array(); if (!strlen($new_name)) { $e_name = pht('Required'); $errors[] = pht('Rule must have a name.'); } $data = null; try { $data = phutil_json_decode($request->getStr('rule')); } catch (PhutilJSONParserException $ex) { throw new PhutilProxyException( pht('Failed to decode rule data.'), $ex); } if (!is_array($data) || !$data['conditions'] || !$data['actions']) { throw new Exception(pht('Failed to decode rule data.')); } $conditions = array(); foreach ($data['conditions'] as $condition) { if ($condition === null) { // We manage this as a sparse array on the client, so may receive // NULL if conditions have been removed. continue; } $obj = new HeraldCondition(); $obj->setFieldName($condition[0]); $obj->setFieldCondition($condition[1]); if (is_array($condition[2])) { $obj->setValue(array_keys($condition[2])); } else { $obj->setValue($condition[2]); } try { $adapter->willSaveCondition($obj); } catch (HeraldInvalidConditionException $ex) { $errors[] = $ex->getMessage(); } $conditions[] = $obj; } $actions = array(); foreach ($data['actions'] as $action) { if ($action === null) { // Sparse on the client; removals can give us NULLs. continue; } if (!isset($action[1])) { // Legitimate for any action which doesn't need a target, like // "Do nothing". $action[1] = null; } $obj = new HeraldActionRecord(); $obj->setAction($action[0]); $obj->setTarget($action[1]); try { $adapter->willSaveAction($rule, $obj); } catch (HeraldInvalidActionException $ex) { $errors[] = $ex->getMessage(); } $actions[] = $obj; } if (!$errors) { $new_state = id(new HeraldRuleSerializer())->serializeRuleComponents( $match_all, $conditions, $actions, $repetition_policy_param); $xactions = array(); $xactions[] = id(new HeraldRuleTransaction()) ->setTransactionType(HeraldRuleTransaction::TYPE_EDIT) ->setNewValue($new_state); $xactions[] = id(new HeraldRuleTransaction()) ->setTransactionType(HeraldRuleTransaction::TYPE_NAME) ->setNewValue($new_name); try { id(new HeraldRuleEditor()) ->setActor($this->getViewer()) ->setContinueOnNoEffect(true) ->setContentSourceFromRequest($request) ->applyTransactions($rule, $xactions); return array(null, null); } catch (Exception $ex) { $errors[] = $ex->getMessage(); } } // mutate current rule, so it would be sent to the client in the right state $rule->setMustMatchAll((int)$match_all); $rule->setName($new_name); $rule->setRepetitionPolicy( HeraldRepetitionPolicyConfig::toInt($repetition_policy_param)); $rule->attachConditions($conditions); $rule->attachActions($actions); return array($e_name, $errors); } private function setupEditorBehavior( HeraldRule $rule, array $handles, HeraldAdapter $adapter) { $all_rules = $this->loadRulesThisRuleMayDependUpon($rule); $all_rules = mpull($all_rules, 'getName', 'getPHID'); asort($all_rules); $all_fields = $adapter->getFieldNameMap(); $all_conditions = $adapter->getConditionNameMap(); $all_actions = $adapter->getActionNameMap($rule->getRuleType()); $fields = $adapter->getFields(); $field_map = array_select_keys($all_fields, $fields); // Populate any fields which exist in the rule but which we don't know the // names of, so that saving a rule without touching anything doesn't change // it. foreach ($rule->getConditions() as $condition) { $field_name = $condition->getFieldName(); if (empty($field_map[$field_name])) { $field_map[$field_name] = pht('', $field_name); } } $actions = $adapter->getActions($rule->getRuleType()); $action_map = array_select_keys($all_actions, $actions); // Populate any actions which exist in the rule but which we don't know the // names of, so that saving a rule without touching anything doesn't change // it. foreach ($rule->getActions() as $action) { $action_name = $action->getAction(); if (empty($action_map[$action_name])) { $action_map[$action_name] = pht('', $action_name); } } $config_info = array(); $config_info['fields'] = $this->getFieldGroups($adapter, $field_map); $config_info['conditions'] = $all_conditions; $config_info['actions'] = $this->getActionGroups($adapter, $action_map); $config_info['valueMap'] = array(); foreach ($field_map as $field => $name) { try { $field_conditions = $adapter->getConditionsForField($field); } catch (Exception $ex) { $field_conditions = array(HeraldAdapter::CONDITION_UNCONDITIONALLY); } $config_info['conditionMap'][$field] = $field_conditions; } foreach ($field_map as $field => $fname) { foreach ($config_info['conditionMap'][$field] as $condition) { $value_key = $adapter->getValueTypeForFieldAndCondition( $field, $condition); if ($value_key instanceof HeraldFieldValue) { $value_key->setViewer($this->getViewer()); $spec = $value_key->getControlSpecificationDictionary(); $value_key = $value_key->getFieldValueKey(); $config_info['valueMap'][$value_key] = $spec; } $config_info['values'][$field][$condition] = $value_key; } } $config_info['rule_type'] = $rule->getRuleType(); foreach ($action_map as $action => $name) { try { $value_key = $adapter->getValueTypeForAction( $action, $rule->getRuleType()); } catch (Exception $ex) { $value_key = new HeraldEmptyFieldValue(); } if ($value_key instanceof HeraldFieldValue) { $value_key->setViewer($this->getViewer()); $spec = $value_key->getControlSpecificationDictionary(); $value_key = $value_key->getFieldValueKey(); $config_info['valueMap'][$value_key] = $spec; } $config_info['targets'][$action] = $value_key; } $default_group = head($config_info['fields']); $default_field = head_key($default_group['options']); $default_condition = head($config_info['conditionMap'][$default_field]); $default_actions = head($config_info['actions']); $default_action = head_key($default_actions['options']); if ($rule->getConditions()) { $serial_conditions = array(); foreach ($rule->getConditions() as $condition) { $value = $adapter->getEditorValueForCondition( $this->getViewer(), $condition); $serial_conditions[] = array( $condition->getFieldName(), $condition->getFieldCondition(), $value, ); } } else { $serial_conditions = array( array($default_field, $default_condition, null), ); } if ($rule->getActions()) { $serial_actions = array(); foreach ($rule->getActions() as $action) { $value = $adapter->getEditorValueForAction( $this->getViewer(), $action); $serial_actions[] = array( $action->getAction(), $value, ); } } else { $serial_actions = array( array($default_action, null), ); } Javelin::initBehavior( 'herald-rule-editor', array( 'root' => 'herald-rule-edit-form', 'default' => array( 'field' => $default_field, 'condition' => $default_condition, 'action' => $default_action, ), 'conditions' => (object)$serial_conditions, 'actions' => (object)$serial_actions, 'template' => $this->buildTokenizerTemplates() + array( 'rules' => $all_rules, ), 'info' => $config_info, )); } private function loadHandlesForRule($rule) { $phids = array(); foreach ($rule->getActions() as $action) { if (!is_array($action->getTarget())) { continue; } foreach ($action->getTarget() as $target) { $target = (array)$target; foreach ($target as $phid) { $phids[] = $phid; } } } foreach ($rule->getConditions() as $condition) { $value = $condition->getValue(); if (is_array($value)) { foreach ($value as $phid) { $phids[] = $phid; } } } $phids[] = $rule->getAuthorPHID(); if ($rule->isObjectRule()) { $phids[] = $rule->getTriggerObjectPHID(); } return $this->loadViewerHandles($phids); } /** * Render the selector for the "When (all of | any of) these conditions are * met:" element. */ private function renderMustMatchSelector($rule) { return AphrontFormSelectControl::renderSelectTag( $rule->getMustMatchAll() ? 'all' : 'any', array( 'all' => pht('all of'), 'any' => pht('any of'), ), array( 'name' => 'must_match', )); } /** * Render the selector for "Take these actions (every time | only the first * time) this rule matches..." element. */ private function renderRepetitionSelector($rule, HeraldAdapter $adapter) { $repetition_policy = HeraldRepetitionPolicyConfig::toString( $rule->getRepetitionPolicy()); $repetition_options = $adapter->getRepetitionOptions(); $repetition_names = HeraldRepetitionPolicyConfig::getMap(); $repetition_map = array_select_keys($repetition_names, $repetition_options); if (count($repetition_map) < 2) { return head($repetition_names); } else { return AphrontFormSelectControl::renderSelectTag( $repetition_policy, $repetition_map, array( 'name' => 'repetition_policy', )); } } protected function buildTokenizerTemplates() { $template = new AphrontTokenizerTemplateView(); $template = $template->render(); return array( 'markup' => $template, ); } /** * Load rules for the "Another Herald rule..." condition dropdown, which * allows one rule to depend upon the success or failure of another rule. */ private function loadRulesThisRuleMayDependUpon(HeraldRule $rule) { $viewer = $this->getRequest()->getUser(); // Any rule can depend on a global rule. $all_rules = id(new HeraldRuleQuery()) ->setViewer($viewer) ->withRuleTypes(array(HeraldRuleTypeConfig::RULE_TYPE_GLOBAL)) ->withContentTypes(array($rule->getContentType())) ->execute(); if ($rule->isObjectRule()) { // Object rules may depend on other rules for the same object. $all_rules += id(new HeraldRuleQuery()) ->setViewer($viewer) ->withRuleTypes(array(HeraldRuleTypeConfig::RULE_TYPE_OBJECT)) ->withContentTypes(array($rule->getContentType())) ->withTriggerObjectPHIDs(array($rule->getTriggerObjectPHID())) ->execute(); } if ($rule->isPersonalRule()) { // Personal rules may depend upon your other personal rules. $all_rules += id(new HeraldRuleQuery()) ->setViewer($viewer) ->withRuleTypes(array(HeraldRuleTypeConfig::RULE_TYPE_PERSONAL)) ->withContentTypes(array($rule->getContentType())) ->withAuthorPHIDs(array($rule->getAuthorPHID())) ->execute(); } // mark disabled rules as disabled since they are not useful as such; // don't filter though to keep edit cases sane / expected foreach ($all_rules as $current_rule) { if ($current_rule->getIsDisabled()) { $current_rule->makeEphemeral(); $current_rule->setName($rule->getName().' '.pht('(Disabled)')); } } // A rule can not depend upon itself. unset($all_rules[$rule->getID()]); return $all_rules; } private function getFieldGroups(HeraldAdapter $adapter, array $field_map) { $group_map = array(); foreach ($field_map as $field_key => $field_name) { $group_key = $adapter->getFieldGroupKey($field_key); $group_map[$group_key][$field_key] = $field_name; } return $this->getGroups( $group_map, HeraldFieldGroup::getAllFieldGroups()); } private function getActionGroups(HeraldAdapter $adapter, array $action_map) { $group_map = array(); foreach ($action_map as $action_key => $action_name) { $group_key = $adapter->getActionGroupKey($action_key); $group_map[$group_key][$action_key] = $action_name; } return $this->getGroups( $group_map, HeraldActionGroup::getAllActionGroups()); } private function getGroups(array $item_map, array $group_list) { assert_instances_of($group_list, 'HeraldGroup'); $groups = array(); foreach ($item_map as $group_key => $options) { asort($options); $group_object = idx($group_list, $group_key); if ($group_object) { $group_label = $group_object->getGroupLabel(); $group_order = $group_object->getSortKey(); } else { $group_label = nonempty($group_key, pht('Other')); $group_order = 'Z'; } $groups[] = array( 'label' => $group_label, 'options' => $options, 'order' => $group_order, ); } return array_values(isort($groups, 'order')); } } diff --git a/src/applications/maniphest/controller/ManiphestBatchEditController.php b/src/applications/maniphest/controller/ManiphestBatchEditController.php index 90fcda28ec..f2ec4b433f 100644 --- a/src/applications/maniphest/controller/ManiphestBatchEditController.php +++ b/src/applications/maniphest/controller/ManiphestBatchEditController.php @@ -1,226 +1,226 @@ getViewer(); $this->requireApplicationCapability( ManiphestBulkEditCapability::CAPABILITY); $project = null; $board_id = $request->getInt('board'); if ($board_id) { $project = id(new PhabricatorProjectQuery()) ->setViewer($viewer) ->withIDs(array($board_id)) ->executeOne(); if (!$project) { return new Aphront404Response(); } } $task_ids = $request->getArr('batch'); if (!$task_ids) { $task_ids = $request->getStrList('batch'); } if (!$task_ids) { throw new Exception( pht( 'No tasks are selected.')); } $tasks = id(new ManiphestTaskQuery()) ->setViewer($viewer) ->withIDs($task_ids) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->needSubscriberPHIDs(true) ->needProjectPHIDs(true) ->execute(); if (!$tasks) { throw new Exception( pht("You don't have permission to edit any of the selected tasks.")); } if ($project) { $cancel_uri = '/project/board/'.$project->getID().'/'; $redirect_uri = $cancel_uri; } else { $cancel_uri = '/maniphest/'; $redirect_uri = '/maniphest/?ids='.implode(',', mpull($tasks, 'getID')); } $actions = $request->getStr('actions'); if ($actions) { $actions = phutil_json_decode($actions); } if ($request->isFormPost() && $actions) { $job = PhabricatorWorkerBulkJob::initializeNewJob( $viewer, new ManiphestTaskEditBulkJobType(), array( 'taskPHIDs' => mpull($tasks, 'getPHID'), 'actions' => $actions, 'cancelURI' => $cancel_uri, 'doneURI' => $redirect_uri, )); $type_status = PhabricatorWorkerBulkJobTransaction::TYPE_STATUS; $xactions = array(); $xactions[] = id(new PhabricatorWorkerBulkJobTransaction()) ->setTransactionType($type_status) ->setNewValue(PhabricatorWorkerBulkJob::STATUS_CONFIRM); $editor = id(new PhabricatorWorkerBulkJobEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnMissingFields(true) ->applyTransactions($job, $xactions); return id(new AphrontRedirectResponse()) ->setURI($job->getMonitorURI()); } $handles = ManiphestTaskListView::loadTaskHandles($viewer, $tasks); $list = new ManiphestTaskListView(); $list->setTasks($tasks); $list->setUser($viewer); $list->setHandles($handles); $template = new AphrontTokenizerTemplateView(); $template = $template->render(); $projects_source = new PhabricatorProjectDatasource(); $mailable_source = new PhabricatorMetaMTAMailableDatasource(); $mailable_source->setViewer($viewer); $owner_source = new ManiphestAssigneeDatasource(); $owner_source->setViewer($viewer); $spaces_source = id(new PhabricatorSpacesNamespaceDatasource()) ->setViewer($viewer); require_celerity_resource('maniphest-batch-editor'); Javelin::initBehavior( 'maniphest-batch-editor', array( 'root' => 'maniphest-batch-edit-form', 'tokenizerTemplate' => $template, 'sources' => array( 'project' => array( 'src' => $projects_source->getDatasourceURI(), 'placeholder' => $projects_source->getPlaceholderText(), 'browseURI' => $projects_source->getBrowseURI(), ), 'owner' => array( 'src' => $owner_source->getDatasourceURI(), 'placeholder' => $owner_source->getPlaceholderText(), 'browseURI' => $owner_source->getBrowseURI(), 'limit' => 1, ), 'cc' => array( 'src' => $mailable_source->getDatasourceURI(), 'placeholder' => $mailable_source->getPlaceholderText(), 'browseURI' => $mailable_source->getBrowseURI(), ), 'spaces' => array( 'src' => $spaces_source->getDatasourceURI(), 'placeholder' => $spaces_source->getPlaceholderText(), 'browseURI' => $spaces_source->getBrowseURI(), 'limit' => 1, ), ), 'input' => 'batch-form-actions', 'priorityMap' => ManiphestTaskPriority::getTaskPriorityMap(), 'statusMap' => ManiphestTaskStatus::getTaskStatusMap(), )); $form = id(new AphrontFormView()) ->setUser($viewer) ->addHiddenInput('board', $board_id) ->setID('maniphest-batch-edit-form'); foreach ($tasks as $task) { $form->appendChild( phutil_tag( 'input', array( 'type' => 'hidden', 'name' => 'batch[]', 'value' => $task->getID(), ))); } $form->appendChild( phutil_tag( 'input', array( 'type' => 'hidden', 'name' => 'actions', 'id' => 'batch-form-actions', ))); $form->appendChild( id(new PHUIFormInsetView()) ->setTitle(pht('Actions')) ->setRightButton(javelin_tag( 'a', array( 'href' => '#', - 'class' => 'button green', + 'class' => 'button button-green', 'sigil' => 'add-action', 'mustcapture' => true, ), pht('Add Another Action'))) ->setContent(javelin_tag( 'table', array( 'sigil' => 'maniphest-batch-actions', 'class' => 'maniphest-batch-actions-table', ), ''))) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue(pht('Update Tasks')) ->addCancelButton($cancel_uri)); $title = pht('Batch Editor'); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb($title); $crumbs->setBorder(true); $header = id(new PHUIHeaderView()) ->setHeader(pht('Batch Editor')) ->setHeaderIcon('fa-pencil-square-o'); $task_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Selected Tasks')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setObjectList($list); $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Actions')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setForm($form); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter(array( $task_box, $form_box, )); return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) ->appendChild($view); } } diff --git a/src/applications/maniphest/view/ManiphestTaskResultListView.php b/src/applications/maniphest/view/ManiphestTaskResultListView.php index 9e28e89d8d..0144df0e33 100644 --- a/src/applications/maniphest/view/ManiphestTaskResultListView.php +++ b/src/applications/maniphest/view/ManiphestTaskResultListView.php @@ -1,271 +1,271 @@ savedQuery = $query; return $this; } public function setTasks(array $tasks) { $this->tasks = $tasks; return $this; } public function setCanEditPriority($can_edit_priority) { $this->canEditPriority = $can_edit_priority; return $this; } public function setCanBatchEdit($can_batch_edit) { $this->canBatchEdit = $can_batch_edit; return $this; } public function setShowBatchControls($show_batch_controls) { $this->showBatchControls = $show_batch_controls; return $this; } public function render() { $viewer = $this->getUser(); $tasks = $this->tasks; $query = $this->savedQuery; // If we didn't match anything, just pick up the default empty state. if (!$tasks) { return id(new PHUIObjectItemListView()) ->setUser($viewer) ->setNoDataString(pht('No tasks found.')); } $group_parameter = nonempty($query->getParameter('group'), 'priority'); $order_parameter = nonempty($query->getParameter('order'), 'priority'); $handles = ManiphestTaskListView::loadTaskHandles($viewer, $tasks); $groups = $this->groupTasks( $tasks, $group_parameter, $handles); $can_edit_priority = $this->canEditPriority; $can_drag = ($order_parameter == 'priority') && ($can_edit_priority) && ($group_parameter == 'none' || $group_parameter == 'priority'); if (!$viewer->isLoggedIn()) { // TODO: (T7131) Eventually, we conceivably need to make each task // draggable individually, since the user may be able to edit some but // not others. $can_drag = false; } $result = array(); $lists = array(); foreach ($groups as $group => $list) { $task_list = new ManiphestTaskListView(); $task_list->setShowBatchControls($this->showBatchControls); if ($can_drag) { $task_list->setShowSubpriorityControls(true); } $task_list->setUser($viewer); $task_list->setTasks($list); $task_list->setHandles($handles); $header = id(new PHUIHeaderView()) ->addSigil('task-group') ->setMetadata(array('priority' => head($list)->getPriority())) ->setHeader(pht('%s (%s)', $group, phutil_count($list))); $lists[] = id(new PHUIObjectBoxView()) ->setHeader($header) ->setObjectList($task_list); } if ($can_drag) { Javelin::initBehavior( 'maniphest-subpriority-editor', array( 'uri' => '/maniphest/subpriority/', )); } return array( $lists, $this->showBatchControls ? $this->renderBatchEditor($query) : null, ); } private function groupTasks(array $tasks, $group, array $handles) { assert_instances_of($tasks, 'ManiphestTask'); assert_instances_of($handles, 'PhabricatorObjectHandle'); $groups = $this->getTaskGrouping($tasks, $group); $results = array(); foreach ($groups as $label_key => $tasks) { $label = $this->getTaskLabelName($group, $label_key, $handles); $results[$label][] = $tasks; } foreach ($results as $label => $task_groups) { $results[$label] = array_mergev($task_groups); } return $results; } private function getTaskGrouping(array $tasks, $group) { switch ($group) { case 'priority': return mgroup($tasks, 'getPriority'); case 'status': return mgroup($tasks, 'getStatus'); case 'assigned': return mgroup($tasks, 'getOwnerPHID'); case 'project': return mgroup($tasks, 'getGroupByProjectPHID'); default: return array(pht('Tasks') => $tasks); } } private function getTaskLabelName($group, $label_key, array $handles) { switch ($group) { case 'priority': return ManiphestTaskPriority::getTaskPriorityName($label_key); case 'status': return ManiphestTaskStatus::getTaskStatusFullName($label_key); case 'assigned': if ($label_key) { return $handles[$label_key]->getFullName(); } else { return pht('(Not Assigned)'); } case 'project': if ($label_key) { return $handles[$label_key]->getFullName(); } else { // This may mean "No Projects", or it may mean the query has project // constraints but the task is only in constrained projects (in this // case, we don't show the group because it would always have all // of the tasks). Since distinguishing between these two cases is // messy and the UI is reasonably clear, label generically. return pht('(Ungrouped)'); } default: return pht('Tasks'); } } private function renderBatchEditor(PhabricatorSavedQuery $saved_query) { $user = $this->getUser(); if (!$this->canBatchEdit) { return null; } if (!$user->isLoggedIn()) { // Don't show the batch editor or excel export for logged-out users. // Technically we //could// let them export, but ehh. return null; } Javelin::initBehavior( 'maniphest-batch-selector', array( 'selectAll' => 'batch-select-all', 'selectNone' => 'batch-select-none', 'submit' => 'batch-select-submit', 'status' => 'batch-select-status-cell', 'idContainer' => 'batch-select-id-container', 'formID' => 'batch-select-form', )); $select_all = javelin_tag( 'a', array( 'href' => '#', 'mustcapture' => true, - 'class' => 'grey button', + 'class' => 'button button-grey', 'id' => 'batch-select-all', ), pht('Select All')); $select_none = javelin_tag( 'a', array( 'href' => '#', 'mustcapture' => true, - 'class' => 'grey button', + 'class' => 'button button-grey', 'id' => 'batch-select-none', ), pht('Clear Selection')); $submit = phutil_tag( 'button', array( 'id' => 'batch-select-submit', 'disabled' => 'disabled', 'class' => 'disabled', ), pht("Batch Edit Selected \xC2\xBB")); $export = javelin_tag( 'a', array( 'href' => '/maniphest/export/'.$saved_query->getQueryKey().'/', - 'class' => 'grey button', + 'class' => 'button button-grey', ), pht('Export to Excel')); $hidden = phutil_tag( 'div', array( 'id' => 'batch-select-id-container', ), ''); $editor = hsprintf( ''. ''. ''. ''. ''. ''. ''. '
%s%s%s%s%s%s
', $select_all, $select_none, $export, '', $submit, $hidden); $editor = phabricator_form( $user, array( 'method' => 'POST', 'action' => '/maniphest/batch/', 'id' => 'batch-select-form', ), $editor); $box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Batch Task Editor')) ->appendChild($editor); $content = phutil_tag_div('maniphest-batch-editor', $box); return $content; } } diff --git a/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php b/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php index a2d32e3360..afde9fee23 100644 --- a/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php +++ b/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php @@ -1,408 +1,408 @@ supportsEmailIntegration(); } public function buildConfigurationPagePanel() { $viewer = $this->getViewer(); $application = $this->getApplication(); $table = $this->buildEmailTable($is_edit = false, null); $can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, $application, PhabricatorPolicyCapability::CAN_EDIT); $header = id(new PHUIHeaderView()) ->setHeader(pht('Application Emails')) ->addActionLink( id(new PHUIButtonView()) ->setTag('a') ->setText(pht('Edit Application Emails')) ->setIcon('fa-pencil') ->setHref($this->getPanelURI()) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit)); $box = id(new PHUIObjectBoxView()) ->setHeader($header) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setTable($table); return $box; } public function handlePanelRequest( AphrontRequest $request, PhabricatorController $controller) { $viewer = $request->getViewer(); $application = $this->getApplication(); $path = $request->getURIData('path'); if (strlen($path)) { return new Aphront404Response(); } $uri = $request->getRequestURI(); $uri->setQueryParams(array()); $new = $request->getStr('new'); $edit = $request->getInt('edit'); $delete = $request->getInt('delete'); if ($new) { return $this->returnNewAddressResponse($request, $uri, $application); } if ($edit) { return $this->returnEditAddressResponse($request, $uri, $edit); } if ($delete) { return $this->returnDeleteAddressResponse($request, $uri, $delete); } $table = $this->buildEmailTable( $is_edit = true, $request->getInt('id')); $form = id(new AphrontFormView()) ->setUser($viewer); $crumbs = $controller->buildPanelCrumbs($this); $crumbs->addTextCrumb(pht('Edit Application Emails')); $crumbs->setBorder(true); $header = id(new PHUIHeaderView()) ->setHeader(pht('Edit Application Emails: %s', $application->getName())) ->setSubheader($application->getAppEmailBlurb()) ->setHeaderIcon('fa-pencil'); $icon = id(new PHUIIconView()) ->setIcon('fa-plus'); $button = new PHUIButtonView(); $button->setText(pht('Add New Address')); $button->setTag('a'); $button->setHref($uri->alter('new', 'true')); $button->setIcon($icon); $button->addSigil('workflow'); $header->addActionLink($button); $object_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Emails')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setTable($table); $title = $application->getName(); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter($object_box); return $controller->buildPanelPage( $this, $title, $crumbs, $view); } private function returnNewAddressResponse( AphrontRequest $request, PhutilURI $uri, PhabricatorApplication $application) { $viewer = $request->getUser(); $email_object = PhabricatorMetaMTAApplicationEmail::initializeNewAppEmail($viewer) ->setApplicationPHID($application->getPHID()); return $this->returnSaveAddressResponse( $request, $uri, $email_object, $is_new = true); } private function returnEditAddressResponse( AphrontRequest $request, PhutilURI $uri, $email_object_id) { $viewer = $request->getUser(); $email_object = id(new PhabricatorMetaMTAApplicationEmailQuery()) ->setViewer($viewer) ->withIDs(array($email_object_id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->executeOne(); if (!$email_object) { return new Aphront404Response(); } return $this->returnSaveAddressResponse( $request, $uri, $email_object, $is_new = false); } private function returnSaveAddressResponse( AphrontRequest $request, PhutilURI $uri, PhabricatorMetaMTAApplicationEmail $email_object, $is_new) { $viewer = $request->getUser(); $config_default = PhabricatorMetaMTAApplicationEmail::CONFIG_DEFAULT_AUTHOR; $e_email = true; $v_email = $email_object->getAddress(); $e_space = null; $v_space = $email_object->getSpacePHID(); $v_default = $email_object->getConfigValue($config_default); $validation_exception = null; if ($request->isDialogFormPost()) { $e_email = null; $v_email = trim($request->getStr('email')); $v_space = $request->getStr('spacePHID'); $v_default = $request->getArr($config_default); $v_default = nonempty(head($v_default), null); $type_address = PhabricatorMetaMTAApplicationEmailTransaction::TYPE_ADDRESS; $type_space = PhabricatorTransactions::TYPE_SPACE; $type_config = PhabricatorMetaMTAApplicationEmailTransaction::TYPE_CONFIG; $key_config = PhabricatorMetaMTAApplicationEmailTransaction::KEY_CONFIG; $xactions = array(); $xactions[] = id(new PhabricatorMetaMTAApplicationEmailTransaction()) ->setTransactionType($type_address) ->setNewValue($v_email); $xactions[] = id(new PhabricatorMetaMTAApplicationEmailTransaction()) ->setTransactionType($type_space) ->setNewValue($v_space); $xactions[] = id(new PhabricatorMetaMTAApplicationEmailTransaction()) ->setTransactionType($type_config) ->setMetadataValue($key_config, $config_default) ->setNewValue($v_default); $editor = id(new PhabricatorMetaMTAApplicationEmailEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true); try { $editor->applyTransactions($email_object, $xactions); return id(new AphrontRedirectResponse())->setURI( $uri->alter('highlight', $email_object->getID())); } catch (PhabricatorApplicationTransactionValidationException $ex) { $validation_exception = $ex; $e_email = $ex->getShortMessage($type_address); $e_space = $ex->getShortMessage($type_space); } } if ($v_default) { $v_default = array($v_default); } else { $v_default = array(); } $form = id(new AphrontFormView()) ->setUser($viewer) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Email')) ->setName('email') ->setValue($v_email) ->setError($e_email)); if (PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) { $form->appendControl( id(new AphrontFormSelectControl()) ->setLabel(pht('Space')) ->setName('spacePHID') ->setValue($v_space) ->setError($e_space) ->setOptions( PhabricatorSpacesNamespaceQuery::getSpaceOptionsForViewer( $viewer, $v_space))); } $form ->appendControl( id(new AphrontFormTokenizerControl()) ->setDatasource(new PhabricatorPeopleDatasource()) ->setLabel(pht('Default Author')) ->setName($config_default) ->setLimit(1) ->setValue($v_default) ->setCaption(pht( 'Used if the "From:" address does not map to a known account.'))); if ($is_new) { $title = pht('New Address'); } else { $title = pht('Edit Address'); } $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->setWidth(AphrontDialogView::WIDTH_FORM) ->setTitle($title) ->setValidationException($validation_exception) ->appendForm($form) ->addSubmitButton(pht('Save')) ->addCancelButton($uri); if ($is_new) { $dialog->addHiddenInput('new', 'true'); } return id(new AphrontDialogResponse())->setDialog($dialog); } private function returnDeleteAddressResponse( AphrontRequest $request, PhutilURI $uri, $email_object_id) { $viewer = $this->getViewer(); $email_object = id(new PhabricatorMetaMTAApplicationEmailQuery()) ->setViewer($viewer) ->withIDs(array($email_object_id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->executeOne(); if (!$email_object) { return new Aphront404Response(); } if ($request->isDialogFormPost()) { $engine = new PhabricatorDestructionEngine(); $engine->destroyObject($email_object); return id(new AphrontRedirectResponse())->setURI($uri); } $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->addHiddenInput('delete', $email_object_id) ->setTitle(pht('Delete Address')) ->appendParagraph(pht( 'Are you sure you want to delete this email address?')) ->addSubmitButton(pht('Delete')) ->addCancelButton($uri); return id(new AphrontDialogResponse())->setDialog($dialog); } private function buildEmailTable($is_edit, $highlight) { $viewer = $this->getViewer(); $application = $this->getApplication(); $uri = new PhutilURI($this->getPanelURI()); $emails = id(new PhabricatorMetaMTAApplicationEmailQuery()) ->setViewer($viewer) ->withApplicationPHIDs(array($application->getPHID())) ->execute(); $rowc = array(); $rows = array(); foreach ($emails as $email) { $button_edit = javelin_tag( 'a', array( - 'class' => 'button small grey', + 'class' => 'button small button-grey', 'href' => $uri->alter('edit', $email->getID()), 'sigil' => 'workflow', ), pht('Edit')); $button_remove = javelin_tag( 'a', array( - 'class' => 'button small grey', + 'class' => 'button small button-grey', 'href' => $uri->alter('delete', $email->getID()), 'sigil' => 'workflow', ), pht('Delete')); if ($highlight == $email->getID()) { $rowc[] = 'highlighted'; } else { $rowc[] = null; } $space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID($email); if ($space_phid) { $email_space = $viewer->renderHandle($space_phid); } else { $email_space = null; } $rows[] = array( $email_space, $email->getAddress(), $button_edit, $button_remove, ); } $table = id(new AphrontTableView($rows)) ->setNoDataString(pht('No application emails created yet.')); $table->setHeaders( array( pht('Space'), pht('Email'), pht('Edit'), pht('Delete'), )); $table->setColumnClasses( array( '', 'wide', 'action', 'action', )); $table->setRowClasses($rowc); $table->setColumnVisibility( array( PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer), true, $is_edit, $is_edit, )); return $table; } } diff --git a/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php b/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php index 06f26b2ee3..596f3decc9 100644 --- a/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php +++ b/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php @@ -1,142 +1,142 @@ getUser(); // TODO: It would be nice to simply disable this panel, but we can't do // viewer-based checks for enabled panels right now. $app_class = 'PhabricatorOAuthServerApplication'; $installed = PhabricatorApplication::isClassInstalledForViewer( $app_class, $viewer); if (!$installed) { $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->setTitle(pht('OAuth Not Available')) ->appendParagraph( pht('You do not have access to OAuth authorizations.')) ->addCancelButton('/settings/'); return id(new AphrontDialogResponse())->setDialog($dialog); } $authorizations = id(new PhabricatorOAuthClientAuthorizationQuery()) ->setViewer($viewer) ->withUserPHIDs(array($viewer->getPHID())) ->execute(); $authorizations = mpull($authorizations, null, 'getID'); $panel_uri = $this->getPanelURI(); $revoke = $request->getInt('revoke'); if ($revoke) { if (empty($authorizations[$revoke])) { return new Aphront404Response(); } if ($request->isFormPost()) { $authorizations[$revoke]->delete(); return id(new AphrontRedirectResponse())->setURI($panel_uri); } $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->setTitle(pht('Revoke Authorization?')) ->appendParagraph( pht( 'This application will no longer be able to access Phabricator '. 'on your behalf.')) ->addSubmitButton(pht('Revoke Authorization')) ->addCancelButton($panel_uri); return id(new AphrontDialogResponse())->setDialog($dialog); } $highlight = $request->getInt('id'); $rows = array(); $rowc = array(); foreach ($authorizations as $authorization) { if ($highlight == $authorization->getID()) { $rowc[] = 'highlighted'; } else { $rowc[] = null; } $button = javelin_tag( 'a', array( 'href' => $this->getPanelURI('?revoke='.$authorization->getID()), - 'class' => 'small grey button', + 'class' => 'small button button-grey', 'sigil' => 'workflow', ), pht('Revoke')); $rows[] = array( phutil_tag( 'a', array( 'href' => $authorization->getClient()->getViewURI(), ), $authorization->getClient()->getName()), $authorization->getScopeString(), phabricator_datetime($authorization->getDateCreated(), $viewer), phabricator_datetime($authorization->getDateModified(), $viewer), $button, ); } $table = new AphrontTableView($rows); $table->setNoDataString( pht("You haven't authorized any OAuth applications.")); $table->setRowClasses($rowc); $table->setHeaders( array( pht('Application'), pht('Scope'), pht('Created'), pht('Updated'), null, )); $table->setColumnClasses( array( 'pri', 'wide', 'right', 'right', 'action', )); $header = id(new PHUIHeaderView()) ->setHeader(pht('OAuth Application Authorizations')); $panel = id(new PHUIObjectBoxView()) ->setHeader($header) ->setTable($table); return $panel; } } diff --git a/src/applications/owners/controller/PhabricatorOwnersPathsController.php b/src/applications/owners/controller/PhabricatorOwnersPathsController.php index b69faf5648..e5463b4cb4 100644 --- a/src/applications/owners/controller/PhabricatorOwnersPathsController.php +++ b/src/applications/owners/controller/PhabricatorOwnersPathsController.php @@ -1,177 +1,177 @@ getUser(); $package = id(new PhabricatorOwnersPackageQuery()) ->setViewer($viewer) ->withIDs(array($request->getURIData('id'))) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->needPaths(true) ->executeOne(); if (!$package) { return new Aphront404Response(); } if ($request->isFormPost()) { $paths = $request->getArr('path'); $repos = $request->getArr('repo'); $excludes = $request->getArr('exclude'); $path_refs = array(); foreach ($paths as $key => $path) { if (!isset($repos[$key])) { throw new Exception( pht( 'No repository PHID for path "%s"!', $key)); } if (!isset($excludes[$key])) { throw new Exception( pht( 'No exclusion value for path "%s"!', $key)); } $path_refs[] = array( 'repositoryPHID' => $repos[$key], 'path' => $path, 'excluded' => (int)$excludes[$key], ); } $type_paths = PhabricatorOwnersPackagePathsTransaction::TRANSACTIONTYPE; $xactions = array(); $xactions[] = id(new PhabricatorOwnersPackageTransaction()) ->setTransactionType($type_paths) ->setNewValue($path_refs); $editor = id(new PhabricatorOwnersPackageTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) ->setContinueOnMissingFields(true); $editor->applyTransactions($package, $xactions); return id(new AphrontRedirectResponse()) ->setURI($package->getURI()); } else { $paths = $package->getPaths(); $path_refs = mpull($paths, 'getRef'); } $repos = id(new PhabricatorRepositoryQuery()) ->setViewer($viewer) ->execute(); $default_paths = array(); foreach ($repos as $repo) { $default_path = $repo->getDetail('default-owners-path'); if ($default_path) { $default_paths[$repo->getPHID()] = $default_path; } } $repo_map = array(); foreach ($repos as $key => $repo) { $monogram = $repo->getMonogram(); $name = $repo->getName(); $repo_map[$repo->getPHID()] = "{$monogram} {$name}"; } asort($repos); $template = new AphrontTypeaheadTemplateView(); $template = $template->render(); Javelin::initBehavior( 'owners-path-editor', array( 'root' => 'path-editor', 'table' => 'paths', 'add_button' => 'addpath', 'repositories' => $repo_map, 'input_template' => $template, 'pathRefs' => $path_refs, 'completeURI' => '/diffusion/services/path/complete/', 'validateURI' => '/diffusion/services/path/validate/', 'repositoryDefaultPaths' => $default_paths, )); require_celerity_resource('owners-path-editor-css'); $cancel_uri = $package->getURI(); $form = id(new AphrontFormView()) ->setUser($viewer) ->appendChild( id(new PHUIFormInsetView()) ->setTitle(pht('Paths')) ->addDivAttributes(array('id' => 'path-editor')) ->setRightButton(javelin_tag( 'a', array( 'href' => '#', - 'class' => 'button green', + 'class' => 'button button-green', 'sigil' => 'addpath', 'mustcapture' => true, ), pht('Add New Path'))) ->setDescription( pht( 'Specify the files and directories which comprise '. 'this package.')) ->setContent(javelin_tag( 'table', array( 'class' => 'owners-path-editor-table', 'sigil' => 'paths', ), ''))) ->appendChild( id(new AphrontFormSubmitControl()) ->addCancelButton($cancel_uri) ->setValue(pht('Save Paths'))); $box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Paths')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setForm($form); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb( $package->getName(), $this->getApplicationURI('package/'.$package->getID().'/')); $crumbs->addTextCrumb(pht('Edit Paths')); $crumbs->setBorder(true); $header = id(new PHUIHeaderView()) ->setHeader(pht('Edit Paths: %s', $package->getName())) ->setHeaderIcon('fa-pencil'); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter($box); $title = array($package->getName(), pht('Edit Paths')); return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) ->appendChild($view); } } diff --git a/src/applications/passphrase/view/PassphraseCredentialControl.php b/src/applications/passphrase/view/PassphraseCredentialControl.php index 015dce1f40..411afd6f85 100644 --- a/src/applications/passphrase/view/PassphraseCredentialControl.php +++ b/src/applications/passphrase/view/PassphraseCredentialControl.php @@ -1,200 +1,200 @@ allowNull = $allow_null; return $this; } public function setDefaultUsername($default_username) { $this->defaultUsername = $default_username; return $this; } public function setCredentialType($credential_type) { $this->credentialType = $credential_type; return $this; } public function getCredentialType() { return $this->credentialType; } public function setOptions(array $options) { assert_instances_of($options, 'PassphraseCredential'); $this->options = $options; return $this; } protected function getCustomControlClass() { return 'passphrase-credential-control'; } protected function renderInput() { $options_map = array(); foreach ($this->options as $option) { $options_map[$option->getPHID()] = pht( '%s %s', $option->getMonogram(), $option->getName()); } // The user editing the form may not have permission to see the current // credential. Populate it into the menu to allow them to save the form // without making any changes. $current_phid = $this->getValue(); if (strlen($current_phid) && empty($options_map[$current_phid])) { $viewer = $this->getViewer(); $user_credential = id(new PassphraseCredentialQuery()) ->setViewer($viewer) ->withPHIDs(array($current_phid)) ->executeOne(); if (!$user_credential) { // Pull the credential with the ominipotent viewer so we can look up // the ID and tell if it's restricted or invalid. $omnipotent_credential = id(new PassphraseCredentialQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) ->withPHIDs(array($current_phid)) ->executeOne(); if ($omnipotent_credential) { $current_name = pht( '%s (Restricted Credential)', $omnipotent_credential->getMonogram()); } else { $current_name = pht( 'Invalid Credential ("%s")', $current_phid); } } else { $current_name = pht( '%s %s', $user_credential->getMonogram(), $user_credential->getName()); } $options_map = array( $current_phid => $current_name, ) + $options_map; } $disabled = $this->getDisabled(); if ($this->allowNull) { $options_map = array('' => pht('(No Credentials)')) + $options_map; } else { if (!$options_map) { $options_map[''] = pht('(No Existing Credentials)'); $disabled = true; } } Javelin::initBehavior('passphrase-credential-control'); $options = AphrontFormSelectControl::renderSelectTag( $this->getValue(), $options_map, array( 'id' => $this->getControlID(), 'name' => $this->getName(), 'disabled' => $disabled ? 'disabled' : null, 'sigil' => 'passphrase-credential-select', )); if ($this->credentialType) { $button = javelin_tag( 'a', array( 'href' => '#', - 'class' => 'button grey', + 'class' => 'button button-grey', 'sigil' => 'passphrase-credential-add', 'mustcapture' => true, ), pht('Add Credential')); } else { $button = null; } return javelin_tag( 'div', array( 'sigil' => 'passphrase-credential-control', 'meta' => array( 'type' => $this->getCredentialType(), 'username' => $this->defaultUsername, 'allowNull' => $this->allowNull, ), ), array( $options, $button, )); } /** * Verify that a given actor has permission to use all of the credentials * in a list of credential transactions. * * In general, the rule here is: * * - If you're editing an object and it uses a credential you can't use, * that's fine as long as you don't change the credential. * - If you do change the credential, the new credential must be one you * can use. * * @param PhabricatorUser The acting user. * @param list List of credential altering * transactions. * @return bool True if the transactions are valid. */ public static function validateTransactions( PhabricatorUser $actor, array $xactions) { $new_phids = array(); foreach ($xactions as $xaction) { $new = $xaction->getNewValue(); if (!$new) { // Removing a credential, so this is OK. continue; } $old = $xaction->getOldValue(); if ($old == $new) { // This is a no-op transaction, so this is also OK. continue; } // Otherwise, we need to check this credential. $new_phids[] = $new; } if (!$new_phids) { // No new credentials being set, so this is fine. return true; } $usable_credentials = id(new PassphraseCredentialQuery()) ->setViewer($actor) ->withPHIDs($new_phids) ->execute(); $usable_credentials = mpull($usable_credentials, null, 'getPHID'); foreach ($new_phids as $phid) { if (empty($usable_credentials[$phid])) { return false; } } return true; } } diff --git a/src/applications/pholio/view/PholioUploadedImageView.php b/src/applications/pholio/view/PholioUploadedImageView.php index 460b54c517..e583fa687b 100644 --- a/src/applications/pholio/view/PholioUploadedImageView.php +++ b/src/applications/pholio/view/PholioUploadedImageView.php @@ -1,129 +1,129 @@ replacesPHID = $replaces_phid; return $this; } public function setImage(PholioImage $image) { $this->image = $image; return $this; } public function render() { require_celerity_resource('pholio-edit-css'); $image = $this->image; $file = $image->getFile(); $phid = $file->getPHID(); $replaces_phid = $this->replacesPHID; $remove = $this->renderRemoveElement(); $title = id(new AphrontFormTextControl()) ->setName('title_'.$phid) ->setValue($image->getName()) ->setSigil('image-title') ->setLabel(pht('Title')); $description = id(new PhabricatorRemarkupControl()) ->setUser($this->getUser()) ->setName('description_'.$phid) ->setValue($image->getDescription()) ->setSigil('image-description') ->setLabel(pht('Description')); $xform = PhabricatorFileTransform::getTransformByKey( PhabricatorFileThumbnailTransform::TRANSFORM_PINBOARD); $thumbnail_uri = $file->getURIForTransform($xform); $thumb_img = javelin_tag( 'img', array( 'class' => 'pholio-thumb-img', 'src' => $thumbnail_uri, 'sigil' => 'pholio-uploaded-thumb', )); $thumb_frame = phutil_tag( 'div', array( 'class' => 'pholio-thumb-frame', ), $thumb_img); $handle = javelin_tag( 'div', array( 'class' => 'pholio-drag-handle', 'sigil' => 'pholio-drag-handle', )); $content = hsprintf( '
%s
%s
%s
%s %s
', $remove, $file->getName(), $thumb_frame, $title, $description); $input = phutil_tag( 'input', array( 'type' => 'hidden', 'name' => 'file_phids[]', 'value' => $phid, )); $replaces_input = phutil_tag( 'input', array( 'type' => 'hidden', 'name' => 'replaces['.$replaces_phid.']', 'value' => $phid, )); return javelin_tag( 'div', array( 'class' => 'pholio-uploaded-image', 'sigil' => 'pholio-drop-image', 'meta' => array( 'filePHID' => $file->getPHID(), 'replacesPHID' => $replaces_phid, ), ), array( $handle, $content, $input, $replaces_input, )); } private function renderRemoveElement() { return javelin_tag( 'a', array( - 'class' => 'button grey', + 'class' => 'button button-grey', 'sigil' => 'pholio-drop-remove', ), 'X'); } } diff --git a/src/applications/phortune/controller/cart/PhortuneCartCheckoutController.php b/src/applications/phortune/controller/cart/PhortuneCartCheckoutController.php index fdc19dae44..dd611ecb7b 100644 --- a/src/applications/phortune/controller/cart/PhortuneCartCheckoutController.php +++ b/src/applications/phortune/controller/cart/PhortuneCartCheckoutController.php @@ -1,233 +1,233 @@ getViewer(); $id = $request->getURIData('id'); $cart = id(new PhortuneCartQuery()) ->setViewer($viewer) ->withIDs(array($id)) ->needPurchases(true) ->executeOne(); if (!$cart) { return new Aphront404Response(); } $cancel_uri = $cart->getCancelURI(); $merchant = $cart->getMerchant(); switch ($cart->getStatus()) { case PhortuneCart::STATUS_BUILDING: return $this->newDialog() ->setTitle(pht('Incomplete Cart')) ->appendParagraph( pht( 'The application that created this cart did not finish putting '. 'products in it. You can not checkout with an incomplete '. 'cart.')) ->addCancelButton($cancel_uri); case PhortuneCart::STATUS_READY: // This is the expected, normal state for a cart that's ready for // checkout. break; case PhortuneCart::STATUS_CHARGED: case PhortuneCart::STATUS_PURCHASING: case PhortuneCart::STATUS_HOLD: case PhortuneCart::STATUS_REVIEW: case PhortuneCart::STATUS_PURCHASED: // For these states, kick the user to the order page to give them // information and options. return id(new AphrontRedirectResponse())->setURI($cart->getDetailURI()); default: throw new Exception( pht( 'Unknown cart status "%s"!', $cart->getStatus())); } $account = $cart->getAccount(); $account_uri = $this->getApplicationURI($account->getID().'/'); $methods = id(new PhortunePaymentMethodQuery()) ->setViewer($viewer) ->withAccountPHIDs(array($account->getPHID())) ->withMerchantPHIDs(array($merchant->getPHID())) ->withStatuses(array(PhortunePaymentMethod::STATUS_ACTIVE)) ->execute(); $e_method = null; $errors = array(); if ($request->isFormPost()) { // Require CAN_EDIT on the cart to actually make purchases. PhabricatorPolicyFilter::requireCapability( $viewer, $cart, PhabricatorPolicyCapability::CAN_EDIT); $method_id = $request->getInt('paymentMethodID'); $method = idx($methods, $method_id); if (!$method) { $e_method = pht('Required'); $errors[] = pht('You must choose a payment method.'); } if (!$errors) { $provider = $method->buildPaymentProvider(); $charge = $cart->willApplyCharge($viewer, $provider, $method); try { $provider->applyCharge($method, $charge); } catch (Exception $ex) { $cart->didFailCharge($charge); return $this->newDialog() ->setTitle(pht('Charge Failed')) ->appendParagraph( pht( 'Unable to make payment: %s', $ex->getMessage())) ->addCancelButton($cart->getCheckoutURI(), pht('Continue')); } $cart->didApplyCharge($charge); $done_uri = $cart->getCheckoutURI(); return id(new AphrontRedirectResponse())->setURI($done_uri); } } $cart_table = $this->buildCartContentTable($cart); $cart_box = id(new PHUIObjectBoxView()) ->setFormErrors($errors) ->setHeaderText(pht('Cart Contents')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setTable($cart_table); $title = $cart->getName(); if (!$methods) { $method_control = id(new AphrontFormStaticControl()) ->setLabel(pht('Payment Method')) ->setValue( phutil_tag('em', array(), pht('No payment methods configured.'))); } else { $method_control = id(new AphrontFormRadioButtonControl()) ->setLabel(pht('Payment Method')) ->setName('paymentMethodID') ->setValue($request->getInt('paymentMethodID')); foreach ($methods as $method) { $method_control->addButton( $method->getID(), $method->getFullDisplayName(), $method->getDescription()); } } $method_control->setError($e_method); $account_id = $account->getID(); $payment_method_uri = $this->getApplicationURI("{$account_id}/card/new/"); $payment_method_uri = new PhutilURI($payment_method_uri); $payment_method_uri->setQueryParams( array( 'merchantID' => $merchant->getID(), 'cartID' => $cart->getID(), )); $form = id(new AphrontFormView()) ->setUser($viewer) ->appendChild($method_control); $add_providers = $this->loadCreatePaymentMethodProvidersForMerchant( $merchant); if ($add_providers) { $new_method = javelin_tag( 'a', array( - 'class' => 'button grey', + 'class' => 'button button-grey', 'href' => $payment_method_uri, ), pht('Add New Payment Method')); $form->appendChild( id(new AphrontFormMarkupControl()) ->setValue($new_method)); } if ($methods || $add_providers) { $submit = id(new AphrontFormSubmitControl()) ->setValue(pht('Submit Payment')) ->setDisabled(!$methods); if ($cart->getCancelURI() !== null) { $submit->addCancelButton($cart->getCancelURI()); } $form->appendChild($submit); } $provider_form = null; $pay_providers = $this->loadOneTimePaymentProvidersForMerchant($merchant); if ($pay_providers) { $one_time_options = array(); foreach ($pay_providers as $provider) { $one_time_options[] = $provider->renderOneTimePaymentButton( $account, $cart, $viewer); } $one_time_options = phutil_tag( 'div', array( 'class' => 'phortune-payment-onetime-list', ), $one_time_options); $provider_form = new PHUIFormLayoutView(); $provider_form->appendChild( id(new AphrontFormMarkupControl()) ->setLabel(pht('Pay With')) ->setValue($one_time_options)); } $payment_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Choose Payment Method')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($form) ->appendChild($provider_form); $description_box = $this->renderCartDescription($cart); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('Checkout')); $crumbs->addTextCrumb($title); $crumbs->setBorder(true); $header = id(new PHUIHeaderView()) ->setHeader($title) ->setHeaderIcon('fa-shopping-cart'); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter(array( $cart_box, $description_box, $payment_box, )); return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) ->appendChild($view); } } diff --git a/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php b/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php index 7af8aa3456..185bbdbcc6 100644 --- a/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php +++ b/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php @@ -1,172 +1,172 @@ getViewer(); $subscription = id(new PhortuneSubscriptionQuery()) ->setViewer($viewer) ->withIDs(array($request->getURIData('id'))) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->executeOne(); if (!$subscription) { return new Aphront404Response(); } id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( $viewer, $request, $subscription->getURI()); $merchant = $subscription->getMerchant(); $account = $subscription->getAccount(); $title = pht('Subscription: %s', $subscription->getSubscriptionName()); $header = id(new PHUIHeaderView()) ->setHeader($subscription->getSubscriptionName()); $view_uri = $subscription->getURI(); $valid_methods = id(new PhortunePaymentMethodQuery()) ->setViewer($viewer) ->withAccountPHIDs(array($account->getPHID())) ->withStatuses( array( PhortunePaymentMethod::STATUS_ACTIVE, )) ->withMerchantPHIDs(array($merchant->getPHID())) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->execute(); $valid_methods = mpull($valid_methods, null, 'getPHID'); $current_phid = $subscription->getDefaultPaymentMethodPHID(); $e_method = null; if ($current_phid && empty($valid_methods[$current_phid])) { $e_method = pht('Needs Update'); } $errors = array(); if ($request->isFormPost()) { $default_method_phid = $request->getStr('defaultPaymentMethodPHID'); if (!$default_method_phid) { $default_method_phid = null; $e_method = null; } else if (empty($valid_methods[$default_method_phid])) { $e_method = pht('Invalid'); if ($default_method_phid == $current_phid) { $errors[] = pht( 'This subscription is configured to autopay with a payment method '. 'that has been deleted. Choose a valid payment method or disable '. 'autopay.'); } else { $errors[] = pht('You must select a valid default payment method.'); } } // TODO: We should use transactions here, and move the validation logic // inside the Editor. if (!$errors) { $subscription->setDefaultPaymentMethodPHID($default_method_phid); $subscription->save(); return id(new AphrontRedirectResponse()) ->setURI($view_uri); } } // Add the option to disable autopay. $disable_options = array( '' => pht('(Disable Autopay)'), ); // Don't require the user to make a valid selection if the current method // has become invalid. if ($current_phid && empty($valid_methods[$current_phid])) { $current_options = array( $current_phid => pht(''), ); } else { $current_options = array(); } // Add any available options. $valid_options = mpull($valid_methods, 'getFullDisplayName', 'getPHID'); $options = $disable_options + $current_options + $valid_options; $crumbs = $this->buildApplicationCrumbs(); $this->addAccountCrumb($crumbs, $account); $crumbs->addTextCrumb( pht('Subscription %d', $subscription->getID()), $view_uri); $crumbs->addTextCrumb(pht('Edit')); $uri = $this->getApplicationURI($account->getID().'/card/new/'); $uri = new PhutilURI($uri); $uri->setQueryParam('merchantID', $merchant->getID()); $uri->setQueryParam('subscriptionID', $subscription->getID()); $add_method_button = phutil_tag( 'a', array( 'href' => $uri, - 'class' => 'button grey', + 'class' => 'button button-grey', ), pht('Add Payment Method...')); $form = id(new AphrontFormView()) ->setUser($viewer) ->appendChild( id(new AphrontFormSelectControl()) ->setName('defaultPaymentMethodPHID') ->setLabel(pht('Autopay With')) ->setValue($current_phid) ->setError($e_method) ->setOptions($options)) ->appendChild( id(new AphrontFormMarkupControl()) ->setValue($add_method_button)) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue(pht('Save Changes')) ->addCancelButton($view_uri)); $box = id(new PHUIObjectBoxView()) ->setUser($viewer) ->setHeaderText(pht('Subscription')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setFormErrors($errors) ->appendChild($form); $header = id(new PHUIHeaderView()) ->setHeader(pht('Edit %s', $subscription->getSubscriptionName())) ->setHeaderIcon('fa-pencil'); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter(array( $box, )); return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) ->appendChild($view); } } diff --git a/src/applications/phortune/view/PhortuneOrderTableView.php b/src/applications/phortune/view/PhortuneOrderTableView.php index a2e492c5be..435f5151d0 100644 --- a/src/applications/phortune/view/PhortuneOrderTableView.php +++ b/src/applications/phortune/view/PhortuneOrderTableView.php @@ -1,173 +1,173 @@ handles = $handles; return $this; } public function getHandles() { return $this->handles; } public function setCarts(array $carts) { $this->carts = $carts; return $this; } public function getCarts() { return $this->carts; } public function setIsInvoices($is_invoices) { $this->isInvoices = $is_invoices; return $this; } public function getIsInvoices() { return $this->isInvoices; } public function setNoDataString($no_data_string) { $this->noDataString = $no_data_string; return $this; } public function getNoDataString() { return $this->noDataString; } public function setIsMerchantView($is_merchant_view) { $this->isMerchantView = $is_merchant_view; return $this; } public function getIsMerchantView() { return $this->isMerchantView; } public function render() { $carts = $this->getCarts(); $handles = $this->getHandles(); $viewer = $this->getUser(); $is_invoices = $this->getIsInvoices(); $is_merchant = $this->getIsMerchantView(); $rows = array(); $rowc = array(); foreach ($carts as $cart) { $cart_link = $handles[$cart->getPHID()]->renderLink(); $purchases = $cart->getPurchases(); if (count($purchases) == 1) { $purchase = head($purchases); $purchase_name = $handles[$purchase->getPHID()]->renderLink(); $purchases = array(); } else { $purchase_name = ''; } if ($is_invoices) { $merchant_link = $handles[$cart->getMerchantPHID()]->renderLink(); } else { $merchant_link = null; } $rowc[] = ''; $rows[] = array( $cart->getID(), $merchant_link, phutil_tag( 'strong', array(), $cart_link), $purchase_name, phutil_tag( 'strong', array(), $cart->getTotalPriceAsCurrency()->formatForDisplay()), PhortuneCart::getNameForStatus($cart->getStatus()), phabricator_datetime($cart->getDateModified(), $viewer), phabricator_datetime($cart->getDateCreated(), $viewer), phutil_tag( 'a', array( 'href' => $cart->getCheckoutURI(), - 'class' => 'small green button', + 'class' => 'small button button-green', ), pht('Pay Now')), ); foreach ($purchases as $purchase) { $id = $purchase->getID(); $price = $purchase->getTotalPriceAsCurrency()->formatForDisplay(); $rowc[] = ''; $rows[] = array( '', '', $handles[$purchase->getPHID()]->renderLink(), $price, '', '', '', '', ); } } $table = id(new AphrontTableView($rows)) ->setNoDataString($this->getNoDataString()) ->setRowClasses($rowc) ->setHeaders( array( pht('ID'), pht('Merchant'), $is_invoices ? pht('Invoice') : pht('Order'), pht('Purchase'), pht('Amount'), pht('Status'), pht('Updated'), pht('Invoice Date'), null, )) ->setColumnClasses( array( '', '', '', 'wide', 'right', '', 'right', 'right', 'action', )) ->setColumnVisibility( array( true, $is_invoices, true, true, true, !$is_invoices, !$is_invoices, $is_invoices, // We show "Pay Now" for due invoices, but not if the viewer is the // merchant, since it doesn't make sense for them to pay. ($is_invoices && !$is_merchant), )); return $table; } } diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php index 8ae9618bbd..b66a3b3094 100644 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -1,257 +1,257 @@ getViewer(); $id = $request->getURIData('id'); $document = id(new PhrictionDocumentQuery()) ->setViewer($viewer) ->withIDs(array($id)) ->needContent(true) ->executeOne(); if (!$document) { return new Aphront404Response(); } $current = $document->getContent(); $l = $request->getInt('l'); $r = $request->getInt('r'); $ref = $request->getStr('ref'); if ($ref) { list($l, $r) = explode(',', $ref); } $content = id(new PhrictionContent())->loadAllWhere( 'documentID = %d AND version IN (%Ld)', $document->getID(), array($l, $r)); $content = mpull($content, null, 'getVersion'); $content_l = idx($content, $l, null); $content_r = idx($content, $r, null); if (!$content_l || !$content_r) { return new Aphront404Response(); } $text_l = $content_l->getContent(); $text_r = $content_r->getContent(); $diff_view = id(new PhabricatorApplicationTransactionTextDiffDetailView()) ->setOldText($text_l) ->setNewText($text_r); $changes = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Content Changes')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild( phutil_tag( 'div', array( 'class' => 'prose-diff-frame', ), $diff_view)); require_celerity_resource('phriction-document-css'); $slug = $document->getSlug(); $revert_l = $this->renderRevertButton($content_l, $current); $revert_r = $this->renderRevertButton($content_r, $current); $crumbs = $this->buildApplicationCrumbs(); $crumb_views = $this->renderBreadcrumbs($slug); foreach ($crumb_views as $view) { $crumbs->addCrumb($view); } $crumbs->addTextCrumb( pht('History'), PhrictionDocument::getSlugURI($slug, 'history')); $title = pht('Version %s vs %s', $l, $r); $header = id(new PHUIHeaderView()) ->setHeader($title) ->setHeaderIcon('fa-history'); $crumbs->addTextCrumb($title, $request->getRequestURI()); $comparison_table = $this->renderComparisonTable( array( $content_r, $content_l, )); $navigation_table = null; if ($l + 1 == $r) { $nav_l = ($l > 1); $nav_r = ($r != $current->getVersion()); $uri = $request->getRequestURI(); if ($nav_l) { $link_l = phutil_tag( 'a', array( 'href' => $uri->alter('l', $l - 1)->alter('r', $r - 1), - 'class' => 'button grey', + 'class' => 'button button-grey', ), pht("\xC2\xAB Previous Change")); } else { $link_l = phutil_tag( 'a', array( 'href' => '#', - 'class' => 'button grey disabled', + 'class' => 'button button-grey disabled', ), pht('Original Change')); } $link_r = null; if ($nav_r) { $link_r = phutil_tag( 'a', array( 'href' => $uri->alter('l', $l + 1)->alter('r', $r + 1), - 'class' => 'button grey', + 'class' => 'button button-grey', ), pht("Next Change \xC2\xBB")); } else { $link_r = phutil_tag( 'a', array( 'href' => '#', - 'class' => 'button grey disabled', + 'class' => 'button button-grey disabled', ), pht('Most Recent Change')); } $navigation_table = phutil_tag( 'table', array('class' => 'phriction-history-nav-table'), phutil_tag('tr', array(), array( phutil_tag('td', array('class' => 'nav-prev'), $link_l), phutil_tag('td', array('class' => 'nav-next'), $link_r), ))); } $output = hsprintf( '
'. '%s%s'. ''. ''. '
%s%s
'. '
', $comparison_table->render(), $navigation_table, $revert_l, $revert_r); $object_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Edits')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->appendChild($output); $crumbs->setBorder(true); $view = id(new PHUITwoColumnView()) ->setHeader($header) ->setFooter(array( $object_box, $changes, )); return $this->newPage() ->setTitle(pht('Document History')) ->setCrumbs($crumbs) ->appendChild($view); } private function renderRevertButton( PhrictionContent $content, PhrictionContent $current) { $document_id = $content->getDocumentID(); $version = $content->getVersion(); $hidden_statuses = array( PhrictionChangeType::CHANGE_DELETE => true, // Silly PhrictionChangeType::CHANGE_MOVE_AWAY => true, // Plain silly PhrictionChangeType::CHANGE_STUB => true, // Utterly silly ); if (isset($hidden_statuses[$content->getChangeType()])) { // Don't show an edit/revert button for changes which deleted, moved or // stubbed the content since it's silly. return null; } if ($content->getID() == $current->getID()) { return phutil_tag( 'a', array( 'href' => '/phriction/edit/'.$document_id.'/', - 'class' => 'button grey', + 'class' => 'button button-grey', ), pht('Edit Current Version')); } return phutil_tag( 'a', array( 'href' => '/phriction/edit/'.$document_id.'/?revert='.$version, - 'class' => 'button grey', + 'class' => 'button button-grey', ), pht('Revert to Version %s...', $version)); } private function renderComparisonTable(array $content) { assert_instances_of($content, 'PhrictionContent'); $viewer = $this->getViewer(); $phids = mpull($content, 'getAuthorPHID'); $handles = $this->loadViewerHandles($phids); $list = new PHUIObjectItemListView(); $first = true; foreach ($content as $c) { $author = $handles[$c->getAuthorPHID()]->renderLink(); $item = id(new PHUIObjectItemView()) ->setHeader(pht('%s by %s, %s', PhrictionChangeType::getChangeTypeLabel($c->getChangeType()), $author, pht('Version %s', $c->getVersion()))) ->addAttribute(pht('%s %s', phabricator_date($c->getDateCreated(), $viewer), phabricator_time($c->getDateCreated(), $viewer))); if ($c->getDescription()) { $item->addAttribute($c->getDescription()); } if ($first == true) { $item->setStatusIcon('fa-file green'); $first = false; } else { $item->setStatusIcon('fa-file red'); } $list->addItem($item); } return $list; } } diff --git a/src/applications/policy/controller/PhabricatorPolicyEditController.php b/src/applications/policy/controller/PhabricatorPolicyEditController.php index 75701cc748..f211aa754d 100644 --- a/src/applications/policy/controller/PhabricatorPolicyEditController.php +++ b/src/applications/policy/controller/PhabricatorPolicyEditController.php @@ -1,347 +1,347 @@ getViewer(); $object_phid = $request->getURIData('objectPHID'); if ($object_phid) { $object = id(new PhabricatorObjectQuery()) ->setViewer($viewer) ->withPHIDs(array($object_phid)) ->executeOne(); if (!$object) { return new Aphront404Response(); } } else { $object_type = $request->getURIData('objectType'); if (!$object_type) { $object_type = $request->getURIData('templateType'); } $phid_types = PhabricatorPHIDType::getAllInstalledTypes($viewer); if (empty($phid_types[$object_type])) { return new Aphront404Response(); } $object = $phid_types[$object_type]->newObject(); if (!$object) { return new Aphront404Response(); } } $phid = $request->getURIData('phid'); switch ($phid) { case AphrontFormPolicyControl::getSelectProjectKey(): return $this->handleProjectRequest($request); case AphrontFormPolicyControl::getSelectCustomKey(): $phid = null; break; default: break; } $action_options = array( PhabricatorPolicy::ACTION_ALLOW => pht('Allow'), PhabricatorPolicy::ACTION_DENY => pht('Deny'), ); $rules = id(new PhutilClassMapQuery()) ->setAncestorClass('PhabricatorPolicyRule') ->execute(); foreach ($rules as $key => $rule) { if (!$rule->canApplyToObject($object)) { unset($rules[$key]); } } $rules = msort($rules, 'getRuleOrder'); $default_rule = array( 'action' => head_key($action_options), 'rule' => head_key($rules), 'value' => null, ); if ($phid) { $policies = id(new PhabricatorPolicyQuery()) ->setViewer($viewer) ->withPHIDs(array($phid)) ->execute(); if (!$policies) { return new Aphront404Response(); } $policy = head($policies); } else { $policy = id(new PhabricatorPolicy()) ->setRules(array($default_rule)) ->setDefaultAction(PhabricatorPolicy::ACTION_DENY); } $root_id = celerity_generate_unique_node_id(); $default_action = $policy->getDefaultAction(); $rule_data = $policy->getRules(); $errors = array(); if ($request->isFormPost()) { $data = $request->getStr('rules'); try { $data = phutil_json_decode($data); } catch (PhutilJSONParserException $ex) { throw new PhutilProxyException( pht('Failed to JSON decode rule data!'), $ex); } $rule_data = array(); foreach ($data as $rule) { $action = idx($rule, 'action'); switch ($action) { case 'allow': case 'deny': break; default: throw new Exception(pht("Invalid action '%s'!", $action)); } $rule_class = idx($rule, 'rule'); if (empty($rules[$rule_class])) { throw new Exception(pht("Invalid rule class '%s'!", $rule_class)); } $rule_obj = $rules[$rule_class]; $value = $rule_obj->getValueForStorage(idx($rule, 'value')); $rule_data[] = array( 'action' => $action, 'rule' => $rule_class, 'value' => $value, ); } // Filter out nonsense rules, like a "users" rule without any users // actually specified. $valid_rules = array(); foreach ($rule_data as $rule) { $rule_class = $rule['rule']; if ($rules[$rule_class]->ruleHasEffect($rule['value'])) { $valid_rules[] = $rule; } } if (!$valid_rules) { $errors[] = pht('None of these policy rules have any effect.'); } // NOTE: Policies are immutable once created, and we always create a new // policy here. If we didn't, we would need to lock this endpoint down, // as users could otherwise just go edit the policies of objects with // custom policies. if (!$errors) { $new_policy = new PhabricatorPolicy(); $new_policy->setRules($valid_rules); $new_policy->setDefaultAction($request->getStr('default')); $new_policy->save(); $data = array( 'phid' => $new_policy->getPHID(), 'info' => array( 'name' => $new_policy->getName(), 'full' => $new_policy->getName(), 'icon' => $new_policy->getIcon(), ), ); return id(new AphrontAjaxResponse())->setContent($data); } } // Convert rule values to display format (for example, expanding PHIDs // into tokens). foreach ($rule_data as $key => $rule) { $rule_data[$key]['value'] = $rules[$rule['rule']]->getValueForDisplay( $viewer, $rule['value']); } $default_select = AphrontFormSelectControl::renderSelectTag( $default_action, $action_options, array( 'name' => 'default', )); if ($errors) { $errors = id(new PHUIInfoView()) ->setErrors($errors); } $form = id(new PHUIFormLayoutView()) ->appendChild($errors) ->appendChild( javelin_tag( 'input', array( 'type' => 'hidden', 'name' => 'rules', 'sigil' => 'rules', ))) ->appendChild( id(new PHUIFormInsetView()) ->setTitle(pht('Rules')) ->setRightButton( javelin_tag( 'a', array( 'href' => '#', - 'class' => 'button green', + 'class' => 'button button-green', 'sigil' => 'create-rule', 'mustcapture' => true, ), pht('New Rule'))) ->setDescription(pht('These rules are processed in order.')) ->setContent(javelin_tag( 'table', array( 'sigil' => 'rules', 'class' => 'policy-rules-table', ), ''))) ->appendChild( id(new AphrontFormMarkupControl()) ->setLabel(pht('If No Rules Match')) ->setValue(pht( '%s all other users.', $default_select))); $form = phutil_tag( 'div', array( 'id' => $root_id, ), $form); $rule_options = mpull($rules, 'getRuleDescription'); $type_map = mpull($rules, 'getValueControlType'); $templates = mpull($rules, 'getValueControlTemplate'); require_celerity_resource('policy-edit-css'); Javelin::initBehavior( 'policy-rule-editor', array( 'rootID' => $root_id, 'actions' => $action_options, 'rules' => $rule_options, 'types' => $type_map, 'templates' => $templates, 'data' => $rule_data, 'defaultRule' => $default_rule, )); $title = pht('Custom Policy'); $key = $request->getStr('capability'); if ($key) { $capability = PhabricatorPolicyCapability::getCapabilityByKey($key); $title = pht('Custom "%s" Policy', $capability->getCapabilityName()); } $dialog = id(new AphrontDialogView()) ->setWidth(AphrontDialogView::WIDTH_FULL) ->setUser($viewer) ->setTitle($title) ->appendChild($form) ->addSubmitButton(pht('Save Policy')) ->addCancelButton('#'); return id(new AphrontDialogResponse())->setDialog($dialog); } private function handleProjectRequest(AphrontRequest $request) { $viewer = $this->getViewer(); $errors = array(); $e_project = true; if ($request->isFormPost()) { $project_phids = $request->getArr('projectPHIDs'); $project_phid = head($project_phids); $project = id(new PhabricatorObjectQuery()) ->setViewer($viewer) ->withPHIDs(array($project_phid)) ->executeOne(); if ($project) { // Save this project as one of the user's most recently used projects, // so we'll show it by default in future menus. $favorites_key = PhabricatorPolicyFavoritesSetting::SETTINGKEY; $favorites = $viewer->getUserSetting($favorites_key); if (!is_array($favorites)) { $favorites = array(); } // Add this, or move it to the end of the list. unset($favorites[$project_phid]); $favorites[$project_phid] = true; $preferences = PhabricatorUserPreferences::loadUserPreferences($viewer); $editor = id(new PhabricatorUserPreferencesEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) ->setContinueOnNoEffect(true) ->setContinueOnMissingFields(true); $xactions = array(); $xactions[] = $preferences->newTransaction($favorites_key, $favorites); $editor->applyTransactions($preferences, $xactions); $data = array( 'phid' => $project->getPHID(), 'info' => array( 'name' => $project->getName(), 'full' => $project->getName(), 'icon' => $project->getDisplayIconIcon(), ), ); return id(new AphrontAjaxResponse())->setContent($data); } else { $errors[] = pht('You must choose a project.'); $e_project = pht('Required'); } } $project_datasource = id(new PhabricatorProjectDatasource()) ->setParameters( array( 'policy' => 1, )); $form = id(new AphrontFormView()) ->setUser($viewer) ->appendControl( id(new AphrontFormTokenizerControl()) ->setLabel(pht('Members Of')) ->setName('projectPHIDs') ->setLimit(1) ->setError($e_project) ->setDatasource($project_datasource)); return $this->newDialog() ->setWidth(AphrontDialogView::WIDTH_FORM) ->setErrors($errors) ->setTitle(pht('Select Project')) ->appendForm($form) ->addSubmitButton(pht('Done')) ->addCancelButton('#'); } } diff --git a/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php b/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php index 31249985e4..d628341dea 100644 --- a/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php @@ -1,416 +1,416 @@ getUser()->getIsMailingList()) { return true; } return false; } public function processRequest(AphrontRequest $request) { $user = $this->getUser(); $editable = PhabricatorEnv::getEnvConfig('account.editable'); $uri = $request->getRequestURI(); $uri->setQueryParams(array()); if ($editable) { $new = $request->getStr('new'); if ($new) { return $this->returnNewAddressResponse($request, $uri, $new); } $delete = $request->getInt('delete'); if ($delete) { return $this->returnDeleteAddressResponse($request, $uri, $delete); } } $verify = $request->getInt('verify'); if ($verify) { return $this->returnVerifyAddressResponse($request, $uri, $verify); } $primary = $request->getInt('primary'); if ($primary) { return $this->returnPrimaryAddressResponse($request, $uri, $primary); } $emails = id(new PhabricatorUserEmail())->loadAllWhere( 'userPHID = %s ORDER BY address', $user->getPHID()); $rowc = array(); $rows = array(); foreach ($emails as $email) { $button_verify = javelin_tag( 'a', array( - 'class' => 'button small grey', + 'class' => 'button small button-grey', 'href' => $uri->alter('verify', $email->getID()), 'sigil' => 'workflow', ), pht('Verify')); $button_make_primary = javelin_tag( 'a', array( - 'class' => 'button small grey', + 'class' => 'button small button-grey', 'href' => $uri->alter('primary', $email->getID()), 'sigil' => 'workflow', ), pht('Make Primary')); $button_remove = javelin_tag( 'a', array( - 'class' => 'button small grey', + 'class' => 'button small button-grey', 'href' => $uri->alter('delete', $email->getID()), 'sigil' => 'workflow', ), pht('Remove')); $button_primary = phutil_tag( 'a', array( 'class' => 'button small disabled', ), pht('Primary')); if (!$email->getIsVerified()) { $action = $button_verify; } else if ($email->getIsPrimary()) { $action = $button_primary; } else { $action = $button_make_primary; } if ($email->getIsPrimary()) { $remove = $button_primary; $rowc[] = 'highlighted'; } else { $remove = $button_remove; $rowc[] = null; } $rows[] = array( $email->getAddress(), $action, $remove, ); } $table = new AphrontTableView($rows); $table->setHeaders( array( pht('Email'), pht('Status'), pht('Remove'), )); $table->setColumnClasses( array( 'wide', 'action', 'action', )); $table->setRowClasses($rowc); $table->setColumnVisibility( array( true, true, $editable, )); $view = new PHUIObjectBoxView(); $header = new PHUIHeaderView(); $header->setHeader(pht('Email Addresses')); if ($editable) { $button = new PHUIButtonView(); $button->setText(pht('Add New Address')); $button->setTag('a'); $button->setHref($uri->alter('new', 'true')); $button->setIcon('fa-plus'); $button->addSigil('workflow'); $header->addActionLink($button); } $view->setHeader($header); $view->setTable($table); return $view; } private function returnNewAddressResponse( AphrontRequest $request, PhutilURI $uri, $new) { $user = $this->getUser(); $viewer = $this->getViewer(); $token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( $viewer, $request, $this->getPanelURI()); $e_email = true; $email = null; $errors = array(); if ($request->isDialogFormPost()) { $email = trim($request->getStr('email')); if ($new == 'verify') { // The user clicked "Done" from the "an email has been sent" dialog. return id(new AphrontReloadResponse())->setURI($uri); } PhabricatorSystemActionEngine::willTakeAction( array($viewer->getPHID()), new PhabricatorSettingsAddEmailAction(), 1); if (!strlen($email)) { $e_email = pht('Required'); $errors[] = pht('Email is required.'); } else if (!PhabricatorUserEmail::isValidAddress($email)) { $e_email = pht('Invalid'); $errors[] = PhabricatorUserEmail::describeValidAddresses(); } else if (!PhabricatorUserEmail::isAllowedAddress($email)) { $e_email = pht('Disallowed'); $errors[] = PhabricatorUserEmail::describeAllowedAddresses(); } if ($e_email === true) { $application_email = id(new PhabricatorMetaMTAApplicationEmailQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) ->withAddresses(array($email)) ->executeOne(); if ($application_email) { $e_email = pht('In Use'); $errors[] = $application_email->getInUseMessage(); } } if (!$errors) { $object = id(new PhabricatorUserEmail()) ->setAddress($email) ->setIsVerified(0); // If an administrator is editing a mailing list, automatically verify // the address. if ($viewer->getPHID() != $user->getPHID()) { if ($viewer->getIsAdmin()) { $object->setIsVerified(1); } } try { id(new PhabricatorUserEditor()) ->setActor($viewer) ->addEmail($user, $object); if ($object->getIsVerified()) { // If we autoverified the address, just reload the page. return id(new AphrontReloadResponse())->setURI($uri); } $object->sendVerificationEmail($user); $dialog = $this->newDialog() ->addHiddenInput('new', 'verify') ->setTitle(pht('Verification Email Sent')) ->appendChild(phutil_tag('p', array(), pht( 'A verification email has been sent. Click the link in the '. 'email to verify your address.'))) ->setSubmitURI($uri) ->addSubmitButton(pht('Done')); return id(new AphrontDialogResponse())->setDialog($dialog); } catch (AphrontDuplicateKeyQueryException $ex) { $e_email = pht('Duplicate'); $errors[] = pht('Another user already has this email.'); } } } if ($errors) { $errors = id(new PHUIInfoView()) ->setErrors($errors); } $form = id(new PHUIFormLayoutView()) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Email')) ->setName('email') ->setValue($email) ->setCaption(PhabricatorUserEmail::describeAllowedAddresses()) ->setError($e_email)); $dialog = $this->newDialog() ->addHiddenInput('new', 'true') ->setTitle(pht('New Address')) ->appendChild($errors) ->appendChild($form) ->addSubmitButton(pht('Save')) ->addCancelButton($uri); return id(new AphrontDialogResponse())->setDialog($dialog); } private function returnDeleteAddressResponse( AphrontRequest $request, PhutilURI $uri, $email_id) { $user = $this->getUser(); $viewer = $this->getViewer(); $token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( $viewer, $request, $this->getPanelURI()); // NOTE: You can only delete your own email addresses, and you can not // delete your primary address. $email = id(new PhabricatorUserEmail())->loadOneWhere( 'id = %d AND userPHID = %s AND isPrimary = 0', $email_id, $user->getPHID()); if (!$email) { return new Aphront404Response(); } if ($request->isFormPost()) { id(new PhabricatorUserEditor()) ->setActor($viewer) ->removeEmail($user, $email); return id(new AphrontRedirectResponse())->setURI($uri); } $address = $email->getAddress(); $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->addHiddenInput('delete', $email_id) ->setTitle(pht("Really delete address '%s'?", $address)) ->appendParagraph( pht( 'Are you sure you want to delete this address? You will no '. 'longer be able to use it to login.')) ->appendParagraph( pht( 'Note: Removing an email address from your account will invalidate '. 'any outstanding password reset links.')) ->addSubmitButton(pht('Delete')) ->addCancelButton($uri); return id(new AphrontDialogResponse())->setDialog($dialog); } private function returnVerifyAddressResponse( AphrontRequest $request, PhutilURI $uri, $email_id) { $user = $this->getUser(); $viewer = $this->getViewer(); // NOTE: You can only send more email for your unverified addresses. $email = id(new PhabricatorUserEmail())->loadOneWhere( 'id = %d AND userPHID = %s AND isVerified = 0', $email_id, $user->getPHID()); if (!$email) { return new Aphront404Response(); } if ($request->isFormPost()) { $email->sendVerificationEmail($user); return id(new AphrontRedirectResponse())->setURI($uri); } $address = $email->getAddress(); $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->addHiddenInput('verify', $email_id) ->setTitle(pht('Send Another Verification Email?')) ->appendChild(phutil_tag('p', array(), pht( 'Send another copy of the verification email to %s?', $address))) ->addSubmitButton(pht('Send Email')) ->addCancelButton($uri); return id(new AphrontDialogResponse())->setDialog($dialog); } private function returnPrimaryAddressResponse( AphrontRequest $request, PhutilURI $uri, $email_id) { $user = $this->getUser(); $viewer = $this->getViewer(); $token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( $viewer, $request, $this->getPanelURI()); // NOTE: You can only make your own verified addresses primary. $email = id(new PhabricatorUserEmail())->loadOneWhere( 'id = %d AND userPHID = %s AND isVerified = 1 AND isPrimary = 0', $email_id, $user->getPHID()); if (!$email) { return new Aphront404Response(); } if ($request->isFormPost()) { id(new PhabricatorUserEditor()) ->setActor($viewer) ->changePrimaryEmail($user, $email); return id(new AphrontRedirectResponse())->setURI($uri); } $address = $email->getAddress(); $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->addHiddenInput('primary', $email_id) ->setTitle(pht('Change primary email address?')) ->appendParagraph( pht( 'If you change your primary address, Phabricator will send all '. 'email to %s.', $address)) ->appendParagraph( pht( 'Note: Changing your primary email address will invalidate any '. 'outstanding password reset links.')) ->addSubmitButton(pht('Change Primary Address')) ->addCancelButton($uri); return id(new AphrontDialogResponse())->setDialog($dialog); } } diff --git a/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php b/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php index 77eb1c55d5..8f1a5c643c 100644 --- a/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php @@ -1,325 +1,325 @@ getExists('new')) { return $this->processNew($request); } if ($request->getExists('edit')) { return $this->processEdit($request); } if ($request->getExists('delete')) { return $this->processDelete($request); } $user = $this->getUser(); $viewer = $request->getUser(); $factors = id(new PhabricatorAuthFactorConfig())->loadAllWhere( 'userPHID = %s', $user->getPHID()); $rows = array(); $rowc = array(); $highlight_id = $request->getInt('id'); foreach ($factors as $factor) { $impl = $factor->getImplementation(); if ($impl) { $type = $impl->getFactorName(); } else { $type = $factor->getFactorKey(); } if ($factor->getID() == $highlight_id) { $rowc[] = 'highlighted'; } else { $rowc[] = null; } $rows[] = array( javelin_tag( 'a', array( 'href' => $this->getPanelURI('?edit='.$factor->getID()), 'sigil' => 'workflow', ), $factor->getFactorName()), $type, phabricator_datetime($factor->getDateCreated(), $viewer), javelin_tag( 'a', array( 'href' => $this->getPanelURI('?delete='.$factor->getID()), 'sigil' => 'workflow', - 'class' => 'small grey button', + 'class' => 'small button button-grey', ), pht('Remove')), ); } $table = new AphrontTableView($rows); $table->setNoDataString( pht("You haven't added any authentication factors to your account yet.")); $table->setHeaders( array( pht('Name'), pht('Type'), pht('Created'), '', )); $table->setColumnClasses( array( 'wide pri', '', 'right', 'action', )); $table->setRowClasses($rowc); $table->setDeviceVisibility( array( true, false, false, true, )); $panel = new PHUIObjectBoxView(); $header = new PHUIHeaderView(); $help_uri = PhabricatorEnv::getDoclink( 'User Guide: Multi-Factor Authentication'); $help_button = id(new PHUIButtonView()) ->setText(pht('Help')) ->setHref($help_uri) ->setTag('a') ->setIcon('fa-info-circle'); $create_button = id(new PHUIButtonView()) ->setText(pht('Add Authentication Factor')) ->setHref($this->getPanelURI('?new=true')) ->setTag('a') ->setWorkflow(true) ->setIcon('fa-plus'); $header->setHeader(pht('Authentication Factors')); $header->addActionLink($help_button); $header->addActionLink($create_button); $panel->setHeader($header); $panel->setTable($table); return $panel; } private function processNew(AphrontRequest $request) { $viewer = $request->getUser(); $user = $this->getUser(); $token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( $viewer, $request, $this->getPanelURI()); $factors = PhabricatorAuthFactor::getAllFactors(); $form = id(new AphrontFormView()) ->setUser($viewer); $type = $request->getStr('type'); if (empty($factors[$type]) || !$request->isFormPost()) { $factor = null; } else { $factor = $factors[$type]; } $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->addHiddenInput('new', true); if ($factor === null) { $choice_control = id(new AphrontFormRadioButtonControl()) ->setName('type') ->setValue(key($factors)); foreach ($factors as $available_factor) { $choice_control->addButton( $available_factor->getFactorKey(), $available_factor->getFactorName(), $available_factor->getFactorDescription()); } $dialog->appendParagraph( pht( 'Adding an additional authentication factor improves the security '. 'of your account. Choose the type of factor to add:')); $form ->appendChild($choice_control); } else { $dialog->addHiddenInput('type', $type); $config = $factor->processAddFactorForm( $form, $request, $user); if ($config) { $config->save(); $log = PhabricatorUserLog::initializeNewLog( $viewer, $user->getPHID(), PhabricatorUserLog::ACTION_MULTI_ADD); $log->save(); $user->updateMultiFactorEnrollment(); // Terminate other sessions so they must log in and survive the // multi-factor auth check. id(new PhabricatorAuthSessionEngine())->terminateLoginSessions( $user, $request->getCookie(PhabricatorCookies::COOKIE_SESSION)); return id(new AphrontRedirectResponse()) ->setURI($this->getPanelURI('?id='.$config->getID())); } } $dialog ->setWidth(AphrontDialogView::WIDTH_FORM) ->setTitle(pht('Add Authentication Factor')) ->appendChild($form->buildLayoutView()) ->addSubmitButton(pht('Continue')) ->addCancelButton($this->getPanelURI()); return id(new AphrontDialogResponse()) ->setDialog($dialog); } private function processEdit(AphrontRequest $request) { $viewer = $request->getUser(); $user = $this->getUser(); $factor = id(new PhabricatorAuthFactorConfig())->loadOneWhere( 'id = %d AND userPHID = %s', $request->getInt('edit'), $user->getPHID()); if (!$factor) { return new Aphront404Response(); } $e_name = true; $errors = array(); if ($request->isFormPost()) { $name = $request->getStr('name'); if (!strlen($name)) { $e_name = pht('Required'); $errors[] = pht( 'Authentication factors must have a name to identify them.'); } if (!$errors) { $factor->setFactorName($name); $factor->save(); $user->updateMultiFactorEnrollment(); return id(new AphrontRedirectResponse()) ->setURI($this->getPanelURI('?id='.$factor->getID())); } } else { $name = $factor->getFactorName(); } $form = id(new AphrontFormView()) ->setUser($viewer) ->appendChild( id(new AphrontFormTextControl()) ->setName('name') ->setLabel(pht('Name')) ->setValue($name) ->setError($e_name)); $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->addHiddenInput('edit', $factor->getID()) ->setTitle(pht('Edit Authentication Factor')) ->setErrors($errors) ->appendChild($form->buildLayoutView()) ->addSubmitButton(pht('Save')) ->addCancelButton($this->getPanelURI()); return id(new AphrontDialogResponse()) ->setDialog($dialog); } private function processDelete(AphrontRequest $request) { $viewer = $request->getUser(); $user = $this->getUser(); $token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( $viewer, $request, $this->getPanelURI()); $factor = id(new PhabricatorAuthFactorConfig())->loadOneWhere( 'id = %d AND userPHID = %s', $request->getInt('delete'), $user->getPHID()); if (!$factor) { return new Aphront404Response(); } if ($request->isFormPost()) { $factor->delete(); $log = PhabricatorUserLog::initializeNewLog( $viewer, $user->getPHID(), PhabricatorUserLog::ACTION_MULTI_REMOVE); $log->save(); $user->updateMultiFactorEnrollment(); return id(new AphrontRedirectResponse()) ->setURI($this->getPanelURI()); } $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->addHiddenInput('delete', $factor->getID()) ->setTitle(pht('Delete Authentication Factor')) ->appendParagraph( pht( 'Really remove the authentication factor %s from your account?', phutil_tag('strong', array(), $factor->getFactorName()))) ->addSubmitButton(pht('Remove Factor')) ->addCancelButton($this->getPanelURI()); return id(new AphrontDialogResponse()) ->setDialog($dialog); } } diff --git a/src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php b/src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php index a468ed53d0..e643f2ee08 100644 --- a/src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php @@ -1,144 +1,144 @@ getUser(); $accounts = id(new PhabricatorExternalAccountQuery()) ->setViewer($viewer) ->withUserPHIDs(array($viewer->getPHID())) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->execute(); $identity_phids = mpull($accounts, 'getPHID'); $identity_phids[] = $viewer->getPHID(); $sessions = id(new PhabricatorAuthSessionQuery()) ->setViewer($viewer) ->withIdentityPHIDs($identity_phids) ->execute(); $handles = id(new PhabricatorHandleQuery()) ->setViewer($viewer) ->withPHIDs($identity_phids) ->execute(); $current_key = PhabricatorHash::weakDigest( $request->getCookie(PhabricatorCookies::COOKIE_SESSION)); $rows = array(); $rowc = array(); foreach ($sessions as $session) { $is_current = phutil_hashes_are_identical( $session->getSessionKey(), $current_key); if ($is_current) { $rowc[] = 'highlighted'; $button = phutil_tag( 'a', array( - 'class' => 'small grey button disabled', + 'class' => 'small button button-grey disabled', ), pht('Current')); } else { $rowc[] = null; $button = javelin_tag( 'a', array( 'href' => '/auth/session/terminate/'.$session->getID().'/', - 'class' => 'small grey button', + 'class' => 'small button button-grey', 'sigil' => 'workflow', ), pht('Terminate')); } $hisec = ($session->getHighSecurityUntil() - time()); $rows[] = array( $handles[$session->getUserPHID()]->renderLink(), substr($session->getSessionKey(), 0, 6), $session->getType(), ($hisec > 0) ? phutil_format_relative_time($hisec) : null, phabricator_datetime($session->getSessionStart(), $viewer), phabricator_date($session->getSessionExpires(), $viewer), $button, ); } $table = new AphrontTableView($rows); $table->setNoDataString(pht("You don't have any active sessions.")); $table->setRowClasses($rowc); $table->setHeaders( array( pht('Identity'), pht('Session'), pht('Type'), pht('HiSec'), pht('Created'), pht('Expires'), pht(''), )); $table->setColumnClasses( array( 'wide', 'n', '', 'right', 'right', 'right', 'action', )); $terminate_button = id(new PHUIButtonView()) ->setText(pht('Terminate All Sessions')) ->setHref('/auth/session/terminate/all/') ->setTag('a') ->setWorkflow(true) ->setIcon('fa-exclamation-triangle'); $header = id(new PHUIHeaderView()) ->setHeader(pht('Active Login Sessions')) ->addActionLink($terminate_button); $hisec = ($viewer->getSession()->getHighSecurityUntil() - time()); if ($hisec > 0) { $hisec_button = id(new PHUIButtonView()) ->setText(pht('Leave High Security')) ->setHref('/auth/session/downgrade/') ->setTag('a') ->setWorkflow(true) ->setIcon('fa-lock'); $header->addActionLink($hisec_button); } $panel = id(new PHUIObjectBoxView()) ->setHeader($header) ->setTable($table); return $panel; } } diff --git a/src/applications/settings/panel/PhabricatorTokensSettingsPanel.php b/src/applications/settings/panel/PhabricatorTokensSettingsPanel.php index d2e0be4a53..c2659d5226 100644 --- a/src/applications/settings/panel/PhabricatorTokensSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorTokensSettingsPanel.php @@ -1,92 +1,92 @@ getUser(); $tokens = id(new PhabricatorAuthTemporaryTokenQuery()) ->setViewer($viewer) ->withTokenResources(array($viewer->getPHID())) ->execute(); $rows = array(); foreach ($tokens as $token) { if ($token->isRevocable()) { $button = javelin_tag( 'a', array( 'href' => '/auth/token/revoke/'.$token->getID().'/', - 'class' => 'small grey button', + 'class' => 'small button button-grey', 'sigil' => 'workflow', ), pht('Revoke')); } else { $button = javelin_tag( 'a', array( - 'class' => 'small grey button disabled', + 'class' => 'small button button-grey disabled', ), pht('Revoke')); } if ($token->getTokenExpires() >= time()) { $expiry = phabricator_datetime($token->getTokenExpires(), $viewer); } else { $expiry = pht('Expired'); } $rows[] = array( $token->getTokenReadableTypeName(), $expiry, $button, ); } $table = new AphrontTableView($rows); $table->setNoDataString(pht("You don't have any active tokens.")); $table->setHeaders( array( pht('Type'), pht('Expires'), pht(''), )); $table->setColumnClasses( array( 'wide', 'right', 'action', )); $terminate_button = id(new PHUIButtonView()) ->setText(pht('Revoke All')) ->setHref('/auth/token/revoke/all/') ->setTag('a') ->setWorkflow(true) ->setIcon('fa-exclamation-triangle'); $header = id(new PHUIHeaderView()) ->setHeader(pht('Temporary Tokens')) ->addActionLink($terminate_button); $panel = id(new PHUIObjectBoxView()) ->setHeader($header) ->setTable($table); return $panel; } } diff --git a/src/applications/uiexample/examples/PHUIButtonExample.php b/src/applications/uiexample/examples/PHUIButtonExample.php index aed5d5bf08..fe58123f03 100644 --- a/src/applications/uiexample/examples/PHUIButtonExample.php +++ b/src/applications/uiexample/examples/PHUIButtonExample.php @@ -1,274 +1,217 @@ getRequest(); $user = $request->getUser(); - $colors = array('', 'green', 'grey', 'disabled'); - $sizes = array('', 'small'); - $tags = array('a', 'button'); - - // phutil_tag - - $column = array(); - foreach ($tags as $tag) { - foreach ($colors as $color) { - foreach ($sizes as $key => $size) { - $class = implode(' ', array($color, $size)); - - if ($tag == 'a') { - $class .= ' button'; - } - - $column[$key][] = phutil_tag( - $tag, - array( - 'class' => $class, - ), - phutil_utf8_ucwords($size.' '.$color.' '.$tag)); - - $column[$key][] = hsprintf('

'); - } - } - } - - $column3 = array(); - foreach ($colors as $color) { - $caret = phutil_tag('span', array('class' => 'caret'), ''); - $column3[] = phutil_tag( - 'a', - array( - 'class' => $color.' button dropdown', - ), - array( - phutil_utf8_ucwords($color.' Dropdown'), - $caret, - )); - $column3[] = hsprintf('

'); - } - - $layout1 = id(new AphrontMultiColumnView()) - ->addColumn($column[0]) - ->addColumn($column[1]) - ->addColumn($column3) - ->setFluidLayout(true) - ->setGutter(AphrontMultiColumnView::GUTTER_MEDIUM); - // PHUIButtonView - $colors = array( null, PHUIButtonView::GREEN, PHUIButtonView::GREY, - PHUIButtonView::DISABLED, ); $sizes = array(null, PHUIButtonView::SMALL); $column = array(); foreach ($colors as $color) { foreach ($sizes as $key => $size) { $column[$key][] = id(new PHUIButtonView()) ->setColor($color) ->setSize($size) ->setTag('a') ->setText(pht('Clicky')); $column[$key][] = hsprintf('

'); } } foreach ($colors as $color) { $column[2][] = id(new PHUIButtonView()) ->setColor($color) ->setTag('button') ->setText(pht('Button')) ->setDropdown(true); $column[2][] = hsprintf('

'); } $layout2 = id(new AphrontMultiColumnView()) ->addColumn($column[0]) ->addColumn($column[1]) ->addColumn($column[2]) ->setFluidLayout(true) ->setGutter(AphrontMultiColumnView::GUTTER_MEDIUM); // Icon Buttons $column = array(); $icons = array( array( 'text' => pht('Comment'), 'icon' => 'fa-comment', ), array( 'text' => pht('Give Token'), 'icon' => 'fa-trophy', ), array( 'text' => pht('Reverse Time'), 'icon' => 'fa-clock-o', ), array( 'text' => pht('Implode Earth'), 'icon' => 'fa-exclamation-triangle', ), array( 'icon' => 'fa-rocket', ), array( 'icon' => 'fa-clipboard', ), array( 'icon' => 'fa-upload', ), array( 'icon' => 'fa-street-view', ), array( 'text' => pht('Copy "Quack" to Clipboard'), 'icon' => 'fa-clipboard', 'copy' => pht('Quack'), ), ); foreach ($icons as $text => $spec) { $button = id(new PHUIButtonView()) ->setTag('a') ->setColor(PHUIButtonView::GREY) ->setIcon(idx($spec, 'icon')) ->setText(idx($spec, 'text')) ->addClass(PHUI::MARGIN_SMALL_RIGHT); $copy = idx($spec, 'copy'); if ($copy !== null) { Javelin::initBehavior('phabricator-clipboard-copy'); $button->addClass('clipboard-copy'); $button->addSigil('clipboard-copy'); $button->setMetadata( array( 'text' => $copy, )); } $column[] = $button; } $layout3 = id(new AphrontMultiColumnView()) ->addColumn($column) ->setFluidLayout(true) ->setGutter(AphrontMultiColumnView::GUTTER_MEDIUM); $icons = array( 'Subscribe' => 'fa-check-circle bluegrey', 'Edit' => 'fa-pencil bluegrey', ); $designs = array( PHUIButtonView::BUTTONTYPE_SIMPLE, ); $colors = array('', 'red', 'green', 'yellow'); $column = array(); foreach ($designs as $design) { foreach ($colors as $color) { foreach ($icons as $text => $icon) { $column[] = id(new PHUIButtonView()) ->setTag('a') ->setButtonType($design) ->setColor($color) ->setIcon($icon) ->setText($text) ->addClass(PHUI::MARGIN_SMALL_RIGHT); } } } $layout4 = id(new AphrontMultiColumnView()) ->addColumn($column) ->setFluidLayout(true) ->setGutter(AphrontMultiColumnView::GUTTER_MEDIUM); // Baby Got Back Buttons $column = array(); $icons = array('Asana', 'Github', 'Facebook', 'Google', 'LDAP'); foreach ($icons as $icon) { $image = id(new PHUIIconView()) ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN) ->setSpriteIcon($icon); $column[] = id(new PHUIButtonView()) ->setTag('a') ->setSize(PHUIButtonView::BIG) ->setColor(PHUIButtonView::GREY) ->setIcon($image) ->setText(pht('Login or Register')) ->setSubtext($icon) ->addClass(PHUI::MARGIN_MEDIUM_RIGHT); } $layout5 = id(new AphrontMultiColumnView()) ->addColumn($column) ->setFluidLayout(true) ->setGutter(AphrontMultiColumnView::GUTTER_MEDIUM); // Set it and forget it - $head1 = id(new PHUIHeaderView()) - ->setHeader('phutil_tag'); - $head2 = id(new PHUIHeaderView()) - ->setHeader('PHUIButtonView'); + ->setHeader('PHUIButtonView') + ->addClass('ml'); $head3 = id(new PHUIHeaderView()) - ->setHeader(pht('Icon Buttons')); + ->setHeader(pht('Icon Buttons')) + ->addClass('ml'); $head4 = id(new PHUIHeaderView()) - ->setHeader(pht('Simple Buttons')); + ->setHeader(pht('Simple Buttons')) + ->addClass('ml'); $head5 = id(new PHUIHeaderView()) - ->setHeader(pht('Big Icon Buttons')); - - $wrap1 = id(new PHUIBoxView()) - ->appendChild($layout1) - ->addMargin(PHUI::MARGIN_LARGE); + ->setHeader(pht('Big Icon Buttons')) + ->addClass('ml'); $wrap2 = id(new PHUIBoxView()) ->appendChild($layout2) ->addMargin(PHUI::MARGIN_LARGE); $wrap3 = id(new PHUIBoxView()) ->appendChild($layout3) ->addMargin(PHUI::MARGIN_LARGE); $wrap4 = id(new PHUIBoxView()) ->appendChild($layout4) ->addMargin(PHUI::MARGIN_LARGE); $wrap5 = id(new PHUIBoxView()) ->appendChild($layout5) ->addMargin(PHUI::MARGIN_LARGE); return array( - $head1, - $wrap1, $head2, $wrap2, $head3, $wrap3, $head4, $wrap4, $head5, $wrap5, ); } } diff --git a/src/applications/uiexample/examples/PHUIColorPalletteExample.php b/src/applications/uiexample/examples/PHUIColorPalletteExample.php index a8910b930d..ea8ac538be 100644 --- a/src/applications/uiexample/examples/PHUIColorPalletteExample.php +++ b/src/applications/uiexample/examples/PHUIColorPalletteExample.php @@ -1,129 +1,129 @@ 'Base Red {$red}', 'f4dddb' => '83% Red {$lightred}', 'e67e22' => 'Base Orange {$orange}', 'f7e2d4' => '83% Orange {$lightorange}', 'f1c40f' => 'Base Yellow {$yellow}', 'fdf5d4' => '83% Yellow {$lightyellow}', '139543' => 'Base Green {$green}', 'd7eddf' => '83% Green {$lightgreen}', '2980b9' => 'Base Blue {$blue}', 'daeaf3' => '83% Blue {$lightblue}', '3498db' => 'Sky Base {$sky}', 'ddeef9' => '83% Sky {$lightsky}', '6e5cb6' => 'Base Indigo {$indigo}', 'eae6f7' => '83% Indigo {$lightindigo}', 'da49be' => 'Base Pink {$pink}', 'fbeaf8' => '83% Pink {$lightpink}', '8e44ad' => 'Base Violet {$violet}', 'ecdff1' => '83% Violet {$lightviolet}', ); $greys = array( 'C7CCD9' => 'Light Grey Border {$lightgreyborder}', 'A1A6B0' => 'Grey Border {$greyborder}', '676A70' => 'Dark Grey Border {$darkgreyborder}', '92969D' => 'Light Grey Text {$lightgreytext}', '74777D' => 'Grey Text {$greytext}', '4B4D51' => 'Dark Grey Text {$darkgreytext}', 'F7F7F7' => 'Light Grey Background {$lightgreybackground}', 'EBECEE' => 'Grey Background {$greybackground}', 'DFE0E2' => 'Dark Grey Background {$darkgreybackground}', ); $blues = array( 'DDE8EF' => 'Thin Blue Border {$thinblueborder}', 'BFCFDA' => 'Light Blue Border {$lightblueborder}', '95A6C5' => 'Blue Border {$blueborder}', '626E82' => 'Dark Blue Border {$darkblueborder}', 'F8F9FC' => 'Light Blue Background {$lightbluebackground}', 'DAE7FF' => 'Blue Background {$bluebackground}', '8C98B8' => 'Light Blue Text {$lightbluetext}', '6B748C' => 'Blue Text {$bluetext}', '464C5C' => 'Dark Blue Text {$darkbluetext}', ); $d_column = array(); foreach ($greys as $color => $name) { $d_column[] = phutil_tag( 'div', array( 'style' => 'background-color: #'.$color.';', 'class' => 'pl', ), $name.' #'.$color); } $b_column = array(); foreach ($blues as $color => $name) { $b_column[] = phutil_tag( 'div', array( 'style' => 'background-color: #'.$color.';', 'class' => 'pl', ), $name.' #'.$color); } $c_column = array(); $url = array(); foreach ($colors as $color => $name) { $url[] = $color; $c_column[] = phutil_tag( 'div', array( 'style' => 'background-color: #'.$color.';', 'class' => 'pl', ), $name.' #'.$color); } $color_url = phutil_tag( 'a', array( 'href' => 'http://color.hailpixel.com/#'.implode(',', $url), - 'class' => 'button grey mlb', + 'class' => 'button button-grey mlb', ), pht('Color Palette')); $wrap1 = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Greys')) ->appendChild($d_column); $wrap2 = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Blues')) ->appendChild($b_column); $wrap3 = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Colors')) ->appendChild($c_column); return phutil_tag( 'div', array(), array( $wrap1, $wrap2, $wrap3, )); } } diff --git a/src/applications/uiexample/examples/PhabricatorNotificationUIExample.php b/src/applications/uiexample/examples/PhabricatorNotificationUIExample.php index 5d15d884cc..4f39df6065 100644 --- a/src/applications/uiexample/examples/PhabricatorNotificationUIExample.php +++ b/src/applications/uiexample/examples/PhabricatorNotificationUIExample.php @@ -1,35 +1,35 @@ 'notification-example', - 'class' => 'button green', + 'class' => 'button button-green', ), pht('Show Notification')); $content = hsprintf('
%s
', $content); return $content; } } diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index 4616393813..12bec92843 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -1,435 +1,435 @@ method = $method; return $this; } public function setIsStandalone($is_standalone) { $this->isStandalone = $is_standalone; return $this; } public function setErrors(array $errors) { $this->errors = $errors; return $this; } public function getIsStandalone() { return $this->isStandalone; } public function setSubmitURI($uri) { $this->submitURI = $uri; return $this; } public function setTitle($title) { $this->title = $title; return $this; } public function getTitle() { return $this->title; } public function setShortTitle($short_title) { $this->shortTitle = $short_title; return $this; } public function getShortTitle() { return $this->shortTitle; } public function setResizeY($resize_y) { $this->resizeY = $resize_y; return $this; } public function getResizeY() { return $this->resizeY; } public function setResizeX($resize_x) { $this->resizeX = $resize_x; return $this; } public function getResizeX() { return $this->resizeX; } public function addSubmitButton($text = null) { if (!$text) { $text = pht('Okay'); } $this->submitButton = $text; return $this; } public function addCancelButton($uri, $text = null) { if (!$text) { $text = pht('Cancel'); } $this->cancelURI = $uri; $this->cancelText = $text; return $this; } public function addFooter($footer) { $this->footers[] = $footer; return $this; } public function addHiddenInput($key, $value) { if (is_array($value)) { foreach ($value as $hidden_key => $hidden_value) { $this->hidden[] = array($key.'['.$hidden_key.']', $hidden_value); } } else { $this->hidden[] = array($key, $value); } return $this; } public function setClass($class) { $this->class = $class; return $this; } public function setFlush($flush) { $this->flush = $flush; return $this; } public function setRenderDialogAsDiv() { // TODO: This API is awkward. $this->renderAsForm = false; return $this; } public function setFormID($id) { $this->formID = $id; return $this; } public function setWidth($width) { $this->width = $width; return $this; } public function setObjectList(PHUIObjectItemListView $list) { $this->objectList = true; $box = id(new PHUIObjectBoxView()) ->setObjectList($list); return $this->appendChild($box); } public function appendParagraph($paragraph) { return $this->appendChild( phutil_tag( 'p', array( 'class' => 'aphront-dialog-view-paragraph', ), $paragraph)); } public function appendList(array $items) { $listitems = array(); foreach ($items as $item) { $listitems[] = phutil_tag( 'li', array( 'class' => 'remarkup-list-item', ), $item); } return $this->appendChild( phutil_tag( 'ul', array( 'class' => 'remarkup-list', ), $listitems)); } public function appendForm(AphrontFormView $form) { return $this->appendChild($form->buildLayoutView()); } public function setDisableWorkflowOnSubmit($disable_workflow_on_submit) { $this->disableWorkflowOnSubmit = $disable_workflow_on_submit; return $this; } public function getDisableWorkflowOnSubmit() { return $this->disableWorkflowOnSubmit; } public function setDisableWorkflowOnCancel($disable_workflow_on_cancel) { $this->disableWorkflowOnCancel = $disable_workflow_on_cancel; return $this; } public function getDisableWorkflowOnCancel() { return $this->disableWorkflowOnCancel; } public function setValidationException( PhabricatorApplicationTransactionValidationException $ex = null) { $this->validationException = $ex; return $this; } public function render() { require_celerity_resource('aphront-dialog-view-css'); $buttons = array(); if ($this->submitButton) { $meta = array(); if ($this->disableWorkflowOnSubmit) { $meta['disableWorkflow'] = true; } $buttons[] = javelin_tag( 'button', array( 'name' => '__submit__', 'sigil' => '__default__', 'type' => 'submit', 'meta' => $meta, ), $this->submitButton); } if ($this->cancelURI) { $meta = array(); if ($this->disableWorkflowOnCancel) { $meta['disableWorkflow'] = true; } $buttons[] = javelin_tag( 'a', array( 'href' => $this->cancelURI, - 'class' => 'button grey', + 'class' => 'button button-grey', 'name' => '__cancel__', 'sigil' => 'jx-workflow-button', 'meta' => $meta, ), $this->cancelText); } if (!$this->hasViewer()) { throw new Exception( pht( 'You must call %s when rendering an %s.', 'setViewer()', __CLASS__)); } $classes = array(); $classes[] = 'aphront-dialog-view'; $classes[] = $this->class; if ($this->flush) { $classes[] = 'aphront-dialog-flush'; } switch ($this->width) { case self::WIDTH_FORM: case self::WIDTH_FULL: $classes[] = 'aphront-dialog-view-width-'.$this->width; break; case self::WIDTH_DEFAULT: break; default: throw new Exception( pht( "Unknown dialog width '%s'!", $this->width)); } if ($this->isStandalone) { $classes[] = 'aphront-dialog-view-standalone'; } if ($this->objectList) { $classes[] = 'aphront-dialog-object-list'; } $attributes = array( 'class' => implode(' ', $classes), 'sigil' => 'jx-dialog', 'role' => 'dialog', ); $form_attributes = array( 'action' => $this->submitURI, 'method' => $this->method, 'id' => $this->formID, ); $hidden_inputs = array(); $hidden_inputs[] = phutil_tag( 'input', array( 'type' => 'hidden', 'name' => '__dialog__', 'value' => '1', )); foreach ($this->hidden as $desc) { list($key, $value) = $desc; $hidden_inputs[] = javelin_tag( 'input', array( 'type' => 'hidden', 'name' => $key, 'value' => $value, 'sigil' => 'aphront-dialog-application-input', )); } if (!$this->renderAsForm) { $buttons = array( phabricator_form( $this->getViewer(), $form_attributes, array_merge($hidden_inputs, $buttons)), ); } $children = $this->renderChildren(); $errors = $this->errors; $ex = $this->validationException; $exception_errors = null; if ($ex) { foreach ($ex->getErrors() as $error) { $errors[] = $error->getMessage(); } } if ($errors) { $children = array( id(new PHUIInfoView())->setErrors($errors), $children, ); } $header = new PHUIHeaderView(); $header->setHeader($this->title); $footer = null; if ($this->footers) { $footer = phutil_tag( 'div', array( 'class' => 'aphront-dialog-foot', ), $this->footers); } $resize = null; if ($this->resizeX || $this->resizeY) { $resize = javelin_tag( 'div', array( 'class' => 'aphront-dialog-resize', 'sigil' => 'jx-dialog-resize', 'meta' => array( 'resizeX' => $this->resizeX, 'resizeY' => $this->resizeY, ), )); } $tail = null; if ($buttons || $footer) { $tail = phutil_tag( 'div', array( 'class' => 'aphront-dialog-tail grouped', ), array( $buttons, $footer, $resize, )); } $content = array( phutil_tag( 'div', array( 'class' => 'aphront-dialog-head', ), $header), phutil_tag('div', array( 'class' => 'aphront-dialog-body phabricator-remarkup grouped', ), $children), $tail, ); if ($this->renderAsForm) { return phabricator_form( $this->getViewer(), $form_attributes + $attributes, array($hidden_inputs, $content)); } else { return javelin_tag( 'div', $attributes, $content); } } /* -( AphrontResponseProducerInterface )----------------------------------- */ public function produceAphrontResponse() { return id(new AphrontDialogResponse()) ->setDialog($this); } } diff --git a/src/view/form/control/AphrontFormPolicyControl.php b/src/view/form/control/AphrontFormPolicyControl.php index 6f343bf00e..0b0e608048 100644 --- a/src/view/form/control/AphrontFormPolicyControl.php +++ b/src/view/form/control/AphrontFormPolicyControl.php @@ -1,400 +1,401 @@ object = $object; return $this; } public function setPolicies(array $policies) { assert_instances_of($policies, 'PhabricatorPolicy'); $this->policies = $policies; return $this; } public function setSpacePHID($space_phid) { $this->spacePHID = $space_phid; return $this; } public function getSpacePHID() { return $this->spacePHID; } public function setTemplatePHIDType($type) { $this->templatePHIDType = $type; return $this; } public function setTemplateObject($object) { $this->templateObject = $object; return $this; } public function getSerializedValue() { return json_encode(array( $this->getValue(), $this->getSpacePHID(), )); } public function readSerializedValue($value) { $decoded = phutil_json_decode($value); $policy_value = $decoded[0]; $space_phid = $decoded[1]; $this->setValue($policy_value); $this->setSpacePHID($space_phid); return $this; } public function readValueFromDictionary(array $dictionary) { // TODO: This is a little hacky but will only get us into trouble if we // have multiple view policy controls in multiple paged form views on the // same page, which seems unlikely. $this->setSpacePHID(idx($dictionary, 'spacePHID')); return parent::readValueFromDictionary($dictionary); } public function readValueFromRequest(AphrontRequest $request) { // See note in readValueFromDictionary(). $this->setSpacePHID($request->getStr('spacePHID')); return parent::readValueFromRequest($request); } public function setCapability($capability) { $this->capability = $capability; $labels = array( PhabricatorPolicyCapability::CAN_VIEW => pht('Visible To'), PhabricatorPolicyCapability::CAN_EDIT => pht('Editable By'), PhabricatorPolicyCapability::CAN_JOIN => pht('Joinable By'), ); if (isset($labels[$capability])) { $label = $labels[$capability]; } else { $capobj = PhabricatorPolicyCapability::getCapabilityByKey($capability); if ($capobj) { $label = $capobj->getCapabilityName(); } else { $label = pht('Capability "%s"', $capability); } } $this->setLabel($label); return $this; } protected function getCustomControlClass() { return 'aphront-form-control-policy'; } protected function getOptions() { $capability = $this->capability; $policies = $this->policies; $viewer = $this->getUser(); // Check if we're missing the policy for the current control value. This // is unusual, but can occur if the user is submitting a form and selected // an unusual project as a policy but the change has not been saved yet. $policy_map = mpull($policies, null, 'getPHID'); $value = $this->getValue(); if ($value && empty($policy_map[$value])) { $handle = id(new PhabricatorHandleQuery()) ->setViewer($viewer) ->withPHIDs(array($value)) ->executeOne(); if ($handle->isComplete()) { $policies[] = PhabricatorPolicy::newFromPolicyAndHandle( $value, $handle); } } // Exclude object policies which don't make sense here. This primarily // filters object policies associated from template capabilities (like // "Default Task View Policy" being set to "Task Author") so they aren't // made available on non-template capabilities (like "Can Bulk Edit"). foreach ($policies as $key => $policy) { if ($policy->getType() != PhabricatorPolicyType::TYPE_OBJECT) { continue; } $rule = PhabricatorPolicyQuery::getObjectPolicyRule($policy->getPHID()); if (!$rule) { continue; } $target = nonempty($this->templateObject, $this->object); if (!$rule->canApplyToObject($target)) { unset($policies[$key]); continue; } } $options = array(); foreach ($policies as $policy) { if ($policy->getPHID() == PhabricatorPolicies::POLICY_PUBLIC) { // Never expose "Public" for capabilities which don't support it. $capobj = PhabricatorPolicyCapability::getCapabilityByKey($capability); if (!$capobj || !$capobj->shouldAllowPublicPolicySetting()) { continue; } } $options[$policy->getType()][$policy->getPHID()] = array( 'name' => $policy->getName(), 'full' => $policy->getName(), 'icon' => $policy->getIcon(), 'sort' => phutil_utf8_strtolower($policy->getName()), ); } $type_project = PhabricatorPolicyType::TYPE_PROJECT; // Make sure we have a "Projects" group before we adjust it. if (empty($options[$type_project])) { $options[$type_project] = array(); } $options[$type_project] = isort($options[$type_project], 'sort'); $placeholder = id(new PhabricatorPolicy()) ->setName(pht('Other Project...')) ->setIcon('fa-search'); $options[$type_project][$this->getSelectProjectKey()] = array( 'name' => $placeholder->getName(), 'full' => $placeholder->getName(), 'icon' => $placeholder->getIcon(), ); // If we were passed several custom policy options, throw away the ones // which aren't the value for this capability. For example, an object might // have a custom view policy and a custom edit policy. When we render // the selector for "Can View", we don't want to show the "Can Edit" // custom policy -- if we did, the menu would look like this: // // Custom // Custom Policy // Custom Policy // // ...where one is the "view" custom policy, and one is the "edit" custom // policy. $type_custom = PhabricatorPolicyType::TYPE_CUSTOM; if (!empty($options[$type_custom])) { $options[$type_custom] = array_select_keys( $options[$type_custom], array($this->getValue())); } // If there aren't any custom policies, add a placeholder policy so we // render a menu item. This allows the user to switch to a custom policy. if (empty($options[$type_custom])) { $placeholder = new PhabricatorPolicy(); $placeholder->setName(pht('Custom Policy...')); $options[$type_custom][$this->getSelectCustomKey()] = array( 'name' => $placeholder->getName(), 'full' => $placeholder->getName(), 'icon' => $placeholder->getIcon(), ); } $options = array_select_keys( $options, array( PhabricatorPolicyType::TYPE_GLOBAL, PhabricatorPolicyType::TYPE_OBJECT, PhabricatorPolicyType::TYPE_USER, PhabricatorPolicyType::TYPE_CUSTOM, PhabricatorPolicyType::TYPE_PROJECT, )); return $options; } protected function renderInput() { if (!$this->object) { throw new PhutilInvalidStateException('setPolicyObject'); } if (!$this->capability) { throw new PhutilInvalidStateException('setCapability'); } $policy = $this->object->getPolicy($this->capability); if (!$policy) { // TODO: Make this configurable. $policy = PhabricatorPolicies::POLICY_USER; } if (!$this->getValue()) { $this->setValue($policy); } $control_id = celerity_generate_unique_node_id(); $input_id = celerity_generate_unique_node_id(); $caret = phutil_tag( 'span', array( 'class' => 'caret', )); $input = phutil_tag( 'input', array( 'type' => 'hidden', 'id' => $input_id, 'name' => $this->getName(), 'value' => $this->getValue(), )); $options = $this->getOptions(); $order = array(); $labels = array(); foreach ($options as $key => $values) { $order[$key] = array_keys($values); $labels[$key] = PhabricatorPolicyType::getPolicyTypeName($key); } $flat_options = array_mergev($options); $icons = array(); foreach (igroup($flat_options, 'icon') as $icon => $ignored) { $icons[$icon] = id(new PHUIIconView()) ->setIcon($icon); } if ($this->templatePHIDType) { $context_path = 'template/'.$this->templatePHIDType.'/'; } else { $object_phid = $this->object->getPHID(); if ($object_phid) { $context_path = 'object/'.$object_phid.'/'; } else { $object_type = phid_get_type($this->object->generatePHID()); $context_path = 'type/'.$object_type.'/'; } } Javelin::initBehavior( 'policy-control', array( 'controlID' => $control_id, 'inputID' => $input_id, 'options' => $flat_options, 'groups' => array_keys($options), 'order' => $order, 'labels' => $labels, 'value' => $this->getValue(), 'capability' => $this->capability, 'editURI' => '/policy/edit/'.$context_path, 'customKey' => $this->getSelectCustomKey(), 'projectKey' => $this->getSelectProjectKey(), 'disabled' => $this->getDisabled(), )); $selected = idx($flat_options, $this->getValue(), array()); $selected_icon = idx($selected, 'icon'); $selected_name = idx($selected, 'name'); $spaces_control = $this->buildSpacesControl(); return phutil_tag( 'div', array( ), array( $spaces_control, javelin_tag( 'a', array( - 'class' => 'grey button dropdown has-icon has-text policy-control', + 'class' => 'button button-grey dropdown has-icon has-text '. + 'policy-control', 'href' => '#', 'mustcapture' => true, 'sigil' => 'policy-control', 'id' => $control_id, ), array( $caret, javelin_tag( 'span', array( 'sigil' => 'policy-label', 'class' => 'phui-button-text', ), array( idx($icons, $selected_icon), $selected_name, )), )), $input, )); return AphrontFormSelectControl::renderSelectTag( $this->getValue(), $this->getOptions(), array( 'name' => $this->getName(), 'disabled' => $this->getDisabled() ? 'disabled' : null, 'id' => $this->getID(), )); } public static function getSelectCustomKey() { return 'select:custom'; } public static function getSelectProjectKey() { return 'select:project'; } private function buildSpacesControl() { if ($this->capability != PhabricatorPolicyCapability::CAN_VIEW) { return null; } if (!($this->object instanceof PhabricatorSpacesInterface)) { return null; } $viewer = $this->getUser(); if (!PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) { return null; } $space_phid = $this->getSpacePHID(); if ($space_phid === null) { $space_phid = $viewer->getDefaultSpacePHID(); } $select = AphrontFormSelectControl::renderSelectTag( $space_phid, PhabricatorSpacesNamespaceQuery::getSpaceOptionsForViewer( $viewer, $space_phid), array( 'disabled' => ($this->getDisabled() ? 'disabled' : null), 'name' => 'spacePHID', 'class' => 'aphront-space-select-control-knob', )); return $select; } } diff --git a/src/view/form/control/PHUIFormIconSetControl.php b/src/view/form/control/PHUIFormIconSetControl.php index 459bff08fa..96b1ad99b8 100644 --- a/src/view/form/control/PHUIFormIconSetControl.php +++ b/src/view/form/control/PHUIFormIconSetControl.php @@ -1,104 +1,104 @@ iconSet = $icon_set; return $this; } public function getIconSet() { return $this->iconSet; } protected function getCustomControlClass() { return 'phui-form-iconset-control'; } protected function renderInput() { Javelin::initBehavior('choose-control'); $set = $this->getIconSet(); $input_id = celerity_generate_unique_node_id(); $display_id = celerity_generate_unique_node_id(); $is_disabled = $this->getDisabled(); $classes = array(); $classes[] = 'button'; - $classes[] = 'grey'; + $classes[] = 'button-grey'; if ($is_disabled) { $classes[] = 'disabled'; } $button = javelin_tag( 'a', array( 'href' => '#', 'class' => implode(' ', $classes), 'sigil' => 'phui-form-iconset-button', ), $set->getChooseButtonText()); $icon = $set->getIcon($this->getValue()); if ($icon) { $display = $set->renderIconForControl($icon); } else { $display = null; } $display_cell = phutil_tag( 'td', array( 'class' => 'phui-form-iconset-display-cell', 'id' => $display_id, ), $display); $button_cell = phutil_tag( 'td', array( 'class' => 'phui-form-iconset-button-cell', ), $button); $row = phutil_tag( 'tr', array(), array($display_cell, $button_cell)); $layout = javelin_tag( 'table', array( 'class' => 'phui-form-iconset-table', 'sigil' => 'phui-form-iconset', 'meta' => array( 'uri' => $set->getSelectURI(), 'inputID' => $input_id, 'displayID' => $display_id, ), ), $row); $hidden_input = phutil_tag( 'input', array( 'type' => 'hidden', 'disabled' => ($is_disabled ? 'disabled' : null), 'name' => $this->getName(), 'value' => $this->getValue(), 'id' => $input_id, )); return array( $hidden_input, $layout, ); } } diff --git a/src/view/layout/AphrontListFilterView.php b/src/view/layout/AphrontListFilterView.php index 7a6be9c3d2..f764964934 100644 --- a/src/view/layout/AphrontListFilterView.php +++ b/src/view/layout/AphrontListFilterView.php @@ -1,118 +1,118 @@ showAction = $show; $this->hideAction = $hide; $this->showHideDescription = $description; $this->showHideHref = $href; return $this; } public function render() { $content = $this->renderChildren(); if (!$content) { return null; } require_celerity_resource('aphront-list-filter-view-css'); $content = phutil_tag( 'div', array( 'class' => 'aphront-list-filter-view-content', ), $content); $classes = array(); $classes[] = 'aphront-list-filter-view'; if ($this->showAction !== null) { $classes[] = 'aphront-list-filter-view-collapsible'; Javelin::initBehavior('phabricator-reveal-content'); $hide_action_id = celerity_generate_unique_node_id(); $show_action_id = celerity_generate_unique_node_id(); $content_id = celerity_generate_unique_node_id(); $hide_action = javelin_tag( 'a', array( - 'class' => 'button grey', + 'class' => 'button button-grey', 'sigil' => 'reveal-content', 'id' => $hide_action_id, 'href' => $this->showHideHref, 'meta' => array( 'hideIDs' => array($hide_action_id), 'showIDs' => array($content_id, $show_action_id), ), ), $this->showAction); $content_description = phutil_tag( 'div', array( 'class' => 'aphront-list-filter-description', ), $this->showHideDescription); $show_action = javelin_tag( 'a', array( - 'class' => 'button grey', + 'class' => 'button button-grey', 'sigil' => 'reveal-content', 'style' => 'display: none;', 'href' => '#', 'id' => $show_action_id, 'meta' => array( 'hideIDs' => array($content_id, $show_action_id), 'showIDs' => array($hide_action_id), ), ), $this->hideAction); $reveal_block = phutil_tag( 'div', array( 'class' => 'aphront-list-filter-reveal', ), array( $content_description, $hide_action, $show_action, )); $content = array( $reveal_block, phutil_tag( 'div', array( 'id' => $content_id, 'style' => 'display: none;', ), $content), ); } $content = phutil_tag( 'div', array( 'class' => implode(' ', $classes), ), $content); return phutil_tag( 'div', array( 'class' => 'aphront-list-filter-wrap', ), $content); } } diff --git a/src/view/phui/PHUIButtonView.php b/src/view/phui/PHUIButtonView.php index 2e269bd9af..10ce5b5876 100644 --- a/src/view/phui/PHUIButtonView.php +++ b/src/view/phui/PHUIButtonView.php @@ -1,264 +1,265 @@ name = $name; return $this; } public function getName() { return $this->name; } public function setText($text) { $this->text = $text; return $this; } public function setHref($href) { $this->href = $href; return $this; } public function setTitle($title) { $this->title = $title; return $this; } public function setSubtext($subtext) { $this->subtext = $subtext; return $this; } public function setColor($color) { $this->color = $color; return $this; } public function getColor() { return $this->color; } public function setDisabled($disabled) { $this->disabled = $disabled; return $this; } public function setTag($tag) { $this->tag = $tag; return $this; } public function setSize($size) { $this->size = $size; return $this; } public function setDropdown($dd) { $this->dropdown = $dd; return $this; } public function setTooltip($text) { $this->tooltip = $text; return $this; } public function setNoCSS($no_css) { $this->noCSS = $no_css; return $this; } public function setHasCaret($has_caret) { $this->hasCaret = $has_caret; return $this; } public function getHasCaret() { return $this->hasCaret; } public function setButtonType($button_type) { $this->buttonType = $button_type; return $this; } public function getButtonType() { return $this->buttonType; } public function setIcon($icon, $first = true) { if (!($icon instanceof PHUIIconView)) { $icon = id(new PHUIIconView()) ->setIcon($icon); } $this->icon = $icon; $this->iconFirst = $first; return $this; } protected function getTagName() { return $this->tag; } public function setDropdownMenu(PhabricatorActionListView $actions) { Javelin::initBehavior('phui-dropdown-menu'); $this->addSigil('phui-dropdown-menu'); $this->setMetadata($actions->getDropdownMenuMetadata()); return $this; } public function setDropdownMenuID($id) { Javelin::initBehavior('phui-dropdown-menu'); $this->addSigil('phui-dropdown-menu'); $this->setMetadata( array( 'menuID' => $id, )); return $this; } protected function getTagAttributes() { require_celerity_resource('phui-button-css'); require_celerity_resource('phui-button-simple-css'); $classes = array(); $classes[] = 'button'; if ($this->color) { - $classes[] = $this->color; + $classes[] = 'button-'.$this->color; } if ($this->size) { $classes[] = $this->size; } if ($this->dropdown) { $classes[] = 'dropdown'; } if ($this->icon) { $classes[] = 'has-icon'; } if ($this->text !== null) { $classes[] = 'has-text'; } if ($this->iconFirst == false) { $classes[] = 'icon-last'; } if ($this->disabled) { $classes[] = 'disabled'; } switch ($this->getButtonType()) { case self::BUTTONTYPE_DEFAULT: - // Nothing special for default buttons. + $classes[] = 'phui-button-default'; break; case self::BUTTONTYPE_SIMPLE: - $classes[] = 'simple'; + $classes[] = 'phui-button-simple'; break; } $sigil = null; $meta = null; if ($this->tooltip) { Javelin::initBehavior('phabricator-tooltips'); require_celerity_resource('aphront-tooltip-css'); $sigil = 'has-tooltip'; $meta = array( 'tip' => $this->tooltip, ); } if ($this->noCSS) { $classes = array(); } return array( 'class' => $classes, 'href' => $this->href, 'name' => $this->name, 'title' => $this->title, 'sigil' => $sigil, 'meta' => $meta, ); } protected function getTagContent() { $icon = null; $text = $this->text; if ($this->icon) { $icon = $this->icon; $subtext = null; if ($this->subtext) { $subtext = phutil_tag( 'div', array( 'class' => 'phui-button-subtext', ), $this->subtext); } if ($this->text !== null) { $text = phutil_tag( 'div', array( 'class' => 'phui-button-text', ), array( $text, $subtext, )); } } $caret = null; if ($this->dropdown || $this->getHasCaret()) { $caret = phutil_tag('span', array('class' => 'caret'), ''); } if ($this->iconFirst == true) { return array($icon, $text, $caret); } else { return array($text, $icon); } } } diff --git a/src/view/phui/PHUIHovercardView.php b/src/view/phui/PHUIHovercardView.php index b99fc8153e..f6cfc45a35 100644 --- a/src/view/phui/PHUIHovercardView.php +++ b/src/view/phui/PHUIHovercardView.php @@ -1,210 +1,210 @@ handle = $handle; return $this; } public function setObject($object) { $this->object = $object; return $this; } public function getObject() { return $this->object; } public function setTitle($title) { $this->title = $title; return $this; } public function setDetail($detail) { $this->detail = $detail; return $this; } public function addField($label, $value) { $this->fields[] = array( 'label' => $label, 'value' => $value, ); return $this; } public function addAction($label, $uri, $workflow = false) { $this->actions[] = array( 'label' => $label, 'uri' => $uri, 'workflow' => $workflow, ); return $this; } public function addTag(PHUITagView $tag) { $this->tags[] = $tag; return $this; } public function addBadge(PHUIBadgeMiniView $badge) { $this->badges[] = $badge; return $this; } protected function getTagAttributes() { $classes = array(); $classes[] = 'phui-hovercard-wrapper'; return array( 'class' => implode(' ', $classes), ); } protected function getTagContent() { if (!$this->handle) { throw new PhutilInvalidStateException('setObjectHandle'); } $viewer = $this->getUser(); $handle = $this->handle; require_celerity_resource('phui-hovercard-view-css'); // If we're a fully custom Hovercard, skip the common UI $children = $this->renderChildren(); if ($children) { return $children; } $title = array( id(new PHUISpacesNamespaceContextView()) ->setUser($viewer) ->setObject($this->getObject()), $this->title ? $this->title : $handle->getName(), ); $header = new PHUIHeaderView(); $header->setHeader($title); if ($this->tags) { foreach ($this->tags as $tag) { $header->addActionItem($tag); } } $body = array(); $body_title = null; if ($this->detail) { $body_title = $this->detail; } else if (!$this->fields) { // Fallback for object handles $body_title = $handle->getFullName(); } if ($body_title) { $body[] = phutil_tag_div('phui-hovercard-body-header', $body_title); } foreach ($this->fields as $field) { $item = array( phutil_tag('strong', array(), $field['label']), ': ', phutil_tag('span', array(), $field['value']), ); $body[] = phutil_tag_div('phui-hovercard-body-item', $item); } if ($this->badges) { $badges = id(new PHUIBadgeBoxView()) ->addItems($this->badges) ->setCollapsed(true); $body[] = phutil_tag( 'div', array( 'class' => 'phui-hovercard-body-item hovercard-badges', ), $badges); } if ($handle->getImageURI()) { // Probably a user, we don't need to assume something else // "Prepend" the image by appending $body $body = phutil_tag( 'div', array( 'class' => 'phui-hovercard-body-image', ), phutil_tag( 'div', array( 'class' => 'profile-header-picture-frame', 'style' => 'background-image: url('.$handle->getImageURI().');', ), '')) ->appendHTML( phutil_tag( 'div', array( 'class' => 'phui-hovercard-body-details', ), $body)); } $buttons = array(); foreach ($this->actions as $action) { $options = array( - 'class' => 'button grey', + 'class' => 'button button-grey', 'href' => $action['uri'], ); if ($action['workflow']) { $options['sigil'] = 'workflow'; $buttons[] = javelin_tag( 'a', $options, $action['label']); } else { $buttons[] = phutil_tag( 'a', $options, $action['label']); } } $tail = null; if ($buttons) { $tail = phutil_tag_div('phui-hovercard-tail', $buttons); } $hovercard = phutil_tag_div( 'phui-hovercard-container grouped', array( phutil_tag_div('phui-hovercard-head', $header), phutil_tag_div('phui-hovercard-body grouped', $body), $tail, )); return $hovercard; } } diff --git a/webroot/rsrc/css/phui/button/phui-button-simple.css b/webroot/rsrc/css/phui/button/phui-button-simple.css index fa0a8d11b2..4bc6daee23 100644 --- a/webroot/rsrc/css/phui/button/phui-button-simple.css +++ b/webroot/rsrc/css/phui/button/phui-button-simple.css @@ -1,131 +1,131 @@ /** * @provides phui-button-simple-css * @requires phui-button-css */ /* - Basic -------------------------------------------------------------------*/ -button.simple, -input[type="submit"].simple, -a.simple, -a.simple:visited { +button.phui-button-simple, +input[type="submit"].phui-button-simple, +a.phui-button-simple, +a.phui-button-simple:visited { background: #fff; color: {$bluetext}; border: 1px solid {$lightblueborder}; } -button.simple .phui-icon-view, -input[type="submit"].simple .phui-icon-view, -a.simple .phui-icon-view, -a.simple:visited .phui-icon-view { +button.phui-button-simple .phui-icon-view, +input[type="submit"].phui-button-simple .phui-icon-view, +a.phui-button-simple .phui-icon-view, +a.phui-button-simple:visited .phui-icon-view { color: {$lightbluetext}; } -a.button.simple:hover, -button.simple:hover { +a.button.phui-button-simple:hover, +button.phui-button-simple:hover { border-color: {$blueborder}; background-image: none; background-color: #fff; transition: 0s; } -a.simple.current { +a.phui-button-simple.current { background: {$lightblue}; } /* - Red --------------------------------------------------------------------*/ -button.simple.red, -input[type="submit"].simple.red, -a.simple.red, -a.simple.red:visited { +button.phui-button-simple.button-red, +input[type="submit"].phui-button-simple.button-red, +a.phui-button-simple.button-red, +a.phui-button-simple.button-red:visited { background: {$sh-redbackground}; color: {$redtext}; border: 1px solid {$sh-redborder}; } -button.simple.red .phui-icon-view, -input[type="submit"].simple.red .phui-icon-view, -a.simple.red .phui-icon-view, -a.simple.red:visited .phui-icon-view { +button.phui-button-simple.button-red .phui-icon-view, +input[type="submit"].phui-button-simple.button-red .phui-icon-view, +a.phui-button-simple.button-red .phui-icon-view, +a.phui-button-simple.button-red:visited .phui-icon-view { color: {$redtext}; } -a.button.simple.red:hover, -button.simple.red:hover { +a.button.phui-button-simple.button-red:hover, +button.phui-button-simple.button-red:hover { border-color: {$sh-redtext}; background-image: none; background-color: {$sh-redbackground}; transition: 0s; } /* - Green ------------------------------------------------------------------*/ -button.simple.green, -input[type="submit"].simple.green, -a.simple.green, -a.simple.green:visited { +button.phui-button-simple.button-green, +input[type="submit"].phui-button-simple.button-green, +a.phui-button-simple.button-green, +a.phui-button-simple.button-green:visited { background: {$sh-greenbackground}; color: {$greentext}; border: 1px solid {$sh-greenborder}; } -button.simple.green .phui-icon-view, -input[type="submit"].simple.green .phui-icon-view, -a.simple.green .phui-icon-view, -a.simple.green:visited .phui-icon-view { +button.phui-button-simple.button-green .phui-icon-view, +input[type="submit"].phui-button-simple.button-green .phui-icon-view, +a.phui-button-simple.button-green .phui-icon-view, +a.phui-button-simple.button-green:visited .phui-icon-view { color: {$greentext}; } -a.button.simple.green:hover, -button.simple.green:hover { +a.button.phui-button-simple.button-green:hover, +button.phui-button-simple.button-green:hover { border-color: {$sh-greentext}; background-image: none; background-color: {$sh-greenbackground}; transition: 0s; } /* - Yellow -----------------------------------------------------------------*/ -button.simple.yellow, -input[type="submit"].simple.yellow, -a.simple.yellow, -a.simple.yellow:visited { +button.phui-button-simple.button-yellow, +input[type="submit"].phui-button-simple.button-yellow, +a.phui-button-simple.button-yellow, +a.phui-button-simple.button-yellow:visited { background-color: {$sh-yellowbackground}; color: {$sh-yellowtext}; border: 1px solid {$sh-yellowborder}; } -button.simple.yellow .phui-icon-view, -input[type="submit"].simple.yellow .phui-icon-view, -a.simple.yellow .phui-icon-view, -a.simple.yellow:visited .phui-icon-view { +button.phui-button-simple.button-yellow .phui-icon-view, +input[type="submit"].phui-button-simple.button-yellow .phui-icon-view, +a.phui-button-simple.button-yellow .phui-icon-view, +a.phui-button-simple.button-yellow:visited .phui-icon-view { color: {$sh-yellowicon}; } -a.button.simple.yellow:hover, -button.simple.yellow:hover { +a.button.phui-button-simple.button-yellow:hover, +button.phui-button-simple.button-yellow:hover { border-color: {$sh-yellowtext}; background-image: none; background-color: {$sh-yellowbackground}; transition: 0s; } /* - Misc -------------------------------------------------------------------*/ -a.button.simple .phui-icon-view { +a.button.phui-button-simple .phui-icon-view { border: none; } -a.button.simple.phuix-dropdown-open { +a.button.phui-button-simple.phuix-dropdown-open { background-color: #fff; color: {$blue}; box-shadow: none; } -a.button.simple.phuix-dropdown-open:hover .phui-icon-view { +a.button.phui-button-simple.phuix-dropdown-open:hover .phui-icon-view { color: {$blue}; } diff --git a/webroot/rsrc/css/phui/button/phui-button.css b/webroot/rsrc/css/phui/button/phui-button.css index d8183febd2..69718808c3 100644 --- a/webroot/rsrc/css/phui/button/phui-button.css +++ b/webroot/rsrc/css/phui/button/phui-button.css @@ -1,295 +1,295 @@ /** * @provides phui-button-css */ button, a.button { font: {$basefont}; -webkit-font-smoothing: antialiased; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } button.phabricator-action-view-item { -webkit-font-smoothing: auto; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } button:focus, a.button:focus { outline: 0; box-shadow: 0 0 2pt 2pt rgba(82, 168, 236, 0.7); } button, a.button, a.button:visited, input[type="submit"] { background-color: #2980b9; border: 1px solid #2980b9; background-image: linear-gradient(to bottom, #3498db, #2980b9); color: white; cursor: pointer; font-weight: bold; font-size: {$normalfontsize}; display: inline-block; padding: 4px 14px 5px; text-align: center; white-space: nowrap; border-radius: 3px; } button .phui-icon-view, a.button .phui-icon-view, -button.green .phui-icon-view, -a.button.green .phui-icon-view { +button.button-green .phui-icon-view, +a.button.button-green .phui-icon-view { color: white; } -button.grey .phui-icon-view, -a.button.grey .phui-icon-view { +button.button-grey .phui-icon-view, +a.button.button-grey .phui-icon-view { color: {$darkbluetext}; } /* Buttons with images (full size only) */ button.icon, a.icon, a.icon:visited { padding-left: 0; position: relative; text-indent: 29px; } -button.green, -a.green.button, -a.green.button:visited { +button.button-green, +a.button-green.button, +a.button-green.button:visited { background-color: {$green}; border-color: {$green}; background-image: linear-gradient(to bottom, #23BB5B, #139543); } -button.grey, -input[type="submit"].grey, -a.grey, -a.grey:visited { +button.button-grey, +input[type="submit"].button-grey, +a.button-grey, +a.button-grey:visited { background-color: #F7F7F9; background-image: linear-gradient(to bottom, #ffffff, #f1f0f1); border: 1px solid rgba({$alphablue}, 0.3); color: {$darkgreytext}; } a.disabled, button.disabled, button[disabled] { filter:alpha(opacity=50); -moz-opacity: 0.5; -khtml-opacity: 0.5; opacity: 0.5; } a.phuix-dropdown-open { color: {$greytext}; } a.button:hover, button:hover { text-decoration: none; background-color: #2980b9; background-image: linear-gradient(to bottom, #3498db, #1b6ba0); border-color: #115988; transition: 0.1s; } -a.button.grey:hover, -button.grey:hover { +a.button.button-grey:hover, +button.button-grey:hover { background-image: linear-gradient(to bottom, #ffffff, #eeebec); border-color: rgba({$alphablue}, 0.4); transition: 0.1s; } -a.button.green:hover, -button.green:hover { +a.button.button-green:hover, +button.button-green:hover { border-color: #127336; background-color: #0DAD48; background-image: linear-gradient(to bottom, #23BB5B, #178841); transition: 0.1s; } body a.button.disabled:hover, body button.disabled:hover, body a.button.disabled:active, body button.disabled:active { box-shadow: none; } button.small, a.small, a.small:visited { padding: 2px 8px; height: auto; font-size: {$smallestfontsize}; line-height: 16px; } button.link { display: inline; border: none; background: transparent; background-image: none; font-weight: normal; padding: 0; margin: 0; font-size: inherit; border-bottom: none; text-decoration: none; color: #19558D; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } button.link:hover { text-decoration: underline; } .phuix-dropdown-menu { position: absolute; width: 200px; background: #fff; margin-top: -1px; padding: 12px; box-shadow: {$dropshadow}; border: 1px solid {$lightgreyborder}; border-radius: 3px; margin-bottom: 16px; } .phuix-dropdown-menu a:focus { /* We automatically focus links in dropdown menus for assistive devices, but this is distracting for visual user agents. */ outline: none; } a.policy-control { width: 240px; text-align: left; } a.policy-control .caret { float: right; } a.policy-control .phui-button-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; } .device-phone a.button.policy-control { display: block; float: none; width: auto; } .caret { display: inline-block; width: 0; height: 0; vertical-align: top; border-top: 5px solid #fff; border-right: 5px solid transparent; border-left: 5px solid transparent; content: ""; } .caret-right { display: inline-block; width: 0; height: 0; vertical-align: middle; border-left: 7px solid {$greytext}; border-top: 5px solid transparent; border-bottom: 5px solid transparent; content: ""; margin-bottom: 4px; } .caret-left { display: inline-block; width: 0; height: 0; vertical-align: middle; border-right: 7px solid {$greytext}; border-bottom: 5px solid transparent; border-top: 5px solid transparent; content: ""; margin-bottom: 4px; } .dropdown .caret { margin-top: 7px; margin-right: -4px; } .small.dropdown .caret { margin-top: 6px; } -.grey.dropdown .caret { +.button-grey.dropdown .caret { border-top-color: #000; } /* Icons */ .button.has-icon { position: relative; } .button.has-text .phui-icon-view { display: inline-block; position: absolute; top: 7px; left: 12px; } .button.icon-last .phui-icon-view { left: auto; right: 10px; } .button.has-icon .phui-button-text { margin-left: 16px; } .button.has-icon.icon-last .phui-button-text { margin: 0 16px 0 0; } /* Login Buttons */ .button.big.has-icon { padding: 4px 20px 4px 14px; border-radius: 4px; text-align: left; } .button.big.has-icon .phui-button-text { margin-left: 30px; display: block; } .button.big.has-icon .phui-button-subtext { color: {$greytext}; font-size: {$smallerfontsize}; line-height: 15px; font-weight: normal; } diff --git a/webroot/rsrc/js/phuix/PHUIXButtonView.js b/webroot/rsrc/js/phuix/PHUIXButtonView.js index e060cf0e9a..e87db88fe4 100644 --- a/webroot/rsrc/js/phuix/PHUIXButtonView.js +++ b/webroot/rsrc/js/phuix/PHUIXButtonView.js @@ -1,111 +1,111 @@ /** * @provides phuix-button-view * @requires javelin-install * javelin-dom */ JX.install('PHUIXButtonView', { statics: { BUTTONTYPE_DEFAULT: 'buttontype.default', BUTTONTYPE_SIMPLE: 'buttontype.simple' }, members: { _node: null, _textNode: null, _iconView: null, _color: null, _buttonType: null, setIcon: function(icon) { this.getIconView().setIcon(icon); return this; }, getIconView: function() { if (!this._iconView) { this._iconView = new JX.PHUIXIconView(); this._redraw(); } return this._iconView; }, setColor: function(color) { var node = this.getNode(); if (this._color) { - JX.DOM.alterClass(node, this._color, false); + JX.DOM.alterClass(node, 'button-' + this._color, false); } this._color = color; - JX.DOM.alterClass(node, this._color, true); + JX.DOM.alterClass(node, 'button-' + this._color, true); return this; }, setButtonType: function(button_type) { var self = JX.PHUIXButtonView; this._buttonType = button_type; var node = this.getNode(); var is_simple = (this._buttonType == self.BUTTONTYPE_SIMPLE); - JX.DOM.alterClass(node, 'simple', is_simple); + JX.DOM.alterClass(node, 'phui-button-simple', is_simple); return this; }, setText: function(text) { JX.DOM.setContent(this._getTextNode(), text); this._redraw(); return this; }, getNode: function() { if (!this._node) { var attrs = { className: 'button' }; this._node = JX.$N('button', attrs); this._redraw(); } return this._node; }, _getTextNode: function() { if (!this._textNode) { var attrs = { className: 'phui-button-text' }; this._textNode = JX.$N('div', attrs); } return this._textNode; }, _redraw: function() { var node = this.getNode(); var icon = this._iconView; var text = this._textNode; var content = []; if (icon) { content.push(icon.getNode()); } if (text) { content.push(text); } JX.DOM.alterClass(node, 'has-icon', !!icon); JX.DOM.alterClass(node, 'has-text', !!text); JX.DOM.setContent(node, content); } } });