1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +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(
'names' => array(
'core.pkg.css' => 'af140e11',
'core.pkg.css' => '11d41499',
'core.pkg.js' => 'a590b451',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '9451634c',
@ -83,7 +83,7 @@ return array(
'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b',
'rsrc/css/application/paste/paste.css' => '1898e534',
'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-inline-comments.css' => '8e545e49',
'rsrc/css/application/pholio/pholio.css' => '95174bdd',
@ -131,7 +131,7 @@ return array(
'rsrc/css/phui/phui-button.css' => '16020a60',
'rsrc/css/phui/phui-crumbs-view.css' => 'd842f867',
'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-form-view.css' => '621b21c5',
'rsrc/css/phui/phui-form.css' => 'afdb2c6e',
@ -765,7 +765,7 @@ return array(
'phabricator-uiexample-reactor-sendclass' => '1def2711',
'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee',
'phabricator-zindex-css' => '57ddcaa2',
'phame-css' => '3259b53d',
'phame-css' => 'bb147387',
'pholio-css' => '95174bdd',
'pholio-edit-css' => '3ad9d1ee',
'pholio-inline-comments-css' => '8e545e49',
@ -784,7 +784,7 @@ return array(
'phui-calendar-month-css' => '476be7e0',
'phui-crumbs-view-css' => 'd842f867',
'phui-document-view-css' => '0267054b',
'phui-feed-story-css' => 'c7d8113a',
'phui-feed-story-css' => 'b7b26d23',
'phui-font-icon-base-css' => '3dad2ae3',
'phui-fontkit-css' => 'cb8ae7ad',
'phui-form-css' => 'afdb2c6e',

View file

@ -9,14 +9,10 @@ abstract class PhameController extends PhabricatorController {
$nav = new AphrontSideNavFilterView();
$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->addFilter('post/all', pht('Latest Posts'));
$nav->addFilter('post/draft', pht('My Drafts'));
$nav->addFilter('post', pht('My Posts'));
$nav->addFilter('post/all', pht('All Posts'));
$nav->addLabel(pht('Blogs'));
$nav->addFilter('blog/user', pht('Joinable Blogs'));

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -56,12 +56,10 @@ final class PhamePostNewController extends PhameController {
))
->execute();
$nav = $this->renderSideNavFilterView();
$nav->selectFilter('post/new');
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title, $view_uri);
$nav->appendChild($crumbs);
$display = array();
$display[] = $crumbs;
if (!$blogs) {
$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 '.
'first, then you can post to it.'));
$nav->appendChild($notification);
$display[] = $notification;
} else {
$options = mpull($blogs, 'getName', 'getID');
asort($options);
@ -109,11 +107,11 @@ final class PhamePostNewController extends PhameController {
->setHeaderText($title)
->setForm($form);
$nav->appendChild($form_box);
$display[] = $form_box;
}
return $this->buildApplicationPage(
$nav,
$display,
array(
'title' => $title,
));

View file

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

View file

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

View file

@ -2,120 +2,6 @@
* @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 span,
.fb-comments iframe[style] {

View file

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