Skip to content

Commit 80f1d01

Browse files
epriestleyepriestley
epriestley
authored and
epriestley
committedNov 6, 2015
Fix Oblivious skin summary remarkup and partially fix title
Summary: Ref T9546. I only got the title to always show the blog title (better than nothing) -- showing the post title properly isn't trivial and is more work than I want to do right now. Test Plan: - Description now has remarkup. - Title now shows blog title (better than nothing). Reviewers: chad Reviewed By: chad Maniphest Tasks: T9546 Differential Revision: https://secure.phabricator.com/D14423
1 parent 3a90cb5 commit 80f1d01

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed
 

‎externals/skins/oblivious/header.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
echo _e($blog->getName());
1414
?></a>
1515
</h1>
16-
<p><?php echo _e($blog->getDescription()); ?></p>
16+
<p><?php echo $skin->remarkup($blog->getDescription()); ?></p>
1717
</div>
1818
<div class="oblivious-content">

‎src/applications/phame/skins/PhameBasicTemplateBlogSkin.php

+16-7
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ public function getCSSResources() {
7979
return $this->cssResources;
8080
}
8181

82+
public function remarkup($corpus) {
83+
$view = id(new PHUIRemarkupView($this->getViewer(), $corpus));
84+
85+
return hsprintf('%s', $view);
86+
}
87+
8288
public function getName() {
8389
return $this->getSpecification()->getName();
8490
}
@@ -107,13 +113,16 @@ private function renderTemplate($__template__, array $__scope__) {
107113

108114
private function getDefaultScope() {
109115
return array(
110-
'skin' => $this,
111-
'blog' => $this->getBlog(),
112-
'uri' => $this->getURI($this->getURIPath()),
113-
'home_uri' => $this->getURI(''),
114-
'title' => $this->getTitle(),
116+
'skin' => $this,
117+
'blog' => $this->getBlog(),
118+
'uri' => $this->getURI($this->getURIPath()),
119+
'home_uri' => $this->getURI(''),
120+
121+
// TODO: This is wrong for detail pages, which should show the post
122+
// title, but getting it right is a pain and this is better than nothing.
123+
'title' => $this->getBlog()->getName(),
115124
'description' => $this->getDescription(),
116-
'og_type' => $this->getOGType(),
125+
'og_type' => $this->getOGType(),
117126
);
118127
}
119128

@@ -135,7 +144,7 @@ protected function renderPostDetail(PhamePostView $post) {
135144
return $this->renderTemplate(
136145
'post-detail.php',
137146
array(
138-
'post' => $post,
147+
'post' => $post,
139148
));
140149
}
141150

0 commit comments

Comments
 (0)
Failed to load comments.