diff --git a/js/src/forum/components/PagePage.js b/js/src/forum/components/PagePage.js index 855e1f7..0463ee1 100755 --- a/js/src/forum/components/PagePage.js +++ b/js/src/forum/components/PagePage.js @@ -1,5 +1,6 @@ import Page from 'flarum/common/components/Page'; import LoadingIndicator from 'flarum/common/components/LoadingIndicator'; +import classList from 'flarum/common/utils/classList'; import PageHero from './PageHero'; @@ -23,7 +24,7 @@ export default class PagePage extends Page { const page = this.page; return ( -
+
{page ? [ diff --git a/resources/less/forum.less b/resources/less/forum.less index d65076d..8c2d418 100644 --- a/resources/less/forum.less +++ b/resources/less/forum.less @@ -1,25 +1,33 @@ -.PageHero { - margin-bottom: 20px; -} -.PageHero-items { - padding: 0; - margin: 0; - list-style: none; +.Pages { + .PageHero { + margin-bottom: 20px; + } + .PageHero-items { + padding: 0; + margin: 0; + list-style: none; - & > li { - display: inline-block; + & > li { + display: inline-block; + } } -} -.PageHero-title { - > a { - color: @hero-color; + .PageHero-title { + > a { + color: @hero-color; + } + display: inline; + vertical-align: middle; } - display: inline; - vertical-align: middle; -} -.Pages-container { - max-width: 820px; - white-space: pre-wrap; + .Pages-container { + max-width: 820px; + white-space: pre-wrap; + } + + &--isHtml { + .Post-body { + white-space: normal; + } + } } diff --git a/src/Api/Serializer/PageSerializer.php b/src/Api/Serializer/PageSerializer.php index 748f6ed..baecae9 100755 --- a/src/Api/Serializer/PageSerializer.php +++ b/src/Api/Serializer/PageSerializer.php @@ -36,13 +36,13 @@ protected function getDefaultAttributes($page) 'time' => $page->time, 'editTime' => $page->edit_time, 'contentHtml' => Html::render($page->content_html, $page), + 'isHtml' => $page->is_html, ]; if ($this->actor->isAdmin()) { $attributes['content'] = $page->content; $attributes['isHidden'] = $page->is_hidden; $attributes['isRestricted'] = $page->is_restricted; - $attributes['isHtml'] = $page->is_html; } return $attributes;