トップページ
このコミットが含まれているのは:
コミット
7bf57141b2
|
@ -16,14 +16,19 @@ class Home extends Common {
|
|||
public function index () {
|
||||
$res = [
|
||||
'page' => 'home',
|
||||
'style' => 'dummy',
|
||||
'style' => 'videoslist',
|
||||
'userinfo' => $this->common->user,
|
||||
];
|
||||
// $res['owner'] = $this->getOwner($id);
|
||||
return view('pages.peertube.notyet', ['res' => $res]);
|
||||
$res['new'] = $this->getNewest();
|
||||
$res['hot'] = $this->getPopularest();
|
||||
return view('pages.peertube.home', ['res' => $res]);
|
||||
}
|
||||
|
||||
function getOwner ($id) {
|
||||
return $this->ptapi_get('/api/v1/accounts/'.$id);
|
||||
function getNewest () {
|
||||
return $this->ptapi_get('/api/v1/videos?start=0&count=8&sort=-publishedAt&skipCount=true&isLocal=true&nsfw=both');
|
||||
}
|
||||
|
||||
function getPopularest () {
|
||||
return $this->ptapi_get('/api/v1/videos?start=0&count=8&sort=-trending&skipCount=true&isLocal=true&nsfw=both');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
@extends('theme.'.env('THEME').'.peertube')
|
||||
|
||||
@section('content')
|
||||
<div id="content" tabindex="-1" class="main-col">
|
||||
<div class="main-row">
|
||||
<ng-component class="ng-star-inserted">
|
||||
<ng-component class="ng-star-inserted">
|
||||
<h1 class="sr-only">トップページ</h1>
|
||||
<div class="margin-content">
|
||||
@include('theme.'.env('THEME').'.component.peertube.parts.home.newest')
|
||||
@include('theme.'.env('THEME').'.component.peertube.parts.home.popularest')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
|
@ -0,0 +1,8 @@
|
|||
<div class="section channel videos ng-star-inserted">
|
||||
<div class="section-title">
|
||||
<h2 class="section-title">最新投稿された動画</h2>
|
||||
</div>
|
||||
@foreach ($res['new']->data as $v)
|
||||
@include('theme.'.env('THEME').'.component.peertube.parts.common.videominature')
|
||||
@endforeach
|
||||
</div>
|
|
@ -0,0 +1,8 @@
|
|||
<div class="section channel videos ng-star-inserted">
|
||||
<div class="section-title">
|
||||
<h2 class="section-title">人気な動画</h2>
|
||||
</div>
|
||||
@foreach ($res['hot']->data as $v)
|
||||
@include('theme.'.env('THEME').'.component.peertube.parts.common.videominature')
|
||||
@endforeach
|
||||
</div>
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
Route::group(['prefix' => 'peertube'], function () {
|
||||
Route::any('/', 'Peertube\Videos\Local@index');
|
||||
Route::any('/', 'Peertube\Home@index');
|
||||
Route::any('/home', 'Peertube\Home@index');
|
||||
|
||||
Route::any('/a/{id}/{cat?}', 'Peertube\Account@index');
|
||||
|
|
新しいイシューから参照