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

Modernize Diffusion

Summary: Converts to ObjectList for display, pht's most everything, some responsive design when possible. Tables still are tables, but scroll on touch.

Test Plan: Use iOS simulator on Diffusion, Chrome

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5847
This commit is contained in:
Chad Little 2013-05-11 08:23:19 -07:00
parent da92d79d8d
commit 57ca8de61c
28 changed files with 324 additions and 303 deletions

View file

@ -831,7 +831,7 @@ celerity_register_resource_map(array(
),
'aphront-panel-view-css' =>
array(
'uri' => '/res/5600525c/rsrc/css/aphront/panel-view.css',
'uri' => '/res/4031ea99/rsrc/css/aphront/panel-view.css',
'type' => 'css',
'requires' =>
array(
@ -4011,7 +4011,7 @@ celerity_register_resource_map(array(
), array(
'packages' =>
array(
'd4935661' =>
'850ba908' =>
array(
'name' => 'core.pkg.css',
'symbols' =>
@ -4053,7 +4053,7 @@ celerity_register_resource_map(array(
34 => 'phabricator-object-item-list-view-css',
35 => 'global-drag-and-drop-css',
),
'uri' => '/res/pkg/d4935661/core.pkg.css',
'uri' => '/res/pkg/850ba908/core.pkg.css',
'type' => 'css',
),
'26980a1c' =>
@ -4244,16 +4244,16 @@ celerity_register_resource_map(array(
'reverse' =>
array(
'aphront-attached-file-view-css' => '6b1fccc6',
'aphront-dialog-view-css' => 'd4935661',
'aphront-error-view-css' => 'd4935661',
'aphront-form-view-css' => 'd4935661',
'aphront-list-filter-view-css' => 'd4935661',
'aphront-pager-view-css' => 'd4935661',
'aphront-panel-view-css' => 'd4935661',
'aphront-table-view-css' => 'd4935661',
'aphront-tokenizer-control-css' => 'd4935661',
'aphront-tooltip-css' => 'd4935661',
'aphront-typeahead-control-css' => 'd4935661',
'aphront-dialog-view-css' => '850ba908',
'aphront-error-view-css' => '850ba908',
'aphront-form-view-css' => '850ba908',
'aphront-list-filter-view-css' => '850ba908',
'aphront-pager-view-css' => '850ba908',
'aphront-panel-view-css' => '850ba908',
'aphront-table-view-css' => '850ba908',
'aphront-tokenizer-control-css' => '850ba908',
'aphront-tooltip-css' => '850ba908',
'aphront-typeahead-control-css' => '850ba908',
'differential-changeset-view-css' => 'dd27a69b',
'differential-core-view-css' => 'dd27a69b',
'differential-inline-comment-editor' => '27c55b30',
@ -4267,7 +4267,7 @@ celerity_register_resource_map(array(
'differential-table-of-contents-css' => 'dd27a69b',
'diffusion-commit-view-css' => 'c8ce2d88',
'diffusion-icons-css' => 'c8ce2d88',
'global-drag-and-drop-css' => 'd4935661',
'global-drag-and-drop-css' => '850ba908',
'inline-comment-summary-css' => 'dd27a69b',
'javelin-aphlict' => '26980a1c',
'javelin-behavior' => '202a3dd0',
@ -4339,48 +4339,48 @@ celerity_register_resource_map(array(
'javelin-util' => '202a3dd0',
'javelin-vector' => '202a3dd0',
'javelin-workflow' => '202a3dd0',
'lightbox-attachment-css' => 'd4935661',
'lightbox-attachment-css' => '850ba908',
'maniphest-task-summary-css' => '6b1fccc6',
'maniphest-transaction-detail-css' => '6b1fccc6',
'phabricator-busy' => '26980a1c',
'phabricator-content-source-view-css' => 'dd27a69b',
'phabricator-core-buttons-css' => 'd4935661',
'phabricator-core-css' => 'd4935661',
'phabricator-crumbs-view-css' => 'd4935661',
'phabricator-directory-css' => 'd4935661',
'phabricator-core-buttons-css' => '850ba908',
'phabricator-core-css' => '850ba908',
'phabricator-crumbs-view-css' => '850ba908',
'phabricator-directory-css' => '850ba908',
'phabricator-drag-and-drop-file-upload' => '27c55b30',
'phabricator-dropdown-menu' => '26980a1c',
'phabricator-file-upload' => '26980a1c',
'phabricator-filetree-view-css' => 'd4935661',
'phabricator-flag-css' => 'd4935661',
'phabricator-form-view-css' => 'd4935661',
'phabricator-header-view-css' => 'd4935661',
'phabricator-jump-nav' => 'd4935661',
'phabricator-filetree-view-css' => '850ba908',
'phabricator-flag-css' => '850ba908',
'phabricator-form-view-css' => '850ba908',
'phabricator-header-view-css' => '850ba908',
'phabricator-jump-nav' => '850ba908',
'phabricator-keyboard-shortcut' => '26980a1c',
'phabricator-keyboard-shortcut-manager' => '26980a1c',
'phabricator-main-menu-view' => 'd4935661',
'phabricator-main-menu-view' => '850ba908',
'phabricator-menu-item' => '26980a1c',
'phabricator-nav-view-css' => 'd4935661',
'phabricator-nav-view-css' => '850ba908',
'phabricator-notification' => '26980a1c',
'phabricator-notification-css' => 'd4935661',
'phabricator-notification-menu-css' => 'd4935661',
'phabricator-object-item-list-view-css' => 'd4935661',
'phabricator-notification-css' => '850ba908',
'phabricator-notification-menu-css' => '850ba908',
'phabricator-object-item-list-view-css' => '850ba908',
'phabricator-object-selector-css' => 'dd27a69b',
'phabricator-phtize' => '26980a1c',
'phabricator-prefab' => '26980a1c',
'phabricator-project-tag-css' => '6b1fccc6',
'phabricator-remarkup-css' => 'd4935661',
'phabricator-remarkup-css' => '850ba908',
'phabricator-shaped-request' => '27c55b30',
'phabricator-side-menu-view-css' => 'd4935661',
'phabricator-standard-page-view' => 'd4935661',
'phabricator-side-menu-view-css' => '850ba908',
'phabricator-standard-page-view' => '850ba908',
'phabricator-textareautils' => '26980a1c',
'phabricator-tooltip' => '26980a1c',
'phabricator-transaction-view-css' => 'd4935661',
'phabricator-zindex-css' => 'd4935661',
'sprite-apps-large-css' => 'd4935661',
'sprite-gradient-css' => 'd4935661',
'sprite-icons-css' => 'd4935661',
'sprite-menu-css' => 'd4935661',
'syntax-highlighting-css' => 'd4935661',
'phabricator-transaction-view-css' => '850ba908',
'phabricator-zindex-css' => '850ba908',
'sprite-apps-large-css' => '850ba908',
'sprite-gradient-css' => '850ba908',
'sprite-icons-css' => '850ba908',
'sprite-menu-css' => '850ba908',
'syntax-highlighting-css' => '850ba908',
),
));

View file

@ -3,7 +3,7 @@
final class PhabricatorApplicationDiffusion extends PhabricatorApplication {
public function getShortDescription() {
return 'Repository Browser';
return pht('Repository Browser');
}
public function getBaseURI() {
@ -90,4 +90,3 @@ final class PhabricatorApplicationDiffusion extends PhabricatorApplication {
}
}

View file

@ -26,8 +26,8 @@ final class DiffusionBranchTableController extends DiffusionController {
$content = null;
if (!$branches) {
$content = new AphrontErrorView();
$content->setTitle('No Branches');
$content->appendChild('This repository has no branches.');
$content->setTitle(pht('No Branches'));
$content->appendChild(pht('This repository has no branches.'));
$content->setSeverity(AphrontErrorView::SEVERITY_NODATA);
} else {
$commits = id(new PhabricatorAuditCommitQuery())
@ -44,7 +44,7 @@ final class DiffusionBranchTableController extends DiffusionController {
->setDiffusionRequest($drequest);
$panel = id(new AphrontPanelView())
->setHeader('Branches')
->setHeader(pht('Branches'))
->appendChild($view)
->appendChild($pager);

View file

@ -31,7 +31,7 @@ final class DiffusionBrowseController extends DiffusionController {
$content = array();
if ($drequest->getTagContent()) {
$title = 'Tag: '.$drequest->getSymbolicCommit();
$title = pht('Tag: %s', $drequest->getSymbolicCommit());
$tag_view = new AphrontPanelView();
$tag_view->setHeader($title);
@ -84,14 +84,21 @@ final class DiffusionBrowseController extends DiffusionController {
$content[] = $this->buildOpenRevisions();
$readme_content = $results->getReadmeContent();
if ($readme_content) {
$readme_panel = new AphrontPanelView();
$readme_panel->setHeader('README');
$readme_panel->appendChild($readme_content);
$readme = $results->getReadmeContent();
if ($readme) {
$box = new PHUIBoxView();
$box->setShadow(true);
$box->appendChild($readme);
$box->addPadding(PHUI::PADDING_LARGE);
$content[] = $readme_panel;
$panel = new AphrontPanelView();
$panel->setHeader(pht('README'));
$panel->setNoBackground();
$panel->appendChild($box);
$content[] = $panel;
}
}
$nav = $this->buildSideNav('browse', false);
@ -107,6 +114,8 @@ final class DiffusionBrowseController extends DiffusionController {
return $this->buildApplicationPage(
$nav,
array(
'device' => true,
'dust' => true,
'title' => array(
nonempty(basename($drequest->getPath()), '/'),
$drequest->getRepository()->getCallsign().' Repository',
@ -119,7 +128,8 @@ final class DiffusionBrowseController extends DiffusionController {
$drequest = $this->getDiffusionRequest();
$form = id(new AphrontFormView())
->setUser($this->getRequest()->getUser())
->setMethod('GET');
->setMethod('GET')
->setNoShading(true);
switch ($drequest->getRepository()->getVersionControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
@ -140,7 +150,10 @@ final class DiffusionBrowseController extends DiffusionController {
break;
}
return $form;
$filter = new AphrontListFilterView();
$filter->appendChild($form);
return $filter;
}
private function renderSearchResults() {

View file

@ -84,17 +84,17 @@ final class DiffusionBrowseFileController extends DiffusionController {
if ($follow) {
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$notice->setTitle('Unable to Continue');
$notice->setTitle(pht('Unable to Continue'));
switch ($follow) {
case 'first':
$notice->appendChild(
"Unable to continue tracing the history of this file because ".
"this commit is the first commit in the repository.");
pht("Unable to continue tracing the history of this file because ".
"this commit is the first commit in the repository."));
break;
case 'created':
$notice->appendChild(
"Unable to continue tracing the history of this file because ".
"this commit created the file.");
pht("Unable to continue tracing the history of this file because ".
"this commit created the file."));
break;
}
$content[] = $notice;
@ -104,10 +104,10 @@ final class DiffusionBrowseFileController extends DiffusionController {
if ($renamed) {
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$notice->setTitle('File Renamed');
$notice->setTitle(pht('File Renamed'));
$notice->appendChild(
"File history passes through a rename from '".$drequest->getPath().
"' to '".$renamed."'.");
pht("File history passes through a rename from '%s' to '%s'.",
$drequest->getPath(), $renamed));
$content[] = $notice;
}
@ -647,7 +647,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
if ($revision_id) {
$revision = idx($revisions, $revision_id);
if (!$revision) {
$tooltip = '(Invalid revision)';
$tooltip = pht('(Invalid revision)');
} else {
$tooltip =
phabricator_date($revision->getDateModified(), $user).
@ -675,7 +675,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
'href' => $uri->setQueryParam('view', 'blame'),
'sigil' => 'has-tooltip',
'meta' => array(
'tip' => 'Skip Past This Commit',
'tip' => pht('Skip Past This Commit'),
'align' => 'E',
'size' => 300,
),

View file

@ -66,7 +66,9 @@ final class DiffusionChangeController extends DiffusionController {
return $this->buildApplicationPage(
$nav,
array(
'title' => 'Change',
'title' => pht('Change'),
'device' => true,
'dust' => true,
));
}

View file

@ -38,10 +38,10 @@ final class DiffusionCommitController extends DiffusionController {
}
return $this->buildStandardPageResponse(
id(new AphrontErrorView())
->setTitle('Error displaying commit.')
->appendChild('Failed to load the commit because the commit has not '.
'been parsed yet.'),
array('title' => 'Commit Still Parsing'));
->setTitle(pht('Error displaying commit.'))
->appendChild(pht('Failed to load the commit because the commit has '.
'not been parsed yet.')),
array('title' => pht('Commit Still Parsing')));
}
$commit_data = $drequest->loadCommitData();
@ -57,13 +57,13 @@ final class DiffusionCommitController extends DiffusionController {
$subpath = $commit_data->getCommitDetail('svn-subpath');
$error_panel = new AphrontErrorView();
$error_panel->setTitle('Commit Not Tracked');
$error_panel->setTitle(pht('Commit Not Tracked'));
$error_panel->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$error_panel->appendChild(
"This Diffusion repository is configured to track only one ".
pht("This Diffusion repository is configured to track only one ".
"subdirectory of the entire Subversion repository, and this commit ".
"didn't affect the tracked subdirectory ('".$subpath."'), so no ".
"information is available.");
"didn't affect the tracked subdirectory ('%s'), so no ".
"information is available.", $subpath));
$content[] = $error_panel;
$content[] = $top_anchor;
} else {
@ -169,7 +169,7 @@ final class DiffusionCommitController extends DiffusionController {
if ($bad_commit) {
$error_panel = new AphrontErrorView();
$error_panel->setTitle('Bad Commit');
$error_panel->setTitle(pht('Bad Commit'));
$error_panel->appendChild($bad_commit['description']);
$content[] = $error_panel;
@ -178,7 +178,7 @@ final class DiffusionCommitController extends DiffusionController {
} else if (!count($changes)) {
$no_changes = new AphrontErrorView();
$no_changes->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$no_changes->setTitle('Not Yet Parsed');
$no_changes->setTitle(pht('Not Yet Parsed'));
// TODO: This can also happen with weird SVN changes that don't do
// anything (or only alter properties?), although the real no-changes case
// is extremely rare and might be impossible to produce organically. We
@ -186,8 +186,8 @@ final class DiffusionCommitController extends DiffusionController {
// DB once we parse these changes so we can distinguish between
// "not parsed yet" and "no changes".
$no_changes->appendChild(
"This commit hasn't been fully parsed yet (or doesn't affect any ".
"paths).");
pht("This commit hasn't been fully parsed yet (or doesn't affect any ".
"paths)."));
$content[] = $no_changes;
} else if ($was_limited) {
$huge_commit = new AphrontErrorView();
@ -210,14 +210,14 @@ final class DiffusionCommitController extends DiffusionController {
'class' => 'button green',
'href' => '?show_all=true',
),
'Show All Changes');
pht('Show All Changes'));
$warning_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setTitle('Very Large Commit')
->appendChild(phutil_tag(
'p',
array(),
"This commit is very large. Load each file individually."));
pht("This commit is very large. Load each file individually.")));
$change_panel->appendChild($warning_view);
$change_panel->addButton($show_all_button);
@ -357,7 +357,7 @@ final class DiffusionCommitController extends DiffusionController {
return $this->buildApplicationPage(
$content,
array(
'title' => $commit_id
'title' => $commit_id,
));
}
@ -463,13 +463,13 @@ final class DiffusionCommitController extends DiffusionController {
array(
'id' => 'commit-branches',
),
'Unknown');
pht('Unknown'));
$props['Tags'] = phutil_tag(
'span',
array(
'id' => 'commit-tags',
),
'Unknown');
pht('Unknown'));
$callsign = $request->getRepository()->getCallsign();
$root = '/diffusion/'.$callsign.'/commit/'.$commit->getCommitIdentifier();
@ -525,8 +525,8 @@ final class DiffusionCommitController extends DiffusionController {
$this->highlightedAudits = $view->getHighlightedAudits();
$panel = new AphrontPanelView();
$panel->setHeader('Audits');
$panel->setCaption('Audits you are responsible for are highlighted.');
$panel->setHeader(pht('Audits'));
$panel->setCaption(pht('Audits you are responsible for are highlighted.'));
$panel->appendChild($view);
$panel->setNoBackground();
@ -617,13 +617,13 @@ final class DiffusionCommitController extends DiffusionController {
->addHiddenInput('commit', $commit->getPHID())
->appendChild(
id(new AphrontFormSelectControl())
->setLabel('Action')
->setLabel(pht('Action'))
->setName('action')
->setID('audit-action')
->setOptions($actions))
->appendChild(
id(new AphrontFormTokenizerControl())
->setLabel('Add Auditors')
->setLabel(pht('Add Auditors'))
->setName('auditors')
->setControlID('add-auditors')
->setControlStyle('display: none')
@ -631,7 +631,7 @@ final class DiffusionCommitController extends DiffusionController {
->setDisableBehavior(true))
->appendChild(
id(new AphrontFormTokenizerControl())
->setLabel('Add CCs')
->setLabel(pht('Add CCs'))
->setName('ccs')
->setControlID('add-ccs')
->setControlStyle('display: none')
@ -639,17 +639,18 @@ final class DiffusionCommitController extends DiffusionController {
->setDisableBehavior(true))
->appendChild(
id(new PhabricatorRemarkupControl())
->setLabel('Comments')
->setLabel(pht('Comments'))
->setName('content')
->setValue($draft)
->setID('audit-content')
->setUser($user))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue($is_serious ? 'Submit' : 'Cook the Books'));
->setValue($is_serious ? pht('Submit') : pht('Cook the Books')));
$panel = new AphrontPanelView();
$panel->setHeader($is_serious ? 'Audit Commit' : 'Creative Accounting');
$panel->setHeader(
$is_serious ? pht('Audit Commit') : pht('Creative Accounting'));
$panel->appendChild($form);
$panel->addClass('aphront-panel-accent');
$panel->addClass('aphront-panel-flush');
@ -665,14 +666,14 @@ final class DiffusionCommitController extends DiffusionController {
'src' => '/typeahead/common/users/',
'row' => 'add-auditors',
'ondemand' => PhabricatorEnv::getEnvConfig('tokenizer.ondemand'),
'placeholder' => 'Type a user name...',
'placeholder' => pht('Type a user name...'),
),
'add-ccs-tokenizer' => array(
'actions' => array('add_ccs' => 1),
'src' => '/typeahead/common/mailable/',
'row' => 'add-ccs',
'ondemand' => PhabricatorEnv::getEnvConfig('tokenizer.ondemand'),
'placeholder' => 'Type a user or mailing list...',
'placeholder' => pht('Type a user or mailing list...'),
),
),
'select' => 'audit-action',
@ -833,7 +834,7 @@ final class DiffusionCommitController extends DiffusionController {
$history_table->setHandles($handles);
$panel = new AphrontPanelView();
$panel->setHeader('Merged Changes');
$panel->setHeader(pht('Merged Changes'));
$panel->setCaption($caption);
$panel->appendChild($history_table);
$panel->setNoBackground();
@ -857,7 +858,7 @@ final class DiffusionCommitController extends DiffusionController {
$commit->getCommitIdentifier().'/edit/';
$action = id(new PhabricatorActionView())
->setName('Edit Commit')
->setName(pht('Edit Commit'))
->setHref($uri)
->setIcon('edit');
$actions->addAction($action);
@ -868,7 +869,7 @@ final class DiffusionCommitController extends DiffusionController {
$maniphest = 'PhabricatorApplicationManiphest';
if (PhabricatorApplication::isClassInstalled($maniphest)) {
$action = id(new PhabricatorActionView())
->setName('Edit Maniphest Tasks')
->setName(pht('Edit Maniphest Tasks'))
->setIcon('attach')
->setHref('/search/attach/'.$commit->getPHID().'/TASK/edge/')
->setWorkflow(true);
@ -877,21 +878,21 @@ final class DiffusionCommitController extends DiffusionController {
if ($user->getIsAdmin()) {
$action = id(new PhabricatorActionView())
->setName('MetaMTA Transcripts')
->setName(pht('MetaMTA Transcripts'))
->setIcon('file')
->setHref('/mail/?phid='.$commit->getPHID());
$actions->addAction($action);
}
$action = id(new PhabricatorActionView())
->setName('Herald Transcripts')
->setName(pht('Herald Transcripts'))
->setIcon('file')
->setHref('/herald/transcript/?phid='.$commit->getPHID())
->setWorkflow(true);
$actions->addAction($action);
$action = id(new PhabricatorActionView())
->setName('Download Raw Diff')
->setName(pht('Download Raw Diff'))
->setHref($request->getRequestURI()->alter('diff', true))
->setIcon('download');
$actions->addAction($action);

View file

@ -14,7 +14,7 @@ final class DiffusionCommitEditController extends DiffusionController {
$callsign = $drequest->getRepository()->getCallsign();
$repository = $drequest->getRepository();
$commit = $drequest->loadCommit();
$page_title = 'Edit Diffusion Commit';
$page_title = pht('Edit Diffusion Commit');
if (!$commit) {
return new Aphront404Response();
@ -54,9 +54,10 @@ final class DiffusionCommitEditController extends DiffusionController {
$form = id(new AphrontFormView())
->setUser($user)
->setAction($request->getRequestURI()->getPath())
->setFlexible(true)
->appendChild(
id(new AphrontFormTokenizerControl())
->setLabel('Projects')
->setLabel(pht('Projects'))
->setName('projects')
->setValue($proj_t_values)
->setID($tokenizer_id)
@ -76,19 +77,22 @@ final class DiffusionCommitEditController extends DiffusionController {
));
$submit = id(new AphrontFormSubmitControl())
->setValue('Save')
->setValue(pht('Save'))
->addCancelButton('/r'.$callsign.$commit->getCommitIdentifier());
$form->appendChild($submit);
$panel = id(new AphrontPanelView())
->setHeader('Edit Diffusion Commit')
->appendChild($form)
->setWidth(AphrontPanelView::WIDTH_FORM);
$header = new PhabricatorHeaderView();
$header->setHeader(pht('Edit Diffusion Commit'));
return $this->buildStandardPageResponse(
$panel,
return $this->buildApplicationPage(
array(
$header,
$form,
),
array(
'title' => $page_title,
'device' => true,
'dust' => true,
));
}

View file

@ -50,10 +50,10 @@ final class DiffusionCommitTagsController extends DiffusionController {
'action' => 'tags',
)),
),
"More tags\xE2\x80\xA6");
pht("More Tags\xE2\x80\xA6"));
}
return id(new AphrontAjaxResponse())
->setContent($tag_links ? implode(', ', $tag_links) : 'None');
->setContent($tag_links ? implode(', ', $tag_links) : pht('None'));
}
}

View file

@ -29,7 +29,7 @@ abstract class DiffusionController extends PhabricatorController {
$page = $this->buildStandardPageView();
$page->setApplicationName('Diffusion');
$page->setApplicationName(pht('Diffusion'));
$page->setBaseURI('/diffusion/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x89\x88");
@ -46,9 +46,9 @@ abstract class DiffusionController extends PhabricatorController {
$nav->setBaseURI(new PhutilURI(''));
$navs = array(
'history' => 'History View',
'browse' => 'Browse View',
'change' => 'Change View',
'history' => pht('History View'),
'browse' => pht('Browse View'),
'change' => pht('Change View'),
);
if (!$has_change_view) {
@ -59,7 +59,7 @@ abstract class DiffusionController extends PhabricatorController {
$branch = $drequest->loadBranch();
if ($branch && $branch->getLintCommit()) {
$navs['lint'] = 'Lint View';
$navs['lint'] = pht('Lint View');
}
$selected_href = null;
@ -80,7 +80,7 @@ abstract class DiffusionController extends PhabricatorController {
$nav->addFilter(
'',
"Search Owners \xE2\x86\x97",
pht("Search Owners \xE2\x86\x97"),
'/owners/view/search/'.
'?repository='.phutil_escape_uri($drequest->getCallsign()).
'&path='.phutil_escape_uri('/'.$drequest->getPath()));
@ -190,14 +190,14 @@ abstract class DiffusionController extends PhabricatorController {
$crumb = new PhabricatorCrumbView();
if ($spec['commit']) {
$crumb->setName(
"Tags for r{$callsign}{$raw_commit}");
pht("Tags for %s", 'r'.$callsign.$raw_commit));
$crumb->setHref($drequest->generateURI(
array(
'action' => 'commit',
'commit' => $raw_commit,
)));
} else {
$crumb->setName('Tags');
$crumb->setName(pht('Tags'));
}
$crumb_list[] = $crumb;
return $crumb_list;
@ -205,7 +205,7 @@ abstract class DiffusionController extends PhabricatorController {
if ($spec['branches']) {
$crumb = id(new PhabricatorCrumbView())
->setName('Branches');
->setName(pht('Branches'));
$crumb_list[] = $crumb;
return $crumb_list;
}
@ -236,16 +236,16 @@ abstract class DiffusionController extends PhabricatorController {
switch ($view) {
case 'history':
$view_name = 'History';
$view_name = pht('History');
break;
case 'browse':
$view_name = 'Browse';
$view_name = pht('Browse');
break;
case 'lint':
$view_name = 'Lint';
$view_name = pht('Lint');
break;
case 'change':
$view_name = 'Change';
$view_name = pht('Change');
$crumb_list[] = $crumb->setName(
hsprintf('%s (%s)', $path, $commit_link));
return $crumb_list;
@ -305,7 +305,7 @@ abstract class DiffusionController extends PhabricatorController {
'commit' => '',
) + $uri_params),
),
'Jump to HEAD');
pht('Jump to HEAD'));
$name = $last_crumb->getName();
$name = hsprintf('%s @ %s (%s)', $name, $commit_link, $jump_link);

View file

@ -65,14 +65,14 @@ final class DiffusionExternalController extends DiffusionController {
$desc .= $id;
$content = id(new AphrontErrorView())
->setTitle('Unknown External')
->setTitle(pht('Unknown External'))
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->appendChild(phutil_tag(
'p',
array(),
"This external ({$desc}) does not appear in any tracked ".
pht("This external (%s) does not appear in any tracked ".
"repository. It may exist in an untracked repository that ".
"Diffusion does not know about."));
"Diffusion does not know about.", $desc)));
} else if (count($commits) == 1) {
$commit = head($commits);
$repo = $repositories[$commit->getRepositoryID()];
@ -110,8 +110,8 @@ final class DiffusionExternalController extends DiffusionController {
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
'Commit',
'Description',
pht('Commit'),
pht('Description'),
));
$table->setColumnClasses(
array(
@ -120,16 +120,18 @@ final class DiffusionExternalController extends DiffusionController {
));
$content = new AphrontPanelView();
$content->setHeader('Multiple Matching Commits');
$content->setHeader(pht('Multiple Matching Commits'));
$content->setCaption(
'This external reference matches multiple known commits.');
pht('This external reference matches multiple known commits.'));
$content->appendChild($table);
}
return $this->buildStandardPageResponse(
return $this->buildApplicationPage(
$content,
array(
'title' => 'Unresolvable External',
'title' => pht('Unresolvable External'),
'device' => true,
'dust' => true,
));
}

View file

@ -40,10 +40,10 @@ final class DiffusionHistoryController extends DiffusionController {
$content = array();
if ($request->getBool('copies')) {
$button_title = 'Hide Copies/Branches';
$button_title = pht('Hide Copies/Branches');
$copies_new = null;
} else {
$button_title = 'Show Copies/Branches';
$button_title = pht('Show Copies/Branches');
$copies_new = true;
}
@ -71,7 +71,7 @@ final class DiffusionHistoryController extends DiffusionController {
}
$history_panel = new AphrontPanelView();
$history_panel->setHeader('History');
$history_panel->setHeader(pht('History'));
$history_panel->addButton($button);
$history_panel->appendChild($history_table);
$history_panel->appendChild($pager);
@ -95,6 +95,8 @@ final class DiffusionHistoryController extends DiffusionController {
return $this->buildApplicationPage(
$nav,
array(
'device' => true,
'dust' => true,
'title' => array(
pht('History'),
pht('%s Repository', $drequest->getRepository()->getCallsign()),

View file

@ -13,31 +13,28 @@ final class DiffusionHomeController extends DiffusionController {
$rows = array();
foreach ($shortcuts as $shortcut) {
$rows[] = array(
phutil_tag(
'a',
array(
'href' => $shortcut->getHref(),
),
$shortcut->getName()),
$shortcut->getName(),
$shortcut->getHref(),
$shortcut->getDescription(),
);
}
$shortcut_table = new AphrontTableView($rows);
$shortcut_table->setHeaders(
array(
'Link',
'',
));
$shortcut_table->setColumnClasses(
array(
'pri',
'wide',
));
$list = new PhabricatorObjectItemListView();
$list->setCards(true);
$list->setFlush(true);
foreach ($rows as $row) {
$item = id(new PhabricatorObjectItemView())
->setHeader($row[0])
->setHref($row[1])
->setSubhead(($row[2] ? $row[2] : pht('No Description')));
$list->addItem($item);
}
$shortcut_panel = id(new AphrontPanelView())
->setNoBackground(true)
->setHeader(pht('Shortcuts'))
->appendChild($list);
$shortcut_panel = new AphrontPanelView();
$shortcut_panel->setHeader('Shortcuts');
$shortcut_panel->appendChild($shortcut_table);
} else {
$shortcut_panel = null;
}
@ -97,7 +94,7 @@ final class DiffusionHomeController extends DiffusionController {
'callsign' => $repository->getCallsign(),
'action' => 'history',
)),
number_format($size));
pht('%d Commits', number_format($size)));
}
$lint_count = '';
@ -113,23 +110,19 @@ final class DiffusionHomeController extends DiffusionController {
'action' => 'lint',
)),
),
number_format($lint_branches[$branch]));
pht('%d Lint Messages', number_format($lint_branches[$branch])));
}
$date = '-';
$time = '-';
$datetime = '';
if ($commit) {
$date = phabricator_date($commit->getEpoch(), $user);
$time = phabricator_time($commit->getEpoch(), $user);
$datetime = $date.' '.$time;
}
$rows[] = array(
phutil_tag(
'a',
array(
'href' => '/diffusion/'.$repository->getCallsign().'/',
),
$repository->getName()),
$repository->getName(),
('/diffusion/'.$repository->getCallsign().'/'),
PhabricatorRepositoryType::getNameForRepositoryType(
$repository->getVersionControlSystem()),
$size,
@ -139,9 +132,8 @@ final class DiffusionHomeController extends DiffusionController {
$repository,
$commit->getCommitIdentifier(),
$commit->getSummary())
: '-',
$date,
$time,
: pht('No Commits'),
$datetime
);
}
@ -170,43 +162,28 @@ final class DiffusionHomeController extends DiffusionController {
$repository_tool));
}
$table = new AphrontTableView($rows);
$table->setNoDataString($no_repositories_txt);
$table->setHeaders(
array(
'Repository',
'VCS',
'Commits',
'Lint',
'Last',
'Date',
'Time',
));
$table->setColumnClasses(
array(
'pri',
'',
'n',
'n',
'wide',
'',
'right',
));
$table->setColumnVisibility(
array(
true,
true,
true,
$show_lint,
true,
true,
true,
));
$list = new PhabricatorObjectItemListView();
$list->setCards(true);
$list->setFlush(true);
foreach ($rows as $row) {
$item = id(new PhabricatorObjectItemView())
->setHeader($row[0])
->setSubHead($row[5])
->setHref($row[1])
->addAttribute(($row[2] ? $row[2] : pht('No Information')))
->addAttribute(($row[3] ? $row[3] : pht('0 Commits')))
->addIcon('none', $row[6]);
if ($show_lint) {
$item->addAttribute($row[4]);
}
$list->addItem($item);
}
$list = id(new AphrontPanelView())
->setNoBackground(true)
->setHeader(pht('Repositories'))
->appendChild($list);
$panel = new AphrontPanelView();
$panel->setHeader('Browse Repositories');
$panel->appendChild($table);
$panel->setNoBackground();
$crumbs = $this->buildCrumbs();
$crumbs->addCrumb(
@ -214,14 +191,16 @@ final class DiffusionHomeController extends DiffusionController {
->setName(pht('All Repositories'))
->setHref($this->getApplicationURI()));
return $this->buildStandardPageResponse(
return $this->buildApplicationPage(
array(
$crumbs,
$shortcut_panel,
$panel,
$list,
),
array(
'title' => 'Diffusion',
'title' => pht('Diffusion'),
'device' => true,
'dust' => true,
));
}

View file

@ -80,13 +80,13 @@ final class DiffusionLintController extends DiffusionController {
$table = id(new AphrontTableView($rows))
->setHeaders(array(
'Problems',
'Files',
'Repository',
'Severity',
'Code',
'Name',
'Example',
pht('Problems'),
pht('Files'),
pht('Repository'),
pht('Severity'),
pht('Code'),
pht('Name'),
pht('Example'),
))
->setColumnVisibility(array(true, true, !$this->diffusionRequest))
->setColumnClasses(array('n', 'n', '', '', 'pri', '', ''));
@ -112,7 +112,7 @@ final class DiffusionLintController extends DiffusionController {
->setDatasource('/typeahead/common/users/')
->setLimit(1)
->setName('owner')
->setLabel('Owner')
->setLabel(pht('Owner'))
->setValue($owners))
->appendChild(
id(new AphrontFormSubmitControl())
@ -143,7 +143,11 @@ final class DiffusionLintController extends DiffusionController {
return $this->buildApplicationPage(
$content,
array('title' => $title));
array(
'title' => $title,
'device' => true,
'dust' => true,
));
}
private function loadLintCodes(array $owner_phids) {

View file

@ -50,12 +50,12 @@ final class DiffusionLintDetailsController extends DiffusionController {
$table = id(new AphrontTableView($rows))
->setHeaders(array(
'Path',
'Line',
'Author',
'Severity',
'Name',
'Description',
pht('Path'),
pht('Line'),
pht('Author'),
pht('Severity'),
pht('Name'),
pht('Description'),
))
->setColumnClasses(array('', 'n'))
->setColumnVisibility(array($is_dir));
@ -97,9 +97,13 @@ final class DiffusionLintDetailsController extends DiffusionController {
return $this->buildApplicationPage(
$nav,
array('title' => array(
'Lint',
$drequest->getRepository()->getCallsign(),
array(
'device' => true,
'dust' => true,
'title' =>
array(
pht('Lint'),
$drequest->getRepository()->getCallsign(),
)));
}

View file

@ -55,12 +55,12 @@ final class DiffusionPathValidateController extends DiffusionController {
if (!$valid) {
$branch = $drequest->getBranch();
if ($branch) {
$message = 'Not found in '.$branch;
$message = pht('Not found in %s', $branch);
} else {
$message = 'Not found at HEAD';
$message = pht('Not found at HEAD');
}
} else {
$message = 'OK';
$message = pht('OK');
}
$output['message'] = $message;

View file

@ -75,10 +75,10 @@ final class DiffusionRepositoryController extends DiffusionController {
'action' => 'history',
)),
),
'View Full Commit History');
pht('View Full Commit History'));
$panel = new AphrontPanelView();
$panel->setHeader(hsprintf("Recent Commits · %s", $all));
$panel->setHeader(pht("Recent Commits · %s", $all));
$panel->appendChild($history_table);
$panel->setNoBackground();
@ -95,7 +95,7 @@ final class DiffusionRepositoryController extends DiffusionController {
$browse_panel->setHeader(phutil_tag(
'a',
array('href' => $drequest->generateURI(array('action' => 'browse'))),
'Browse Repository'));
pht('Browse Repository')));
$browse_panel->appendChild($browse_table);
$browse_panel->setNoBackground();
@ -107,16 +107,24 @@ final class DiffusionRepositoryController extends DiffusionController {
$readme = $browse_results->getReadmeContent();
if ($readme) {
$box = new PHUIBoxView();
$box->setShadow(true);
$box->appendChild($readme);
$box->addPadding(PHUI::PADDING_LARGE);
$panel = new AphrontPanelView();
$panel->setHeader('README');
$panel->appendChild($readme);
$panel->setHeader(pht('README'));
$panel->setNoBackground();
$panel->appendChild($box);
$content[] = $panel;
}
return $this->buildStandardPageResponse(
return $this->buildApplicationPage(
$content,
array(
'title' => $drequest->getRepository()->getName(),
'dust' => true,
'device' => true,
));
}
@ -149,7 +157,7 @@ final class DiffusionRepositoryController extends DiffusionController {
));
$panel = new AphrontPanelView();
$panel->setHeader('Repository Properties');
$panel->setHeader(pht('Repository Properties'));
$panel->appendChild($table);
$panel->setNoBackground();
@ -187,11 +195,11 @@ final class DiffusionRepositoryController extends DiffusionController {
$table->setUser($this->getRequest()->getUser());
$panel = new AphrontPanelView();
$panel->setHeader('Branches');
$panel->setHeader(pht('Branches'));
$panel->setNoBackground();
if ($more_branches) {
$panel->setCaption('Showing ' . $limit . ' branches.');
$panel->setCaption(pht('Showing %d branches.', $limit));
}
$panel->addButton(
@ -204,7 +212,7 @@ final class DiffusionRepositoryController extends DiffusionController {
)),
'class' => 'grey button',
),
"Show All Branches \xC2\xBB"));
pht("Show All Branches \xC2\xBB")));
$panel->appendChild($table);
@ -253,10 +261,10 @@ final class DiffusionRepositoryController extends DiffusionController {
$view->setHandles($handles);
$panel = new AphrontPanelView();
$panel->setHeader('Tags');
$panel->setHeader(pht('Tags'));
if ($more_tags) {
$panel->setCaption('Showing the '.$tag_limit.' most recent tags.');
$panel->setCaption(pht('Showing the %d most recent tags.', $tag_limit));
}
$panel->addButton(
@ -269,7 +277,7 @@ final class DiffusionRepositoryController extends DiffusionController {
)),
'class' => 'grey button',
),
"Show All Tags \xC2\xBB"));
pht("Show All Tags \xC2\xBB")));
$panel->appendChild($view);
return $panel;

View file

@ -119,12 +119,12 @@ final class DiffusionSymbolController extends DiffusionController {
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
'Type',
'Context',
'Name',
'Language',
'Project',
'File',
pht('Type'),
pht('Context'),
pht('Name'),
pht('Language'),
pht('Project'),
pht('File'),
));
$table->setColumnClasses(
array(
@ -136,18 +136,20 @@ final class DiffusionSymbolController extends DiffusionController {
'',
));
$table->setNoDataString(
"No matching symbol could be found in any indexed project.");
pht("No matching symbol could be found in any indexed project."));
$panel = new AphrontPanelView();
$panel->setHeader('Similar Symbols');
$panel->setHeader(pht('Similar Symbols'));
$panel->appendChild($table);
return $this->buildStandardPageResponse(
return $this->buildApplicationPage(
array(
$panel,
),
array(
'title' => 'Find Symbol',
'title' => pht('Find Symbol'),
'device' => true,
'dust' => true,
));
}

View file

@ -39,11 +39,11 @@ final class DiffusionTagListController extends DiffusionController {
$content = null;
if (!$tags) {
$content = new AphrontErrorView();
$content->setTitle('No Tags');
$content->setTitle(pht('No Tags'));
if ($is_commit) {
$content->appendChild('This commit has no tags.');
$content->appendChild(pht('This commit has no tags.'));
} else {
$content->appendChild('This repository has no tags.');
$content->appendChild(pht('This repository has no tags.'));
}
$content->setSeverity(AphrontErrorView::SEVERITY_NODATA);
} else {
@ -65,7 +65,7 @@ final class DiffusionTagListController extends DiffusionController {
$view->setHandles($handles);
$panel = id(new AphrontPanelView())
->setHeader('Tags')
->setHeader(pht('Tags'))
->appendChild($view)
->appendChild($pager);

View file

@ -45,7 +45,7 @@ final class DiffusionBranchTableView extends DiffusionView {
'branch' => $branch->getName(),
))
),
'History'),
pht('History')),
phutil_tag(
'a',
array(
@ -73,11 +73,11 @@ final class DiffusionBranchTableView extends DiffusionView {
$view = new AphrontTableView($rows);
$view->setHeaders(
array(
'History',
'Branch',
'Head',
'Modified',
'Details',
pht('History'),
pht('Branch'),
pht('Head'),
pht('Modified'),
pht('Details'),
));
$view->setColumnClasses(
array(

View file

@ -200,7 +200,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
array(
'href' => $editor_link,
),
'Edit');
pht('Edit'));
}
}
@ -228,15 +228,15 @@ final class DiffusionBrowseTableView extends DiffusionView {
$view = new AphrontTableView($rows);
$view->setHeaders(
array(
'History',
'Edit',
'Path',
($lint ? $lint : 'Lint'),
'Modified',
'Date',
'Time',
'Author/Committer',
'Details',
pht('History'),
pht('Edit'),
pht('Path'),
($lint ? $lint : pht('Lint')),
pht('Modified'),
pht('Date'),
pht('Time'),
pht('Author/Committer'),
pht('Details'),
));
$view->setColumnClasses(
array(

View file

@ -114,10 +114,10 @@ final class DiffusionCommentView extends AphrontView {
$actions = array();
if ($action == PhabricatorAuditActionConstants::ADD_CCS) {
$rendered_ccs = $this->renderHandleList($added_ccs);
$actions[] = hsprintf("%s added CCs: %s.", $author_link, $rendered_ccs);
$actions[] = pht("%s added CCs: %s.", $author_link, $rendered_ccs);
} else if ($action == PhabricatorAuditActionConstants::ADD_AUDITORS) {
$rendered_auditors = $this->renderHandleList($added_auditors);
$actions[] = hsprintf(
$actions[] = pht(
"%s added auditors: %s.",
$author_link,
$rendered_auditors);

View file

@ -82,10 +82,10 @@ final class DiffusionCommitChangeTableView extends DiffusionView {
$view = new AphrontTableView($rows);
$view->setHeaders(
array(
'History',
'Browse',
'Change',
'Path',
pht('History'),
pht('Browse'),
pht('Change'),
pht('Path'),
));
$view->setColumnClasses(
array(
@ -95,7 +95,7 @@ final class DiffusionCommitChangeTableView extends DiffusionView {
'wide',
));
$view->setRowClasses($rowc);
$view->setNoDataString('This change has not been fully parsed yet.');
$view->setNoDataString(pht('This change has not been fully parsed yet.'));
return $view->render();
}

View file

@ -29,15 +29,15 @@ final class DiffusionEmptyResultView extends DiffusionView {
$reason = $this->browseResultSet->getReasonForEmptyResultSet();
switch ($reason) {
case DiffusionBrowseResultSet::REASON_IS_NONEXISTENT:
$title = 'Path Does Not Exist';
$title = pht('Path Does Not Exist');
// TODO: Under git, this error message should be more specific. It
// may exist on some other branch.
$body = "This path does not exist anywhere.";
$body = pht("This path does not exist anywhere.");
$severity = AphrontErrorView::SEVERITY_ERROR;
break;
case DiffusionBrowseResultSet::REASON_IS_EMPTY:
$title = 'Empty Directory';
$body = "This path was an empty directory at {$commit}.\n";
$title = pht('Empty Directory');
$body = pht("This path was an empty directory at %s.\n", $commit);
$severity = AphrontErrorView::SEVERITY_NOTICE;
break;
case DiffusionBrowseResultSet::REASON_IS_DELETED:
@ -52,8 +52,8 @@ final class DiffusionEmptyResultView extends DiffusionView {
'params' => array('view' => $this->view),
));
$title = 'Path Was Deleted';
$body = hsprintf(
$title = pht('Path Was Deleted');
$body = pht(
"This path does not exist at %s. It was deleted in %s and last %s ".
"at %s.",
$commit,
@ -64,12 +64,12 @@ final class DiffusionEmptyResultView extends DiffusionView {
break;
case DiffusionBrowseResultSet::REASON_IS_UNTRACKED_PARENT:
$subdir = $drequest->getRepository()->getDetail('svn-subpath');
$title = 'Directory Not Tracked';
$title = pht('Directory Not Tracked');
$body =
"This repository is configured to track only one subdirectory ".
"of the entire repository ('{$subdir}'), ".
pht("This repository is configured to track only one subdirectory ".
"of the entire repository ('%s'), ".
"but you aren't looking at something in that subdirectory, so no ".
"information is available.";
"information is available.", $subdir);
$severity = AphrontErrorView::SEVERITY_WARNING;
break;
default:

View file

@ -146,15 +146,15 @@ final class DiffusionHistoryTableView extends DiffusionView {
$view = new AphrontTableView($rows);
$view->setHeaders(
array(
'Browse',
pht('Browse'),
'',
'Commit',
'Revision',
'Change',
'Date',
'Time',
'Author/Committer',
'Details',
pht('Commit'),
pht('Revision'),
pht('Change'),
pht('Date'),
pht('Time'),
pht('Author/Committer'),
pht('Details'),
));
$view->setColumnClasses(
array(

View file

@ -92,11 +92,11 @@ final class DiffusionTagListView extends DiffusionView {
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
'Tag',
'Commit',
'Description',
'Author',
'Created',
pht('Tag'),
pht('Commit'),
pht('Description'),
pht('Author'),
pht('Created'),
));
$table->setColumnClasses(
array(

View file

@ -52,7 +52,7 @@ abstract class DiffusionView extends AphrontView {
array(
'href' => $href,
),
'History');
pht('History'));
}
final public function linkBrowse($path, array $details = array()) {
@ -66,7 +66,7 @@ abstract class DiffusionView extends AphrontView {
if (isset($details['text'])) {
$text = $details['text'];
} else {
$text = 'Browse';
$text = pht('Browse');
}
return phutil_tag(

View file

@ -26,13 +26,14 @@
}
.aphront-panel-view .aphront-panel-header {
margin: 0 0 1em 0;
margin: 0 0 8px 0;
}
.aphront-panel-view h1 {
font-size: 16px;
font-weight: bold;
color: #555;
text-shadow: 0 1px 1px #fff;
padding: 4px 0 0 0;
}