Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15199407
D17102.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D17102.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -83,7 +83,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' => 'aeb61182',
+ 'rsrc/css/application/phame/phame.css' => '0f847576',
'rsrc/css/application/pholio/pholio-edit.css' => '07676f51',
'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49',
'rsrc/css/application/pholio/pholio.css' => 'ca89d380',
@@ -827,7 +827,7 @@
'phabricator-uiexample-reactor-sendclass' => '1def2711',
'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee',
'phabricator-zindex-css' => 'd1270942',
- 'phame-css' => 'aeb61182',
+ 'phame-css' => '0f847576',
'pholio-css' => 'ca89d380',
'pholio-edit-css' => '07676f51',
'pholio-inline-comments-css' => '8e545e49',
diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php
--- a/src/applications/phame/controller/post/PhamePostViewController.php
+++ b/src/applications/phame/controller/post/PhamePostViewController.php
@@ -162,6 +162,7 @@
$document->setFoot($next_view);
$crumbs = $this->buildApplicationCrumbs();
$properties = phutil_tag_div('phui-document-view-pro-box', $properties);
+ $share = $this->buildSocialShare($post, $is_live);
$page = $this->newPage()
->setTitle($post->getTitle())
@@ -171,6 +172,7 @@
array(
$hero,
$document,
+ $share,
$about,
$properties,
$timeline,
@@ -317,8 +319,7 @@
return array(head($prev), head($next));
}
- private function buildPhamePostHeader(
- PhamePost $post) {
+ private function buildPhamePostHeader(PhamePost $post) {
$image = null;
if ($post->getHeaderImagePHID()) {
@@ -346,4 +347,43 @@
}
+ private function buildSocialShare(PhamePost $post, $is_live) {
+ if (!$is_live) {
+ return null;
+ }
+ Javelin::initBehavior('phabricator-tooltips');
+
+ $text = $post->getTitle();
+ $url = $post->getLiveURI();
+
+ $twitter_href = "http://twitter.com/share?text={$text}&url={$url}";
+ $facebook_href = "http://www.facebook.com/sharer/sharer.php?u={$url}";
+
+ $twitter = id(new PHUIIconCircleView())
+ ->setIcon('fa-twitter')
+ ->setHref($twitter_href)
+ ->setSize(PHUIIconCircleView::MEDIUM)
+ ->addSigil('has-tooltip')
+ ->setMetadata(
+ array(
+ 'tip' => pht('Share on Twitter'),
+ 'align' => 'N',
+ 'size' => 212,
+ ));
+
+ $facebook = id(new PHUIIconCircleView())
+ ->setIcon('fa-facebook')
+ ->setHref($facebook_href)
+ ->setSize(PHUIIconCircleView::MEDIUM)
+ ->addSigil('has-tooltip')
+ ->setMetadata(
+ array(
+ 'tip' => pht('Share on Facebook'),
+ 'align' => 'N',
+ 'size' => 212,
+ ));
+
+ return phutil_tag_div('phame-social-share', array($twitter, $facebook));
+ }
+
}
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
@@ -2,13 +2,22 @@
* @provides phame-css
*/
-.phame-blog-description {
+.phame-blog-description,
+.phame-social-share {
max-width: 800px;
margin: 32px auto;
position: relative;
padding: 0 8px;
}
+.phame-social-share {
+ text-align: center;
+}
+
+.phame-social-share .phui-icon-circle {
+ margin: 0 4px;
+}
+
.phame-blog-description-name {
font-weight: bold;
font-size: {$biggerfontsize};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 24, 8:33 AM (14 h, 39 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7189345
Default Alt Text
D17102.diff (3 KB)
Attached To
Mode
D17102: Add share widgets to live blog posts
Attached
Detach File
Event Timeline
Log In to Comment