review.blade.php 3.03 KB
@inject('webpackAssets', 'FootyRoom\Support\WebpackAssets')

@extends('layouts.default', ['isShowAds' => false])

@php
    $webpackAssets->require('web/public/js/dist/forum');
	$webpackAssets->require('web/public/css/dist/flags-review');
	$webpackAssets->require('web/public/css/dist/markdown');
@endphp

@section('content')
	@if (count($flagsReports) > 0)
		<div class="fixed-header-push">
			<div id="comments">
				<div class="comment-list flags-review">
					@foreach($flagsReports as $report) 
						<div class="review-task" ng-controller="FlagsReportController as ctrl" data-comment-id="{!! $report->commentId !!}">
							<div class="review-task-bar row">
								<div class="col-sm-8 clearfix">
									<ul class="pointer pull-left unselectable" ng-click="showDetails = !showDetails" ng-class="{open: showDetails}">
										<i class="review-task-tick pull-right" ng-class="{'icn-tick-up': showDetails, 'icn-tick-down': !showDetails}"></i>

										<li>
											{!! $report->total !!} Flag{!! $report->total > 1 ? 's' : '' !!}
										</li>
										
										@foreach (['spam', 'rude', 'broken'] as $flagName)
											@if (isset($report->$flagName))
												<li>
													<span class="text-badge danger">{!! count($report->$flagName) !!}</span> {!! ucwords($flagName) !!}
												</li>
											@endif
										@endforeach
									</ul>

									<ul class="clear" ng-show="showDetails" ng-cloak>
										@foreach (['spam', 'rude', 'broken'] as $flagName)
											@if (isset($report->$flagName))
												<li>
													Voted {!! ucwords($flagName) !!}
													
													<div class="review-task-reporters">
														@foreach ($report->$flagName as $reporter)
															<a href="{!! route('profile', ['username' => $reporter]) !!}">{!! $reporter !!}</a>
														@endforeach
													</div>
												</li>
											@endif
										@endforeach
									</ul>
								</div>
								<ul class="review-task-menu col-sm-4 clearfix">
									<div class="pull-right">
										@if ($report->url)
											<a class="btn btn-link" href="{!! $report->url !!}">Go to post</a>
										@endif
										
										<span class="btn pointer" ng-click="ctrl.clear()">Mark Resolved</span>
									</div>
								</ul>
							</div>
							@include('comments/comment', [
								'disThumbs' => true,
								'controller' => strpos($report->comment->discussionId, 'forumPost') === false ? null : 'forumCommentController',
								'disReply' => true,
								'comment' => $report->comment,
								'markdown' => strpos($report->comment->discussionId, 'forumPost') === false ? false : true,
								'post' => $report->post ?? null,
							])
						</div>
					@endforeach
				</div>
			</div>
		</div>
	
		<div class="text-center">
			{!! $pagination->render() !!}
		</div>

		<div class="displayno">
			@compose('comments/commenter', 'CommenterComposer', null, $user())
		</div>
		@include('comments/removeWizard')
	@else
		<div class="main-box text-center">
			<h3>Good job, nothing is flagged ;)</h3>
		</div>
	@endif
@endsection