Merge pull request #484 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2018-09-23 16:41:52 -06:00 committed by GitHub
commit 3f48792aa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 6 deletions

View File

@ -3,9 +3,11 @@
namespace App\Http\Controllers;
use App\AccountLog;
use App\Following;
use App\UserFilter;
use Auth;
use DB;
use Cache;
use Illuminate\Http\Request;
use App\Http\Controllers\Settings\{
HomeSettings,
@ -69,6 +71,50 @@ class SettingsController extends Controller
return view('settings.dataexport');
}
public function exportFollowing()
{
$data = Cache::remember('account:export:profile:following:'.Auth::user()->profile->id, 1440, function() {
return Auth::user()->profile->following()->get()->map(function($i) {
return $i->url();
});
});
return response()->streamDownload(function () use($data) {
echo $data;
}, 'following.json');
}
public function exportFollowers()
{
$data = Cache::remember('account:export:profile:followers:'.Auth::user()->profile->id, 1440, function() {
return Auth::user()->profile->followers()->get()->map(function($i) {
return $i->url();
});
});
return response()->streamDownload(function () use($data) {
echo $data;
}, 'followers.json');
}
public function exportMuteBlockList()
{
$profile = Auth::user()->profile;
$exists = UserFilter::select('id')
->whereUserId($profile->id)
->exists();
if(!$exists) {
return redirect()->back();
}
$data = Cache::remember('account:export:profile:muteblocklist:'.Auth::user()->profile->id, 1440, function() use($profile) {
return json_encode([
'muted' => $profile->mutedProfileUrls(),
'blocked' => $profile->blockedProfileUrls()
], JSON_PRETTY_PRINT);
});
return response()->streamDownload(function () use($data) {
echo $data;
}, 'muted-and-blocked-accounts.json');
}
public function dataImport()
{
return view('settings.import.home');

View File

@ -24,8 +24,8 @@
<div class="col-md-4">
<div class="card">
<div class="card-body text-center">
<p class="h2">{{App\Util\Lexer\PrettyNumber::convert(App\Status::whereLocal(true)->count())}}</p>
<p class="small text-uppercase font-weight-bold text-muted mb-0">Local Statuses</p>
<p class="h2">{{App\Util\Lexer\PrettyNumber::convert(DB::table('failed_jobs')->where('failed_at', '>=', \Carbon\Carbon::now()->subDay())->count())}}</p>
<p class="small text-uppercase font-weight-bold text-muted mb-0">Failed Jobs (24h)</p>
</div>
</div>
</div>
@ -33,8 +33,36 @@
<div class="col-md-4">
<div class="card">
<div class="card-body text-center">
<p class="h2">{{App\Util\Lexer\PrettyNumber::convert(App\Status::count())}}</p>
<p class="small text-uppercase font-weight-bold text-muted mb-0">All Statuses</p>
<p class="h2">{{App\Util\Lexer\PrettyNumber::convert(App\Report::whereNull('admin_seen')->count())}}</p>
<p class="small text-uppercase font-weight-bold text-muted mb-0">Reports</p>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-4">
<div class="card">
<div class="card-body text-center">
<p class="h2">{{App\Util\Lexer\PrettyNumber::convert(App\Status::whereNull('in_reply_to_id')->whereNull('reblog_of_id')->count())}}</p>
<p class="small text-uppercase font-weight-bold text-muted mb-0">Statuses</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body text-center">
<p class="h2">{{App\Util\Lexer\PrettyNumber::convert(App\Status::whereNotNull('in_reply_to_id')->count())}}</p>
<p class="small text-uppercase font-weight-bold text-muted mb-0">Replies</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body text-center">
<p class="h2">{{App\Util\Lexer\PrettyNumber::convert(App\Status::whereNotNull('reblog_of_id')->count())}}</p>
<p class="small text-uppercase font-weight-bold text-muted mb-0">Shares (Reblogs)</p>
</div>
</div>
</div>
@ -87,7 +115,6 @@
</div>
</div>
</div>
@php($filesum = filesize(storage_path('app/public/m/')))
<div class="col-md-4">
<div class="card">
<div class="card-body text-center">