mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
commit
52fdc0e1c7
18 changed files with 152 additions and 29 deletions
|
@ -267,7 +267,7 @@ class ApiV1Controller extends Controller
|
||||||
'max_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
'max_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
||||||
'since_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
'since_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
||||||
'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
||||||
'limit' => 'nullable|integer|min:1|max:40'
|
'limit' => 'nullable|integer|min:1|max:80'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$profile = Profile::whereNull('status')->findOrFail($id);
|
$profile = Profile::whereNull('status')->findOrFail($id);
|
||||||
|
@ -748,6 +748,8 @@ class ApiV1Controller extends Controller
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if($like->wasRecentlyCreated == true) {
|
if($like->wasRecentlyCreated == true) {
|
||||||
|
$status->likes_count = $status->likes()->count();
|
||||||
|
$status->save();
|
||||||
LikePipeline::dispatch($like);
|
LikePipeline::dispatch($like);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,6 +779,8 @@ class ApiV1Controller extends Controller
|
||||||
|
|
||||||
if($like) {
|
if($like) {
|
||||||
$like->delete();
|
$like->delete();
|
||||||
|
$status->likes_count = $status->likes()->count();
|
||||||
|
$status->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
$resource = new Fractal\Resource\Item($status, new StatusTransformer());
|
$resource = new Fractal\Resource\Item($status, new StatusTransformer());
|
||||||
|
|
|
@ -40,6 +40,7 @@ class Kernel extends HttpKernel
|
||||||
'api' => [
|
'api' => [
|
||||||
'throttle:60,1',
|
'throttle:60,1',
|
||||||
'bindings',
|
'bindings',
|
||||||
|
\Barryvdh\Cors\HandleCors::class,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ class AuthServiceProvider extends ServiceProvider
|
||||||
$this->registerPolicies();
|
$this->registerPolicies();
|
||||||
|
|
||||||
if(config('pixelfed.oauth_enabled')) {
|
if(config('pixelfed.oauth_enabled')) {
|
||||||
Passport::routes();
|
Passport::routes(null, ['middleware' => [ \Barryvdh\Cors\HandleCors::class ]]);
|
||||||
Passport::tokensExpireIn(now()->addDays(15));
|
Passport::tokensExpireIn(now()->addDays(15));
|
||||||
Passport::refreshTokensExpireIn(now()->addDays(30));
|
Passport::refreshTokensExpireIn(now()->addDays(30));
|
||||||
Passport::enableImplicitGrant();
|
Passport::enableImplicitGrant();
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Transformer\Api\Mastodon\v1;
|
||||||
|
|
||||||
use App\Profile;
|
use App\Profile;
|
||||||
use League\Fractal;
|
use League\Fractal;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class AccountTransformer extends Fractal\TransformerAbstract
|
class AccountTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
|
@ -11,12 +12,11 @@ class AccountTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
$local = $profile->domain == null;
|
$local = $profile->domain == null;
|
||||||
$is_admin = !$local ? false : $profile->user->is_admin;
|
$is_admin = !$local ? false : $profile->user->is_admin;
|
||||||
$acct = $local ? $profile->username . '@' . config('pixelfed.domain.app') : substr($profile->username, 1);
|
$username = $local ? $profile->username : explode('@', substr($profile->username, 1))[0];
|
||||||
$username = $local ? $profile->username : explode('@', $acct)[0];
|
|
||||||
return [
|
return [
|
||||||
'id' => (string) $profile->id,
|
'id' => (string) $profile->id,
|
||||||
'username' => $username,
|
'username' => $username,
|
||||||
'acct' => $acct,
|
'acct' => $username,
|
||||||
'display_name' => $profile->name,
|
'display_name' => $profile->name,
|
||||||
'locked' => (bool) $profile->is_private,
|
'locked' => (bool) $profile->is_private,
|
||||||
'created_at' => $profile->created_at->toJSON(),
|
'created_at' => $profile->created_at->toJSON(),
|
||||||
|
@ -32,7 +32,7 @@ class AccountTransformer extends Fractal\TransformerAbstract
|
||||||
'emojis' => [],
|
'emojis' => [],
|
||||||
'moved' => null,
|
'moved' => null,
|
||||||
'fields' => null,
|
'fields' => null,
|
||||||
'bot' => null,
|
'bot' => false,
|
||||||
'software' => 'pixelfed',
|
'software' => 'pixelfed',
|
||||||
'is_admin' => (bool) $is_admin,
|
'is_admin' => (bool) $is_admin,
|
||||||
];
|
];
|
||||||
|
|
|
@ -28,8 +28,8 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
'created_at' => $status->created_at->toJSON(),
|
'created_at' => $status->created_at->toJSON(),
|
||||||
'emojis' => [],
|
'emojis' => [],
|
||||||
'replies_count' => 0,
|
'replies_count' => 0,
|
||||||
'reblogs_count' => $status->reblogs_count,
|
'reblogs_count' => $status->reblogs_count ?? 0,
|
||||||
'favourites_count' => $status->likes_count,
|
'favourites_count' => $status->likes_count ?? 0,
|
||||||
'reblogged' => null,
|
'reblogged' => null,
|
||||||
'favourited' => null,
|
'favourited' => null,
|
||||||
'muted' => null,
|
'muted' => null,
|
||||||
|
|
|
@ -25,8 +25,8 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
'content' => $status->rendered ?? $status->caption,
|
'content' => $status->rendered ?? $status->caption,
|
||||||
'created_at' => $status->created_at->format('c'),
|
'created_at' => $status->created_at->format('c'),
|
||||||
'emojis' => [],
|
'emojis' => [],
|
||||||
'reblogs_count' => $status->reblogs_count,
|
'reblogs_count' => $status->reblogs_count ?? 0,
|
||||||
'favourites_count' => $status->likes_count,
|
'favourites_count' => $status->likes_count ?? 0,
|
||||||
'reblogged' => $status->shared(),
|
'reblogged' => $status->shared(),
|
||||||
'favourited' => $status->liked(),
|
'favourited' => $status->liked(),
|
||||||
'muted' => null,
|
'muted' => null,
|
||||||
|
|
26
resources/lang/de/helpcenter.php
Normal file
26
resources/lang/de/helpcenter.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
'helpcenter' => 'Hilfezentrum',
|
||||||
|
'whatsnew' => 'Was gibt\'s Neues',
|
||||||
|
|
||||||
|
'gettingStarted' => 'Loslegen',
|
||||||
|
'sharingMedia' => 'Medien teilen',
|
||||||
|
'profile' => 'Profil',
|
||||||
|
'stories' => 'Stories',
|
||||||
|
'hashtags' => 'Hashtags',
|
||||||
|
'discover' => 'Entdecken',
|
||||||
|
'directMessages' => 'Privatnachrichten',
|
||||||
|
'timelines' => 'Timelines',
|
||||||
|
'embed' => 'Einbetten',
|
||||||
|
|
||||||
|
'communityGuidelines' => 'Community-Richtlinien',
|
||||||
|
'whatIsTheFediverse' => 'Was ist das Fediversum?',
|
||||||
|
'controllingVisibility' => 'Sichtbarkeit steuern',
|
||||||
|
'blockingAccounts' => 'Kontosperrung',
|
||||||
|
'safetyTips' => 'Sicherheitstipps',
|
||||||
|
'reportSomething' => 'Etwas melden',
|
||||||
|
'dataPolicy' => 'Datenpolitik'
|
||||||
|
|
||||||
|
];
|
|
@ -2,7 +2,13 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
|
'search' => 'Suche',
|
||||||
|
'home' => 'Heim',
|
||||||
|
'local' => 'Lokal',
|
||||||
|
'network' => 'Netzwerk',
|
||||||
|
'discover' => 'Entdecken',
|
||||||
'viewMyProfile' => 'Mein Profil anschauen',
|
'viewMyProfile' => 'Mein Profil anschauen',
|
||||||
|
'myProfile' => 'Mein Profil',
|
||||||
'myTimeline' => 'Meine Timeline',
|
'myTimeline' => 'Meine Timeline',
|
||||||
'publicTimeline' => 'Öffentliche Timeline',
|
'publicTimeline' => 'Öffentliche Timeline',
|
||||||
'remoteFollow' => 'Aus der Ferne folgen',
|
'remoteFollow' => 'Aus der Ferne folgen',
|
||||||
|
|
|
@ -3,8 +3,10 @@
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'likedPhoto' => 'gefällt dein Foto.',
|
'likedPhoto' => 'gefällt dein Foto.',
|
||||||
|
'likedComment' => 'gefällt dein Kommentar.',
|
||||||
'startedFollowingYou' => 'folgt dir nun.',
|
'startedFollowingYou' => 'folgt dir nun.',
|
||||||
'commented' => 'hat deinen Post kommentiert.',
|
'commented' => 'hat deinen Post kommentiert.',
|
||||||
'mentionedYou' => 'hat dich erwähnt.',
|
'mentionedYou' => 'hat dich erwähnt.',
|
||||||
|
'shared' => 'hat deinen Post teilen.',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -9,4 +9,7 @@ return [
|
||||||
'privateProfileWarning' => 'Dieser Account ist privat',
|
'privateProfileWarning' => 'Dieser Account ist privat',
|
||||||
'alreadyFollow' => ':username bereits folgen?',
|
'alreadyFollow' => ':username bereits folgen?',
|
||||||
'loginToSeeProfile' => 'um deren Bilder und Videos zu sehen.',
|
'loginToSeeProfile' => 'um deren Bilder und Videos zu sehen.',
|
||||||
|
|
||||||
|
'status.disabled.header' => 'Profil nicht verfügbar',
|
||||||
|
'status.disabled.body' => 'Entschuldigung, dieses Profil ist im Moment nicht verfügbar. Bitte versuchen Sie es später noch einmal.',
|
||||||
];
|
];
|
||||||
|
|
|
@ -12,5 +12,8 @@ return [
|
||||||
'l10nWip' => 'Wir arbeiten noch an der Unterstützung weiterer Sprachen',
|
'l10nWip' => 'Wir arbeiten noch an der Unterstützung weiterer Sprachen',
|
||||||
'currentLocale' => 'Aktuelle Sprache',
|
'currentLocale' => 'Aktuelle Sprache',
|
||||||
'selectLocale' => 'Wähle eine der unterstützten Sprachen aus',
|
'selectLocale' => 'Wähle eine der unterstützten Sprachen aus',
|
||||||
|
'contact' => 'Kontakt',
|
||||||
|
'contact-us' => 'Kontaktiere uns',
|
||||||
|
'places' => 'Plätze',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,17 +2,18 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'about' => 'About',
|
'about' => 'About',
|
||||||
'help' => 'Help',
|
'help' => 'Help',
|
||||||
'language' => 'Language',
|
'language' => 'Language',
|
||||||
'fediverse' => 'Fediverse',
|
'fediverse' => 'Fediverse',
|
||||||
'opensource' => 'Open Source',
|
'opensource' => 'Open Source',
|
||||||
'terms' => 'Terms',
|
'terms' => 'Terms',
|
||||||
'privacy' => 'Privacy',
|
'privacy' => 'Privacy',
|
||||||
'l10nWip' => 'We’re still working on localization support',
|
'l10nWip' => 'We’re still working on localization support',
|
||||||
'currentLocale' => 'Current locale',
|
'currentLocale' => 'Current locale',
|
||||||
'selectLocale' => 'Select one of the supported languages',
|
'selectLocale' => 'Select one of the supported languages',
|
||||||
'contact' => 'Contact',
|
'contact' => 'Contact',
|
||||||
'contact-us' => 'Contact Us',
|
'contact-us' => 'Contact Us',
|
||||||
|
'places' => 'Places',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
26
resources/lang/sv/helpcenter.php
Normal file
26
resources/lang/sv/helpcenter.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
'helpcenter' => 'Hjälpcenter',
|
||||||
|
'whatsnew' => 'Vad är nytt',
|
||||||
|
|
||||||
|
'gettingStarted' => 'Komma igång',
|
||||||
|
'sharingMedia' => 'Sharing Media',
|
||||||
|
'profile' => 'Profil',
|
||||||
|
'stories' => 'Stories',
|
||||||
|
'hashtags' => 'Hashtags',
|
||||||
|
'discover' => 'Upptäck',
|
||||||
|
'directMessages' => 'Direktmeddelanden',
|
||||||
|
'timelines' => 'Tidslinjer',
|
||||||
|
'embed' => 'Bädda in',
|
||||||
|
|
||||||
|
'communityGuidelines' => 'Riktlinjer för communityt',
|
||||||
|
'whatIsTheFediverse' => 'Vad är fediversumet?',
|
||||||
|
'controllingVisibility' => 'Kontrollera synlighet',
|
||||||
|
'blockingAccounts' => 'Blocka konton',
|
||||||
|
'safetyTips' => 'Säkerhetstips',
|
||||||
|
'reportSomething' => 'Rapportera någonting',
|
||||||
|
'dataPolicy' => 'Datapolicy'
|
||||||
|
|
||||||
|
];
|
20
resources/lang/sv/navmenu.php
Normal file
20
resources/lang/sv/navmenu.php
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
'search' => 'Sök',
|
||||||
|
'home' => 'Hem',
|
||||||
|
'local' => 'Lokal',
|
||||||
|
'network' => 'Nätverk',
|
||||||
|
'discover' => 'Upptäck',
|
||||||
|
'viewMyProfile' => 'Se min profil',
|
||||||
|
'myProfile' => 'Min Profil',
|
||||||
|
'myTimeline' => 'Min Tidslinje',
|
||||||
|
'publicTimeline' => 'Publik Tidslinje',
|
||||||
|
'remoteFollow' => 'Remote-följ',
|
||||||
|
'settings' => 'Inställningar',
|
||||||
|
'admin' => 'Admin',
|
||||||
|
'logout' => 'Logga ut',
|
||||||
|
'directMessages' => 'Meddelanden',
|
||||||
|
|
||||||
|
];
|
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'likedPhoto' => 'gillade ditt foto.',
|
'likedPhoto' => 'gillade ditt inlägg.',
|
||||||
|
'likedComment' => 'gillade din kommentar.',
|
||||||
'startedFollowingYou' => 'började följa dig.',
|
'startedFollowingYou' => 'började följa dig.',
|
||||||
|
'commented' => 'kommenterade ditt inlägg.',
|
||||||
|
'mentionedYou' => 'nämnde dig.',
|
||||||
|
'shared' => 'delade ditt inlägg.',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'emptyTimeline' => 'Den här användaren har inga inlägg än!',
|
'emptyTimeline' => 'Den här användaren har inga inlägg än!',
|
||||||
'emptyFollowers' => 'Den här användaren har inga följare än!',
|
'emptyFollowers' => 'Den här användaren har inga följare än!',
|
||||||
'emptyFollowing' => 'Den här användaren följer inte någon än!',
|
'emptyFollowing' => 'Den här användaren följer inte någon än!',
|
||||||
'savedWarning' => 'Du är den enda som kan se vad du har sparat',
|
'emptySaved' => 'Du har inte sparat några inlägg än!',
|
||||||
|
'savedWarning' => 'Du är den enda som kan se vad du har sparat',
|
||||||
|
'privateProfileWarning' => 'Det här kontot är privat',
|
||||||
|
'alreadyFollow' => 'Följer du redan :username?',
|
||||||
|
'loginToSeeProfile' => 'för att se hens foton och videos.',
|
||||||
|
|
||||||
|
'status.disabled.header' => 'Profilen är otillgänglig',
|
||||||
|
'status.disabled.body' => 'Förlåt, men den här profilen är otillgänglig just nu. Försök igen om en stund.',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
19
resources/lang/sv/site.php
Normal file
19
resources/lang/sv/site.php
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
'about' => 'Om',
|
||||||
|
'help' => 'Hjälp',
|
||||||
|
'language' => 'Språk',
|
||||||
|
'fediverse' => 'Fediversum',
|
||||||
|
'opensource' => 'Öppen källkod',
|
||||||
|
'terms' => 'Villkor',
|
||||||
|
'privacy' => 'Integritet',
|
||||||
|
'l10nWip' => 'Vi jobbar fortfarande med lokalisering',
|
||||||
|
'currentLocale' => 'Nuvarande locale',
|
||||||
|
'selectLocale' => 'Välj ett av de språk som stöds',
|
||||||
|
'contact' => 'Kontakt',
|
||||||
|
'contact-us' => 'Kontakta oss',
|
||||||
|
'places' => 'Platser',
|
||||||
|
|
||||||
|
];
|
|
@ -8,7 +8,7 @@
|
||||||
<a href="{{route('site.help')}}" class="text-primary pr-3">{{__('site.help')}}</a>
|
<a href="{{route('site.help')}}" class="text-primary pr-3">{{__('site.help')}}</a>
|
||||||
<a href="{{route('site.terms')}}" class="text-primary pr-3">{{__('site.terms')}}</a>
|
<a href="{{route('site.terms')}}" class="text-primary pr-3">{{__('site.terms')}}</a>
|
||||||
<a href="{{route('site.privacy')}}" class="text-primary pr-3">{{__('site.privacy')}}</a>
|
<a href="{{route('site.privacy')}}" class="text-primary pr-3">{{__('site.privacy')}}</a>
|
||||||
<a href="{{route('discover.places')}}" class="text-primary pr-3">Places</a>
|
<a href="{{route('discover.places')}}" class="text-primary pr-3">{{__('site.places')}}</a>
|
||||||
<a href="{{route('site.language')}}" class="text-primary pr-3">{{__('site.language')}}</a>
|
<a href="{{route('site.language')}}" class="text-primary pr-3">{{__('site.language')}}</a>
|
||||||
<a href="https://pixelfed.org" class="text-muted float-right" rel="noopener" title="version {{config('pixelfed.version')}}" data-toggle="tooltip">Powered by Pixelfed</a>
|
<a href="https://pixelfed.org" class="text-muted float-right" rel="noopener" title="version {{config('pixelfed.version')}}" data-toggle="tooltip">Powered by Pixelfed</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Reference in a new issue