ソースを参照

トップページ

dev-master
コミット
7bf57141b2
  1. 15
      app/Http/Controllers/Peertube/Home.php
  2. 17
      resources/views/pages/peertube/home.blade.php
  3. 8
      resources/views/theme/techsuwa/component/peertube/home/newest.blade.php
  4. 8
      resources/views/theme/techsuwa/component/peertube/home/popularest.blade.php
  5. 2
      routes/view/peertube.php

15
app/Http/Controllers/Peertube/Home.php

@ -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

8
resources/views/theme/techsuwa/component/peertube/home/newest.blade.php

@ -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>

8
resources/views/theme/techsuwa/component/peertube/home/popularest.blade.php

@ -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>

2
routes/view/peertube.php

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

読み込み中…
キャンセル
保存