(Update) Torrent Request System

- requires `php artisan migrate && php artisan clear:all` if not using
gitupdater

- Create A Torrent Request Anonymously
- Add Bounty To A Torrent Request Anonymously
- Fill A Torrent Request Anonymously

- closes #201
This commit is contained in:
HDVinnie
2018-09-29 22:44:22 -04:00
parent dafce3f4d5
commit 40234c0662
8 changed files with 327 additions and 148 deletions
+82 -71
View File
@@ -255,6 +255,7 @@ class RequestController extends Controller
$tr->type = $request->input('type');
$tr->bounty = $request->input('bounty');
$tr->votes = 1;
$tr->anon = $request->input('anon');
$v = validator($tr->toArray(), [
"name" => "required|max:180",
@@ -265,7 +266,8 @@ class RequestController extends Controller
"category_id" => "required|exists:categories,id",
"type" => "required",
"description" => "required|string",
"bounty" => "required|numeric|min:0|max:{$user->seedbonus}"
"bounty" => "required|numeric|min:0|max:{$user->seedbonus}",
"anon" => "required",
]);
if ($v->fails()) {
@@ -278,6 +280,7 @@ class RequestController extends Controller
$requestsBounty->user_id = $user->id;
$requestsBounty->seedbonus = $request->input('bounty');
$requestsBounty->requests_id = $tr->id;
$requestsBounty->anon = $request->input('anon');
$requestsBounty->save();
$BonTransactions = new BonTransactions();
@@ -296,9 +299,15 @@ class RequestController extends Controller
$profile_url = hrefProfile($user);
// Auto Shout
$this->chat->systemMessage(
"[url={$profile_url}]{$user->username}[/url] has created a new request [url={$tr_url}]{$tr->name}[/url]"
);
if ($tr->anon == 0) {
$this->chat->systemMessage(
"[url={$profile_url}]{$user->username}[/url] has created a new request [url={$tr_url}]{$tr->name}[/url]"
);
} else {
$this->chat->systemMessage(
"An anonymous user has created a new request [url={$tr_url}]{$tr->name}[/url]"
);
}
// Activity Log
\LogActivity::addToLog("Member {$user->username} has made a new torrent request, ID: {$tr->id} NAME: {$tr->name} .");
@@ -347,6 +356,7 @@ class RequestController extends Controller
$category = $request->input('category_id');
$type = $request->input('type');
$description = $request->input('description');
$anon = $request->input('anon');
$torrentRequest->name = $name;
$torrentRequest->imdb = $imdb;
@@ -356,6 +366,7 @@ class RequestController extends Controller
$torrentRequest->category_id = $category;
$torrentRequest->type = $type;
$torrentRequest->description = $description;
$torrentRequest->anon = $anon;
$v = validator($torrentRequest->toArray(), [
"name" => "required|max:180",
@@ -365,8 +376,8 @@ class RequestController extends Controller
"mal" => "required|numeric",
"category_id" => "required|exists:categories,id",
"type" => "required",
"description" => "required|string"
"description" => "required|string",
"anon" => "required",
]);
if ($v->fails()) {
@@ -419,6 +430,7 @@ class RequestController extends Controller
$requestsBounty->user_id = $user->id;
$requestsBounty->seedbonus = $request->input('bonus_value');
$requestsBounty->requests_id = $tr->id;
$requestsBounty->anon = $request->input('anon');
$requestsBounty->save();
$BonTransactions = new BonTransactions();
@@ -437,9 +449,15 @@ class RequestController extends Controller
$profile_url = hrefProfile($user);
// Auto Shout
$this->chat->systemMessage(
"[url={$profile_url}]{$user->username}[/url] has addded {$request->input('bonus_value')} BON bounty to request [url={$tr_url}]{$tr->name}[/url]"
);
if ($requestsBounty->anon == 0) {
$this->chat->systemMessage(
"[url={$profile_url}]{$user->username}[/url] has added {$request->input('bonus_value')} BON bounty to request [url={$tr_url}]{$tr->name}[/url]"
);
} else {
$this->chat->systemMessage(
"An anonymous user added {$request->input('bonus_value')} BON bounty to request [url={$tr_url}]{$tr->name}[/url]"
);
}
// Send Private Message
if ($user->id != $tr->user_id) {
@@ -448,7 +466,11 @@ class RequestController extends Controller
$pm->receiver_id = $tr->user_id;
$pm->subject = "Your Request " . $tr->name . " Has A New Bounty!";
$profile_url = hrefProfile($user);
$pm->message = "[url={$profile_url}]{$user->username}[/url] Has Added A Bounty To " . "[url={$tr_url}]" . $tr->name . "[/url]";
if ($requestsBounty->anon == 0) {
$pm->message = "[url={$profile_url}]{$user->username}[/url] Has Added A Bounty To " . "[url={$tr_url}]" . $tr->name . "[/url]";
} else {
$pm->message = "An Anonymous User Has Added A Bounty To " . "[url={$tr_url}]" . $tr->name . "[/url]";
}
$pm->save();
}
@@ -471,66 +493,45 @@ class RequestController extends Controller
{
$user = auth()->user();
$v = validator($request->all(), [
'request_id' => "required|exists:requests,id",
'info_hash' => "required|exists:torrents,info_hash",
]);
if ($v->passes()) {
$torrent = Torrent::where('info_hash', $request->input('info_hash'))->firstOrFail();
if ($user->id == $torrent->user_id) {
$this->addRequestModeration($request->input('request_id'), $request->input('info_hash'));
return redirect()->route('request', ['id' => $request->input('request_id')])
->with(Toastr::success('Your request fill is pending approval by the Requestor.', 'Yay!', ['options']));
} elseif ($user->id != $torrent->user_id && Carbon::now()->addDay() > $torrent->created_at) {
$this->addRequestModeration($request->input('request_id'), $request->input('info_hash'));
return redirect()->route('request', ['id' => $request->input('request_id')])
->with(Toastr::success('Your request fill is pending approval by the Requestor.', 'Yay!', ['options']));
} else {
return redirect()->route('request', ['id' => $request->input('request_id')])
->with(Toastr::error('You cannot fill this request for some weird reason', 'Whoops!', ['options']));
}
} else {
return redirect()->route('request', ['id' => $request->input('request_id')])
->with(Toastr::error('You failed to adhere to the requirements.', 'Whoops!', ['options']));
}
}
/**
* Function that handles the actual filling of requests
* @method addRequestModeration
*
* @param $request_id ID of the Request being handled
* @param $info_hash Hash of the torrent filling the hash
*/
public function addRequestModeration($request_id, $info_hash)
{
$user = auth()->user();
$torrentRequest = TorrentRequest::findOrFail($request_id);
$torrentRequest = TorrentRequest::findOrFail($id);
$torrentRequest->filled_by = $user->id;
$torrentRequest->filled_hash = $info_hash;
$torrentRequest->filled_hash = $request->input('info_hash');
$torrentRequest->filled_when = Carbon::now();
$torrentRequest->filled_anon = $request->input('filled_anon');
$torrentRequest->save();
$v = validator($request->all(), [
'request_id' => "required|exists:requests,id",
'info_hash' => "required|exists:torrents,info_hash",
'filled_anon' => "required",
]);
// Send Private Message
$appurl = config('app.url');
if ($v->fails()) {
return redirect()->route('request', ['id' => $request->input('request_id')])
->with(Toastr::error($v->errors()->toJson(), 'Whoops!', ['options']));
} else {
$torrentRequest->save();
$pm = new PrivateMessage;
$pm->sender_id = 1;
$pm->receiver_id = $torrentRequest->user_id;
$pm->subject = "Your Request " . $torrentRequest->name . " Has Been Filled!";
$profile_url = hrefProfile($user);
$pm->message = "[url={$profile_url}]{$user->username}[/url] Has Filled Your Request [url={$appurl}/request/" . $torrentRequest->id . "]" . $torrentRequest->name . "[/url]" . " Please Approve or Decline The FullFill! ";
$pm->save();
// Send Private Message
$appurl = config('app.url');
// Activity Log
\LogActivity::addToLog("Member {$user->username} has filled torrent request, ID: {$torrentRequest->id} NAME: {$torrentRequest->name} . It is now pending approval.");
$pm = new PrivateMessage;
$pm->sender_id = 1;
$pm->receiver_id = $torrentRequest->user_id;
$pm->subject = "Your Request " . $torrentRequest->name . " Has Been Filled!";
$profile_url = hrefProfile($user);
if ($torrentRequest->filled_anon == 0) {
$pm->message = "[url={$profile_url}]{$user->username}[/url] Has Filled Your Request [url={$appurl}/request/" . $torrentRequest->id . "]" . $torrentRequest->name . "[/url]" . " Please Approve or Decline The FullFill! ";
} else {
$pm->message = "An Anonymous User Filled Your Request [url={$appurl}/request/" . $torrentRequest->id . "]" . $torrentRequest->name . "[/url]" . " Please Approve or Decline The FullFill! ";
}
$pm->save();
// Activity Log
\LogActivity::addToLog("Member {$user->username} has filled torrent request, ID: {$torrentRequest->id} NAME: {$torrentRequest->name} . It is now pending approval.");
return redirect()->route('request', ['id' => $request->input('request_id')])
->with(Toastr::success('Your request fill is pending approval by the Requester.', 'Yay!', ['options']));
}
}
/**
@@ -564,12 +565,11 @@ class RequestController extends Controller
$BonTransactions->cost = $fill_amount;
$BonTransactions->sender = 0;
$BonTransactions->receiver = $fill_user->id;
$BonTransactions->comment = "{$fill_user->username} has filled {$tr->name} and has been awared {$fill_amount} BONUS.";
$BonTransactions->comment = "{$fill_user->username} has filled {$tr->name} and has been awarded {$fill_amount} BONUS.";
$BonTransactions->save();
$fill_user->seedbonus += $fill_amount;
$fill_user->save();
//End BON code here.
// Achievements
$fill_user->addProgress(new UserFilled25Requests(), 1);
@@ -581,9 +581,15 @@ class RequestController extends Controller
$profile_url = hrefProfile($fill_user);
// Auto Shout
$this->chat->systemMessage(
"[url={$profile_url}]{$fill_user->username}[/url] has filled [url={$tr_url}]{$tr->name}[/url]"
);
if ($tr->filled_anon == 0) {
$this->chat->systemMessage(
"[url={$profile_url}]{$fill_user->username}[/url] has filled request, [url={$tr_url}]{$tr->name}[/url]"
);
} else {
$this->chat->systemMessage(
"An anonymous user has filled request, [url={$tr_url}]{$tr->name}[/url]"
);
}
// Send Private Message
$pm = new PrivateMessage;
@@ -597,8 +603,13 @@ class RequestController extends Controller
// Activity Log
\LogActivity::addToLog("Member {$user->username} has approved {$fill_user->username} fill on torrent request, ID: {$tr->id} NAME: {$tr->name} .");
return redirect()->route('request', ['id' => $id])
->with(Toastr::success("You have approved {$tr->name} and the bounty has been awarded to {$fill_user->username}", "Yay!", ['options']));
if ($tr->filled_anon == 0) {
return redirect()->route('request', ['id' => $id])
->with(Toastr::success("You have approved {$tr->name} and the bounty has been awarded to {$fill_user->username}", "Yay!", ['options']));
} else {
return redirect()->route('request', ['id' => $id])
->with(Toastr::success("You have approved {$tr->name} and the bounty has been awarded to a anonymous user", "Yay!", ['options']));
}
} else {
return redirect()->route('request', ['id' => $id])
->with(Toastr::error("You don't have access to approve this request", 'Whoops!', ['options']));
@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAnonToRequestsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('requests', function (Blueprint $table) {
$table->boolean('anon')->default(0)->after('claimed');
$table->boolean('filled_anon')->default(0)->after('filled_when');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('requests', function (Blueprint $table) {
//
});
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAnonToRequestBountyTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('request_bounty', function (Blueprint $table) {
$table->boolean('anon')->default(0)->after('requests_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('request_bounty', function (Blueprint $table) {
//
});
}
}
+16 -13
View File
@@ -4,10 +4,6 @@
<title>{{ trans('request.add-request') }} - {{ config('other.title') }}</title>
@endsection
@section('stylesheets')
@endsection
@section('breadcrumb')
<li>
<a href="{{ url('requests') }}" itemprop="url" class="l-breadcrumb-item-link">
@@ -38,8 +34,7 @@
@else
<div class="col-sm-12">
<div class="well well-sm mt-20">
<p class="lead text-orange text-center">{{ trans('request.no-imdb-id') }}</strong>
</p>
<p class="lead text-orange text-center"><strong>{{ trans('request.no-imdb-id') }}</strong></p>
</div>
</div>
<h1 class="upload-title">{{ trans('request.add-request') }}</h1>
@@ -97,18 +92,26 @@
</div>
<div class="form-group">
<label for="bonus_point">{{ trans('request.reward') }}</label>
<label for="bonus_point">{{ trans('request.reward') }} <small><em>({{ trans('request.reward-desc') }})</em></small></label>
<input class="form-control" name="bounty" type="number" min='100' value="100" required>
<span class="help-block">{{ trans('request.reward-desc') }}</span>
</div>
<label for="anon" class="control-label">Anonymous Torrent Request?</label>
<div class="radio-inline">
<label><input type="radio" name="anon" value="1">{{ trans('common.yes') }}</label>
</div>
<div class="radio-inline">
<label><input type="radio" name="anon" checked="checked" value="0">{{ trans('common.yes') }}</label>
</div>
</div>
<button type="submit" class="btn btn-primary">{{ trans('common.submit') }}</button>
<br>
<div class="text-center">
<button type="submit" class="btn btn-primary">{{ trans('common.submit') }}</button>
</div>
</div>
</form>
<br>
</div>
</div>
@endif
@endif
</div>
@endsection
@@ -4,10 +4,6 @@
<title>{{ trans('request.edit-request') }} - {{ config('other.title') }}</title>
@endsection
@section('stylesheets')
@endsection
@section('breadcrumb')
<li>
<a href="{{ url('requests') }}" itemprop="url" class="l-breadcrumb-item-link">
@@ -100,12 +96,29 @@
class="form-control">{{ $torrentRequest->description }}</textarea>
</div>
<button type="submit" class="btn btn-primary">{{ trans('common.submit') }}</button>
<br>
<label for="anon" class="control-label">Anonymous Request?</label>
<div class="radio-inline">
<label>
<input type="radio" name="anon" @if($torrentRequest->anon == 1) checked @endif value="1">{{ trans('common.yes') }}
</label>
</div>
<div class="radio-inline">
<label>
<input type="radio" name="anon" @if($torrentRequest->anon == 0) checked @endif value="0">{{ trans('common.no') }}
</label>
</div>
<br>
<div class="text-center">
<button type="submit" class="btn btn-primary">{{ trans('common.submit') }}</button>
</div>
</div>
</form>
<br>
</div>
</div>
@endif
</div>
@endsection
@section('javascripts')
+101 -36
View File
@@ -63,7 +63,7 @@
@endif @if($user->group->is_modo || ($torrentRequest->user->id == $user->id && $torrentRequest->filled_hash == null))
<a class="btn btn-warning btn-xs"
href="{{ route('edit_request', ['id' => $torrentRequest->id]) }}" role="button"><i
class="{{ config('other.font-awesome') }} fa-pencil-square"
class="{{ config('other.font-awesome') }} fa-edit"
aria-hidden="true"> {{ trans('request.edit-request') }}</i></a>
<button class="btn btn-xs btn-danger" data-toggle="modal" data-target="#delete"><i
class="{{ config('other.font-awesome') }} fa-trash">
@@ -251,9 +251,24 @@
<strong>{{ trans('request.requested-by') }}</strong>
</td>
<td>
<span class="badge-user"><a
href="{{ route('profile', ['username' => $torrentRequest->user->username, 'id' => $torrentRequest->user->id]) }}"
title="">{{ $torrentRequest->user->username }} <em>({{ $torrentRequest->created_at->diffForHumans() }})</em></a></span>
@if ($torrentRequest->anon == 0)
<span class="badge-user">
<a href="{{ route('profile', ['username' => $torrentRequest->user->username, 'id' => $torrentRequest->user->id]) }}" title="">
{{ $torrentRequest->user->username }}
</a>
</span>
@else
<span class="badge-user">{{ strtoupper(trans('common.anonymous')) }}
@if($user->group->is_modo || $torrentRequest->user->username == $user->username)
<a href="{{ route('profile', ['username' => $torrentRequest->user->username, 'id' => $torrentRequest->user->id]) }}" title="">
({{ $torrentRequest->user->username }})
</a>
@endif
</span>
@endif
<span class="badge-user">
<em>({{ $torrentRequest->created_at->diffForHumans() }})</em>
</span>
</td>
</tr>
<tr>
@@ -276,34 +291,38 @@
@elseif($torrentRequest->filled_hash != null)
<button class="btn btn-xs btn-success" disabled><i
class="{{ config('other.font-awesome') }} fa-check-square"></i>{{ trans('request.filled') }}</button>
@else @if($torrentRequestClaim->anon == 0)
<span class="badge-user">{{ $torrentRequestClaim->username }} <em>({{ $torrentRequestClaim->created_at->diffForHumans() }})</em></span> @if($user->group->is_modo || $torrentRequestClaim->username == $user->username)
<a href="{{ route('unclaimRequest', ['id' => $torrentRequest->id]) }}"
class="btn btn-xs btn-danger" role="button" data-toggle="tooltip" title=""
data-original-title="{{ trans('request.unclaim') }}">
<span class="icon"><i
class="{{ config('other.font-awesome') }} fa-times"></i> {{ trans('request.unclaim') }}</span>
@else
@if($torrentRequestClaim->anon == 0)
<span class="badge-user">
<a href="{{ route('profile', ['username' => $torrentRequestClaim->username, 'id' => $torrentRequestClaim->user_id]) }}">
{{ $torrentRequestClaim->username }}
</a>
<a href="{{ route('upload_form', ['title' => $movie->title, 'imdb' => $movie->imdb, 'tmdb' => $movie->tmdb]) }}"
class="btn btn-xs btn-success"> {{ trans('common.upload') }} {{ $movie->title ?? ''}}
</a>
@endif @else
</span>
@else
<span class="badge-user">{{ strtoupper(trans('common.anonymous')) }}
@if($user->group->is_modo || $torrentRequestClaim->username == $user->username)
@if($user->group->is_modo || $torrentRequestClaim->username == $user->username)
({{ $torrentRequestClaim->username }})
@endif
<em>({{ $torrentRequestClaim->created_at->diffForHumans() }})</em></span>
</span>
@endif
<span class="badge-user">
<em>({{ $torrentRequestClaim->created_at->diffForHumans() }})</em>
</span>
@if($user->group->is_modo || $torrentRequestClaim->username == $user->username)
<a href="{{ route('unclaimRequest', ['id' => $torrentRequest->id]) }}"
class="btn btn-xs btn-danger" role="button" data-toggle="tooltip" title=""
data-original-title="{{ trans('request.unclaim') }}">
<span class="icon"><i
class="{{ config('other.font-awesome') }} fa-times"></i> {{ trans('request.unclaim') }}</span>
<span class="icon">
<i class="{{ config('other.font-awesome') }} fa-times"></i> {{ trans('request.unclaim') }}
</span>
</a>
<a href="{{ route('upload_form', ['title' => $movie->title, 'imdb' => $movie->imdb, 'tmdb' => $movie->tmdb]) }}"
class="btn btn-xs btn-success"> {{ trans('common.upload') }} {{ $movie->title ?? ''}}
</a>
@endif @endif @endif
@endif
@endif
</td>
</tr>
@if($torrentRequest->filled_hash != null && $torrentRequest->approved_by != null)
@@ -312,10 +331,24 @@
<strong>{{ trans('request.filled-by') }}</strong>
</td>
<td>
<span class="badge-user"><a
href="{{ route('profile', ['username' => $torrentRequest->FillUser->username, 'id' => $torrentRequest->FillUser->id ]) }}"
title="">{{ $torrentRequest->FillUser->username }}</a></span>
<span class="badge-extra">{{ $torrentRequest->approved_when->diffForHumans() }}</span>
@if ($torrentRequest->filled_anon == 0)
<span class="badge-user">
<a href="{{ route('profile', ['username' => $torrentRequest->FillUser->username, 'id' => $torrentRequest->FillUser->id ]) }}">
{{ $torrentRequest->FillUser->username }}
</a>
</span>
@else
<span class="badge-user">{{ strtoupper(trans('common.anonymous')) }}
@if($user->group->is_modo || $torrentRequest->FillUser->username == $user->username)
<a href="{{ route('profile', ['username' => $torrentRequest->FillUser->username, 'id' => $torrentRequest->FillUser->id ]) }}">
({{ $torrentRequest->FillUser->username }})
</a>
@endif
</span>
@endif
<span class="badge-user">
{{ $torrentRequest->approved_when->diffForHumans() }}
</span>
</td>
</tr>
<tr>
@@ -326,20 +359,40 @@
<a href="{{ route('torrent', ['slug' => $torrentRequest->torrent->slug, 'id' => $torrentRequest->torrent->id]) }}">{{ $torrentRequest->torrent->name }}</a>
</td>
</tr>
@endif @if($torrentRequest->user_id == $user->id && $torrentRequest->filled_hash != null && $torrentRequest->approved_by == null || auth()->user()->group->is_modo && $torrentRequest->filled_hash != null && $torrentRequest->approved_by == null)
@endif
@if($torrentRequest->user_id == $user->id && $torrentRequest->filled_hash != null && $torrentRequest->approved_by == null || auth()->user()->group->is_modo && $torrentRequest->filled_hash != null && $torrentRequest->approved_by == null)
<tr>
<td>
<strong>{{ trans('request.filled-by') }}</strong>
</td>
<td>
<span class="badge-user"><a
href="{{ route('profile', ['username' => $torrentRequest->FillUser->username, 'id' => $torrentRequest->FillUser->id ]) }}"
title="">{{ $torrentRequest->FillUser->username }}</a></span>
<span class="badge-extra">{{ $torrentRequest->filled_when->diffForHumans() }}</span>
<span class="badge-extra"><a
href="{{ route('approveRequest', ['id' => $torrentRequest->id]) }}">{{ trans('request.approve') }}</a></span>
<span class="badge-extra"><a
href="{{ route('rejectRequest', ['id' => $torrentRequest->id]) }}">{{ trans('request.reject') }}</a></span>
@if ($torrentRequest->filled_anon == 0)
<span class="badge-user">
<a href="{{ route('profile', ['username' => $torrentRequest->FillUser->username, 'id' => $torrentRequest->FillUser->id ]) }}">
{{ $torrentRequest->FillUser->username }}
</a>
</span>
@else
<span class="badge-user">{{ strtoupper(trans('common.anonymous')) }}
@if($user->group->is_modo || $torrentRequestClaim->FillUser->username == $user->username)
({{ $torrentRequestClaim->FillUser->username }})
@endif
</span>
@endif
<span class="badge-extra">
{{ $torrentRequest->filled_when->diffForHumans() }}
</span>
<span class="badge-extra">
<a href="{{ route('approveRequest', ['id' => $torrentRequest->id]) }}">
{{ trans('request.approve') }}
</a>
</span>
<span class="badge-extra">
<a href="{{ route('rejectRequest', ['id' => $torrentRequest->id]) }}">
{{ trans('request.reject') }}
</a>
</span>
</td>
</tr>
<tr>
@@ -379,9 +432,21 @@
@foreach($voters as $voter)
<tr>
<td>
<span class="badge-user"><a
href="{{ route('profile', ['username' => $voter->user->username, 'id' => $voter->user->id ]) }}"
title="">{{ $voter->user->username }}</a></span>
@if ($voter->anon == 0)
<span class="badge-user">
<a href="{{ route('profile', ['username' => $voter->user->username, 'id' => $voter->user->id ]) }}">
{{ $voter->user->username }}
</a>
</span>
@else
<span class="badge-user">{{ strtoupper(trans('common.anonymous')) }}
@if($user->group->is_modo || $voter->user->username == $user->username)
<a href="{{ route('profile', ['username' => $voter->user->username, 'id' => $voter->user->id ]) }}">
({{ $voter->user->username }})
</a>
@endif
</span>
@endif
</td>
<td>
{{ $voter->seedbonus }}
@@ -9,19 +9,23 @@
</div>
<form role="form" method="POST" action="{{ route('add_votes',['id' => $torrentRequest->id]) }}">
@csrf
<div class="modal-body">
<p class="text-center">{{ trans('request.enter-bp') }}.</p>
<div class="modal-body text-center">
<p>{{ trans('request.enter-bp') }}</p>
<fieldset>
<input type='hidden' tabindex='3' name='request_id' value='{{ $torrentRequest->id }}'>
<input type="number" tabindex="3" name='bonus_value' min='100' value="100">
<p>Anonymous Bounty?</p>
<div class="radio-inline">
<label><input type="radio" name="anon" value="1">{{ trans('common.yes') }}</label>
</div>
<div class="radio-inline">
<label><input type="radio" name="anon" value="0" checked>{{ trans('common.no') }}</label>
</div>
</fieldset>
<br>
<div class="btns">
<button type="button" class="btn btn-default"
data-dismiss="modal">{{ trans('common.cancel') }}</button>
<button type="submit" @if($user->seedbonus < 100) disabled
title='{{ trans('request.dont-have-bps') }}'
@endif class="btn btn-success">{{ trans('request.vote') }}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('common.cancel') }}</button>
<button type="submit" @if($user->seedbonus < 100) disabled title='{{ trans('request.dont-have-bps') }}' @endif class="btn btn-success">{{ trans('request.vote') }}</button>
</div>
</div>
</form>
@@ -40,17 +44,22 @@
</div>
<form role="form" method="POST" action="{{ route('fill_request',['id' => $torrentRequest->id]) }}">
@csrf
<div class="modal-body">
<p class="text-center">{{ trans('request.enter-hash') }}.</p>
<div class="modal-body text-center">
<p>{{ trans('request.enter-hash') }}.</p>
<fieldset>
<input type='hidden' tabindex='3' name='request_id' value='{{ $torrentRequest->id }}'>
<input type="text" tabindex="3" name='info_hash'
placeholder="{{ trans('request.torrent-hash') }}">
<input type="text" tabindex="3" name='info_hash' placeholder="{{ trans('request.torrent-hash') }}">
<p>Anonymous Fill?</p>
<div class="radio-inline">
<label><input type="radio" name="filled_anon" value="1">{{ trans('common.yes') }}</label>
</div>
<div class="radio-inline">
<label><input type="radio" name="filled_anon" value="0" checked>{{ trans('common.no') }}</label>
</div>
</fieldset>
<br>
<div class="btns">
<button type="button" class="btn btn-default"
data-dismiss="modal">{{ trans('common.cancel') }}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('common.cancel') }}</button>
<button type="submit" class="btn btn-success">{{ trans('request.fill') }}</button>
</div>
</div>
@@ -124,16 +133,16 @@
</div>
<form role="form" method="POST" action="{{ route('claimRequest',['id' => $torrentRequest->id]) }}">
@csrf
<div class="modal-body">
<p class="text-center">{{ trans('request.claim-as-anon') }}?</p>
<div class="modal-body text-center">
<p>{{ trans('request.claim-as-anon') }}?</p>
<br>
<fieldset>
<p>{{ trans('request.claim-anon-choose') }}</p>
<div class="radio-inline">
<label><input type="radio" name="anon" value="1">{{ trans('request.yes') }}</label>
<label><input type="radio" name="anon" value="1">{{ trans('common.yes') }}</label>
</div>
<div class="radio-inline">
<label><input type="radio" name="anon" value="0" checked>{{ trans('request.no') }}</label>
<label><input type="radio" name="anon" value="0" checked>{{ trans('common.no') }}</label>
</div>
</fieldset>
<br>
+16 -3
View File
@@ -3,6 +3,7 @@
<thead>
<tr>
<th class="torrents-icon">{{ trans('torrent.category') }}</th>
<th>{{ trans('torrent.type') }}</th>
<th class="torrents-filename col-sm-6">{{ trans('request.request') }}</th>
<th>{{ trans('common.author') }}</th>
<th>{{ trans('request.votes') }}</th>
@@ -22,19 +23,31 @@
</div>
</td>
<td>
<a class="view-torrent" data-id="{{ $torrentRequest->id }}" href="{{ route('request', ['id' => $torrentRequest->id]) }}">
{{ $torrentRequest->name }}
</a>
<span class="label label-success">
{{ $torrentRequest->type }}
</span>
</td>
<td>
<a class="view-torrent" data-id="{{ $torrentRequest->id }}" href="{{ route('request', ['id' => $torrentRequest->id]) }}">
{{ $torrentRequest->name }}
</a>
</td>
<td>
@if ($torrentRequest->anon == 0)
<span class="badge-user">
<a href="{{ route('profile', ['username' => $torrentRequest->user->username, 'id' => $torrentRequest->user->id]) }}">
{{ $torrentRequest->user->username }}
</a>
</span>
@else
<span class="badge-user">{{ strtoupper(trans('common.anonymous')) }}
@if($user->group->is_modo || $torrentRequest->user->username == $user->username)
<a href="{{ route('profile', ['username' => $torrentRequest->user->username, 'id' => $torrentRequest->user->id]) }}">
({{ $torrentRequest->user->username }})
</a>
@endif
</span>
@endif
</td>
<td>
<span class="badge-user">