トップページ

このコミットが含まれているのは:
守矢諏訪子 2021-12-16 21:26:49 +09:00
コミット 7bf57141b2
5個のファイルの変更44行の追加6行の削除

ファイルの表示

@ -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');
}
}

17
resources/views/pages/peertube/home.blade.php ノーマルファイル
ファイルの表示

@ -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');