mirror of https://github.com/pixelfed/pixelfed.git
commit
52fdc0e1c7
|
@ -267,7 +267,7 @@ class ApiV1Controller extends Controller
|
|||
'max_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,
|
||||
'limit' => 'nullable|integer|min:1|max:40'
|
||||
'limit' => 'nullable|integer|min:1|max:80'
|
||||
]);
|
||||
|
||||
$profile = Profile::whereNull('status')->findOrFail($id);
|
||||
|
@ -748,6 +748,8 @@ class ApiV1Controller extends Controller
|
|||
]);
|
||||
|
||||
if($like->wasRecentlyCreated == true) {
|
||||
$status->likes_count = $status->likes()->count();
|
||||
$status->save();
|
||||
LikePipeline::dispatch($like);
|
||||
}
|
||||
|
||||
|
@ -777,6 +779,8 @@ class ApiV1Controller extends Controller
|
|||
|
||||
if($like) {
|
||||
$like->delete();
|
||||
$status->likes_count = $status->likes()->count();
|
||||
$status->save();
|
||||
}
|
||||
|
||||
$resource = new Fractal\Resource\Item($status, new StatusTransformer());
|
||||
|
|
|
@ -40,6 +40,7 @@ class Kernel extends HttpKernel
|
|||
'api' => [
|
||||
'throttle:60,1',
|
||||
'bindings',
|
||||
\Barryvdh\Cors\HandleCors::class,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class AuthServiceProvider extends ServiceProvider
|
|||
$this->registerPolicies();
|
||||
|
||||
if(config('pixelfed.oauth_enabled')) {
|
||||
Passport::routes();
|
||||
Passport::routes(null, ['middleware' => [ \Barryvdh\Cors\HandleCors::class ]]);
|
||||
Passport::tokensExpireIn(now()->addDays(15));
|
||||
Passport::refreshTokensExpireIn(now()->addDays(30));
|
||||
Passport::enableImplicitGrant();
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Transformer\Api\Mastodon\v1;
|
|||
|
||||
use App\Profile;
|
||||
use League\Fractal;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AccountTransformer extends Fractal\TransformerAbstract
|
||||
{
|
||||
|
@ -11,12 +12,11 @@ class AccountTransformer extends Fractal\TransformerAbstract
|
|||
{
|
||||
$local = $profile->domain == null;
|
||||
$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('@', $acct)[0];
|
||||
$username = $local ? $profile->username : explode('@', substr($profile->username, 1))[0];
|
||||
return [
|
||||
'id' => (string) $profile->id,
|
||||
'username' => $username,
|
||||
'acct' => $acct,
|
||||
'acct' => $username,
|
||||
'display_name' => $profile->name,
|
||||
'locked' => (bool) $profile->is_private,
|
||||
'created_at' => $profile->created_at->toJSON(),
|
||||
|
@ -32,7 +32,7 @@ class AccountTransformer extends Fractal\TransformerAbstract
|
|||
'emojis' => [],
|
||||
'moved' => null,
|
||||
'fields' => null,
|
||||
'bot' => null,
|
||||
'bot' => false,
|
||||
'software' => 'pixelfed',
|
||||
'is_admin' => (bool) $is_admin,
|
||||
];
|
||||
|
|
|
@ -28,8 +28,8 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
'created_at' => $status->created_at->toJSON(),
|
||||
'emojis' => [],
|
||||
'replies_count' => 0,
|
||||
'reblogs_count' => $status->reblogs_count,
|
||||
'favourites_count' => $status->likes_count,
|
||||
'reblogs_count' => $status->reblogs_count ?? 0,
|
||||
'favourites_count' => $status->likes_count ?? 0,
|
||||
'reblogged' => null,
|
||||
'favourited' => null,
|
||||
'muted' => null,
|
||||
|
|
|
@ -25,8 +25,8 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
'content' => $status->rendered ?? $status->caption,
|
||||
'created_at' => $status->created_at->format('c'),
|
||||
'emojis' => [],
|
||||
'reblogs_count' => $status->reblogs_count,
|
||||
'favourites_count' => $status->likes_count,
|
||||
'reblogs_count' => $status->reblogs_count ?? 0,
|
||||
'favourites_count' => $status->likes_count ?? 0,
|
||||
'reblogged' => $status->shared(),
|
||||
'favourited' => $status->liked(),
|
||||
'muted' => null,
|
||||
|
|
|
@ -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 [
|
||||
|
||||
'search' => 'Suche',
|
||||
'home' => 'Heim',
|
||||
'local' => 'Lokal',
|
||||
'network' => 'Netzwerk',
|
||||
'discover' => 'Entdecken',
|
||||
'viewMyProfile' => 'Mein Profil anschauen',
|
||||
'myProfile' => 'Mein Profil',
|
||||
'myTimeline' => 'Meine Timeline',
|
||||
'publicTimeline' => 'Öffentliche Timeline',
|
||||
'remoteFollow' => 'Aus der Ferne folgen',
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
return [
|
||||
|
||||
'likedPhoto' => 'gefällt dein Foto.',
|
||||
'likedComment' => 'gefällt dein Kommentar.',
|
||||
'startedFollowingYou' => 'folgt dir nun.',
|
||||
'commented' => 'hat deinen Post kommentiert.',
|
||||
'mentionedYou' => 'hat dich erwähnt.',
|
||||
'shared' => 'hat deinen Post teilen.',
|
||||
|
||||
];
|
||||
|
|
|
@ -9,4 +9,7 @@ return [
|
|||
'privateProfileWarning' => 'Dieser Account ist privat',
|
||||
'alreadyFollow' => ':username bereits folgen?',
|
||||
'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',
|
||||
'currentLocale' => 'Aktuelle Sprache',
|
||||
'selectLocale' => 'Wähle eine der unterstützten Sprachen aus',
|
||||
|
||||
'contact' => 'Kontakt',
|
||||
'contact-us' => 'Kontaktiere uns',
|
||||
'places' => 'Plätze',
|
||||
|
||||
];
|
||||
|
|
|
@ -2,17 +2,18 @@
|
|||
|
||||
return [
|
||||
|
||||
'about' => 'About',
|
||||
'help' => 'Help',
|
||||
'language' => 'Language',
|
||||
'fediverse' => 'Fediverse',
|
||||
'opensource' => 'Open Source',
|
||||
'terms' => 'Terms',
|
||||
'privacy' => 'Privacy',
|
||||
'l10nWip' => 'We’re still working on localization support',
|
||||
'currentLocale' => 'Current locale',
|
||||
'selectLocale' => 'Select one of the supported languages',
|
||||
'contact' => 'Contact',
|
||||
'contact-us' => 'Contact Us',
|
||||
'about' => 'About',
|
||||
'help' => 'Help',
|
||||
'language' => 'Language',
|
||||
'fediverse' => 'Fediverse',
|
||||
'opensource' => 'Open Source',
|
||||
'terms' => 'Terms',
|
||||
'privacy' => 'Privacy',
|
||||
'l10nWip' => 'We’re still working on localization support',
|
||||
'currentLocale' => 'Current locale',
|
||||
'selectLocale' => 'Select one of the supported languages',
|
||||
'contact' => 'Contact',
|
||||
'contact-us' => 'Contact Us',
|
||||
'places' => 'Places',
|
||||
|
||||
];
|
||||
|
|
|
@ -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'
|
||||
|
||||
];
|
|
@ -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 [
|
||||
|
||||
'likedPhoto' => 'gillade ditt foto.',
|
||||
'likedPhoto' => 'gillade ditt inlägg.',
|
||||
'likedComment' => 'gillade din kommentar.',
|
||||
'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
|
||||
|
||||
return [
|
||||
'emptyTimeline' => 'Den här användaren har inga inlägg än!',
|
||||
'emptyFollowers' => 'Den här användaren har inga följare ä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',
|
||||
'emptyTimeline' => 'Den här användaren har inga inlägg än!',
|
||||
'emptyFollowers' => 'Den här användaren har inga följare än!',
|
||||
'emptyFollowing' => 'Den här användaren följer inte någon än!',
|
||||
'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.',
|
||||
|
||||
];
|
||||
|
|
|
@ -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.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('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="https://pixelfed.org" class="text-muted float-right" rel="noopener" title="version {{config('pixelfed.version')}}" data-toggle="tooltip">Powered by Pixelfed</a>
|
||||
</p>
|
||||
|
|
Loading…
Reference in New Issue