1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

RevisionList

This commit is contained in:
epriestley 2011-01-25 15:19:06 -08:00
parent 14ed5482ab
commit a997e77693
16 changed files with 135 additions and 15 deletions

View file

@ -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(

View file

@ -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',

View file

@ -77,6 +77,7 @@ class AphrontDefaultApplicationConfiguration
'/api/(?<method>[^/]+)$' => 'PhabricatorConduitAPIController',
'/differential/' => array(
'$' => 'DifferentialRevisionListController',
'diff/(?<id>\d+)/$' => 'DifferentialDiffViewController',
'changeset/(?<id>\d+)/$' => 'DifferentialChangesetViewController',
'revision/edit/(?:(?<id>\d+)/)?$'

View file

@ -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');

View file

@ -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');

View file

@ -47,14 +47,11 @@ 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>'.
'</div>';
return $this->buildStandardPageResponse(

View file

@ -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(
'<div class="differential-primary-pane">'.
implode(
"\n",
array(
$table_of_contents,
$details,
),
$action_panel->render(),
$table_of_contents->render(),
$details->render(),
)).
'</div>',
array(
'title' => 'Diff View',
));

View file

@ -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');

View file

@ -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',
));
}
}

View file

@ -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');

View file

@ -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>';
}

View file

@ -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;

View file

@ -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;

View file

@ -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;
}

View file

@ -1,5 +1,6 @@
/**
* @provides javelin-behavior-aphront-basic-tokenizer
* @requires javelin-lib-dev
*/
JX.behavior('aphront-basic-tokenizer', function(config) {

View file

@ -1,5 +1,6 @@
/**
* @provides javelin-behavior-differential-populate
* @requires javelin-lib-dev
*/
JX.behavior('differential-populate', function(config) {