Skip to content

Commit 3a90cb5

Browse files
committedNov 6, 2015
Clean up Oblivious skin
Summary: Adds Remarkup rules and CSS, cleans up some spacing a color. Ref T9546 Test Plan: Review a blog post list, and a blog Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9546 Differential Revision: https://secure.phabricator.com/D14421
1 parent af7b162 commit 3a90cb5

File tree

4 files changed

+39
-41
lines changed

4 files changed

+39
-41
lines changed
 

‎externals/skins/oblivious/css/oblivious.css

+11-25
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,18 @@ html {
2929
.oblivious-content {
3030
padding-top: 3%;
3131
margin-left: 22%;
32-
max-width: 600px;
32+
max-width: 800px;
3333
}
3434

3535
a {
36-
color: #222222;
36+
color: #2980b9;
3737
text-decoration: none;
3838
}
3939

4040
a:hover {
41-
color: #a00000;
41+
text-decoration: underline;
4242
}
4343

44-
4544
h1 {
4645
font-size: 24px;
4746
font-weight: normal;
@@ -50,37 +49,24 @@ h1 {
5049
h2 {
5150
font-size: 22px;
5251
font-weight: bold;
52+
margin-bottom: 8px;
5353
}
5454

5555
.phame-post {
5656
margin: 0 0 2em;
5757
}
5858

59-
.phame-post-date {
60-
font-size: 12px;
61-
margin: .25em 0 1em;
62-
}
63-
64-
.phame-post {
65-
line-height: 1.6em;
66-
}
67-
68-
.phame-post p {
69-
margin: 0 0 1em;
59+
.phame-post-title {
60+
font-size: 28px;
7061
}
7162

72-
.phame-post tt {
73-
color: #333333;
74-
background: #ebebeb;
75-
padding: 0 .25em;
76-
white-space: pre-wrap;
63+
.phame-post-date {
64+
font-size: 12px;
65+
margin: .25em 0 2em;
7766
}
7867

79-
.phame-post .remarkup-code-block pre {
80-
overflow: auto;
81-
padding: 10px 10px;
82-
border: 1px solid #dfdfdf;
83-
background-color: #f8f8f8;
68+
.oblivious-content .phabricator-remarkup ul.remarkup-list {
69+
margin-left: 0;
8470
}
8571

8672
.fb-comments,

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

+12-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function setURIPath($uri_path) {
1616
$this->uriPath = $uri_path;
1717
return $this;
1818
}
19+
1920
public function getURIPath() {
2021
return $this->uriPath;
2122
}
@@ -24,6 +25,7 @@ protected function setOGType($og_type) {
2425
$this->oGType = $og_type;
2526
return $this;
2627
}
28+
2729
protected function getOGType() {
2830
return $this->oGType;
2931
}
@@ -32,6 +34,7 @@ protected function setDescription($description) {
3234
$this->description = $description;
3335
return $this;
3436
}
37+
3538
protected function getDescription() {
3639
return $this->description;
3740
}
@@ -40,13 +43,12 @@ protected function setTitle($title) {
4043
$this->title = $title;
4144
return $this;
4245
}
46+
4347
protected function getTitle() {
4448
return $this->title;
4549
}
4650

47-
public function processRequest() {
48-
$request = $this->getRequest();
49-
51+
public function handleRequest(AphrontRequest $request) {
5052
$content = $this->renderContent($request);
5153

5254
if (!$content) {
@@ -69,7 +71,6 @@ public function processRequest() {
6971
$view->setFrameable(true);
7072
}
7173

72-
7374
$view->appendChild($content);
7475

7576
$response = new AphrontWebpageResponse();
@@ -222,7 +223,7 @@ protected function renderNewerPageLink() {
222223
* @task internal
223224
*/
224225
protected function renderContent(AphrontRequest $request) {
225-
$user = $request->getUser();
226+
$viewer = $request->getViewer();
226227

227228
$matches = null;
228229
$path = $request->getPath();
@@ -233,7 +234,7 @@ protected function renderContent(AphrontRequest $request) {
233234
$this->setURIPath('');
234235
if (preg_match('@^/post/(?P<name>.*)$@', $path, $matches)) {
235236
$post = id(new PhamePostQuery())
236-
->setViewer($user)
237+
->setViewer($viewer)
237238
->withBlogPHIDs(array($this->getBlog()->getPHID()))
238239
->withPhameTitles(array($matches['name']))
239240
->executeOne();
@@ -263,7 +264,7 @@ protected function renderContent(AphrontRequest $request) {
263264
$pager->setPageSize($this->getPageSize());
264265

265266
$posts = id(new PhamePostQuery())
266-
->setViewer($user)
267+
->setViewer($viewer)
267268
->withBlogPHIDs(array($this->getBlog()->getPHID()))
268269
->executeWithCursorPager($pager);
269270

@@ -280,10 +281,10 @@ protected function renderContent(AphrontRequest $request) {
280281

281282
private function buildPostViews(array $posts) {
282283
assert_instances_of($posts, 'PhamePost');
283-
$user = $this->getRequest()->getUser();
284+
$viewer = $this->getViewer();
284285

285286
$engine = id(new PhabricatorMarkupEngine())
286-
->setViewer($user);
287+
->setViewer($viewer);
287288

288289
$phids = array();
289290
foreach ($posts as $post) {
@@ -294,7 +295,7 @@ private function buildPostViews(array $posts) {
294295
}
295296

296297
$handles = id(new PhabricatorHandleQuery())
297-
->setViewer($user)
298+
->setViewer($viewer)
298299
->withPHIDs($phids)
299300
->execute();
300301

@@ -303,7 +304,7 @@ private function buildPostViews(array $posts) {
303304
$views = array();
304305
foreach ($posts as $post) {
305306
$view = id(new PhamePostView())
306-
->setUser($user)
307+
->setUser($viewer)
307308
->setSkin($this)
308309
->setPost($post)
309310
->setBody($engine->getOutput($post, PhamePost::MARKUP_FIELD_BODY))

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

+14-3
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,26 @@ public function processRequest() {
2727
}
2828

2929
$map = CelerityResourceMap::getNamedInstance('phabricator');
30-
$resource_symbol = 'syntax-highlighting-css';
31-
$resource_uri = $map->getURIForSymbol($resource_symbol);
30+
$highlight_symbol = 'syntax-highlighting-css';
31+
$highlight_uri = $map->getURIForSymbol($highlight_symbol);
3232

3333
$this->cssResources[] = phutil_tag(
3434
'link',
3535
array(
3636
'rel' => 'stylesheet',
3737
'type' => 'text/css',
38-
'href' => PhabricatorEnv::getCDNURI($resource_uri),
38+
'href' => PhabricatorEnv::getCDNURI($highlight_uri),
39+
));
40+
41+
$remarkup_symbol = 'phabricator-remarkup-css';
42+
$remarkup_uri = $map->getURIForSymbol($remarkup_symbol);
43+
44+
$this->cssResources[] = phutil_tag(
45+
'link',
46+
array(
47+
'rel' => 'stylesheet',
48+
'type' => 'text/css',
49+
'href' => PhabricatorEnv::getCDNURI($remarkup_uri),
3950
));
4051

4152
$this->cssResources = phutil_implode_html("\n", $this->cssResources);

‎src/applications/phame/view/PhamePostView.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function renderBody() {
8787
return phutil_tag(
8888
'div',
8989
array(
90-
'class' => 'phame-post-body',
90+
'class' => 'phame-post-body phabricator-remarkup',
9191
),
9292
$this->getBody());
9393
}
@@ -96,7 +96,7 @@ public function renderSummary() {
9696
return phutil_tag(
9797
'div',
9898
array(
99-
'class' => 'phame-post-body',
99+
'class' => 'phame-post-body phabricator-remarkup',
100100
),
101101
$this->getSummary());
102102
}

0 commit comments

Comments
 (0)
Failed to load comments.