1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02: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:
epriestley 2014-05-12 19:57:12 -07:00
parent 91eb751d6f
commit 77b4c3145a
5 changed files with 47 additions and 65 deletions

View file

@ -7,7 +7,7 @@
return array(
'names' =>
array(
'core.pkg.css' => 'c3e794ca',
'core.pkg.css' => 'd52dea33',
'core.pkg.js' => 'b2ed04a2',
'darkconsole.pkg.js' => 'ca8671ce',
'differential.pkg.css' => '4b8686e3',
@ -30,7 +30,7 @@ return array(
'rsrc/css/aphront/panel-view.css' => '5846dfa2',
'rsrc/css/aphront/phabricator-nav-view.css' => '80e60fc1',
'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/tooltip.css' => '9c90229d',
'rsrc/css/aphront/transaction.css' => 'ce491938',
@ -498,7 +498,7 @@ return array(
'aphront-pager-view-css' => '2e3539af',
'aphront-panel-view-css' => '5846dfa2',
'aphront-request-failure-view-css' => 'da14df31',
'aphront-table-view-css' => 'de599000',
'aphront-table-view-css' => '52becc92',
'aphront-tokenizer-control-css' => '36903077',
'aphront-tooltip-css' => '9c90229d',
'aphront-two-column-view-css' => '16ab3ad2',

View file

@ -89,18 +89,18 @@ final class DiffusionRepositoryController extends DiffusionController {
$readme = null;
}
$content[] = $this->buildHistoryTable(
$history_results,
$history,
$history_exception,
$handles);
$content[] = $this->buildBrowseTable(
$browse_results,
$browse_paths,
$browse_exception,
$handles);
$content[] = $this->buildHistoryTable(
$history_results,
$history,
$history_exception,
$handles);
try {
$content[] = $this->buildTagListTable($drequest);
} catch (Exception $ex) {
@ -161,7 +161,6 @@ final class DiffusionRepositoryController extends DiffusionController {
$view = id(new PHUIPropertyListView())
->setUser($user);
$view->addProperty(pht('Callsign'), $repository->getCallsign());
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$repository->getPHID(),

View file

@ -76,33 +76,14 @@ final class DiffusionBrowseTableView extends DiffusionView {
$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(
$this->linkHistory($base_path.$path->getPath().$dir_slash),
$editor_button,
$browse_link,
idx($dict, 'lint'),
$dict['commit'],
$dict['date'],
$dict['time'],
$dict['author'],
$dict['details'],
$dict['date'],
$dict['time'],
);
}
@ -126,32 +107,26 @@ final class DiffusionBrowseTableView extends DiffusionView {
$view = new AphrontTableView($rows);
$view->setHeaders(
array(
pht('History'),
pht('Edit'),
pht('Path'),
($lint ? $lint : pht('Lint')),
pht('Modified'),
pht('Date'),
pht('Time'),
pht('Author/Committer'),
pht('Details'),
pht('Date'),
pht('Time'),
));
$view->setColumnClasses(
array(
'',
'',
'',
'n',
'n',
'',
'wide',
'',
'right',
'',
'wide',
));
$view->setColumnVisibility(
array(
true,
$show_edit,
true,
$show_lint,
true,
@ -160,6 +135,19 @@ final class DiffusionBrowseTableView extends DiffusionView {
true,
true,
));
$view->setDeviceVisibility(
array(
true,
false,
true,
false,
true,
false,
false,
));
return $view->render();
}

View file

@ -118,21 +118,13 @@ final class DiffusionHistoryTableView extends DiffusionView {
$commit = $history->getCommit();
if ($commit && $commit->isPartiallyImported($partial_import) && $data) {
$change = $this->linkChange(
$history->getChangeType(),
$history->getFileType(),
$path = null,
$history->getCommitIdentifier());
$summary = AphrontTableView::renderSingleDisplayLine(
$history->getSummary());
} else {
$change = phutil_tag('em', array(), "Importing\xE2\x80\xA6");
$summary = phutil_tag('em', array(), "Importing\xE2\x80\xA6");
}
$rows[] = array(
$this->linkBrowse(
$drequest->getPath(),
array(
'commit' => $history->getCommitIdentifier(),
)),
$graph ? $graph[$ii++] : null,
self::linkCommit(
$drequest->getRepository(),
@ -140,45 +132,48 @@ final class DiffusionHistoryTableView extends DiffusionView {
($commit ?
self::linkRevision(idx($this->revisions, $commit->getPHID())) :
null),
$change,
$author,
$summary,
$date,
$time,
$author,
AphrontTableView::renderSingleDisplayLine($history->getSummary()),
// TODO: etc etc
);
}
$view = new AphrontTableView($rows);
$view->setHeaders(
array(
pht('Browse'),
'',
pht('Commit'),
pht('Revision'),
pht('Change'),
pht('Date'),
pht('Time'),
pht('Author/Committer'),
pht('Details'),
pht('Date'),
pht('Time'),
));
$view->setColumnClasses(
array(
'',
'threads',
'n',
'n',
'',
'wide',
'',
'right',
'',
'wide',
));
$view->setColumnVisibility(
array(
true,
$graph ? true : false,
));
$view->setDeviceVisibility(
array(
$graph ? true : false,
true,
true,
false,
true,
false,
false,
));
return $view->render();
}

View file

@ -220,7 +220,7 @@ span.single-display-line-content {
.aphront-table-view td.threads {
font-family: monospace;
white-space: pre;
padding: 0;
padding: 0 0 0 8px;
}
.aphront-table-view td.threads canvas {