Page MenuHomePhabricator

D16147.diff
No OneTemporary

D16147.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -81,7 +81,7 @@
'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 @@
'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
--- /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
--- a/src/applications/phame/controller/blog/PhameBlogViewController.php
+++ b/src/applications/phame/controller/blog/PhameBlogViewController.php
@@ -32,10 +32,10 @@
$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 @@
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 @@
'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
--- a/src/applications/phame/editor/PhameBlogEditEngine.php
+++ b/src/applications/phame/editor/PhameBlogEditEngine.php
@@ -77,6 +77,14 @@
->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
--- a/src/applications/phame/editor/PhameBlogEditor.php
+++ b/src/applications/phame/editor/PhameBlogEditor.php
@@ -15,6 +15,7 @@
$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 @@
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 @@
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 @@
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 @@
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
--- a/src/applications/phame/storage/PhameBlog.php
+++ b/src/applications/phame/storage/PhameBlog.php
@@ -15,6 +15,7 @@
const MARKUP_FIELD_DESCRIPTION = 'markup:description';
protected $name;
+ protected $subtitle;
protected $description;
protected $domain;
protected $configData;
@@ -40,6 +41,7 @@
),
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
--- a/src/applications/phame/storage/PhameBlogTransaction.php
+++ b/src/applications/phame/storage/PhameBlogTransaction.php
@@ -4,6 +4,7 @@
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 @@
$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 @@
$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 @@
$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
--- 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;
+}

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 3, 8:52 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7541640
Default Alt Text
D16147.diff (9 KB)

Event Timeline