ソースを参照

ディスカバー

dev-master
コミット
6f0a6d9860
  1. 15
      app/Http/Controllers/Peertube/Videos/Overview.php
  2. 5
      resources/views/pages/peertube/videos/overview.blade.php
  3. 8
      resources/views/theme/techsuwa/component/peertube/parts/videos/categories.blade.php
  4. 13
      resources/views/theme/techsuwa/component/peertube/parts/videos/channels.blade.php
  5. 8
      resources/views/theme/techsuwa/component/peertube/parts/videos/tags.blade.php
  6. 18
      resources/views/theme/techsuwa/component/peertube/videos/overview.blade.php
  7. 2
      routes/view/peertube.php

15
app/Http/Controllers/Peertube/Videos/Overview.php

@ -13,17 +13,18 @@ class Overview extends Common {
$this->common = new Common;
}
public function index () {
public function index ($page=1) {
$res = [
'page' => 'dummy',
'page' => 'videoslist',
'paginate' => $page,
'pagetotal' => 500,
'userinfo' => $this->common->user,
];
// $res['owner'] = $this->getOwner($id);
return view('pages.peertube.notyet', ['res' => $res]);
$res['video'] = $this->getVideo($page);
return view('pages.peertube.videos.overview', ['res' => $res]);
}
function getOwner ($id) {
//https://video.076.ne.jp/api/v1/overviews/videos?page=1
return $this->ptapi_get('/api/v1/accounts/'.$id);
function getVideo ($page) {
return $this->ptapi_get('/api/v1/overviews/videos?page='.$page);
}
}

5
resources/views/pages/peertube/videos/overview.blade.php

@ -0,0 +1,5 @@
@extends('theme.'.env('THEME').'.peertube')
@section('content')
@include('theme.'.env('THEME').'.component.peertube.videos.overview')
@endsection

8
resources/views/theme/techsuwa/component/peertube/parts/videos/categories.blade.php

@ -0,0 +1,8 @@
<div class="section videos ng-star-inserted">
<h1 class="section-title">
<a routerlink="/search" href="/peertube/search?categoryOneOf={{ $res['video']->categories[0]->category->id }}">{{ $res['video']->categories[0]->category->label }}</a>
</h1>
@foreach ($res['video']->categories[0]->videos as $k => $v)
@include('theme.'.env('THEME').'.component.peertube.parts.common.videominature')
@endforeach
</div>

13
resources/views/theme/techsuwa/component/peertube/parts/videos/channels.blade.php

@ -0,0 +1,13 @@
<div class="section channel videos ng-star-inserted">
<div class="section-title">
<a href="/peertube/c/{{ $res['video']->channels[0]->channel->name }}{{ $res['video']->channels[0]->channel->host != 'video.076.ne.jp' ? '@'.$res['video']->channels[0]->channel->host : '' }}">
<my-actor-avatar>
<img class="avatar channel ng-star-inserted" src="{{ !is_null($res['video']->channels[0]->channel->avatar) ? 'https://video.076.ne.jp'.$res['video']->channels[0]->channel->avatar->path : '/img/noicon.jpg' }}" alt="チャンネルのアバター">
</my-actor-avatar>
<h2 class="section-title">{{ $res['video']->channels[0]->channel->displayName }}</h2>
</a>
</div>
@foreach ($res['video']->channels[0]->videos as $k => $v)
@include('theme.'.env('THEME').'.component.peertube.parts.common.videominature')
@endforeach
</div>

8
resources/views/theme/techsuwa/component/peertube/parts/videos/tags.blade.php

@ -0,0 +1,8 @@
<div class="section videos ng-star-inserted">
<h2 class="section-title">
<a routerlink="/search" href="/peertube/search?tagsOneOf=vampiros">{{ '#'.$res['video']->tags[0]->tag }}</a>
</h2>
@foreach ($res['video']->tags[0]->videos as $k => $v)
@include('theme.'.env('THEME').'.component.peertube.parts.common.videominature')
@endforeach
</div>

18
resources/views/theme/techsuwa/component/peertube/videos/overview.blade.php

@ -0,0 +1,18 @@
<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">
@if (!empty($res['video']->categories)) @include('theme.'.env('THEME').'.component.peertube.parts.videos.categories') @endif
@if (!empty($res['video']->tags)) @include('theme.'.env('THEME').'.component.peertube.parts.videos.tags') @endif
@if (!empty($res['video']->channels)) @include('theme.'.env('THEME').'.component.peertube.parts.videos.channels') @endif
<div style="margin-top: 16px;"></div>
@include('theme.'.env('THEME').'.component.peertube.parts.common.paginate', [
'root' => '/peertube/videos/overview'
])
</div>
</div>
</div>
</div>
</div>

2
routes/view/peertube.php

@ -36,7 +36,7 @@ Route::group(['prefix' => 'peertube'], function () {
Route::group(['prefix' => 'videos'], function () {
Route::any('/', 'Peertube\Videos\Local@index');
Route::any('/subscriptions', 'Peertube\Videos\Subscriptions@index');
Route::any('/overview', 'Peertube\Videos\Overview@index');
Route::any('/overview/{page?}', 'Peertube\Videos\Overview@index');
Route::any('/trending/{page?}', 'Peertube\Videos\Trending@index');
Route::any('/recently-added/{page?}', 'Peertube\Videos\Recentlyadded@index');
Route::any('/local/{page?}', 'Peertube\Videos\Local@index');

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