<commit_before>@extends('coanda::admin.layout.main')

@section('page_title', 'Trash')

@section('content')

<div class="row">
	<div class="breadcrumb-nav">
		<ul class="breadcrumb">
			<li><a href="{{ Coanda::adminUrl('pages') }}">Pages</a></li>
			<li>Trash</li>
		</ul>
	</div>
</div>

<div class="row">
	<div class="page-name col-md-12">
		<h1 class="pull-left">Trash <small>Pages</small></h1>
	</div>
</div>

<div class="row">
	<div class="page-options col-md-12">
		{{-- <a href="{{ Coanda::adminUrl('pages/empty-trash') }}" class="btn btn-primary">Empty trash</a> --}}
	</div>
</div>

{{ Form::open(['url' => Coanda::adminUrl('pages/trash')]) }}
<div class="row">
	<div class="col-md-12">
		<div class="page-tabs">
			<ul class="nav nav-tabs">
				<li class="active"><a href="#trashedpages" data-toggle="tab">Trashed pages</a></li>
			</ul>
			<div class="tab-content">
				<div class="tab-pane active" id="trashedpages">

					@if ($pages->count() > 0)
						<table class="table table-striped">
							<tr>
								<th></th>
								<th>Name</th>
								<th></th>
								<th></th>
							</tr>
							@foreach ($pages as $page)
								<tr class="status-{{ $page->status }}">
									<td class="tight">
										@if ($page->can_edit)
											<input type="checkbox" name="permanent_remove_list[]" value="{{ $page->id }}">
										@endif
									</td>
									<td>
										@if ($page->is_draft)
											<i class="fa fa-circle-o"></i>
										@else
											<i class="fa {{ $page->pageType()->icon() }}"></i>
										@endif

										@if ($page->can_view)
											<a href="{{ Coanda::adminUrl('pages/view/' . $page->id) }}">{{ $page->present()->name }}</a>
										@else
											{{ $page->present()->name }}
										@endif
									</td>
									<td>
										@if ($page->can_view)
											@if ($page->locations->count() > 0)
												@foreach ($page->locations as $location)
												<p>
													<a href="{{ Coanda::adminUrl('pages') }}">Pages</a> / 
													@foreach ($location->parents() as $parent)
														<a href="{{ Coanda::adminUrl('pages/location/' . $parent->id) }}">{{ $parent->page->present()->name }}</a> /
													@endforeach
													{{ $location->page->present()->name }}
												</p>
												@endforeach
											@endif
										@endif
									</td>
									<td>
										@if ($page->can_view)
											<a class="pull-right btn btn-xs btn-primary" href="{{ Coanda::adminUrl('pages/restore/' . $page->id) }}">Restore</a>
										@endif
									</td>
								</tr>
							@endforeach
						</table>

						{{ Form::button('Delete permanently', ['name' => 'permanent_remove', 'value' => 'true', 'type' => 'submit', 'class' => 'btn btn-danger']) }}
					@else
						<p>There are no trashed pages.</p>
					@endif
				</div>
			</div>
		</div>
	</div>
</div>
{{ Form::close() }}
@stop<commit_msg>Only show the delete button if they have permission to edit at least one of the items in the list.<commit_after>@extends('coanda::admin.layout.main')

@section('page_title', 'Trash')

@section('content')

<div class="row">
	<div class="breadcrumb-nav">
		<ul class="breadcrumb">
			<li><a href="{{ Coanda::adminUrl('pages') }}">Pages</a></li>
			<li>Trash</li>
		</ul>
	</div>
</div>

<div class="row">
	<div class="page-name col-md-12">
		<h1 class="pull-left">Trash <small>Pages</small></h1>
	</div>
</div>

<div class="row">
	<div class="page-options col-md-12">
		{{-- <a href="{{ Coanda::adminUrl('pages/empty-trash') }}" class="btn btn-primary">Empty trash</a> --}}
	</div>
</div>

{{ Form::open(['url' => Coanda::adminUrl('pages/trash')]) }}

@set('show_delete_button', false)
<div class="row">
	<div class="col-md-12">
		<div class="page-tabs">
			<ul class="nav nav-tabs">
				<li class="active"><a href="#trashedpages" data-toggle="tab">Trashed pages</a></li>
			</ul>
			<div class="tab-content">
				<div class="tab-pane active" id="trashedpages">

					@if ($pages->count() > 0)
						<table class="table table-striped">
							<tr>
								<th></th>
								<th>Name</th>
								<th></th>
								<th></th>
							</tr>
							@foreach ($pages as $page)
								<tr class="status-{{ $page->status }}">
									<td class="tight">
										@if ($page->can_edit)
											<input type="checkbox" name="permanent_remove_list[]" value="{{ $page->id }}">
											@set('show_delete_button', true)
										@endif
									</td>
									<td>
										@if ($page->is_draft)
											<i class="fa fa-circle-o"></i>
										@else
											<i class="fa {{ $page->pageType()->icon() }}"></i>
										@endif

										@if ($page->can_view)
											<a href="{{ Coanda::adminUrl('pages/view/' . $page->id) }}">{{ $page->present()->name }}</a>
										@else
											{{ $page->present()->name }}
										@endif
									</td>
									<td>
										@if ($page->can_view)
											@if ($page->locations->count() > 0)
												@foreach ($page->locations as $location)
												<p>
													<a href="{{ Coanda::adminUrl('pages') }}">Pages</a> / 
													@foreach ($location->parents() as $parent)
														<a href="{{ Coanda::adminUrl('pages/location/' . $parent->id) }}">{{ $parent->page->present()->name }}</a> /
													@endforeach
													{{ $location->page->present()->name }}
												</p>
												@endforeach
											@endif
										@endif
									</td>
									<td>
										@if ($page->can_view)
											<a class="pull-right btn btn-xs btn-primary" href="{{ Coanda::adminUrl('pages/restore/' . $page->id) }}">Restore</a>
										@endif
									</td>
								</tr>
							@endforeach
						</table>

                        @if ($show_delete_button)
						    {{ Form::button('Delete permanently', ['name' => 'permanent_remove', 'value' => 'true', 'type' => 'submit', 'class' => 'btn btn-danger']) }}
						@endif
					@else
						<p>There are no trashed pages.</p>
					@endif
				</div>
			</div>
		</div>
	</div>
</div>
{{ Form::close() }}
@stop
{'fraction_non_alphanumeric': 0.22715967501243575, 'fraction_numerical': 0.00331619963521804, 'mean_word_length': 2.2119275825346114, 'pattern_counts': {'":': 0, '<': 165, '<?xml version=': 0, '>': 233, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '405354', 'n_tokens_mistral': 3032, 'n_tokens_neox': 2066, 'n_words': 409}