@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+39 -171
+5 -5
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => 'af140e11', 10 + 'core.pkg.css' => '11d41499', 11 11 'core.pkg.js' => 'a590b451', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '9451634c', ··· 83 83 'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b', 84 84 'rsrc/css/application/paste/paste.css' => '1898e534', 85 85 'rsrc/css/application/people/people-profile.css' => '25970776', 86 - 'rsrc/css/application/phame/phame.css' => '3259b53d', 86 + 'rsrc/css/application/phame/phame.css' => 'bb147387', 87 87 'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee', 88 88 'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49', 89 89 'rsrc/css/application/pholio/pholio.css' => '95174bdd', ··· 131 131 'rsrc/css/phui/phui-button.css' => '16020a60', 132 132 'rsrc/css/phui/phui-crumbs-view.css' => 'd842f867', 133 133 'rsrc/css/phui/phui-document.css' => '0267054b', 134 - 'rsrc/css/phui/phui-feed-story.css' => 'c7d8113a', 134 + 'rsrc/css/phui/phui-feed-story.css' => 'b7b26d23', 135 135 'rsrc/css/phui/phui-fontkit.css' => 'cb8ae7ad', 136 136 'rsrc/css/phui/phui-form-view.css' => '621b21c5', 137 137 'rsrc/css/phui/phui-form.css' => 'afdb2c6e', ··· 765 765 'phabricator-uiexample-reactor-sendclass' => '1def2711', 766 766 'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee', 767 767 'phabricator-zindex-css' => '57ddcaa2', 768 - 'phame-css' => '3259b53d', 768 + 'phame-css' => 'bb147387', 769 769 'pholio-css' => '95174bdd', 770 770 'pholio-edit-css' => '3ad9d1ee', 771 771 'pholio-inline-comments-css' => '8e545e49', ··· 784 784 'phui-calendar-month-css' => '476be7e0', 785 785 'phui-crumbs-view-css' => 'd842f867', 786 786 'phui-document-view-css' => '0267054b', 787 - 'phui-feed-story-css' => 'c7d8113a', 787 + 'phui-feed-story-css' => 'b7b26d23', 788 788 'phui-font-icon-base-css' => '3dad2ae3', 789 789 'phui-fontkit-css' => 'cb8ae7ad', 790 790 'phui-form-css' => 'afdb2c6e',
+1 -5
src/applications/phame/controller/PhameController.php
··· 9 9 $nav = new AphrontSideNavFilterView(); 10 10 $nav->setBaseURI($base_uri); 11 11 12 - $nav->addLabel(pht('Create')); 13 - $nav->addFilter('post/new', pht('New Post')); 14 - $nav->addFilter('blog/new', pht('New Blog')); 15 - 16 12 $nav->addLabel(pht('Posts')); 13 + $nav->addFilter('post/all', pht('Latest Posts')); 17 14 $nav->addFilter('post/draft', pht('My Drafts')); 18 15 $nav->addFilter('post', pht('My Posts')); 19 - $nav->addFilter('post/all', pht('All Posts')); 20 16 21 17 $nav->addLabel(pht('Blogs')); 22 18 $nav->addFilter('blog/user', pht('Joinable Blogs'));
+3 -7
src/applications/phame/controller/blog/PhameBlogEditController.php
··· 192 192 ->setForm($form); 193 193 194 194 $crumbs = $this->buildApplicationCrumbs(); 195 + $crumbs->addTextCrumb(pht('Blogs'), $this->getApplicationURI('blog/')); 195 196 $crumbs->addTextCrumb($page_title, $this->getApplicationURI('blog/new')); 196 197 197 - $nav = $this->renderSideNavFilterView(); 198 - $nav->selectFilter($id ? null : 'blog/new'); 199 - $nav->appendChild( 198 + return $this->buildApplicationPage( 200 199 array( 201 200 $crumbs, 202 201 $form_box, 203 - )); 204 - 205 - return $this->buildApplicationPage( 206 - $nav, 202 + ), 207 203 array( 208 204 'title' => $page_title, 209 205 ));
+9 -4
src/applications/phame/controller/blog/PhameBlogListController.php
··· 60 60 61 61 private function renderBlogList( 62 62 array $blogs, 63 - PhabricatorUser $user, 63 + PhabricatorUser $viewer, 64 64 $nodata) { 65 65 66 66 $view = new PHUIObjectItemListView(); 67 67 $view->setNoDataString($nodata); 68 - $view->setUser($user); 68 + $view->setUser($viewer); 69 69 foreach ($blogs as $blog) { 70 70 71 + $id = $blog->getID(); 71 72 $item = id(new PHUIObjectItemView()) 73 + ->setUser($viewer) 74 + ->setObject($blog) 72 75 ->setHeader($blog->getName()) 73 - ->setHref($this->getApplicationURI('blog/view/'.$blog->getID().'/')) 74 - ->setObject($blog); 76 + ->setStatusIcon('fa-star') 77 + ->setHref($this->getApplicationURI("/blog/view/{$id}/")) 78 + ->addAttribute($blog->getSkin()) 79 + ->addAttribute($blog->getDomain()); 75 80 76 81 $view->addItem($item); 77 82 }
+5 -12
src/applications/phame/controller/blog/PhameBlogViewController.php
··· 22 22 ->withBlogPHIDs(array($blog->getPHID())) 23 23 ->executeWithCursorPager($pager); 24 24 25 - $nav = $this->renderSideNavFilterView(null); 26 - 27 25 $header = id(new PHUIHeaderView()) 28 26 ->setHeader($blog->getName()) 29 27 ->setUser($user) ··· 36 34 $user, 37 35 pht('This blog has no visible posts.')); 38 36 39 - require_celerity_resource('phame-css'); 40 - $post_list = id(new PHUIBoxView()) 41 - ->addPadding(PHUI::PADDING_LARGE) 42 - ->addClass('phame-post-list') 37 + $post_list = id(new PHUIObjectBoxView()) 38 + ->setHeaderText(pht('Latest Posts')) 43 39 ->appendChild($post_list); 44 - 45 40 46 41 $crumbs = $this->buildApplicationCrumbs(); 42 + $crumbs->addTextCrumb(pht('Blogs'), $this->getApplicationURI('blog/')); 47 43 $crumbs->addTextCrumb($blog->getName(), $this->getApplicationURI()); 48 44 49 45 $object_box = id(new PHUIObjectBoxView()) 50 46 ->setHeader($header) 51 47 ->addPropertyList($properties); 52 48 53 - $nav->appendChild( 49 + return $this->buildApplicationPage( 54 50 array( 55 51 $crumbs, 56 52 $object_box, 57 53 $post_list, 58 - )); 59 - 60 - return $this->buildApplicationPage( 61 - $nav, 54 + ), 62 55 array( 63 56 'title' => $blog->getName(), 64 57 ));
+2 -7
src/applications/phame/controller/post/PhamePostEditController.php
··· 169 169 phutil_tag('div', array('id' => 'post-preview'), $loading), 170 170 )); 171 171 172 - require_celerity_resource('phame-css'); 173 172 Javelin::initBehavior( 174 173 'phame-post-preview', 175 174 array( ··· 190 189 $page_title, 191 190 $this->getApplicationURI('/post/view/'.$id.'/')); 192 191 193 - $nav = $this->renderSideNavFilterView(null); 194 - $nav->appendChild( 192 + return $this->buildApplicationPage( 195 193 array( 196 194 $crumbs, 197 195 $form_box, 198 196 $preview_panel, 199 - )); 200 - 201 - return $this->buildApplicationPage( 202 - $nav, 197 + ), 203 198 array( 204 199 'title' => $page_title, 205 200 ));
+6 -7
src/applications/phame/controller/post/PhamePostListController.php
··· 21 21 $title = pht('Unpublished Drafts'); 22 22 $nav->selectFilter('post/draft'); 23 23 break; 24 - case 'all': 25 - $nodata = pht('There are no visible posts.'); 26 - $title = pht('Posts'); 27 - $nav->selectFilter('post/all'); 28 - break; 29 - default: 30 24 case 'blogger': 31 25 if ($bloggername) { 32 26 $blogger = id(new PhabricatorUser())->loadOneWhere( ··· 48 42 } 49 43 $title = pht('Posts by %s', $blogger); 50 44 break; 45 + default: 46 + case 'all': 47 + $nodata = pht('There are no visible posts.'); 48 + $title = pht('Posts'); 49 + $nav->selectFilter('post/all'); 50 + break; 51 51 } 52 52 53 53 $pager = id(new AphrontCursorPagerView()) ··· 55 55 56 56 $posts = $query->executeWithCursorPager($pager); 57 57 58 - require_celerity_resource('phame-css'); 59 58 $post_list = $this->renderPostList($posts, $viewer, $nodata); 60 59 $post_list = id(new PHUIObjectBoxView()) 61 60 ->setHeaderText($title)
+5 -7
src/applications/phame/controller/post/PhamePostNewController.php
··· 56 56 )) 57 57 ->execute(); 58 58 59 - $nav = $this->renderSideNavFilterView(); 60 - $nav->selectFilter('post/new'); 61 - 62 59 $crumbs = $this->buildApplicationCrumbs(); 63 60 $crumbs->addTextCrumb($title, $view_uri); 64 - $nav->appendChild($crumbs); 61 + $display = array(); 62 + $display[] = $crumbs; 65 63 66 64 if (!$blogs) { 67 65 $notification = id(new PHUIInfoView()) ··· 70 68 pht('You do not have permission to join any blogs. Create a blog '. 71 69 'first, then you can post to it.')); 72 70 73 - $nav->appendChild($notification); 71 + $display[] = $notification; 74 72 } else { 75 73 $options = mpull($blogs, 'getName', 'getID'); 76 74 asort($options); ··· 109 107 ->setHeaderText($title) 110 108 ->setForm($form); 111 109 112 - $nav->appendChild($form_box); 110 + $display[] = $form_box; 113 111 } 114 112 115 113 return $this->buildApplicationPage( 116 - $nav, 114 + $display, 117 115 array( 118 116 'title' => $title, 119 117 ));
+1 -1
src/applications/phame/query/PhamePostSearchEngine.php
··· 102 102 103 103 $result = new PhabricatorApplicationSearchResultView(); 104 104 $result->setObjectList($list); 105 - $result->setNoDataString(pht('No blogs found.')); 105 + $result->setNoDataString(pht('No blogs posts found.')); 106 106 107 107 return $result; 108 108 }
+1
src/applications/phame/view/PhamePostView.php
··· 173 173 174 174 $uri = $this->getSkin()->getURI('post/'.$this->getPost()->getPhameTitle()); 175 175 176 + require_celerity_resource('phame-css'); 176 177 $fb_comments = phutil_tag('div', 177 178 array( 178 179 'class' => 'fb-comments',
-114
webroot/rsrc/css/application/phame/phame.css
··· 2 2 * @provides phame-css 3 3 */ 4 4 5 - .notice { 6 - background: #F3F3FF; 7 - border: 1px solid #008; 8 - margin: 16px 16px 4px 26px; 9 - } 10 - .notice h3 { 11 - background: #E3E3FF; 12 - padding: 8px; 13 - } 14 - 15 - .notice h4 { 16 - font-weight: normal; 17 - padding: 8px; 18 - } 19 - 20 - .phame-post-preview-header { 21 - margin: 0px 0px 16px 0px; 22 - } 23 - 24 - .device-desktop .phame-post-list { 25 - max-width: 600px; 26 - } 27 - 28 - .phame-post-list .phui-info-view { 29 - margin: 0; 30 - } 31 - 32 - .phame-post-list .phui-icon-view:hover { 33 - text-decoration: none; 34 - } 35 - 36 - .blog-post-list { 37 - clear: left; 38 - float: left; 39 - width: 70%; 40 - margin: 16px 0px 16px 16px; 41 - padding: 0px 8px 12px 8px; 42 - } 43 - 44 - .device .blog-post-list { 45 - float: none; 46 - width: 90%; 47 - margin: 16px auto; 48 - } 49 - 50 - .blog-post-list-full { 51 - clear: left; 52 - float: left; 53 - margin: 16px 0px 0px 0px; 54 - padding: 0px 16px 0px 16px; 55 - } 56 - 57 - .device .blog-post-list-full { 58 - float: none; 59 - margin: 16px auto; 60 - } 61 - 62 - .blog-detail { 63 - float: right; 64 - clear: right; 65 - width: 20%; 66 - margin: 16px 16px 16px 0px; 67 - } 68 - 69 - .device .blog-detail { 70 - float: none; 71 - margin: 16px auto; 72 - width: 90%; 73 - } 74 - 75 - .blog-detail .description { 76 - margin: 16px 0px 16px 0px; 77 - } 78 - 79 - .blog-detail .bloggers { 80 - font-size: {$smallerfontsize}; 81 - } 82 - 83 - .blog-post, 84 - .blog-detail { 85 - border: 1px solid #DBDBDB; 86 - background: #F9F9F9; 87 - padding: 20px; 88 - } 89 - 90 - .blog-post { 91 - margin: 0px 0px 20px 0px; 92 - } 93 - 94 - .blog-post .header { 95 - padding: 0px 0px 16px 0px; 96 - } 97 - 98 - .blog-post .header h1 { 99 - clear: none; 100 - } 101 - 102 - .blog-post .header .last-updated { 103 - color: {$greytext}; 104 - clear: none; 105 - font-size: {$smallerfontsize}; 106 - } 107 - 108 - .blog-post .header .buttons { 109 - float: right; 110 - } 111 - .blog-post .header .buttons a { 112 - margin: 0px 0px 0px 12px; 113 - } 114 - 115 - .more-and-comments { 116 - padding: 12px 0px 12px 0px; 117 - } 118 - 119 5 .fb-comments, 120 6 .fb-comments span, 121 7 .fb-comments iframe[style] {
+1 -2
webroot/rsrc/css/phui/phui-feed-story.css
··· 61 61 } 62 62 63 63 .phui-feed-story-bigtext-post h3 { 64 - font-size: 18px; 65 - font-weight: 200; 64 + font-size: {$biggestfontsize}; 66 65 line-height: 18px; 67 66 color: {$darkgreytext}; 68 67 margin: 0 0 5px 0;