mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 11:22:40 +01:00
b560014577
Summary: Rebuilds the UI in Differential commenting. Specifically we look at the following design patterns: **To the author:** - The author of the diff should be able to easily identify what comments are done and not done. - We keep undone comments yellow - Clicking done turns comment block into 'unsubmitted state' **To the reviewer:** - Easier understanding of unsubmitted states - All conversations to be yellow/important **Todo** - Not all color CSS states correct - Unpulished checkbox support Test Plan: Test leaving comments, published and unpublished. Checking Done, unpublished and published. Check delete states. From the Diff Author's perspective: {F352094} For a Diff commenter's perspective: {F352095} Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T1460, T7660, T7503 Differential Revision: https://secure.phabricator.com/D12171
42 lines
932 B
PHP
42 lines
932 B
PHP
<?php
|
|
|
|
final class PHUIButtonBarView extends AphrontTagView {
|
|
|
|
private $buttons = array();
|
|
|
|
public function addButton($button) {
|
|
$this->buttons[] = $button;
|
|
return $this;
|
|
}
|
|
|
|
protected function getTagAttributes() {
|
|
return array('class' => 'phui-button-bar');
|
|
}
|
|
|
|
protected function getTagName() {
|
|
return 'span';
|
|
}
|
|
|
|
protected function getTagContent() {
|
|
require_celerity_resource('phui-button-css');
|
|
|
|
$i = 1;
|
|
$j = count($this->buttons);
|
|
foreach ($this->buttons as $button) {
|
|
// LeeLoo Dallas Multi-Pass
|
|
if ($j > 1) {
|
|
if ($i == 1) {
|
|
$button->addClass('phui-button-bar-first');
|
|
} else if ($i == $j) {
|
|
$button->addClass('phui-button-bar-last');
|
|
} else if ($j > 1) {
|
|
$button->addClass('phui-button-bar-middle');
|
|
}
|
|
}
|
|
$this->appendChild($button);
|
|
$i++;
|
|
}
|
|
|
|
return $this->renderChildren();
|
|
}
|
|
}
|