Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion js/admin/dist/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18057,7 +18057,7 @@ System.register('flarum/components/BasicsPage', ['flarum/components/Page', 'flar

this.loading = false;

this.fields = ['forum_title', 'forum_description', 'default_locale', 'show_language_selector', 'default_route', 'welcome_title', 'welcome_message'];
this.fields = ['forum_title', 'forum_keywords', 'forum_description', 'default_locale', 'show_language_selector', 'default_route', 'welcome_title', 'welcome_message'];
this.values = {};

var settings = app.data.settings;
Expand Down Expand Up @@ -18091,6 +18091,14 @@ System.register('flarum/components/BasicsPage', ['flarum/components/Page', 'flar
label: app.translator.trans('core.admin.basics.forum_title_heading'),
children: [m('input', { className: 'FormControl', value: this.values.forum_title(), oninput: m.withAttr('value', this.values.forum_title) })]
}),
FieldSet.component({
label: app.translator.trans('core.admin.basics.forum_keywords_heading'),
children: [m(
'div',
{ className: 'helpText' },
app.translator.trans('core.admin.basics.forum_keywords_text')
), m('textarea', { className: 'FormControl', value: this.values.forum_keywords(), oninput: m.withAttr('value', this.values.forum_keywords) })]
}),
FieldSet.component({
label: app.translator.trans('core.admin.basics.forum_description_heading'),
children: [m(
Expand Down
11 changes: 11 additions & 0 deletions js/admin/src/components/BasicsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default class BasicsPage extends Page {

this.fields = [
'forum_title',
'forum_keywords',
'forum_description',
'default_locale',
'show_language_selector',
Expand Down Expand Up @@ -48,6 +49,16 @@ export default class BasicsPage extends Page {
]
})}

{FieldSet.component({
label: app.translator.trans('core.admin.basics.forum_keywords_heading'),
children: [
<div className="helpText">
{app.translator.trans('core.admin.basics.forum_keywords_text')}
</div>,
<textarea className="FormControl" value={this.values.forum_keywords()} oninput={m.withAttr('value', this.values.forum_keywords)}/>
]
})}

{FieldSet.component({
label: app.translator.trans('core.admin.basics.forum_description_heading'),
children: [
Expand Down
1 change: 1 addition & 0 deletions src/Api/Serializer/ForumSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ protected function getDefaultAttributes($model)
{
$attributes = [
'title' => $this->settings->get('forum_title'),
'keywords' => $this->settings->get('forum_keywords'),
'description' => $this->settings->get('forum_description'),
'showLanguageSelector' => (bool) $this->settings->get('show_language_selector', true),
'baseUrl' => $url = $this->app->url(),
Expand Down
2 changes: 2 additions & 0 deletions src/Forum/Controller/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Flarum\Api\Client as ApiClient;
use Flarum\Core\User;
use Flarum\Http\Exception\RouteNotFoundException;
use Flarum\Forum\WebApp;
use Illuminate\Contracts\Events\Dispatcher;
use Psr\Http\Message\ServerRequestInterface as Request;
Expand Down Expand Up @@ -66,6 +67,7 @@ protected function getView(Request $request)
];

$document = $this->getDocument($request->getAttribute('actor'), $params);
if(empty($document->data)) throw new RouteNotFoundException;

$view->document = $document;
$view->content = app('view')->make('flarum.forum::index', compact('document', 'page', 'forum'));
Expand Down
1 change: 1 addition & 0 deletions src/Http/WebApp/WebAppView.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ public function render(Request $request)
$view = $this->view->file(__DIR__.'/../../../views/app.blade.php');

$view->title = $this->buildTitle(array_get($forum, 'data.attributes.title'));
$view->keywords = $this->keywords ?: array_get($forum, 'data.attributes.keywords');
$view->description = $this->description ?: array_get($forum, 'data.attributes.description');
$view->language = $this->language ?: $this->locales->getLocale();
$view->direction = $this->direction ?: 'ltr';
Expand Down
1 change: 1 addition & 0 deletions views/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title>{{ $title }}</title>
<meta name="keywords" content="{{ $keywords }}">
<meta name="description" content="{{ $description }}">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<meta name="theme-color" content="{{ array_get($forum, 'attributes.themePrimaryColor') }}">
Expand Down