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

Clean up Ponder CSS

Summary: Ref T3578, Removes old cruft and updates Ponder UI very slightly.

Test Plan: Use Ponder alot, new answers, comments, questions. Grep for removed CSS.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T3578

Differential Revision: https://secure.phabricator.com/D13786
This commit is contained in:
Chad Little 2015-08-05 09:42:39 -07:00
parent a3b955f948
commit e05e539a9c
9 changed files with 52 additions and 220 deletions

View file

@ -94,10 +94,7 @@ return array(
'rsrc/css/application/policy/policy-edit.css' => '815c66f7', 'rsrc/css/application/policy/policy-edit.css' => '815c66f7',
'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43', 'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43',
'rsrc/css/application/policy/policy.css' => '957ea14c', 'rsrc/css/application/policy/policy.css' => '957ea14c',
'rsrc/css/application/ponder/comments.css' => '865a67e6', 'rsrc/css/application/ponder/ponder-view.css' => 'fcd6b398',
'rsrc/css/application/ponder/feed.css' => 'e62615b6',
'rsrc/css/application/ponder/post.css' => '9d415218',
'rsrc/css/application/ponder/vote.css' => 'aea452b0',
'rsrc/css/application/projects/project-icon.css' => '4e3eaa5a', 'rsrc/css/application/projects/project-icon.css' => '4e3eaa5a',
'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733', 'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733',
'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5',
@ -816,10 +813,7 @@ return array(
'policy-css' => '957ea14c', 'policy-css' => '957ea14c',
'policy-edit-css' => '815c66f7', 'policy-edit-css' => '815c66f7',
'policy-transaction-detail-css' => '82100a43', 'policy-transaction-detail-css' => '82100a43',
'ponder-comment-table-css' => '865a67e6', 'ponder-view-css' => 'fcd6b398',
'ponder-feed-view-css' => 'e62615b6',
'ponder-post-css' => '9d415218',
'ponder-vote-css' => 'aea452b0',
'project-icon-css' => '4e3eaa5a', 'project-icon-css' => '4e3eaa5a',
'raphael-core' => '51ee6b43', 'raphael-core' => '51ee6b43',
'raphael-g' => '40dde778', 'raphael-g' => '40dde778',

View file

@ -24,6 +24,7 @@ final class PonderAnswerHistoryController extends PonderController {
$aid = $answer->getID(); $aid = $answer->getID();
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->setBorder(true);
$crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}");
$crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}"); $crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}");
$crumbs->addTextCrumb(pht('History')); $crumbs->addTextCrumb(pht('History'));

View file

@ -22,6 +22,7 @@ final class PonderQuestionHistoryController extends PonderController {
$qid = $question->getID(); $qid = $question->getID();
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->setBorder(true);
$crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}");
$crumbs->addTextCrumb(pht('History')); $crumbs->addTextCrumb(pht('History'));

View file

