Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributors (Illustration) #338

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions app/Http/Controllers/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers;

use App\Models\Image;
use App\Models\Notice;
use Carbon\Carbon;
use Exception;
Expand Down Expand Up @@ -305,6 +306,24 @@ public function rdfDescribe(string $resource = null){
return view('main.rdfDescribe', compact('turtle', 'resource'));
}

public function contributors(){
$authors_raw = Image::select(['author', 'author_info'])->distinct()->get()->toArray();
$authors = [];
foreach ($authors_raw as $author) {
$author_info = explode("\n", $author['author_info']);
$authors[$author['author']] = [
'name' => $author['author'],
'info' => [],
];
foreach ($author_info as $ai) {
$air = explode(',', str_replace("\r", "", $ai));
if (empty($air[1])) continue;
$authors[$author['author']]['info'][$air[0]] = $air[1];
}
}
return view('main.contributors', compact('authors'));
}

public function ed403(){
abort(403);
}
Expand Down
133 changes: 133 additions & 0 deletions resources/views/main/contributors.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
@extends('app.layout', ['title' => 'Contributors'])

@section('head')
<style>
#twin {
display: flex;
width: 100%;
box-sizing: border-box;
gap: 40px;
}
#twin > div {
width: 100%;
}
.list-item-a {
width: calc(50% - 12px);
}
#illustration .list-item-b {
display: inline-block;
width: calc(25% - 11px);
margin-right: 10px;
padding: 8px 18px;
}
#illustration .list-item-b:nth-child(4n) {
margin-right: 0;
}
</style>
@endsection

@section('main')
<main>
<h1>コントリビューター一覧</h1>
<p class="center">
LemonadeとLuciaDBはご覧の皆様のご協力・ご尽力により開発・運用されています。
</p>
<div id="twin">
<div id="lemonade">
<h2>Lemonade</h2>
<div style="display: flex; flex-wrap: wrap; justify-content: space-between">
<a class="list-item-a" href="https://dev.lemonade.lily.garden/lily/Aizawa_Kazuha">
<div class="list-item-image">
<img src="https://github.com/miyacorata.png" alt="icon">
</div>
<div class="list-item-data">
<div class="title-ruby">miyacorata</div>
<div class="title">K Miyano</div>
<div>Contributions : N</div>
</div>
</a>
<a class="list-item-a" href="https://dev.lemonade.lily.garden/lily/Aizawa_Kazuha">
<div class="list-item-image">
<img src="https://github.com/dependabot.png" alt="icon">
</div>
<div class="list-item-data">
<div class="title-ruby">contributor</div>
<div class="title">コントリビュータ</div>
<div>Contributions : N</div>
</div>
</a>
</div>
</div>
<div id="lucia-db">
<h2>LuciaDB</h2>
<div style="display: flex; flex-wrap: wrap; ">
<a class="list-item-a" href="https://dev.lemonade.lily.garden/lily/Aizawa_Kazuha">
<div class="list-item-image">
<img src="https://github.com/fvh-P.png" alt="icon">
</div>
<div class="list-item-data">
<div class="title-ruby">fvh-P</div>
<div class="title">ふぁぼ原</div>
<div>Contributions : N</div>
</div>
</a>
</div>
</div>
</div>
<div>
<h2>イラスト寄稿</h2>
<p class="center">
Lemonadeでは以下の皆様からご提供いただいたイラストをアイコンとして使用させていただいています。
</p>
<div id="illustration">
@forelse($authors as $author)
<div class="list-item-b" style="vertical-align: top">
<div class="list-item-data" style="min-height: 80px">
<div class="title">{{ $author['name'] }}</div>
@if(!empty($author['info']['twitter']))
<div>
Twitter : <a href="https://twitter.com/{{ $author['info']['twitter'] }}" target="_blank">
{{ '@'.$author['info']['twitter'] }}</a>
</div>
@endif
@if(!empty($author['info']['pixiv']))
<div>
pixiv : <a href="https://pixiv.net/{{ $author['info']['pixiv'] }}" target="_blank">
{{ $author['info']['pixiv'] }}</a>
</div>
@endif
</div>
</div>
@empty
@endforelse
</div>
<!--<div id="illustration">
<div class="list-item-b">
<div class="list-item-data">
<div class="title">K Miyano</div>
</div>
</div>
<div class="list-item-b">
<div class="list-item-data">
<div class="title">Name</div>
</div>
</div>
<div class="list-item-b">
<div class="list-item-data">
<div class="title">名前</div>
</div>
</div>
<div class="list-item-b">
<div class="list-item-data">
<div class="title">コントリビュータ</div>
</div>
</div>
<div class="list-item-b">
<div class="list-item-data">
<div class="title">コントリビュータ</div>
</div>
</div>
</div>-->
</div>
</main>
@endsection
2 changes: 2 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

Route::resource('/info', InfoController::class, ['only' => ['index', 'show']]);

Route::get('/contributors', [MainController::class, 'contributors'])->name('contributors');

Route::middleware('throttle:30,1')->group(function (){
Route::get('/ogp/{type}/{title}.jpg', [OGPController::class, 'generate'])->name('ogp');
});
Expand Down