mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Simplify Diffusion main view
Summary: Currently, Diffusion has very complex views. After three years I'm not really used to them and rarely use many of these options. Simplify the browse and history views: - Put the browse view on top. - Move dates to the right. - Remove "History" and "Edit" links from the browse view. You can access these actions by clicking the file/path. - Remove "Browse" link from the history view. You can access this action by clicking the commit. - Remove "Change Type", which is essentially never useful, from the history view. - Add some tweaks for mobile. Test Plan: {F153931} Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley, zeeg Differential Revision: https://secure.phabricator.com/D9085
This commit is contained in:
parent
91eb751d6f
commit
77b4c3145a
5 changed files with 47 additions and 65 deletions
|
@ -7,7 +7,7 @@
|
||||||
return array(
|
return array(
|
||||||
'names' =>
|
'names' =>
|
||||||
array(
|
array(
|
||||||
'core.pkg.css' => 'c3e794ca',
|
'core.pkg.css' => 'd52dea33',
|
||||||
'core.pkg.js' => 'b2ed04a2',
|
'core.pkg.js' => 'b2ed04a2',
|
||||||
'darkconsole.pkg.js' => 'ca8671ce',
|
'darkconsole.pkg.js' => 'ca8671ce',
|
||||||
'differential.pkg.css' => '4b8686e3',
|
'differential.pkg.css' => '4b8686e3',
|
||||||
|
@ -30,7 +30,7 @@ return array(
|
||||||
'rsrc/css/aphront/panel-view.css' => '5846dfa2',
|
'rsrc/css/aphront/panel-view.css' => '5846dfa2',
|
||||||
'rsrc/css/aphront/phabricator-nav-view.css' => '80e60fc1',
|
'rsrc/css/aphront/phabricator-nav-view.css' => '80e60fc1',
|
||||||
'rsrc/css/aphront/request-failure-view.css' => 'da14df31',
|
'rsrc/css/aphront/request-failure-view.css' => 'da14df31',
|
||||||
'rsrc/css/aphront/table-view.css' => 'de599000',
|
'rsrc/css/aphront/table-view.css' => '52becc92',
|
||||||
'rsrc/css/aphront/tokenizer.css' => '36903077',
|
'rsrc/css/aphront/tokenizer.css' => '36903077',
|
||||||
'rsrc/css/aphront/tooltip.css' => '9c90229d',
|
'rsrc/css/aphront/tooltip.css' => '9c90229d',
|
||||||
'rsrc/css/aphront/transaction.css' => 'ce491938',
|
'rsrc/css/aphront/transaction.css' => 'ce491938',
|
||||||
|
@ -498,7 +498,7 @@ return array(
|
||||||
'aphront-pager-view-css' => '2e3539af',
|
'aphront-pager-view-css' => '2e3539af',
|
||||||
'aphront-panel-view-css' => '5846dfa2',
|
'aphront-panel-view-css' => '5846dfa2',
|
||||||
'aphront-request-failure-view-css' => 'da14df31',
|
'aphront-request-failure-view-css' => 'da14df31',
|
||||||
'aphront-table-view-css' => 'de599000',
|
'aphront-table-view-css' => '52becc92',
|
||||||
'aphront-tokenizer-control-css' => '36903077',
|
'aphront-tokenizer-control-css' => '36903077',
|
||||||
'aphront-tooltip-css' => '9c90229d',
|
'aphront-tooltip-css' => '9c90229d',
|
||||||
'aphront-two-column-view-css' => '16ab3ad2',
|
'aphront-two-column-view-css' => '16ab3ad2',
|
||||||
|
|
|
@ -89,18 +89,18 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||||
$readme = null;
|
$readme = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$content[] = $this->buildHistoryTable(
|
|
||||||
$history_results,
|
|
||||||
$history,
|
|
||||||
$history_exception,
|
|
||||||
$handles);
|
|
||||||
|
|
||||||
$content[] = $this->buildBrowseTable(
|
$content[] = $this->buildBrowseTable(
|
||||||
$browse_results,
|
$browse_results,
|
||||||
$browse_paths,
|
$browse_paths,
|
||||||
$browse_exception,
|
$browse_exception,
|
||||||
$handles);
|
$handles);
|
||||||
|
|
||||||
|
$content[] = $this->buildHistoryTable(
|
||||||
|
$history_results,
|
||||||
|
$history,
|
||||||
|
$history_exception,
|
||||||
|
$handles);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$content[] = $this->buildTagListTable($drequest);
|
$content[] = $this->buildTagListTable($drequest);
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
|
@ -161,7 +161,6 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||||
|
|
||||||
$view = id(new PHUIPropertyListView())
|
$view = id(new PHUIPropertyListView())
|
||||||
->setUser($user);
|
->setUser($user);
|
||||||
$view->addProperty(pht('Callsign'), $repository->getCallsign());
|
|
||||||
|
|
||||||
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
|
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
|
||||||
$repository->getPHID(),
|
$repository->getPHID(),
|
||||||
|
|
|
@ -76,33 +76,14 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
||||||
$dict[$k] = phutil_tag('span', array('id' => $uniq), '');
|
$dict[$k] = phutil_tag('span', array('id' => $uniq), '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$editor_button = '';
|
|
||||||
if ($this->user) {
|
|
||||||
$editor_link = $this->user->loadEditorLink(
|
|
||||||
$base_path.$path->getPath(),
|
|
||||||
1,
|
|
||||||
$request->getRepository()->getCallsign());
|
|
||||||
if ($editor_link) {
|
|
||||||
$show_edit = true;
|
|
||||||
$editor_button = phutil_tag(
|
|
||||||
'a',
|
|
||||||
array(
|
|
||||||
'href' => $editor_link,
|
|
||||||
),
|
|
||||||
pht('Edit'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
$this->linkHistory($base_path.$path->getPath().$dir_slash),
|
|
||||||
$editor_button,
|
|
||||||
$browse_link,
|
$browse_link,
|
||||||
idx($dict, 'lint'),
|
idx($dict, 'lint'),
|
||||||
$dict['commit'],
|
$dict['commit'],
|
||||||
$dict['date'],
|
|
||||||
$dict['time'],
|
|
||||||
$dict['author'],
|
$dict['author'],
|
||||||
$dict['details'],
|
$dict['details'],
|
||||||
|
$dict['date'],
|
||||||
|
$dict['time'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,32 +107,26 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
||||||
$view = new AphrontTableView($rows);
|
$view = new AphrontTableView($rows);
|
||||||
$view->setHeaders(
|
$view->setHeaders(
|
||||||
array(
|
array(
|
||||||
pht('History'),
|
|
||||||
pht('Edit'),
|
|
||||||
pht('Path'),
|
pht('Path'),
|
||||||
($lint ? $lint : pht('Lint')),
|
($lint ? $lint : pht('Lint')),
|
||||||
pht('Modified'),
|
pht('Modified'),
|
||||||
pht('Date'),
|
|
||||||
pht('Time'),
|
|
||||||
pht('Author/Committer'),
|
pht('Author/Committer'),
|
||||||
pht('Details'),
|
pht('Details'),
|
||||||
|
pht('Date'),
|
||||||
|
pht('Time'),
|
||||||
));
|
));
|
||||||
$view->setColumnClasses(
|
$view->setColumnClasses(
|
||||||
array(
|
array(
|
||||||
'',
|
'',
|
||||||
'',
|
'n',
|
||||||
'',
|
|
||||||
'n',
|
'n',
|
||||||
'',
|
'',
|
||||||
|
'wide',
|
||||||
'',
|
'',
|
||||||
'right',
|
'right',
|
||||||
'',
|
|
||||||
'wide',
|
|
||||||
));
|
));
|
||||||
$view->setColumnVisibility(
|
$view->setColumnVisibility(
|
||||||
array(
|
array(
|
||||||
true,
|
|
||||||
$show_edit,
|
|
||||||
true,
|
true,
|
||||||
$show_lint,
|
$show_lint,
|
||||||
true,
|
true,
|
||||||
|
@ -160,6 +135,19 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$view->setDeviceVisibility(
|
||||||
|
array(
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
return $view->render();
|
return $view->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,21 +118,13 @@ final class DiffusionHistoryTableView extends DiffusionView {
|
||||||
|
|
||||||
$commit = $history->getCommit();
|
$commit = $history->getCommit();
|
||||||
if ($commit && $commit->isPartiallyImported($partial_import) && $data) {
|
if ($commit && $commit->isPartiallyImported($partial_import) && $data) {
|
||||||
$change = $this->linkChange(
|
$summary = AphrontTableView::renderSingleDisplayLine(
|
||||||
$history->getChangeType(),
|
$history->getSummary());
|
||||||
$history->getFileType(),
|
|
||||||
$path = null,
|
|
||||||
$history->getCommitIdentifier());
|
|
||||||
} else {
|
} else {
|
||||||
$change = phutil_tag('em', array(), "Importing\xE2\x80\xA6");
|
$summary = phutil_tag('em', array(), "Importing\xE2\x80\xA6");
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
$this->linkBrowse(
|
|
||||||
$drequest->getPath(),
|
|
||||||
array(
|
|
||||||
'commit' => $history->getCommitIdentifier(),
|
|
||||||
)),
|
|
||||||
$graph ? $graph[$ii++] : null,
|
$graph ? $graph[$ii++] : null,
|
||||||
self::linkCommit(
|
self::linkCommit(
|
||||||
$drequest->getRepository(),
|
$drequest->getRepository(),
|
||||||
|
@ -140,45 +132,48 @@ final class DiffusionHistoryTableView extends DiffusionView {
|
||||||
($commit ?
|
($commit ?
|
||||||
self::linkRevision(idx($this->revisions, $commit->getPHID())) :
|
self::linkRevision(idx($this->revisions, $commit->getPHID())) :
|
||||||
null),
|
null),
|
||||||
$change,
|
$author,
|
||||||
|
$summary,
|
||||||
$date,
|
$date,
|
||||||
$time,
|
$time,
|
||||||
$author,
|
|
||||||
AphrontTableView::renderSingleDisplayLine($history->getSummary()),
|
|
||||||
// TODO: etc etc
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = new AphrontTableView($rows);
|
$view = new AphrontTableView($rows);
|
||||||
$view->setHeaders(
|
$view->setHeaders(
|
||||||
array(
|
array(
|
||||||
pht('Browse'),
|
|
||||||
'',
|
'',
|
||||||
pht('Commit'),
|
pht('Commit'),
|
||||||
pht('Revision'),
|
pht('Revision'),
|
||||||
pht('Change'),
|
|
||||||
pht('Date'),
|
|
||||||
pht('Time'),
|
|
||||||
pht('Author/Committer'),
|
pht('Author/Committer'),
|
||||||
pht('Details'),
|
pht('Details'),
|
||||||
|
pht('Date'),
|
||||||
|
pht('Time'),
|
||||||
));
|
));
|
||||||
$view->setColumnClasses(
|
$view->setColumnClasses(
|
||||||
array(
|
array(
|
||||||
'',
|
|
||||||
'threads',
|
'threads',
|
||||||
'n',
|
'n',
|
||||||
'n',
|
'n',
|
||||||
'',
|
'',
|
||||||
|
'wide',
|
||||||
'',
|
'',
|
||||||
'right',
|
'right',
|
||||||
'',
|
|
||||||
'wide',
|
|
||||||
));
|
));
|
||||||
$view->setColumnVisibility(
|
$view->setColumnVisibility(
|
||||||
array(
|
array(
|
||||||
true,
|
|
||||||
$graph ? true : false,
|
$graph ? true : false,
|
||||||
));
|
));
|
||||||
|
$view->setDeviceVisibility(
|
||||||
|
array(
|
||||||
|
$graph ? true : false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
));
|
||||||
return $view->render();
|
return $view->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,7 +220,7 @@ span.single-display-line-content {
|
||||||
.aphront-table-view td.threads {
|
.aphront-table-view td.threads {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
padding: 0;
|
padding: 0 0 0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aphront-table-view td.threads canvas {
|
.aphront-table-view td.threads canvas {
|
||||||
|
|
Loading…
Reference in a new issue