mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-09 16:32:39 +01:00
RevisionList
This commit is contained in:
parent
14ed5482ab
commit
a997e77693
16 changed files with 135 additions and 15 deletions
|
@ -130,18 +130,20 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-aphront-basic-tokenizer' =>
|
||||
array(
|
||||
'path' => '/res/12de8502/rsrc/js/application/core/behavior-tokenizer.js',
|
||||
'path' => '/res/8317d761/rsrc/js/application/core/behavior-tokenizer.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
0 => 'javelin-lib-dev',
|
||||
),
|
||||
),
|
||||
'javelin-behavior-differential-populate' =>
|
||||
array(
|
||||
'path' => '/res/b419291a/rsrc/js/application/differential/behavior-populate.js',
|
||||
'path' => '/res/9982573c/rsrc/js/application/differential/behavior-populate.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
0 => 'javelin-lib-dev',
|
||||
),
|
||||
),
|
||||
'javelin-init-dev' =>
|
||||
|
@ -186,7 +188,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-typeahead-prod' =>
|
||||
array(
|
||||
'path' => '/res/871c9b0f/rsrc/js/javelin/typeahead.min.js',
|
||||
'path' => '/res/1da2d984/rsrc/js/javelin/typeahead.min.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -78,6 +78,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialRevision' => 'applications/differential/storage/revision',
|
||||
'DifferentialRevisionControlSystem' => 'applications/differential/constants/revisioncontrolsystem',
|
||||
'DifferentialRevisionEditController' => 'applications/differential/controller/revisionedit',
|
||||
'DifferentialRevisionListController' => 'applications/differential/controller/revisionlist',
|
||||
'DifferentialRevisionStatus' => 'applications/differential/constants/revisionstatus',
|
||||
'DifferentialUnitStatus' => 'applications/differential/constants/unitstatus',
|
||||
'Javelin' => 'infratructure/javelin/api',
|
||||
|
@ -197,6 +198,7 @@ phutil_register_library_map(array(
|
|||
'DifferentialHunk' => 'DifferentialDAO',
|
||||
'DifferentialRevision' => 'DifferentialDAO',
|
||||
'DifferentialRevisionEditController' => 'DifferentialController',
|
||||
'DifferentialRevisionListController' => 'DifferentialController',
|
||||
'PhabricatorConduitAPIController' => 'PhabricatorConduitController',
|
||||
'PhabricatorConduitConnectionLog' => 'PhabricatorConduitDAO',
|
||||
'PhabricatorConduitConsoleController' => 'PhabricatorConduitController',
|
||||
|
|
|
@ -77,6 +77,7 @@ class AphrontDefaultApplicationConfiguration
|
|||
'/api/(?<method>[^/]+)$' => 'PhabricatorConduitAPIController',
|
||||
|
||||
'/differential/' => array(
|
||||
'$' => 'DifferentialRevisionListController',
|
||||
'diff/(?<id>\d+)/$' => 'DifferentialDiffViewController',
|
||||
'changeset/(?<id>\d+)/$' => 'DifferentialChangesetViewController',
|
||||
'revision/edit/(?:(?<id>\d+)/)?$'
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
abstract class DifferentialController extends PhabricatorController {
|
||||
|
||||
public function buildStandardPageResponse($view, array $data) {
|
||||
|
||||
require_celerity_resource('differential-core-view-css');
|
||||
|
||||
$page = new PhabricatorStandardPageView();
|
||||
|
||||
$page->setApplicationName('Differential');
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
phutil_require_module('phabricator', 'aphront/response/webpage');
|
||||
phutil_require_module('phabricator', 'applications/base/controller/base');
|
||||
phutil_require_module('phabricator', 'infratructure/celerity/api');
|
||||
phutil_require_module('phabricator', 'view/page/standard');
|
||||
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
|
|
@ -47,13 +47,10 @@ class DifferentialChangesetViewController extends DifferentialController {
|
|||
$detail->setChangeset($changeset);
|
||||
$detail->appendChild($output);
|
||||
|
||||
// TODO: This is a bit of a hacky mess.
|
||||
$output =
|
||||
'<div style="padding: 2em 1em;">'.
|
||||
'<div class="differential-primary-pane">'.
|
||||
'<div class="differential-review-stage">'.
|
||||
$detail->render().
|
||||
'</div>'.
|
||||
'<div class="differential-primary-pane">'.
|
||||
'<div class="differential-review-stage">'.
|
||||
$detail->render().
|
||||
'</div>'.
|
||||
'</div>';
|
||||
|
||||
|
|
|
@ -30,6 +30,33 @@ class DifferentialDiffViewController extends DifferentialController {
|
|||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$action_panel = new AphrontPanelView();
|
||||
$action_panel->setHeader('Preview Diff');
|
||||
$action_panel->setWidth(AphrontPanelView::WIDTH_WIDE);
|
||||
$action_panel->appendChild(
|
||||
'<p class="aphront-panel-instructions">Review the diff for correctness. '.
|
||||
'When you are satisfied, either <strong>create a new revision</strong> '.
|
||||
'or <strong>update an existing revision</strong>.');
|
||||
|
||||
$action_form = new AphrontFormView();
|
||||
$action_form
|
||||
->setAction('/differential/revision/edit/')
|
||||
->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
->setLabel('Attach To')
|
||||
->setName('revisionID')
|
||||
->setValue('')
|
||||
->setOptions(array(
|
||||
'' => "Create a new Revision...",
|
||||
)))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue('Continue'));
|
||||
|
||||
$action_panel->appendChild($action_form);
|
||||
|
||||
|
||||
|
||||
$changesets = $diff->loadChangesets();
|
||||
$changesets = msort($changesets, 'getSortKey');
|
||||
|
||||
|
@ -40,10 +67,15 @@ class DifferentialDiffViewController extends DifferentialController {
|
|||
->setChangesets($changesets);
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
array(
|
||||
$table_of_contents,
|
||||
$details,
|
||||
),
|
||||
'<div class="differential-primary-pane">'.
|
||||
implode(
|
||||
"\n",
|
||||
array(
|
||||
$action_panel->render(),
|
||||
$table_of_contents->render(),
|
||||
$details->render(),
|
||||
)).
|
||||
'</div>',
|
||||
array(
|
||||
'title' => 'Diff View',
|
||||
));
|
||||
|
|
|
@ -11,6 +11,9 @@ phutil_require_module('phabricator', 'applications/differential/controller/base'
|
|||
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
||||
phutil_require_module('phabricator', 'applications/differential/view/changesetlistview');
|
||||
phutil_require_module('phabricator', 'applications/differential/view/difftableofcontents');
|
||||
phutil_require_module('phabricator', 'view/form/base');
|
||||
phutil_require_module('phabricator', 'view/form/control/submit');
|
||||
phutil_require_module('phabricator', 'view/layout/panel');
|
||||
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class DifferentialRevisionListController extends DifferentialController {
|
||||
|
||||
public function processRequest() {
|
||||
|
||||
$side_nav = new AphrontSideNavView();
|
||||
$side_nav->addNavItem(
|
||||
phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '/differential/',
|
||||
),
|
||||
'Active Revisions'));
|
||||
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
$side_nav,
|
||||
array(
|
||||
'title' => 'Differential Home',
|
||||
));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is automatically generated. Lint this module to rebuild it.
|
||||
* @generated
|
||||
*/
|
||||
|
||||
|
||||
|
||||
phutil_require_module('phabricator', 'applications/differential/controller/base');
|
||||
phutil_require_module('phabricator', 'view/layout/sidenav');
|
||||
|
||||
phutil_require_module('phutil', 'markup');
|
||||
|
||||
|
||||
phutil_require_source('DifferentialRevisionListController.php');
|
|
@ -105,7 +105,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
|
|||
if ($meta) {
|
||||
$rows[] =
|
||||
'<tr>'.
|
||||
'<td colspan="3" />'.
|
||||
'<td colspan="3"></td>'.
|
||||
'<td class="differential-toc-meta">'.$meta.'</td>'.
|
||||
'</tr>';
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.aphront-form-input textarea {
|
||||
height: 12em;
|
||||
}
|
||||
|
@ -49,9 +50,14 @@
|
|||
.aphront-form-control-submit button,
|
||||
.aphront-form-control-submit a.button {
|
||||
float: right;
|
||||
margin: 1em 0 0em 2%;
|
||||
margin: 0.5em 0 0em 2%;
|
||||
}
|
||||
|
||||
.aphront-form-control-select .aphront-form-input {
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
|
||||
.aphront-form-view .aphront-form-caption {
|
||||
font-size: 11px;
|
||||
color: #444444;
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
float: right;
|
||||
}
|
||||
|
||||
.aphront-panel-view p.aphront-panel-instructions {
|
||||
margin: .5em 2em .75em;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.aphront-panel-width-form {
|
||||
width: 720px;
|
||||
margin-right: auto;
|
||||
|
|
|
@ -108,3 +108,14 @@
|
|||
padding: 1em;
|
||||
margin: 0 0 6px 0;
|
||||
}
|
||||
|
||||
.differential-changeset h1 {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
padding: 2px 0 8px;
|
||||
}
|
||||
|
||||
.differential-changeset {
|
||||
margin: 0.5em 0;
|
||||
padding: 10px 0px 20px;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @provides javelin-behavior-aphront-basic-tokenizer
|
||||
* @requires javelin-lib-dev
|
||||
*/
|
||||
|
||||
JX.behavior('aphront-basic-tokenizer', function(config) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @provides javelin-behavior-differential-populate
|
||||
* @requires javelin-lib-dev
|
||||
*/
|
||||
|
||||
JX.behavior('differential-populate', function(config) {
|
||||
|
|
Loading…
Reference in a new issue