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 = $('
') + // .addClass('alert alert-warning mb-0 rounded-0 text-center font-weight-bold') + // .html(this.config.announcement.message); + // $('body').prepend(msg); + // } }); }, @@ -748,7 +755,9 @@ type: 'status', item: status.id }).then(res => { - this.feed.splice(index,1); + this.feed = this.feed.filter(s => { + return s.id != status.id; + }) swal('Success', 'You have successfully deleted this post', 'success'); }).catch(err => { swal('Error', 'Something went wrong. Please try again later.', 'error'); diff --git a/resources/views/admin/pages/home.blade.php b/resources/views/admin/pages/home.blade.php index b1cdaa025..0fe9bf325 100644 --- a/resources/views/admin/pages/home.blade.php +++ b/resources/views/admin/pages/home.blade.php @@ -49,17 +49,22 @@
@csrf - +
@csrf - + +
+
+ @csrf + +
@csrf - - + +
@else @@ -73,17 +78,22 @@
@csrf - +
@csrf - + +
+
+ @csrf + +
@csrf - - + +
@endif diff --git a/resources/views/site/help.blade.php b/resources/views/site/help.blade.php index 9fd432e5f..13b5edfff 100644 --- a/resources/views/site/help.blade.php +++ b/resources/views/site/help.blade.php @@ -149,7 +149,7 @@ - {{--
+
@@ -158,13 +158,13 @@

{{__('helpcenter.communityGuidelines')}}

-

 

-

 

+

Content that will be removed

+

Content that is explicitly disallowed

-
--}} +
{{--
diff --git a/resources/views/site/help/community-guidelines.blade.php b/resources/views/site/help/community-guidelines.blade.php index 2ece56545..122113203 100644 --- a/resources/views/site/help/community-guidelines.blade.php +++ b/resources/views/site/help/community-guidelines.blade.php @@ -6,21 +6,58 @@

Community Guidelines


-
-
-
-
-
- -
-
-
-
-

This page isn't available

-

We haven't finished it yet, it will be updated soon!

-
-
-
-
+ @if($page) +
+ {!!$page->content!!} +
+

This document was last updated {{$page->created_at->format('M d, Y')}}.

+

Originally adapted from the Mastodon Code of Conduct.

+ @else +
+

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:

+
+
The following types of content will be removed from the public timeline:
+
    +
  • Excessive advertising
  • +
  • Uncurated news bots posting from third-party news sources
  • +
  • Untagged nudity, pornography and sexually explicit content, including artistic depictions
  • +
  • Untagged gore and extremely graphic violence, including artistic depictions
  • +
+
+
+
+
The following types of content will be removed from the public timeline, and may result in account suspension and revocation of access to the service:
+
    +
  • Racism or advocation of racism
  • +
  • Sexism or advocation of sexism
  • +
  • Discrimination against gender and sexual minorities, or advocation thereof
  • +
  • Xenophobic and/or violent nationalism
  • +
+
+
+
+
The following types of content are explicitly disallowed and will result in revocation of access to the service:
+
    +
  • Sexual depictions of children
  • +
  • Content illegal in Canada, Germany and/or France, such as holocaust denial or Nazi symbolism
  • +
  • Conduct promoting the ideology of National Socialism
  • +
+
+
+
+
Any conduct intended to stalk or harass other users, or to impede other users from utilizing the service, or to degrade the performance of the service, or to harass other users, or to incite other users to perform any of the aforementioned actions, is also disallowed, and subject to punishment up to and including revocation of access to the service. This includes, but is not limited to, the following behaviors:
+
    +
  • Continuing to engage in conversation with a user that has specifically has requested for said engagement with that user to cease and desist may be considered harassment, regardless of platform-specific privacy tools employed.
  • +
  • Aggregating, posting, and/or disseminating a person's demographic, personal, or private data without express permission (informally called doxing or dropping dox) may be considered harassment.
  • +
  • Inciting users to engage another user in continued interaction or discussion after a user has requested for said engagement with that user to cease and desist (informally called brigading or dogpiling) may be considered harassment.
  • +
+
+
+

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.

+
+ @endif @endsection diff --git a/resources/views/site/help/partial/sidebar.blade.php b/resources/views/site/help/partial/sidebar.blade.php index 05f6ec99f..2278eb7a3 100644 --- a/resources/views/site/help/partial/sidebar.blade.php +++ b/resources/views/site/help/partial/sidebar.blade.php @@ -30,11 +30,11 @@ - {{-- --}} + {{-- --}} diff --git a/resources/views/site/terms.blade.php b/resources/views/site/terms.blade.php index 6ede08305..5a2e51fb2 100644 --- a/resources/views/site/terms.blade.php +++ b/resources/views/site/terms.blade.php @@ -43,7 +43,9 @@

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.

8. Governing Law

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.

-
9. Additional Rules
+
9. Community Guidelines
+

You can view our Community Guidelines here.

+
10. Additional Rules

This website does not have any additional rules.

@endif @endsection