1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-06 09:29:28 +01:00

Clean up Phame a little

Summary: Remove redundent UI, use standard components, remove unused CSS.

Test Plan: Use Phame

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13755
This commit is contained in:
Chad Little 2015-07-29 17:03:13 -07:00
parent 77ababadcb
commit 082ef68d85
12 changed files with 39 additions and 171 deletions

View file

@ -7,7 +7,7 @@
*/ */
return array( return array(
'names' => array( 'names' => array(
'core.pkg.css' => 'af140e11', 'core.pkg.css' => '11d41499',
'core.pkg.js' => 'a590b451', 'core.pkg.js' => 'a590b451',
'darkconsole.pkg.js' => 'e7393ebb', 'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '9451634c', 'differential.pkg.css' => '9451634c',
@ -83,7 +83,7 @@ return array(
'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b', 'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b',
'rsrc/css/application/paste/paste.css' => '1898e534', 'rsrc/css/application/paste/paste.css' => '1898e534',
'rsrc/css/application/people/people-profile.css' => '25970776', 'rsrc/css/application/people/people-profile.css' => '25970776',
'rsrc/css/application/phame/phame.css' => '3259b53d', 'rsrc/css/application/phame/phame.css' => 'bb147387',
'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee', 'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee',
'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49', 'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49',
'rsrc/css/application/pholio/pholio.css' => '95174bdd', 'rsrc/css/application/pholio/pholio.css' => '95174bdd',
@ -131,7 +131,7 @@ return array(
'rsrc/css/phui/phui-button.css' => '16020a60', 'rsrc/css/phui/phui-button.css' => '16020a60',
'rsrc/css/phui/phui-crumbs-view.css' => 'd842f867', 'rsrc/css/phui/phui-crumbs-view.css' => 'd842f867',
'rsrc/css/phui/phui-document.css' => '0267054b', 'rsrc/css/phui/phui-document.css' => '0267054b',
'rsrc/css/phui/phui-feed-story.css' => 'c7d8113a', 'rsrc/css/phui/phui-feed-story.css' => 'b7b26d23',
'rsrc/css/phui/phui-fontkit.css' => 'cb8ae7ad', 'rsrc/css/phui/phui-fontkit.css' => 'cb8ae7ad',
'rsrc/css/phui/phui-form-view.css' => '621b21c5', 'rsrc/css/phui/phui-form-view.css' => '621b21c5',
'rsrc/css/phui/phui-form.css' => 'afdb2c6e', 'rsrc/css/phui/phui-form.css' => 'afdb2c6e',
@ -765,7 +765,7 @@ return array(
'phabricator-uiexample-reactor-sendclass' => '1def2711', 'phabricator-uiexample-reactor-sendclass' => '1def2711',
'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee', 'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee',
'phabricator-zindex-css' => '57ddcaa2', 'phabricator-zindex-css' => '57ddcaa2',
'phame-css' => '3259b53d', 'phame-css' => 'bb147387',
'pholio-css' => '95174bdd', 'pholio-css' => '95174bdd',
'pholio-edit-css' => '3ad9d1ee', 'pholio-edit-css' => '3ad9d1ee',
'pholio-inline-comments-css' => '8e545e49', 'pholio-inline-comments-css' => '8e545e49',
@ -784,7 +784,7 @@ return array(
'phui-calendar-month-css' => '476be7e0', 'phui-calendar-month-css' => '476be7e0',
'phui-crumbs-view-css' => 'd842f867', 'phui-crumbs-view-css' => 'd842f867',
'phui-document-view-css' => '0267054b', 'phui-document-view-css' => '0267054b',
'phui-feed-story-css' => 'c7d8113a', 'phui-feed-story-css' => 'b7b26d23',
'phui-font-icon-base-css' => '3dad2ae3', 'phui-font-icon-base-css' => '3dad2ae3',
'phui-fontkit-css' => 'cb8ae7ad', 'phui-fontkit-css' => 'cb8ae7ad',
'phui-form-css' => 'afdb2c6e', 'phui-form-css' => 'afdb2c6e',

View file

@ -9,14 +9,10 @@ abstract class PhameController extends PhabricatorController {
$nav = new AphrontSideNavFilterView(); $nav = new AphrontSideNavFilterView();
$nav->setBaseURI($base_uri); $nav->setBaseURI($base_uri);
$nav->addLabel(pht('Create'));
$nav->addFilter('post/new', pht('New Post'));
$nav->addFilter('blog/new', pht('New Blog'));
$nav->addLabel(pht('Posts')); $nav->addLabel(pht('Posts'));
$nav->addFilter('post/all', pht('Latest Posts'));
$nav->addFilter('post/draft', pht('My Drafts')); $nav->addFilter('post/draft', pht('My Drafts'));
$nav->addFilter('post', pht('My Posts')); $nav->addFilter('post', pht('My Posts'));
$nav->addFilter('post/all', pht('All Posts'));
$nav->addLabel(pht('Blogs')); $nav->addLabel(pht('Blogs'));
$nav->addFilter('blog/user', pht('Joinable Blogs')); $nav->addFilter('blog/user', pht('Joinable Blogs'));

View file

@ -192,18 +192,14 @@ final class PhameBlogEditController
->setForm($form); ->setForm($form);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Blogs'), $this->getApplicationURI('blog/'));
$crumbs->addTextCrumb($page_title, $this->getApplicationURI('blog/new')); $crumbs->addTextCrumb($page_title, $this->getApplicationURI('blog/new'));
$nav = $this->renderSideNavFilterView(); return $this->buildApplicationPage(
$nav->selectFilter($id ? null : 'blog/new');
$nav->appendChild(
array( array(
$crumbs, $crumbs,
$form_box, $form_box,
)); ),
return $this->buildApplicationPage(
$nav,
array( array(
'title' => $page_title, 'title' => $page_title,
)); ));

View file

@ -60,18 +60,23 @@ final class PhameBlogListController extends PhameController {
private function renderBlogList( private function renderBlogList(
array $blogs, array $blogs,
PhabricatorUser $user, PhabricatorUser $viewer,
$nodata) { $nodata) {
$view = new PHUIObjectItemListView(); $view = new PHUIObjectItemListView();
$view->setNoDataString($nodata); $view->setNoDataString($nodata);
$view->setUser($user); $view->setUser($viewer);
foreach ($blogs as $blog) { foreach ($blogs as $blog) {
$id = $blog->getID();
$item = id(new PHUIObjectItemView()) $item = id(new PHUIObjectItemView())
->setUser($viewer)
->setObject($blog)
->setHeader($blog->getName()) ->setHeader($blog->getName())
->setHref($this->getApplicationURI('blog/view/'.$blog->getID().'/')) ->setStatusIcon('fa-star')
->setObject($blog); ->setHref($this->getApplicationURI("/blog/view/{$id}/"))
->addAttribute($blog->getSkin())
->addAttribute($blog->getDomain());
$view->addItem($item); $view->addItem($item);
} }

View file

@ -22,8 +22,6 @@ final class PhameBlogViewController extends PhameController {
->withBlogPHIDs(array($blog->getPHID())) ->withBlogPHIDs(array($blog->getPHID()))
->executeWithCursorPager($pager); ->executeWithCursorPager($pager);
$nav = $this->renderSideNavFilterView(null);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader($blog->getName()) ->setHeader($blog->getName())
->setUser($user) ->setUser($user)
@ -36,29 +34,24 @@ final class PhameBlogViewController extends PhameController {
$user, $user,
pht('This blog has no visible posts.')); pht('This blog has no visible posts.'));
require_celerity_resource('phame-css'); $post_list = id(new PHUIObjectBoxView())
$post_list = id(new PHUIBoxView()) ->setHeaderText(pht('Latest Posts'))
->addPadding(PHUI::PADDING_LARGE)
->addClass('phame-post-list')
->appendChild($post_list); ->appendChild($post_list);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Blogs'), $this->getApplicationURI('blog/'));
$crumbs->addTextCrumb($blog->getName(), $this->getApplicationURI()); $crumbs->addTextCrumb($blog->getName(), $this->getApplicationURI());
$object_box = id(new PHUIObjectBoxView()) $object_box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeader($header)
->addPropertyList($properties); ->addPropertyList($properties);
$nav->appendChild( return $this->buildApplicationPage(
array( array(
$crumbs, $crumbs,
$object_box, $object_box,
$post_list, $post_list,
)); ),
return $this->buildApplicationPage(
$nav,
array( array(
'title' => $blog->getName(), 'title' => $blog->getName(),
)); ));

View file

@ -169,7 +169,6 @@ final class PhamePostEditController extends PhameController {
phutil_tag('div', array('id' => 'post-preview'), $loading), phutil_tag('div', array('id' => 'post-preview'), $loading),
)); ));
require_celerity_resource('phame-css');
Javelin::initBehavior( Javelin::initBehavior(
'phame-post-preview', 'phame-post-preview',
array( array(
@ -190,16 +189,12 @@ final class PhamePostEditController extends PhameController {
$page_title, $page_title,
$this->getApplicationURI('/post/view/'.$id.'/')); $this->getApplicationURI('/post/view/'.$id.'/'));
$nav = $this->renderSideNavFilterView(null); return $this->buildApplicationPage(
$nav->appendChild(
array( array(
$crumbs, $crumbs,
$form_box, $form_box,
$preview_panel, $preview_panel,
)); ),
return $this->buildApplicationPage(
$nav,
array( array(
'title' => $page_title, 'title' => $page_title,
)); ));

View file

@ -21,12 +21,6 @@ final class PhamePostListController extends PhameController {
$title = pht('Unpublished Drafts'); $title = pht('Unpublished Drafts');
$nav->selectFilter('post/draft'); $nav->selectFilter('post/draft');
break; break;
case 'all':
$nodata = pht('There are no visible posts.');
$title = pht('Posts');
$nav->selectFilter('post/all');
break;
default:
case 'blogger': case 'blogger':
if ($bloggername) { if ($bloggername) {
$blogger = id(new PhabricatorUser())->loadOneWhere( $blogger = id(new PhabricatorUser())->loadOneWhere(
@ -48,6 +42,12 @@ final class PhamePostListController extends PhameController {
} }
$title = pht('Posts by %s', $blogger); $title = pht('Posts by %s', $blogger);
break; break;
default:
case 'all':
$nodata = pht('There are no visible posts.');
$title = pht('Posts');
$nav->selectFilter('post/all');
break;
} }
$pager = id(new AphrontCursorPagerView()) $pager = id(new AphrontCursorPagerView())
@ -55,7 +55,6 @@ final class PhamePostListController extends PhameController {
$posts = $query->executeWithCursorPager($pager); $posts = $query->executeWithCursorPager($pager);
require_celerity_resource('phame-css');
$post_list = $this->renderPostList($posts, $viewer, $nodata); $post_list = $this->renderPostList($posts, $viewer, $nodata);
$post_list = id(new PHUIObjectBoxView()) $post_list = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText($title)

View file

@ -56,12 +56,10 @@ final class PhamePostNewController extends PhameController {
)) ))
->execute(); ->execute();
$nav = $this->renderSideNavFilterView();
$nav->selectFilter('post/new');
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title, $view_uri); $crumbs->addTextCrumb($title, $view_uri);
$nav->appendChild($crumbs); $display = array();
$display[] = $crumbs;
if (!$blogs) { if (!$blogs) {
$notification = id(new PHUIInfoView()) $notification = id(new PHUIInfoView())
@ -70,7 +68,7 @@ final class PhamePostNewController extends PhameController {
pht('You do not have permission to join any blogs. Create a blog '. pht('You do not have permission to join any blogs. Create a blog '.
'first, then you can post to it.')); 'first, then you can post to it.'));
$nav->appendChild($notification); $display[] = $notification;
} else { } else {
$options = mpull($blogs, 'getName', 'getID'); $options = mpull($blogs, 'getName', 'getID');
asort($options); asort($options);
@ -109,11 +107,11 @@ final class PhamePostNewController extends PhameController {
->setHeaderText($title) ->setHeaderText($title)
->setForm($form); ->setForm($form);
$nav->appendChild($form_box); $display[] = $form_box;
} }
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $display,
array( array(
'title' => $title, 'title' => $title,
)); ));

View file

@ -102,7 +102,7 @@ final class PhamePostSearchEngine
$result = new PhabricatorApplicationSearchResultView(); $result = new PhabricatorApplicationSearchResultView();
$result->setObjectList($list); $result->setObjectList($list);
$result->setNoDataString(pht('No blogs found.')); $result->setNoDataString(pht('No blogs posts found.'));
return $result; return $result;
} }

View file

@ -173,6 +173,7 @@ final class PhamePostView extends AphrontView {
$uri = $this->getSkin()->getURI('post/'.$this->getPost()->getPhameTitle()); $uri = $this->getSkin()->getURI('post/'.$this->getPost()->getPhameTitle());
require_celerity_resource('phame-css');
$fb_comments = phutil_tag('div', $fb_comments = phutil_tag('div',
array( array(
'class' => 'fb-comments', 'class' => 'fb-comments',

View file

@ -2,120 +2,6 @@
* @provides phame-css * @provides phame-css
*/ */
.notice {
background: #F3F3FF;
border: 1px solid #008;
margin: 16px 16px 4px 26px;
}
.notice h3 {
background: #E3E3FF;
padding: 8px;
}
.notice h4 {
font-weight: normal;
padding: 8px;
}
.phame-post-preview-header {
margin: 0px 0px 16px 0px;
}
.device-desktop .phame-post-list {
max-width: 600px;
}
.phame-post-list .phui-info-view {
margin: 0;
}
.phame-post-list .phui-icon-view:hover {
text-decoration: none;
}
.blog-post-list {
clear: left;
float: left;
width: 70%;
margin: 16px 0px 16px 16px;
padding: 0px 8px 12px 8px;
}
.device .blog-post-list {
float: none;
width: 90%;
margin: 16px auto;
}
.blog-post-list-full {
clear: left;
float: left;
margin: 16px 0px 0px 0px;
padding: 0px 16px 0px 16px;
}
.device .blog-post-list-full {
float: none;
margin: 16px auto;
}
.blog-detail {
float: right;
clear: right;
width: 20%;
margin: 16px 16px 16px 0px;
}
.device .blog-detail {
float: none;
margin: 16px auto;
width: 90%;
}
.blog-detail .description {
margin: 16px 0px 16px 0px;
}
.blog-detail .bloggers {
font-size: {$smallerfontsize};
}
.blog-post,
.blog-detail {
border: 1px solid #DBDBDB;
background: #F9F9F9;
padding: 20px;
}
.blog-post {
margin: 0px 0px 20px 0px;
}
.blog-post .header {
padding: 0px 0px 16px 0px;
}
.blog-post .header h1 {
clear: none;
}
.blog-post .header .last-updated {
color: {$greytext};
clear: none;
font-size: {$smallerfontsize};
}
.blog-post .header .buttons {
float: right;
}
.blog-post .header .buttons a {
margin: 0px 0px 0px 12px;
}
.more-and-comments {
padding: 12px 0px 12px 0px;
}
.fb-comments, .fb-comments,
.fb-comments span, .fb-comments span,
.fb-comments iframe[style] { .fb-comments iframe[style] {

View file

@ -61,8 +61,7 @@
} }
.phui-feed-story-bigtext-post h3 { .phui-feed-story-bigtext-post h3 {
font-size: 18px; font-size: {$biggestfontsize};
font-weight: 200;
line-height: 18px; line-height: 18px;
color: {$darkgreytext}; color: {$darkgreytext};
margin: 0 0 5px 0; margin: 0 0 5px 0;