From 7d2a6df9f96ed400168672393ea5388bcdccc5b9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 Jun 2019 00:49:12 -0600 Subject: [PATCH 1/9] Update PageController --- app/Http/Controllers/PageController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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')); From 76962abb4c993edfd275cebb371273628f0907d5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 Jun 2019 00:50:01 -0600 Subject: [PATCH 2/9] Update instance config --- config/instance.php | 5 +++++ 1 file changed, 5 insertions(+) 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 From ddaafd9678eb0d56ab8e3eac993e5ccd3a37ffa1 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 Jun 2019 00:50:32 -0600 Subject: [PATCH 3/9] Update Timeline.vue --- resources/assets/js/components/Timeline.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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'); From 6af4e7739b2ca710140b492966555cc9ee222d2b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 Jun 2019 00:50:56 -0600 Subject: [PATCH 4/9] Update admin pages view --- resources/views/admin/pages/home.blade.php | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) 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 From 68ff420699b8e37428efd8708e38ec609e7a7310 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 Jun 2019 00:52:07 -0600 Subject: [PATCH 5/9] Update Community Guidelines view --- .../site/help/community-guidelines.blade.php | 69 ++++++++++++++----- 1 file changed, 53 insertions(+), 16 deletions(-) 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 From 9327d50c28adf128b7522387a490fab9d9b0a56c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 Jun 2019 00:58:45 -0600 Subject: [PATCH 6/9] Update terms view --- resources/views/site/terms.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 From 91062b1f55718e2eda222107e18b29a004e2a166 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 Jun 2019 01:01:20 -0600 Subject: [PATCH 7/9] Update Webfinger class --- app/Util/Webfinger/Webfinger.php | 105 +++++++++++-------------------- 1 file changed, 37 insertions(+), 68 deletions(-) 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, + ]; + } } From 103c0e7420d7c0f2782befa2977ba0cdbd2dded1 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 Jun 2019 01:05:39 -0600 Subject: [PATCH 8/9] Update Help Center view --- resources/views/site/help.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 @@
- {{-- {{--