@ -3,11 +3,11 @@
final class PonderQuestionViewController extends PonderController { final class PonderQuestionViewController extends PonderController {
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {
$user = $request->getViewer(); $viewer = $request->getViewer();
$id = $request->getURIData('id'); $id = $request->getURIData('id');
$question = id(new PonderQuestionQuery()) $question = id(new PonderQuestionQuery())
->setViewer($user) ->setViewer($viewer)
->withIDs(array($id)) ->withIDs(array($id))
->needAnswers(true) ->needAnswers(true)
->needViewerVotes(true) ->needViewerVotes(true)
@ -16,15 +16,15 @@ final class PonderQuestionViewController extends PonderController {
return new Aphront404Response(); return new Aphront404Response();
} }
$question->attachVotes($user->getPHID()); $question->attachVotes($viewer->getPHID());
$question_xactions = $this->buildQuestionTransactions($question); $question_xactions = $this->buildQuestionTransactions($question);
$answers = $this->buildAnswers($question->getAnswers()); $answers = $this->buildAnswers($question->getAnswers());
$authors = mpull($question->getAnswers(), null, 'getAuthorPHID'); $authors = mpull($question->getAnswers(), null, 'getAuthorPHID');
if (isset($authors[$user->getPHID()])) { if (isset($authors[$viewer->getPHID()])) {
$answer_add_panel = id(new PHUIInfoView()) $answer_add_panel = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_NODATA) ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
->appendChild( ->appendChild(
pht( pht(
'You have already answered this question. You can not answer '. 'You have already answered this question. You can not answer '.
@ -33,14 +33,14 @@ final class PonderQuestionViewController extends PonderController {
$answer_add_panel = new PonderAddAnswerView(); $answer_add_panel = new PonderAddAnswerView();
$answer_add_panel $answer_add_panel
->setQuestion($question) ->setQuestion($question)
->setUser($user) ->setUser($viewer)
->setActionURI('/ponder/answer/add/'); ->setActionURI('/ponder/answer/add/');
} }
$header = id(new PHUIHeaderView()) $header = new PHUIHeaderView();
->setHeader($question->getTitle()) $header->setHeader($question->getTitle());
->setUser($user) $header->setUser($viewer);
->setPolicyObject($question); $header->setPolicyObject($question);
if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) { if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) {
$header->setStatus('fa-square-o', 'bluegrey', pht('Open')); $header->setStatus('fa-square-o', 'bluegrey', pht('Open'));
@ -58,13 +58,22 @@ final class PonderQuestionViewController extends PonderController {
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView());
$crumbs->addTextCrumb('Q'.$id, '/Q'.$id); $crumbs->addTextCrumb('Q'.$id, '/Q'.$id);
return $this->buildApplicationPage( $ponder_view = phutil_tag(
'div',
array(
'class' => 'ponder-question-view',
),
array( array(
$crumbs, $crumbs,
$object_box, $object_box,
$question_xactions, $question_xactions,
$answers, $answers,
$answer_add_panel, $answer_add_panel,
));
return $this->buildApplicationPage(
array(
$ponder_view,
), ),
array( array(
'title' => 'Q'.$question->getID().' '.$question->getTitle(), 'title' => 'Q'.$question->getID().' '.$question->getTitle(),
@ -75,9 +84,8 @@ final class PonderQuestionViewController extends PonderController {
} }
private function buildActionListView(PonderQuestion $question) { private function buildActionListView(PonderQuestion $question) {
$viewer = $this->getViewer();
$request = $this->getRequest(); $request = $this->getRequest();
$viewer = $request->getUser();
$id = $question->getID(); $id = $question->getID();
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
@ -86,7 +94,7 @@ final class PonderQuestionViewController extends PonderController {
PhabricatorPolicyCapability::CAN_EDIT); PhabricatorPolicyCapability::CAN_EDIT);
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($request->getUser()) ->setUser($viewer)
->setObject($question) ->setObject($question)
->setObjectURI($request->getRequestURI()); ->setObjectURI($request->getRequestURI());
@ -130,16 +138,12 @@ final class PonderQuestionViewController extends PonderController {
PonderQuestion $question, PonderQuestion $question,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
->setObject($question) ->setObject($question)
->setActionList($actions); ->setActionList($actions);
$view->addProperty(
pht('Status'),
PonderQuestionStatus::getQuestionStatusFullName($question->getStatus()));
$view->addProperty( $view->addProperty(
pht('Author'), pht('Author'),
$viewer->renderHandle($question->getAuthorPHID())); $viewer->renderHandle($question->getAuthorPHID()));
@ -209,8 +213,7 @@ final class PonderQuestionViewController extends PonderController {
* standard fashion. This is necessary to scale this application. * standard fashion. This is necessary to scale this application.
*/ */
private function buildAnswers(array $answers) { private function buildAnswers(array $answers) {
$request = $this->getRequest(); $viewer = $this->getViewer();
$viewer = $request->getUser();
$out = array(); $out = array();
@ -283,9 +286,8 @@ final class PonderQuestionViewController extends PonderController {
} }
private function buildAnswerActions(PonderAnswer $answer) { private function buildAnswerActions(PonderAnswer $answer) {
$viewer = $this->getViewer();
$request = $this->getRequest(); $request = $this->getRequest();
$viewer = $request->getUser();
$id = $answer->getID(); $id = $answer->getID();
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
@ -294,7 +296,7 @@ final class PonderQuestionViewController extends PonderController {
PhabricatorPolicyCapability::CAN_EDIT); PhabricatorPolicyCapability::CAN_EDIT);
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($request->getUser()) ->setUser($viewer)
->setObject($answer) ->setObject($answer)
->setObjectURI($request->getRequestURI()); ->setObjectURI($request->getRequestURI());
@ -319,7 +321,7 @@ final class PonderQuestionViewController extends PonderController {
PonderAnswer $answer, PonderAnswer $answer,
PhabricatorActionListView $actions) { PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) $view = id(new PHUIPropertyListView())
->setUser($viewer) ->setUser($viewer)
->setObject($answer) ->setObject($answer)
@ -366,7 +368,7 @@ final class PonderQuestionViewController extends PonderController {
$hide_id = celerity_generate_unique_node_id(); $hide_id = celerity_generate_unique_node_id();
Javelin::initBehavior('phabricator-reveal-content'); Javelin::initBehavior('phabricator-reveal-content');
require_celerity_resource('ponder-comment-table-css'); require_celerity_resource('ponder-view-css');
$show = phutil_tag( $show = phutil_tag(
'div', 'div',
@ -389,6 +391,7 @@ final class PonderQuestionViewController extends PonderController {
$hide = phutil_tag( $hide = phutil_tag(
'div', 'div',
array( array(
'class' => 'ponder-comments-view',
'id' => $hide_id, 'id' => $hide_id,
'style' => 'display: none', 'style' => 'display: none',
), ),

View file

@ -28,7 +28,7 @@ final class PonderVotableView extends AphrontView {
} }
public function render() { public function render() {
require_celerity_resource('ponder-vote-css'); require_celerity_resource('ponder-view-css');
require_celerity_resource('javelin-behavior-ponder-votebox'); require_celerity_resource('javelin-behavior-ponder-votebox');
Javelin::initBehavior('ponder-votebox', array()); Javelin::initBehavior('ponder-votebox', array());

View file

@ -1,85 +0,0 @@
/**
* @provides ponder-comment-table-css
*/
.ponder-show-comments {
text-align: center;
padding: 8px;
margin: 0 16px;
float: right;
font-weight: bold;
background: #fff;
border-bottom: 1px solid {$blueborder};
border-left: 1px solid {$lightblueborder};
border-right: 1px solid {$lightblueborder};
}
.ponder-comments {
width: 480px;
margin: 5px 0 0 60px;
}
.device .ponder-comments {
width: 100%;
margin: 5px 0 0 0;
}
.ponder-comments th {
width: 0px;
height: 0px;
}
.ponder-comments td {
vertical-align: top;
padding: 6px;
border-bottom: 1px solid {$thinblueborder};
background: #fff;
}
.ponder-datestamp {
font-size: {$smallestfontsize};
color: {$greytext};
}
.ponder-label {
display: block;
width: 100%;
font-weight: bold;
color: #333;
text-align: left;
margin: 0px 0px 6px;
padding: 6px 4px;
background: #ccc;
border-bottom: 1px solid #aaa;
cursor: pointer;
}
td .aphront-form-control {
padding: 0;
}
td .aphront-form-control-submit {
display: block;
}
td .aphront-form-input {
margin: 0;
width: 100%;
}
td .aphront-form-control textarea {
height: 50px;
}
.ponder-comment-markup p {
margin: 0 0 5px 0;
}
.ponder-comment-markup h2,
.ponder-comment-markup h3,
.ponder-comment-markup h4,
.ponder-comment-markup h5 {
margin: 0;
font-size: inherit;
font-weight: normal;
}

View file

@ -1,74 +0,0 @@
/**
* @provides ponder-feed-view-css
*/
.ponder-question-summary {
width: 100%;
background: #DFDFE3;
float: left;
clear: both;
margin-top: 1px;
padding: 1px;
}
.ponder-answer-summary {
width : 100%;
background : #DFDFE3;
float : left;
clear : both;
margin-top : 1px;
padding : 1px;
}
.ponder-summary-votes {
width : 50px;
height : 36pt;
font-size : 18pt;
text-align : center;
background : #EEE;
border : 1px solid #BBB;
float : left;
margin : 2px;
padding-top : 2px;
}
.ponder-summary-answers {
width : 50px;
height : 36pt;
font-size : 18pt;
text-align : center;
background : #EEE;
border : 1px solid #BBB;
float : left;
margin : 2px;
padding-top : 2px;
}
.ponder-question-label {
font-size : 6pt;
}
h2.ponder-question-title {
font-size : 12pt;
margin : 2px;
padding : 0;
}
h2.ponder-answer-title {
font-size : 12pt;
margin : 2px;
padding : 0;
}
.ponder-metadata {
padding-left : 5px;
width : 650px;
float : left;
}
.ponder-small-metadata {
font-size : 7.5pt;
color : #555;
margin : 0;
text-align : right;
}

View file

@ -1,5 +1,5 @@
/** /**
* @provides ponder-vote-css * @provides ponder-view-css
*/ */
.ponder-votable { .ponder-votable {
@ -40,3 +40,20 @@
line-height: 20px; line-height: 20px;
font-weight: bold; font-weight: bold;
} }
.ponder-show-comments {
text-align: center;
padding: 8px;
margin: 0 16px;
float: right;
font-weight: bold;
background: #fff;
border-bottom: 1px solid {$blueborder};
border-left: 1px solid {$lightblueborder};
border-right: 1px solid {$lightblueborder};
}
.device-desktop .ponder-comments-view {
width: 90%;
margin: 0 auto;
}

View file

@ -1,25 +0,0 @@
/**
* @provides ponder-post-css
*/
.ponder-post-list {
max-width: 1162px;
}
.ponder-add-answer-panel {
max-width: 1162px;
}
.ponder-post-list .anchor-target {
background-color: #ffffdd;
border-color: #ffff00;
}
.ponder-post-core .phabricator-remarkup .remarkup-code-block {
width: 88ex;
width: 81ch;
}
.ponder-question {
background: white;
}