diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php
index b3d8869ac..94d149410 100644
--- a/app/Http/Controllers/PageController.php
+++ b/app/Http/Controllers/PageController.php
@@ -18,6 +18,7 @@ class PageController extends Controller
'/site/about' => 'site:about',
'/site/privacy' => 'site:privacy',
'/site/terms' => 'site:terms',
+ '/site/kb/community-guidelines' => 'site:help:community-guidelines'
];
}
@@ -81,7 +82,7 @@ class PageController extends Controller
public function generatePage(Request $request)
{
$this->validate($request, [
- 'page' => 'required|string|in:about,terms,privacy',
+ 'page' => 'required|string|in:about,terms,privacy,community_guidelines',
]);
$page = $request->input('page');
@@ -98,6 +99,10 @@ class PageController extends Controller
case 'terms':
Page::firstOrCreate(['slug' => '/site/terms']);
break;
+
+ case 'community_guidelines':
+ Page::firstOrCreate(['slug' => '/site/kb/community-guidelines']);
+ break;
}
return redirect(route('admin.settings.pages'));
diff --git a/app/Util/Webfinger/Webfinger.php b/app/Util/Webfinger/Webfinger.php
index e8f10c31c..879103332 100644
--- a/app/Util/Webfinger/Webfinger.php
+++ b/app/Util/Webfinger/Webfinger.php
@@ -4,74 +4,43 @@ namespace App\Util\Webfinger;
class Webfinger
{
- public $user;
- public $subject;
- public $aliases;
- public $links;
+ protected $user;
+ protected $subject;
+ protected $aliases;
+ protected $links;
- public function __construct($user)
- {
- $this->user = $user;
- $this->subject = '';
- $this->aliases = [];
- $this->links = [];
- }
+ public function __construct($user)
+ {
+ $this->subject = 'acct:'.$user->username.'@'.parse_url(config('app.url'), PHP_URL_HOST);
+ $this->aliases = [
+ $user->url(),
+ $user->permalink(),
+ ];
+ $this->links = [
+ [
+ 'rel' => 'http://webfinger.net/rel/profile-page',
+ 'type' => 'text/html',
+ 'href' => $user->url(),
+ ],
+ [
+ 'rel' => 'http://schemas.google.com/g/2010#updates-from',
+ 'type' => 'application/atom+xml',
+ 'href' => $user->permalink('.atom'),
+ ],
+ [
+ 'rel' => 'self',
+ 'type' => 'application/activity+json',
+ 'href' => $user->permalink(),
+ ],
+ ];
+ }
- public function setSubject()
- {
- $host = parse_url(config('app.url'), PHP_URL_HOST);
- $username = $this->user->username;
-
- $this->subject = 'acct:'.$username.'@'.$host;
-
- return $this;
- }
-
- public function generateAliases()
- {
- $this->aliases = [
- $this->user->url(),
- $this->user->permalink(),
- ];
-
- return $this;
- }
-
- public function generateLinks()
- {
- $user = $this->user;
-
- $this->links = [
- [
- 'rel' => 'http://webfinger.net/rel/profile-page',
- 'type' => 'text/html',
- 'href' => $user->url(),
- ],
- [
- 'rel' => 'http://schemas.google.com/g/2010#updates-from',
- 'type' => 'application/atom+xml',
- 'href' => $user->permalink('.atom'),
- ],
- [
- 'rel' => 'self',
- 'type' => 'application/activity+json',
- 'href' => $user->permalink(),
- ],
- ];
-
- return $this;
- }
-
- public function generate()
- {
- $this->setSubject();
- $this->generateAliases();
- $this->generateLinks();
-
- return [
- 'subject' => $this->subject,
- 'aliases' => $this->aliases,
- 'links' => $this->links,
- ];
- }
+ public function generate()
+ {
+ return [
+ 'subject' => $this->subject,
+ 'aliases' => $this->aliases,
+ 'links' => $this->links,
+ ];
+ }
}
diff --git a/config/instance.php b/config/instance.php
index 3842de358..6fc04c902 100644
--- a/config/instance.php
+++ b/config/instance.php
@@ -7,4 +7,9 @@ return [
'enabled' => env('INSTANCE_CONTACT_FORM', false),
'max_per_day' => env('INSTANCE_CONTACT_MAX_PER_DAY', 1),
],
+
+ 'announcement' => [
+ 'enabled' => env('INSTANCE_ANNOUNCEMENT_ENABLED', true),
+ 'message' => env('INSTANCE_ANNOUNCEMENT_MESSAGE', 'Example announcement message.
Something else here')
+ ]
];
\ No newline at end of file
diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue
index cf8c5fac1..cb3be6da7 100644
--- a/resources/assets/js/components/Timeline.vue
+++ b/resources/assets/js/components/Timeline.vue
@@ -449,6 +449,13 @@
this.config = res.data;
this.fetchProfile();
this.fetchTimelineApi();
+
+ // if(this.config.announcement.enabled == true) {
+ // let msg = $('
This page isn't available
-We haven't finished it yet, it will be updated soon!
-This document was last updated {{$page->created_at->format('M d, Y')}}.
+Originally adapted from the Mastodon Code of Conduct.
The following guidelines are not a legal document, and final interpretation is up to the administration of {{config('pixelfed.domain.app')}}; they are here to provide you with an insight into our content moderation policies:
+These provisions notwithstanding, the administration of the service reserves the right to revoke any user's access permissions, at any time, for any reason, except as limited by law.
+This document was last updated Jun 26, 2019.
+Originally adapted from the Mastodon Code of Conduct.
+Pixelfed may revise these terms of service for its website at any time without notice. By using this website you are agreeing to be bound by the then current version of these terms of service.
These terms and conditions are governed by and construed in accordance with the laws of Canada and you irrevocably submit to the exclusive jurisdiction of the courts in that State or location.
-You can view our Community Guidelines here.
+This website does not have any additional rules.
@endif @endsection