1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Tweak style on "Create Another Task" button

Summary:
Not totally sure I'm in love with this but I think it's somewhat non-terrible,
despite the lack of lens flare.

Also made "Cancel" take you back to the task if you got to "Create" from "Create
Another Task".

Test Plan:
  - Style:
https://secure.phabricator.com/file/view/PHID-FILE-ad37d3c1f3b2c7a7a7d1/
  - Hit "Cancel" from "Create Another", got sent back to task.
  - Hit "Cancel" from normal create, got sent back to list.
  - Tried to save an invalid task after making changes to CC/Projects, changes
were preserved.

Reviewed By: codeblock
Reviewers: hunterbridges, jungejason, tuomaspelkonen, aran, codeblock
CC: aran, epriestley, codeblock
Differential Revision: 736
This commit is contained in:
epriestley 2011-07-27 10:46:22 -07:00
parent 4061593f18
commit 774211af76
9 changed files with 216 additions and 104 deletions

View file

@ -16,6 +16,15 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/css/aphront/attached-file-view.css',
),
'aphront-contextbar-view-css' =>
array(
'uri' => '/res/3e2f3045/rsrc/css/aphront/context-bar.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/aphront/context-bar.css',
),
'aphront-crumbs-view-css' =>
array(
'uri' => '/res/9009e6bd/rsrc/css/aphront/crumbs-view.css',
@ -625,6 +634,17 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/application/maniphest/behavior-transaction-preview.js',
),
0 =>
array(
'uri' => '/res/1da00bfe/rsrc/js/javelin/lib/__tests__/URI.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-uri',
1 => 'javelin-php-serializer',
),
'disk' => '/rsrc/js/javelin/lib/__tests__/URI.js',
),
'javelin-behavior-owners-path-editor' =>
array(
'uri' => '/res/9cf78ffc/rsrc/js/application/owners/owners-path-editor.js',
@ -649,6 +669,33 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/application/core/behavior-keyboard-shortcuts.js',
),
'javelin-behavior-phabricator-object-selector' =>
array(
'uri' => '/res/34f9a11e/rsrc/js/application/core/behavior-object-selector.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
2 => 'javelin-request',
3 => 'javelin-util',
4 => 'javelin-stratcom',
),
'disk' => '/rsrc/js/application/core/behavior-object-selector.js',
),
'javelin-behavior-phabricator-watch-anchor' =>
array(
'uri' => '/res/bb6fa5b2/rsrc/js/application/core/behavior-watch-anchor.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-stratcom',
2 => 'javelin-util',
3 => 'javelin-dom',
),
'disk' => '/rsrc/js/application/core/behavior-watch-anchor.js',
),
'javelin-behavior-phriction-document-preview' =>
array(
'uri' => '/res/f1665ecd/rsrc/js/application/phriction/phriction-document-preview.js',
@ -680,44 +727,6 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/application/projects/projects-resource-editor.js',
),
0 =>
array(
'uri' => '/res/1da00bfe/rsrc/js/javelin/lib/__tests__/URI.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-uri',
1 => 'javelin-php-serializer',
),
'disk' => '/rsrc/js/javelin/lib/__tests__/URI.js',
),
'javelin-behavior-phabricator-object-selector' =>
array(
'uri' => '/res/34f9a11e/rsrc/js/application/core/behavior-object-selector.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
2 => 'javelin-request',
3 => 'javelin-util',
4 => 'javelin-stratcom',
),
'disk' => '/rsrc/js/application/core/behavior-object-selector.js',
),
'javelin-behavior-phabricator-watch-anchor' =>
array(
'uri' => '/res/bb6fa5b2/rsrc/js/application/core/behavior-watch-anchor.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-stratcom',
2 => 'javelin-util',
3 => 'javelin-dom',
),
'disk' => '/rsrc/js/application/core/behavior-watch-anchor.js',
),
'javelin-behavior-refresh-csrf' =>
array(
'uri' => '/res/39aa51f7/rsrc/js/application/core/behavior-refresh-csrf.js',
@ -1209,7 +1218,7 @@ celerity_register_resource_map(array(
),
'phabricator-standard-page-view' =>
array(
'uri' => '/res/e8238633/rsrc/css/application/base/standard-page-view.css',
'uri' => '/res/cbc3bb69/rsrc/css/application/base/standard-page-view.css',
'type' => 'css',
'requires' =>
array(
@ -1265,6 +1274,30 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/03ef179e/diffusion.pkg.css',
'type' => 'css',
),
'124bba3b' =>
array (
'name' => 'core.pkg.css',
'symbols' =>
array (
0 => 'phabricator-core-css',
1 => 'phabricator-core-buttons-css',
2 => 'phabricator-standard-page-view',
3 => 'aphront-dialog-view-css',
4 => 'aphront-form-view-css',
5 => 'aphront-panel-view-css',
6 => 'aphront-side-nav-view-css',
7 => 'aphront-table-view-css',
8 => 'aphront-crumbs-view-css',
9 => 'aphront-tokenizer-control-css',
10 => 'aphront-typeahead-control-css',
11 => 'aphront-list-filter-view-css',
12 => 'phabricator-directory-css',
13 => 'phabricator-remarkup-css',
14 => 'syntax-highlighting-css',
),
'uri' => '/res/pkg/124bba3b/core.pkg.css',
'type' => 'css',
),
'25f94e94' =>
array (
'name' => 'typeahead.pkg.js',
@ -1300,30 +1333,6 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/307df223/javelin.pkg.js',
'type' => 'js',
),
'3638143d' =>
array (
'name' => 'core.pkg.css',
'symbols' =>
array (
0 => 'phabricator-core-css',
1 => 'phabricator-core-buttons-css',
2 => 'phabricator-standard-page-view',
3 => 'aphront-dialog-view-css',
4 => 'aphront-form-view-css',
5 => 'aphront-panel-view-css',
6 => 'aphront-side-nav-view-css',
7 => 'aphront-table-view-css',
8 => 'aphront-crumbs-view-css',
9 => 'aphront-tokenizer-control-css',
10 => 'aphront-typeahead-control-css',
11 => 'aphront-list-filter-view-css',
12 => 'phabricator-directory-css',
13 => 'phabricator-remarkup-css',
14 => 'syntax-highlighting-css',
),
'uri' => '/res/pkg/3638143d/core.pkg.css',
'type' => 'css',
),
'3f2092d7' =>
array (
'name' => 'differential.pkg.css',
@ -1374,15 +1383,15 @@ celerity_register_resource_map(array(
),
'reverse' =>
array (
'aphront-crumbs-view-css' => '3638143d',
'aphront-dialog-view-css' => '3638143d',
'aphront-form-view-css' => '3638143d',
'aphront-list-filter-view-css' => '3638143d',
'aphront-panel-view-css' => '3638143d',
'aphront-side-nav-view-css' => '3638143d',
'aphront-table-view-css' => '3638143d',
'aphront-tokenizer-control-css' => '3638143d',
'aphront-typeahead-control-css' => '3638143d',
'aphront-crumbs-view-css' => '124bba3b',
'aphront-dialog-view-css' => '124bba3b',
'aphront-form-view-css' => '124bba3b',
'aphront-list-filter-view-css' => '124bba3b',
'aphront-panel-view-css' => '124bba3b',
'aphront-side-nav-view-css' => '124bba3b',
'aphront-table-view-css' => '124bba3b',
'aphront-tokenizer-control-css' => '124bba3b',
'aphront-typeahead-control-css' => '124bba3b',
'differential-changeset-view-css' => '3f2092d7',
'differential-core-view-css' => '3f2092d7',
'differential-revision-add-comment-css' => '3f2092d7',
@ -1419,13 +1428,13 @@ celerity_register_resource_map(array(
'javelin-util' => '307df223',
'javelin-vector' => '307df223',
'javelin-workflow' => 'd0713563',
'phabricator-core-buttons-css' => '3638143d',
'phabricator-core-css' => '3638143d',
'phabricator-directory-css' => '3638143d',
'phabricator-core-buttons-css' => '124bba3b',
'phabricator-core-css' => '124bba3b',
'phabricator-directory-css' => '124bba3b',
'phabricator-keyboard-shortcut' => 'd0713563',
'phabricator-keyboard-shortcut-manager' => 'd0713563',
'phabricator-remarkup-css' => '3638143d',
'phabricator-standard-page-view' => '3638143d',
'syntax-highlighting-css' => '3638143d',
'phabricator-remarkup-css' => '124bba3b',
'phabricator-standard-page-view' => '124bba3b',
'syntax-highlighting-css' => '124bba3b',
),
));

View file

@ -15,6 +15,7 @@ phutil_register_library_map(array(
'AphrontApplicationConfiguration' => 'aphront/applicationconfiguration',
'AphrontAttachedFileView' => 'view/control/attachedfile',
'AphrontCSRFException' => 'aphront/exception/csrf',
'AphrontContextBarView' => 'view/layout/contextbar',
'AphrontController' => 'aphront/controller',
'AphrontCrumbsView' => 'view/layout/crumbs',
'AphrontDatabaseConnection' => 'storage/connection/base',
@ -658,6 +659,7 @@ phutil_register_library_map(array(
'AphrontAjaxResponse' => 'AphrontResponse',
'AphrontAttachedFileView' => 'AphrontView',
'AphrontCSRFException' => 'AphrontException',
'AphrontContextBarView' => 'AphrontView',
'AphrontCrumbsView' => 'AphrontView',
'AphrontDefaultApplicationConfiguration' => 'AphrontApplicationConfiguration',
'AphrontDefaultApplicationController' => 'AphrontController',

View file

@ -188,18 +188,18 @@ class ManiphestTaskDetailController extends ManiphestController {
implode("\n", $table).
'</table>';
$create_new_button = '';
$context_bar = null;
if ($request->getStr('workflow') == 'create') {
$create_new_button =
'<div class="create-button-container">'.
phutil_render_tag(
'a',
array(
'href' => '/maniphest/task/create/?template='.$task->getID(),
'class' => 'green button',
),
'Create New Task').
'</div>';
$context_bar = new AphrontContextBarView();
$context_bar->addButton(
phutil_render_tag(
'a',
array(
'href' => '/maniphest/task/create/?template='.$task->getID(),
'class' => 'green button',
),
'Create Another Task'));
$context_bar->appendChild('New task created.');
}
$actions = array();
@ -241,7 +241,6 @@ class ManiphestTaskDetailController extends ManiphestController {
'<div class="maniphest-panel">'.
$action_list->render().
'<div class="maniphest-task-detail-core">'.
$create_new_button.
'<h1>'.
'<span class="aphront-headsup-object-name">'.
phutil_escape_html('T'.$task->getID()).
@ -426,6 +425,7 @@ class ManiphestTaskDetailController extends ManiphestController {
return $this->buildStandardPageResponse(
array(
$context_bar,
$panel,
$transaction_view,
$comment_panel,

View file

@ -29,6 +29,7 @@ phutil_require_module('phabricator', 'view/form/control/select');
phutil_require_module('phabricator', 'view/form/control/submit');
phutil_require_module('phabricator', 'view/form/control/textarea');
phutil_require_module('phabricator', 'view/form/control/tokenizer');
phutil_require_module('phabricator', 'view/layout/contextbar');
phutil_require_module('phabricator', 'view/layout/filepreview');
phutil_require_module('phabricator', 'view/layout/headsup/action');
phutil_require_module('phabricator', 'view/layout/headsup/actionlist');

View file

@ -72,6 +72,8 @@ class ManiphestTaskEditController extends ManiphestController {
}
}
$template_id = $request->getStr('template');
$errors = array();
$e_title = true;
@ -210,21 +212,17 @@ class ManiphestTaskEditController extends ManiphestController {
$task->setCCPHIDs(array(
$user->getPHID(),
));
if ($template_id) {
$template_task = id(new ManiphestTask())->load($template_id);
if ($template_task) {
$task->setCCPHIDs($template_task->getCCPHIDs());
$task->setProjectPHIDs($template_task->getProjectPHIDs());
$task->setOwnerPHID($template_task->getOwnerPHID());
}
}
}
}
$template_task = null;
$template_id = $request->getStr('template');
if ($template_id && !$request->isFormPost()) {
$template_task = id(new ManiphestTask())->load($template_id);
}
if (!$task->getID() && $template_task) {
$task->setCCPHIDs($template_task->getCCPHIDs());
$task->setProjectPHIDs($template_task->getProjectPHIDs());
$task->setOwnerPHID($template_task->getOwnerPHID());
}
$phids = array_merge(
array($task->getOwnerPHID()),
$task->getCCPHIDs(),
@ -267,12 +265,17 @@ class ManiphestTaskEditController extends ManiphestController {
$projects_value = array();
}
$cancel_id = nonempty($task->getID(), $template_id);
if ($cancel_id) {
$cancel_uri = '/T'.$cancel_id;
} else {
$cancel_uri = '/maniphest/';
}
if ($task->getID()) {
$cancel_uri = '/T'.$task->getID();
$button_name = 'Save Task';
$header_name = 'Edit Task';
} else {
$cancel_uri = '/maniphest/';
$button_name = 'Create Task';
$header_name = 'Create New Task';
}
@ -283,6 +286,7 @@ class ManiphestTaskEditController extends ManiphestController {
$form
->setUser($user)
->setAction($request->getRequestURI()->getPath())
->addHiddenInput('template', $template_id)
->appendChild(
id(new AphrontFormTextAreaControl())
->setLabel('Title')

View file

@ -0,0 +1,48 @@
<?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.
*/
final class AphrontContextBarView extends AphrontView {
protected $buttons = array();
public function addButton($button) {
$this->buttons[] = $button;
return $this;
}
public function render() {
$view = new AphrontNullView();
$view->appendChild($this->buttons);
require_celerity_resource('aphront-contextbar-view-css');
return
'<div class="aphront-contextbar-view">'.
'<div class="aphront-contextbar-core">'.
'<div class="aphront-contextbar-buttons">'.
$view->render().
'</div>'.
'<div class="aphront-contextbar-content">'.
$this->renderChildren().
'</div>'.
'</div>'.
'<div style="clear: both;"></div>'.
'</div>';
}
}

View file

@ -0,0 +1,14 @@
<?php
/**
* This file is automatically generated. Lint this module to rebuild it.
* @generated
*/
phutil_require_module('phabricator', 'infrastructure/celerity/api');
phutil_require_module('phabricator', 'view/base');
phutil_require_module('phabricator', 'view/null');
phutil_require_source('AphrontContextBarView.php');

View file

@ -0,0 +1,23 @@
/**
* @provides aphront-contextbar-view-css
*/
.aphront-contextbar-view {
background: #efefef;
margin-bottom: 6px;
padding: 6px 2em;
border-bottom: 1px solid #dfdfdf;
}
.aphront-contextbar-core {
}
.aphront-contextbar-content {
padding-top: 5px;
font-size: 13px;
color: #666666;
}
.aphront-contextbar-buttons {
float: right;
}

View file

@ -158,3 +158,14 @@ td.phabricator-login-details {
background: url('/rsrc/image/icon/fatcow/key_question.png') 0px 0px no-repeat;
}
.workflow-header {
background: #efefef;
padding: 6px 2em;
text-align: right;
margin-bottom: 6px;
border-bottom: 1px solid #dfdfdf;
}
.workflow-header button {
float: right;
}