diff --git a/resources/celerity/map.php b/resources/celerity/map.php index a64ceb83e1..78752ff381 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -81,7 +81,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' => '2473d929', - 'rsrc/css/application/phame/phame.css' => 'dfdaec0e', + 'rsrc/css/application/phame/phame.css' => '4748d928', 'rsrc/css/application/pholio/pholio-edit.css' => '07676f51', 'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49', 'rsrc/css/application/pholio/pholio.css' => 'ca89d380', @@ -808,7 +808,7 @@ return array( 'phabricator-uiexample-reactor-sendclass' => '1def2711', 'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee', 'phabricator-zindex-css' => '5b6fcf3f', - 'phame-css' => 'dfdaec0e', + 'phame-css' => '4748d928', 'pholio-css' => 'ca89d380', 'pholio-edit-css' => '07676f51', 'pholio-inline-comments-css' => '8e545e49', diff --git a/resources/sql/autopatches/20160618.phame.blog.subtitle.sql b/resources/sql/autopatches/20160618.phame.blog.subtitle.sql new file mode 100644 index 0000000000..1ea6572bb0 --- /dev/null +++ b/resources/sql/autopatches/20160618.phame.blog.subtitle.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_phame.phame_blog + ADD subtitle VARCHAR(64) NOT NULL COLLATE {$COLLATE_TEXT}; diff --git a/src/applications/phame/controller/blog/PhameBlogViewController.php b/src/applications/phame/controller/blog/PhameBlogViewController.php index 37e90d1522..1e751c905b 100644 --- a/src/applications/phame/controller/blog/PhameBlogViewController.php +++ b/src/applications/phame/controller/blog/PhameBlogViewController.php @@ -32,10 +32,10 @@ final class PhameBlogViewController extends PhameLiveController { $posts = $post_query->executeWithCursorPager($pager); - $hero = $this->buildHeaderImage($blog); + $hero = $this->buildPhameHeader($blog); $header = id(new PHUIHeaderView()) - ->setHeader($blog->getName()) + ->addClass('phame-header-bar') ->setUser($viewer); if (!$is_external) { @@ -155,11 +155,12 @@ final class PhameBlogViewController extends PhameLiveController { return $actions; } - private function buildHeaderImage( + private function buildPhameHeader( PhameBlog $blog) { + $image = null; if ($blog->getHeaderImagePHID()) { - $view = phutil_tag( + $image = phutil_tag( 'div', array( 'class' => 'phame-header-hero', @@ -170,9 +171,17 @@ final class PhameBlogViewController extends PhameLiveController { 'src' => $blog->getHeaderImageURI(), 'class' => 'phame-header-image', ))); - return $view; } - return null; + + $title = phutil_tag_div('phame-header-title', $blog->getName()); + $subtitle = null; + if ($blog->getSubtitle()) { + $subtitle = phutil_tag_div('phame-header-subtitle', $blog->getSubtitle()); + } + + return phutil_tag_div( + 'phame-mega-header', array($image, $title, $subtitle)); + } } diff --git a/src/applications/phame/editor/PhameBlogEditEngine.php b/src/applications/phame/editor/PhameBlogEditEngine.php index b9ee23a442..9cc7217147 100644 --- a/src/applications/phame/editor/PhameBlogEditEngine.php +++ b/src/applications/phame/editor/PhameBlogEditEngine.php @@ -77,6 +77,14 @@ final class PhameBlogEditEngine ->setConduitTypeDescription(pht('New blog title.')) ->setTransactionType(PhameBlogTransaction::TYPE_NAME) ->setValue($object->getName()), + id(new PhabricatorTextEditField()) + ->setKey('subtitle') + ->setLabel(pht('Subtitle')) + ->setDescription(pht('Blog subtitle.')) + ->setConduitDescription(pht('Change the blog subtitle.')) + ->setConduitTypeDescription(pht('New blog subtitle.')) + ->setTransactionType(PhameBlogTransaction::TYPE_SUBTITLE) + ->setValue($object->getSubtitle()), id(new PhabricatorRemarkupEditField()) ->setKey('description') ->setLabel(pht('Description')) diff --git a/src/applications/phame/editor/PhameBlogEditor.php b/src/applications/phame/editor/PhameBlogEditor.php index c4ffb7c0f9..ec0cbe9e06 100644 --- a/src/applications/phame/editor/PhameBlogEditor.php +++ b/src/applications/phame/editor/PhameBlogEditor.php @@ -15,6 +15,7 @@ final class PhameBlogEditor $types = parent::getTransactionTypes(); $types[] = PhameBlogTransaction::TYPE_NAME; + $types[] = PhameBlogTransaction::TYPE_SUBTITLE; $types[] = PhameBlogTransaction::TYPE_DESCRIPTION; $types[] = PhameBlogTransaction::TYPE_DOMAIN; $types[] = PhameBlogTransaction::TYPE_STATUS; @@ -31,6 +32,8 @@ final class PhameBlogEditor switch ($xaction->getTransactionType()) { case PhameBlogTransaction::TYPE_NAME: return $object->getName(); + case PhameBlogTransaction::TYPE_SUBTITLE: + return $object->getSubtitle(); case PhameBlogTransaction::TYPE_DESCRIPTION: return $object->getDescription(); case PhameBlogTransaction::TYPE_DOMAIN: @@ -46,6 +49,7 @@ final class PhameBlogEditor switch ($xaction->getTransactionType()) { case PhameBlogTransaction::TYPE_NAME: + case PhameBlogTransaction::TYPE_SUBTITLE: case PhameBlogTransaction::TYPE_DESCRIPTION: case PhameBlogTransaction::TYPE_STATUS: return $xaction->getNewValue(); @@ -65,6 +69,8 @@ final class PhameBlogEditor switch ($xaction->getTransactionType()) { case PhameBlogTransaction::TYPE_NAME: return $object->setName($xaction->getNewValue()); + case PhameBlogTransaction::TYPE_SUBTITLE: + return $object->setSubtitle($xaction->getNewValue()); case PhameBlogTransaction::TYPE_DESCRIPTION: return $object->setDescription($xaction->getNewValue()); case PhameBlogTransaction::TYPE_DOMAIN: @@ -82,6 +88,7 @@ final class PhameBlogEditor switch ($xaction->getTransactionType()) { case PhameBlogTransaction::TYPE_NAME: + case PhameBlogTransaction::TYPE_SUBTITLE: case PhameBlogTransaction::TYPE_DESCRIPTION: case PhameBlogTransaction::TYPE_DOMAIN: case PhameBlogTransaction::TYPE_STATUS: diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php index dc11d78417..b956eaa1c6 100644 --- a/src/applications/phame/storage/PhameBlog.php +++ b/src/applications/phame/storage/PhameBlog.php @@ -15,6 +15,7 @@ final class PhameBlog extends PhameDAO const MARKUP_FIELD_DESCRIPTION = 'markup:description'; protected $name; + protected $subtitle; protected $description; protected $domain; protected $configData; @@ -40,6 +41,7 @@ final class PhameBlog extends PhameDAO ), self::CONFIG_COLUMN_SCHEMA => array( 'name' => 'text64', + 'subtitle' => 'text64', 'description' => 'text', 'domain' => 'text128?', 'status' => 'text32', diff --git a/src/applications/phame/storage/PhameBlogTransaction.php b/src/applications/phame/storage/PhameBlogTransaction.php index 6a89b936f6..8d71fa0ee9 100644 --- a/src/applications/phame/storage/PhameBlogTransaction.php +++ b/src/applications/phame/storage/PhameBlogTransaction.php @@ -4,6 +4,7 @@ final class PhameBlogTransaction extends PhabricatorApplicationTransaction { const TYPE_NAME = 'phame.blog.name'; + const TYPE_SUBTITLE = 'phame.blog.subtitle'; const TYPE_DESCRIPTION = 'phame.blog.description'; const TYPE_DOMAIN = 'phame.blog.domain'; const TYPE_STATUS = 'phame.blog.status'; @@ -80,6 +81,7 @@ final class PhameBlogTransaction $tags[] = self::MAILTAG_SUBSCRIBERS; break; case self::TYPE_NAME: + case self::TYPE_SUBTITLE: case self::TYPE_DESCRIPTION: case self::TYPE_DOMAIN: $tags[] = self::MAILTAG_DETAILS; @@ -116,6 +118,19 @@ final class PhameBlogTransaction $new); } break; + case self::TYPE_SUBTITLE: + if ($old === null) { + return pht( + '%s set this blog\'s subtitle to "%s".', + $this->renderHandleLink($author_phid), + $new); + } else { + return pht( + '%s updated the blog\'s subtitle to "%s".', + $this->renderHandleLink($author_phid), + $new); + } + break; case self::TYPE_DESCRIPTION: return pht( '%s updated the blog\'s description.', @@ -166,6 +181,19 @@ final class PhameBlogTransaction $this->renderHandleLink($object_phid)); } break; + case self::TYPE_SUBTITLE: + if ($old === null) { + return pht( + '%s set the subtitle for %s.', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid)); + } else { + return pht( + '%s updated the subtitle for %s.', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid)); + } + break; case self::TYPE_DESCRIPTION: return pht( '%s updated the description for %s.', diff --git a/webroot/rsrc/css/application/phame/phame.css b/webroot/rsrc/css/application/phame/phame.css index 0f226f370d..e6a928b61f 100644 --- a/webroot/rsrc/css/application/phame/phame.css +++ b/webroot/rsrc/css/application/phame/phame.css @@ -261,3 +261,43 @@ max-width: 100%; margin: 0 auto; } + +.phui-document-view.phui-document-view-pro .phui-header-shell.phame-header-bar { + border-top: 1px solid {$thinblueborder}; + border-bottom: none; + padding: 4px 0; +} + +.phame-header-bar .phui-header-subheader { + margin: 0; +} + +.phame-mega-header { + margin: 0 auto; + text-align: center; + background: #fff; + padding: 16px 0 24px; +} + +.device-phone .phame-mega-header { + padding: 24px 0; +} + +.phame-mega-header .phame-header-title { + color: #000; + font-size: 28px; + font-weight: bold; + font-family: 'Aleo', {$fontfamily}; + padding-top: 24px; +} + +.device-phone .phame-mega-header .phame-header-title { + padding-top: 0; +} + +.phame-mega-header .phame-header-subtitle { + color: {$greytext}; + font-size: 20px; + font-family: 'Aleo', {$fontfamily}; + padding-top: 8px; +}