mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +01:00
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
This commit is contained in:
parent
af7b16248e
commit
3a90cb56b4
4 changed files with 39 additions and 41 deletions
36
externals/skins/oblivious/css/oblivious.css
vendored
36
externals/skins/oblivious/css/oblivious.css
vendored
|
@ -29,19 +29,18 @@ html {
|
||||||
.oblivious-content {
|
.oblivious-content {
|
||||||
padding-top: 3%;
|
padding-top: 3%;
|
||||||
margin-left: 22%;
|
margin-left: 22%;
|
||||||
max-width: 600px;
|
max-width: 800px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #222222;
|
color: #2980b9;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
color: #a00000;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
@ -50,37 +49,24 @@ h1 {
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phame-post {
|
.phame-post {
|
||||||
margin: 0 0 2em;
|
margin: 0 0 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phame-post-title {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
.phame-post-date {
|
.phame-post-date {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin: .25em 0 1em;
|
margin: .25em 0 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phame-post {
|
.oblivious-content .phabricator-remarkup ul.remarkup-list {
|
||||||
line-height: 1.6em;
|
margin-left: 0;
|
||||||
}
|
|
||||||
|
|
||||||
.phame-post p {
|
|
||||||
margin: 0 0 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phame-post tt {
|
|
||||||
color: #333333;
|
|
||||||
background: #ebebeb;
|
|
||||||
padding: 0 .25em;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phame-post .remarkup-code-block pre {
|
|
||||||
overflow: auto;
|
|
||||||
padding: 10px 10px;
|
|
||||||
border: 1px solid #dfdfdf;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.fb-comments,
|
.fb-comments,
|
||||||
|
|
|
@ -16,6 +16,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$this->uriPath = $uri_path;
|
$this->uriPath = $uri_path;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getURIPath() {
|
public function getURIPath() {
|
||||||
return $this->uriPath;
|
return $this->uriPath;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +25,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$this->oGType = $og_type;
|
$this->oGType = $og_type;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getOGType() {
|
protected function getOGType() {
|
||||||
return $this->oGType;
|
return $this->oGType;
|
||||||
}
|
}
|
||||||
|
@ -32,6 +34,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getDescription() {
|
protected function getDescription() {
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
@ -40,13 +43,12 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTitle() {
|
protected function getTitle() {
|
||||||
return $this->title;
|
return $this->title;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processRequest() {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$request = $this->getRequest();
|
|
||||||
|
|
||||||
$content = $this->renderContent($request);
|
$content = $this->renderContent($request);
|
||||||
|
|
||||||
if (!$content) {
|
if (!$content) {
|
||||||
|
@ -69,7 +71,6 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$view->setFrameable(true);
|
$view->setFrameable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$view->appendChild($content);
|
$view->appendChild($content);
|
||||||
|
|
||||||
$response = new AphrontWebpageResponse();
|
$response = new AphrontWebpageResponse();
|
||||||
|
@ -222,7 +223,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
* @task internal
|
* @task internal
|
||||||
*/
|
*/
|
||||||
protected function renderContent(AphrontRequest $request) {
|
protected function renderContent(AphrontRequest $request) {
|
||||||
$user = $request->getUser();
|
$viewer = $request->getViewer();
|
||||||
|
|
||||||
$matches = null;
|
$matches = null;
|
||||||
$path = $request->getPath();
|
$path = $request->getPath();
|
||||||
|
@ -233,7 +234,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$this->setURIPath('');
|
$this->setURIPath('');
|
||||||
if (preg_match('@^/post/(?P<name>.*)$@', $path, $matches)) {
|
if (preg_match('@^/post/(?P<name>.*)$@', $path, $matches)) {
|
||||||
$post = id(new PhamePostQuery())
|
$post = id(new PhamePostQuery())
|
||||||
->setViewer($user)
|
->setViewer($viewer)
|
||||||
->withBlogPHIDs(array($this->getBlog()->getPHID()))
|
->withBlogPHIDs(array($this->getBlog()->getPHID()))
|
||||||
->withPhameTitles(array($matches['name']))
|
->withPhameTitles(array($matches['name']))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
@ -263,7 +264,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$pager->setPageSize($this->getPageSize());
|
$pager->setPageSize($this->getPageSize());
|
||||||
|
|
||||||
$posts = id(new PhamePostQuery())
|
$posts = id(new PhamePostQuery())
|
||||||
->setViewer($user)
|
->setViewer($viewer)
|
||||||
->withBlogPHIDs(array($this->getBlog()->getPHID()))
|
->withBlogPHIDs(array($this->getBlog()->getPHID()))
|
||||||
->executeWithCursorPager($pager);
|
->executeWithCursorPager($pager);
|
||||||
|
|
||||||
|
@ -280,10 +281,10 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
|
|
||||||
private function buildPostViews(array $posts) {
|
private function buildPostViews(array $posts) {
|
||||||
assert_instances_of($posts, 'PhamePost');
|
assert_instances_of($posts, 'PhamePost');
|
||||||
$user = $this->getRequest()->getUser();
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
$engine = id(new PhabricatorMarkupEngine())
|
$engine = id(new PhabricatorMarkupEngine())
|
||||||
->setViewer($user);
|
->setViewer($viewer);
|
||||||
|
|
||||||
$phids = array();
|
$phids = array();
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
|
@ -294,7 +295,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
}
|
}
|
||||||
|
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($user)
|
->setViewer($viewer)
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
@ -303,7 +304,7 @@ abstract class PhameBasicBlogSkin extends PhameBlogSkin {
|
||||||
$views = array();
|
$views = array();
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
$view = id(new PhamePostView())
|
$view = id(new PhamePostView())
|
||||||
->setUser($user)
|
->setUser($viewer)
|
||||||
->setSkin($this)
|
->setSkin($this)
|
||||||
->setPost($post)
|
->setPost($post)
|
||||||
->setBody($engine->getOutput($post, PhamePost::MARKUP_FIELD_BODY))
|
->setBody($engine->getOutput($post, PhamePost::MARKUP_FIELD_BODY))
|
||||||
|
|
|
@ -27,15 +27,26 @@ final class PhameBasicTemplateBlogSkin extends PhameBasicBlogSkin {
|
||||||
}
|
}
|
||||||
|
|
||||||
$map = CelerityResourceMap::getNamedInstance('phabricator');
|
$map = CelerityResourceMap::getNamedInstance('phabricator');
|
||||||
$resource_symbol = 'syntax-highlighting-css';
|
$highlight_symbol = 'syntax-highlighting-css';
|
||||||
$resource_uri = $map->getURIForSymbol($resource_symbol);
|
$highlight_uri = $map->getURIForSymbol($highlight_symbol);
|
||||||
|
|
||||||
$this->cssResources[] = phutil_tag(
|
$this->cssResources[] = phutil_tag(
|
||||||
'link',
|
'link',
|
||||||
array(
|
array(
|
||||||
'rel' => 'stylesheet',
|
'rel' => 'stylesheet',
|
||||||
'type' => 'text/css',
|
'type' => 'text/css',
|
||||||
'href' => PhabricatorEnv::getCDNURI($resource_uri),
|
'href' => PhabricatorEnv::getCDNURI($highlight_uri),
|
||||||
|
));
|
||||||
|
|
||||||
|
$remarkup_symbol = 'phabricator-remarkup-css';
|
||||||
|
$remarkup_uri = $map->getURIForSymbol($remarkup_symbol);
|
||||||
|
|
||||||
|
$this->cssResources[] = phutil_tag(
|
||||||
|
'link',
|
||||||
|
array(
|
||||||
|
'rel' => 'stylesheet',
|
||||||
|
'type' => 'text/css',
|
||||||
|
'href' => PhabricatorEnv::getCDNURI($remarkup_uri),
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->cssResources = phutil_implode_html("\n", $this->cssResources);
|
$this->cssResources = phutil_implode_html("\n", $this->cssResources);
|
||||||
|
|
|
@ -87,7 +87,7 @@ final class PhamePostView extends AphrontView {
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
'class' => 'phame-post-body',
|
'class' => 'phame-post-body phabricator-remarkup',
|
||||||
),
|
),
|
||||||
$this->getBody());
|
$this->getBody());
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ final class PhamePostView extends AphrontView {
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
'class' => 'phame-post-body',
|
'class' => 'phame-post-body phabricator-remarkup',
|
||||||
),
|
),
|
||||||
$this->getSummary());
|
$this->getSummary());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue