@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

Style drafts in new PhameBlogView

Summary: Provides more information that a post is a draft.

Test Plan:
Add a draft post, see new style. Check Blog as non-editor, don't see draft post.

{F1008655}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9360

Differential Revision: https://secure.phabricator.com/D14613

+21 -6
+2 -2
resources/celerity/map.php
··· 127 127 'rsrc/css/phui/phui-button.css' => '16020a60', 128 128 'rsrc/css/phui/phui-crumbs-view.css' => '414406b5', 129 129 'rsrc/css/phui/phui-document-pro.css' => 'e0fad431', 130 - 'rsrc/css/phui/phui-document-summary.css' => 'bca1ed88', 130 + 'rsrc/css/phui/phui-document-summary.css' => '350d6025', 131 131 'rsrc/css/phui/phui-document.css' => 'a4a1c3b9', 132 132 'rsrc/css/phui/phui-feed-story.css' => 'b7b26d23', 133 133 'rsrc/css/phui/phui-fontkit.css' => '9cda225e', ··· 790 790 'phui-calendar-list-css' => 'c1c7f338', 791 791 'phui-calendar-month-css' => '476be7e0', 792 792 'phui-crumbs-view-css' => '414406b5', 793 - 'phui-document-summary-view-css' => 'bca1ed88', 793 + 'phui-document-summary-view-css' => '350d6025', 794 794 'phui-document-view-css' => 'a4a1c3b9', 795 795 'phui-document-view-pro-css' => 'e0fad431', 796 796 'phui-feed-story-css' => 'b7b26d23',
+7 -2
src/applications/phame/controller/blog/PhameBlogViewController.php
··· 159 159 160 160 $blogger = phutil_tag('strong', array(), $blogger); 161 161 $date = phabricator_datetime($post->getDatePublished(), $viewer); 162 - $subtitle = pht('Written by %s on %s.', $blogger, $date); 162 + if ($post->isDraft()) { 163 + $subtitle = pht('Unpublished draft by %s.', $blogger); 164 + } else { 165 + $subtitle = pht('Written by %s on %s.', $blogger, $date); 166 + } 163 167 164 168 $item = id(new PHUIDocumentSummaryView()) 165 169 ->setTitle($post->getTitle()) ··· 167 171 ->setSubtitle($subtitle) 168 172 ->setImage($blogger_image) 169 173 ->setImageHref($blogger_uri) 170 - ->setSummary($phame_post); 174 + ->setSummary($phame_post) 175 + ->setDraft($post->isDraft()); 171 176 172 177 $list[] = $item; 173 178 }
+10
src/view/phui/PHUIDocumentSummaryView.php
··· 8 8 private $subtitle; 9 9 private $href; 10 10 private $summary; 11 + private $draft; 11 12 12 13 public function setTitle($title) { 13 14 $this->title = $title; ··· 39 40 return $this; 40 41 } 41 42 43 + public function setDraft($draft) { 44 + $this->draft = $draft; 45 + return $this; 46 + } 47 + 42 48 protected function getTagAttributes() { 43 49 $classes = array(); 44 50 $classes[] = 'phui-document-summary-view'; 45 51 $classes[] = 'phabricator-remarkup'; 52 + 53 + if ($this->draft) { 54 + $classes[] = 'is-draft'; 55 + } 46 56 47 57 return array( 48 58 'class' => implode(' ', $classes),
+2 -2
webroot/rsrc/css/phui/phui-document-summary.css
··· 2 2 * @provides phui-document-summary-view-css 3 3 */ 4 4 5 - .phui-document-summary-view { 6 - 5 + .phui-document-summary-view.is-draft { 6 + opacity: 0.5; 7 7 } 8 8 9 9 body .phui-document-view .phui-document-summary-view h2.remarkup-header {