vsmov 1.0.0
This commit is contained in:
23
resources/views/core/base/columns/relationship.blade.php
Normal file
23
resources/views/core/base/columns/relationship.blade.php
Normal file
@@ -0,0 +1,23 @@
|
||||
@php
|
||||
$column['value'] = $column['value'] ?? data_get($entry, $column['name']);
|
||||
$column['escaped'] = $column['escaped'] ?? true;
|
||||
$column['text'] = $column['default'] ?? '-';
|
||||
|
||||
if ($column['value'] instanceof \Closure) {
|
||||
$column['value'] = $column['value']($entry);
|
||||
}
|
||||
|
||||
if (!empty($column['value'])) {
|
||||
$column['text'] = isset($column['value']->name) ? $column['value']->name : $column['value']->pluck('name')->implode(', ');
|
||||
}
|
||||
@endphp
|
||||
|
||||
<span>
|
||||
@includeWhen(!empty($column['wrapper']), 'crud::columns.inc.wrapper_start')
|
||||
@if ($column['escaped'])
|
||||
{{ $column['text'] }}
|
||||
@else
|
||||
{!! $column['text'] !!}
|
||||
@endif
|
||||
@includeWhen(!empty($column['wrapper']), 'crud::columns.inc.wrapper_end')
|
||||
</span>
|
||||
199
resources/views/core/base/dashboard.blade.php
Normal file
199
resources/views/core/base/dashboard.blade.php
Normal file
@@ -0,0 +1,199 @@
|
||||
@extends(backpack_view('blank'))
|
||||
|
||||
@php
|
||||
$widgets['before_content'] = [
|
||||
[
|
||||
'type' => 'alert',
|
||||
'class' => 'alert alert-dark mb-2 col-12',
|
||||
'heading' => 'VsMovCMS - Tạo website xem phim miễn phí vĩnh viễn',
|
||||
'content' =>
|
||||
'
|
||||
Phiên bản: <span class="text-danger text-break">' .
|
||||
config('vsmov.version') .
|
||||
'</span><br/>
|
||||
Trang chủ: <a href="https://vsmov.com">VsMovCMS.Com</a><br/>
|
||||
Dữ liệu phim miễn phí: <a href="https://vsmov.com">VsMov.COM</a>
|
||||
',
|
||||
'close_button' => true, // show close button or not
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js"
|
||||
integrity="sha512-d8F1J2kyiRowBB/8/pAWsqUl0wSEOkG5KATkVV4slfblq9VRQ6MyDZVxWl2tWd+mPhuCbpTB4M7uU/x9FlgQ9Q=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
$('.counter').counterUp({
|
||||
delay: 10,
|
||||
time: 500
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.card-counter {
|
||||
box-shadow: 2px 2px 10px #DADADA;
|
||||
margin: 5px 0;
|
||||
padding: 20px 10px;
|
||||
background-color: #fff;
|
||||
height: 100px;
|
||||
border-radius: 5px;
|
||||
transition: .3s linear all;
|
||||
}
|
||||
|
||||
.card-counter:hover {
|
||||
box-shadow: 4px 4px 20px #DADADA;
|
||||
transition: .3s linear all;
|
||||
}
|
||||
|
||||
.card-counter.primary {
|
||||
background-color: #007bff;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.card-counter.danger {
|
||||
background-color: #ef5350;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.card-counter.success {
|
||||
background-color: #66bb6a;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.card-counter.info {
|
||||
background-color: #26c6da;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.card-counter i {
|
||||
font-size: 5em;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.card-counter .count-numbers {
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
top: 20px;
|
||||
font-size: 32px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.card-counter .count-name {
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
top: 65px;
|
||||
font-style: italic;
|
||||
text-transform: capitalize;
|
||||
opacity: 0.5;
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="card-counter primary">
|
||||
<i class="la la-play-circle"></i>
|
||||
<span class="count-numbers counter">{{ $count_movies }}</span>
|
||||
<span class="count-name">Tổng số phim</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="card-counter info">
|
||||
<i class="las la-server"></i>
|
||||
<span class="count-numbers counter">{{ $count_episodes }}</span>
|
||||
<span class="count-name">Tổng số tập</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="card-counter danger">
|
||||
<i class="las la-bug"></i>
|
||||
<span class="count-numbers counter">{{ $count_episodes_error }}</span>
|
||||
<span class="count-name">Tập lỗi</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="card-counter success">
|
||||
<i class="las la-user"></i>
|
||||
<span class="count-numbers counter">{{ $count_users }}</span>
|
||||
<span class="count-name">Users</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="card-counter bg-primary">
|
||||
<i class="la la-paint-brush"></i>
|
||||
<span class="count-numbers counter">{{ $count_themes }}</span>
|
||||
<span class="count-name">Giao diện</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="card-counter">
|
||||
<i class="las la-puzzle-piece"></i>
|
||||
<span class="count-numbers counter">{{ count(config('plugins', [])) }}</span>
|
||||
<span class="count-name">Plugins</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="p-3 col-md-4">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" scope="col">TOP NGÀY</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white">
|
||||
@foreach ($top_view_day as $movie)
|
||||
<tr>
|
||||
<td><a href="{{ $movie->getUrl() }}">{{ $movie->name }}</a></td>
|
||||
<td class="text-right"><span class="badge badge-success"><i class="las la-eye"></i> {{ $movie->view_day }}</span></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="p-3 col-md-4">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" scope="col">TOP TUẦN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white">
|
||||
@foreach ($top_view_week as $movie)
|
||||
<tr>
|
||||
<td><a href="{{ $movie->getUrl() }}">{{ $movie->name }}</a></td>
|
||||
<td class="text-right"><span class="badge badge-success"><i class="las la-eye"></i> {{ $movie->view_week }}</span></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="p-3 col-md-4">
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" scope="col">TOP THÁNG</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white">
|
||||
@foreach ($top_view_month as $movie)
|
||||
<tr>
|
||||
<td><a href="{{ $movie->getUrl() }}">{{ $movie->name }}</a></td>
|
||||
<td class="text-right"><span class="badge badge-success"><i class="las la-eye"></i> {{ $movie->view_month }}</span></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
109
resources/views/core/base/fields/checklist.blade.php
Normal file
109
resources/views/core/base/fields/checklist.blade.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<!-- checklist -->
|
||||
@php
|
||||
$key_attribute = (new $field['model']())->getKeyName();
|
||||
$field['attribute'] = $field['attribute'] ?? (new $field['model']())->identifiableAttribute();
|
||||
$field['number_of_columns'] = $field['number_of_columns'] ?? 3;
|
||||
|
||||
// calculate the checklist options
|
||||
if (!isset($field['options'])) {
|
||||
$field['options'] = $field['model']
|
||||
::all()
|
||||
->pluck($field['attribute'], $key_attribute)
|
||||
->toArray();
|
||||
} else {
|
||||
$field['options'] = call_user_func($field['options'], $field['model']::query());
|
||||
}
|
||||
|
||||
// calculate the value of the hidden input
|
||||
$field['value'] = old_empty_or_null($field['name'], []) ?? ($field['value'] ?? ($field['default'] ?? []));
|
||||
if (!empty($field['value'])) {
|
||||
if (is_a($field['value'], \Illuminate\Support\Collection::class)) {
|
||||
$field['value'] = $field['value']->pluck($key_attribute)->toArray();
|
||||
} elseif (is_string($field['value'])) {
|
||||
$field['value'] = json_decode($field['value']);
|
||||
}
|
||||
}
|
||||
|
||||
// define the init-function on the wrapper
|
||||
$field['wrapper']['data-init-function'] = $field['wrapper']['data-init-function'] ?? 'bpFieldInitChecklist';
|
||||
@endphp
|
||||
|
||||
@include('crud::fields.inc.wrapper_start')
|
||||
<label>{!! $field['label'] !!}</label>
|
||||
@include('crud::fields.inc.translatable_icon')
|
||||
|
||||
<input type="hidden" value='@json($field['value'])'>
|
||||
|
||||
<div class="row">
|
||||
@foreach ($field['options'] as $key => $option)
|
||||
<div class="col-sm-{{ intval(12 / $field['number_of_columns']) }}">
|
||||
<div class="checkbox">
|
||||
<label class="font-weight-normal">
|
||||
<input type="checkbox" value="{{ $key }}" name="{{ $field['name'] }}[]"> {{ $option }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
{{-- HINT --}}
|
||||
@if (isset($field['hint']))
|
||||
<p class="help-block">{!! $field['hint'] !!}</p>
|
||||
@endif
|
||||
@include('crud::fields.inc.wrapper_end')
|
||||
|
||||
|
||||
{{-- ########################################## --}}
|
||||
{{-- Extra CSS and JS for this particular field --}}
|
||||
{{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}}
|
||||
{{-- FIELD JS - will be loaded in the after_scripts section --}}
|
||||
@push('crud_fields_scripts')
|
||||
@loadOnce('bpFieldInitChecklist')
|
||||
<script>
|
||||
function bpFieldInitChecklist(element) {
|
||||
var hidden_input = element.find('input[type=hidden]');
|
||||
var selected_options = JSON.parse(hidden_input.val() || '[]');
|
||||
var checkboxes = element.find('input[type=checkbox]');
|
||||
var container = element.find('.row');
|
||||
|
||||
// set the default checked/unchecked states on checklist options
|
||||
checkboxes.each(function(key, option) {
|
||||
var id = $(this).val();
|
||||
|
||||
if (selected_options.map(String).includes(id)) {
|
||||
$(this).prop('checked', 'checked');
|
||||
} else {
|
||||
$(this).prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// when a checkbox is clicked
|
||||
// set the correct value on the hidden input
|
||||
checkboxes.click(function() {
|
||||
var newValue = [];
|
||||
|
||||
checkboxes.each(function() {
|
||||
if ($(this).is(':checked')) {
|
||||
var id = $(this).val();
|
||||
newValue.push(id);
|
||||
}
|
||||
});
|
||||
|
||||
hidden_input.val(JSON.stringify(newValue)).trigger('change');
|
||||
|
||||
});
|
||||
|
||||
hidden_input.on('CrudField:disable', function(e) {
|
||||
checkboxes.attr('disabled', 'disabled');
|
||||
});
|
||||
|
||||
hidden_input.on('CrudField:enable', function(e) {
|
||||
checkboxes.removeAttr('disabled');
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
@endLoadOnce
|
||||
@endpush
|
||||
{{-- End of Extra CSS and JS --}}
|
||||
{{-- ########################################## --}}
|
||||
76
resources/views/core/base/fields/ckfinder.blade.php
Normal file
76
resources/views/core/base/fields/ckfinder.blade.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<!-- field_type_name -->
|
||||
@include('crud::fields.inc.wrapper_start')
|
||||
@php
|
||||
$field['has_preview'] = isset($field['has_preview']) ? $field['has_preview'] : false;
|
||||
$field['preview']['width'] = isset($field['preview']['width']) ? $field['preview']['width'] : '90%';
|
||||
$field['preview']['height'] = isset($field['preview']['height']) ? $field['preview']['height'] : '90%';
|
||||
@endphp
|
||||
<label>{!! $field['label'] !!}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="{{ $field['name'] }}"
|
||||
value="{{ old($field['name']) ? old($field['name']) : (isset($field['value']) ? $field['value'] : (isset($field['default']) ? $field['default'] : '')) }}"
|
||||
@include('crud::fields.inc.attributes') id="ckfinder-{{ strtolower($field['name']) }}">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-info"
|
||||
onclick="selectFileWithCKFinder('{{ strtolower($field['name']) }}')">Browse</button>
|
||||
</span>
|
||||
</div>
|
||||
@if ($field['has_preview'] && old($field['name'], isset($entry) ? $entry->{$field['name']} : ''))
|
||||
<img class="mw-100 mt-2 rounded" src="{{ old($field['name'], isset($entry) ? $entry->{$field['name']} : '') }}"
|
||||
id="preview-{{ strtolower($field['name']) }}"
|
||||
style="width: {{ $field['preview']['width'] }};height: {{ $field['preview']['height'] }}">
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
{{-- HINT --}}
|
||||
@if (isset($field['hint']))
|
||||
<p class="help-block">{!! $field['hint'] !!}</p>
|
||||
@endif
|
||||
@include('crud::fields.inc.wrapper_end')
|
||||
|
||||
@if ($crud->fieldTypeNotLoaded($field))
|
||||
@php
|
||||
$crud->markFieldTypeAsLoaded($field);
|
||||
@endphp
|
||||
|
||||
{{-- FIELD EXTRA CSS --}}
|
||||
{{-- push things in the after_styles section --}}
|
||||
@push('crud_fields_styles')
|
||||
<!-- no styles -->
|
||||
@endpush
|
||||
|
||||
{{-- FIELD EXTRA JS --}}
|
||||
{{-- push things in the after_scripts section --}}
|
||||
@push('crud_fields_scripts')
|
||||
@include('ckfinder::setup')
|
||||
<script>
|
||||
function selectFileWithCKFinder(elementId) {
|
||||
CKFinder.popup({
|
||||
startupPath: '/images/sherwood-phan-1/',
|
||||
chooseFiles: true,
|
||||
width: 800,
|
||||
height: 600,
|
||||
onInit: function(finder) {
|
||||
finder.on('files:choose', function(evt) {
|
||||
var file = evt.data.files.first();
|
||||
var output = document.getElementById('ckfinder-' + elementId);
|
||||
var preview = document.getElementById('preview-' + elementId);
|
||||
if (output) {
|
||||
output.value = file.getUrl();
|
||||
}
|
||||
if (preview) {
|
||||
preview.src = file.getUrl();
|
||||
}
|
||||
});
|
||||
|
||||
finder.on('file:choose:resizedImage', function(evt) {
|
||||
var output = document.getElementById(elementId);
|
||||
output.value = evt.data.resizedUrl;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@endif
|
||||
91
resources/views/core/base/fields/fields_option.blade.php
Normal file
91
resources/views/core/base/fields/fields_option.blade.php
Normal file
@@ -0,0 +1,91 @@
|
||||
@php
|
||||
$value = isset($field) ? old_empty_or_null($field['name'], '') ?? ($field['value'] ?? null) : null;
|
||||
@endphp
|
||||
|
||||
@php
|
||||
$progress = [
|
||||
'episodes' => 'Tập mới',
|
||||
'status' => 'Trạng thái phim',
|
||||
'episode_time' => 'Thời lượng tập phim',
|
||||
'episode_current' => 'Số tập phim hiện tại',
|
||||
'episode_total' => 'Tổng số tập phim',
|
||||
];
|
||||
|
||||
$info = [
|
||||
'name' => 'Tên phim',
|
||||
'origin_name' => 'Tên gốc phim',
|
||||
'content' => 'Mô tả nội dung phim',
|
||||
'thumb_url' => 'Ảnh Thumb',
|
||||
'poster_url' => 'Ảnh Poster',
|
||||
'trailer_url' => 'Trailer URL',
|
||||
'quality' => 'Chất lượng phim',
|
||||
'language' => 'Ngôn ngữ',
|
||||
'notify' => 'Nội dung thông báo',
|
||||
'showtimes' => 'Giờ chiếu phim',
|
||||
'publish_year' => 'Năm xuất bản',
|
||||
'is_shown_in_theater' => 'Đánh dấu phim chiếu rạp',
|
||||
'is_copyright' => 'Đánh dấu có bản quyền',
|
||||
];
|
||||
|
||||
$relations = [
|
||||
'type' => 'Định dạng phim',
|
||||
'actors' => 'Diễn viên',
|
||||
'directors' => 'Đạo diễn',
|
||||
'categories' => 'Thể loại',
|
||||
'regions' => 'Khu vực',
|
||||
'tags' => 'Từ khóa',
|
||||
'studios' => 'Studio',
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div class="px-3 py-2">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 px-0">
|
||||
<input class="checkall" data-target="progress-checkbox" id="progress-all" type="checkbox" checked>
|
||||
<label for="progress-all">Tiến độ phim</label>
|
||||
</div>
|
||||
@foreach ($progress as $key => $option)
|
||||
<div class="col-12 col-md-6 form-check checkbox">
|
||||
<input class="form-check-input progress-checkbox" id="progress-{{ $loop->index }}" type="checkbox"
|
||||
name="fields[]" value="{{ $key }}" @if (is_null($value) || in_array($key, $value)) checked @endif>
|
||||
<label class="d-inline" for="progress-{{ $loop->index }}">{{ $option }}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 px-0">
|
||||
<input class="checkall" data-target="info-checkbox" id="info-all" type="checkbox" checked>
|
||||
<label for="info-all">Thông tin phim</label>
|
||||
</div>
|
||||
@foreach ($info as $key => $option)
|
||||
<div class="col-12 col-md-6 form-check checkbox">
|
||||
<input class="form-check-input info-checkbox" id="info-{{ $loop->index }}" type="checkbox"
|
||||
name="fields[]" value="{{ $key }}" @if (is_null($value) || in_array($key, $value)) checked @endif>
|
||||
<label class="d-inline" for="info-{{ $loop->index }}">{{ $option }}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 px-0">
|
||||
<input class="checkall" data-target="relation-checkbox" id="relation-all" type="checkbox" checked>
|
||||
<label for="relation-all">Phân loại</label>
|
||||
</div>
|
||||
@foreach ($relations as $key => $option)
|
||||
<div class="col-12 col-md-6 form-check">
|
||||
<input class="form-check-input relation-checkbox" id="relation-{{ $loop->index }}" type="checkbox"
|
||||
name="fields[]" value="{{ $key }}" @if (is_null($value) || in_array($key, $value)) checked @endif>
|
||||
<label class="d-inline" for="relation-{{ $loop->index }}">{{ $option }}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- FIELD JS - will be loaded in the after_scripts section --}}
|
||||
@push('crud_fields_scripts')
|
||||
<script>
|
||||
$('.checkall').change(function() {
|
||||
$(`.${$(this).data('target')}`).prop('checked', this.checked);
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
131
resources/views/core/base/fields/page_or_link.blade.php
Normal file
131
resources/views/core/base/fields/page_or_link.blade.php
Normal file
@@ -0,0 +1,131 @@
|
||||
{{-- PAGE OR LINK field --}}
|
||||
{{-- Used in Backpack\MenuCRUD --}}
|
||||
|
||||
<?php
|
||||
$field['allows_null'] = $field['allows_null'] ?? false;
|
||||
$field['name']['type'] = $field['name']['type'] ?? $field['name'][0] ?? 'type';
|
||||
$field['name']['link'] = $field['name']['link'] ?? $field['name'][1] ?? 'link';
|
||||
$field['options']['internal_link'] = $field['options']['internal_link'] ?? trans('backpack::crud.internal_link');
|
||||
$field['options']['external_link'] = $field['options']['external_link'] ?? trans('backpack::crud.external_link');
|
||||
?>
|
||||
|
||||
@include('crud::fields.inc.wrapper_start')
|
||||
<label>{!! $field['label'] !!}</label>
|
||||
@include('crud::fields.inc.translatable_icon')
|
||||
|
||||
<div class="row" data-init-function="bpFieldInitPageOrLinkElement">
|
||||
{{-- hidden placeholders for content --}}
|
||||
<input type="hidden" value="{{ $entry->{$field['name']['link']} ?? '' }}" name="{{ $field['name']['link'] }}" />
|
||||
|
||||
<div class="col-sm-3">
|
||||
{{-- type select --}}
|
||||
<select
|
||||
data-identifier="page_or_link_select"
|
||||
name="{!! $field['name']['type'] !!}"
|
||||
@include('crud::fields.inc.attributes')
|
||||
>
|
||||
|
||||
@if ($field['allows_null'])
|
||||
<option value="">-</option>
|
||||
@endif
|
||||
|
||||
@foreach ($field['options'] as $key => $value)
|
||||
<option value="{{ $key }}"
|
||||
@if (isset($entry) && $key === $entry->{$field['name']['type']})
|
||||
selected
|
||||
@endif
|
||||
>{{ $value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
{{-- internal link input --}}
|
||||
<div class="page_or_link_value internal_link {{ isset($entry) && $entry->{$field['name']['type']} === 'internal_link' ? '' : '' }}">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
placeholder="{{ trans('backpack::crud.internal_link_placeholder', ['url', url(config('backpack.base.route_prefix').'/page')]) }}"
|
||||
for="{{ $field['name']['link'] }}"
|
||||
required
|
||||
|
||||
@if (isset($entry) && $entry->{$field['name']['type']} !== 'internal_link')
|
||||
disabled="disabled"
|
||||
@endif
|
||||
|
||||
@if (isset($entry) && $entry->{$field['name']['type']} === 'internal_link' && $entry->{$field['name']['link']})
|
||||
value="{{ $entry->{$field['name']['link']} }}"
|
||||
@endif
|
||||
>
|
||||
</div>
|
||||
|
||||
{{-- external link input --}}
|
||||
<div class="page_or_link_value external_link {{ isset($entry) && $entry->{$field['name']['type']} === 'external_link' ? '' : 'd-none' }}">
|
||||
<input
|
||||
type="url"
|
||||
class="form-control"
|
||||
placeholder="{{ trans('backpack::crud.page_link_placeholder') }}"
|
||||
for="{{ $field['name']['link'] }}"
|
||||
required
|
||||
|
||||
@if (isset($entry) && $entry->{$field['name']['type']} !== 'external_link')
|
||||
disabled="disabled"
|
||||
@endif
|
||||
|
||||
@if (isset($entry) && $entry->{$field['name']['type']} === 'external_link' && $entry->{$field['name']['link']})
|
||||
value="{{ $entry->{$field['name']['link']} }}"
|
||||
@endif
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- HINT --}}
|
||||
@if (isset($field['hint']))
|
||||
<p class="help-block">{!! $field['hint'] !!}</p>
|
||||
@endif
|
||||
|
||||
@include('crud::fields.inc.wrapper_end')
|
||||
|
||||
|
||||
{{-- ########################################## --}}
|
||||
{{-- Extra CSS and JS for this particular field --}}
|
||||
{{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}}
|
||||
@if ($crud->fieldTypeNotLoaded($field))
|
||||
@php
|
||||
$crud->markFieldTypeAsLoaded($field);
|
||||
@endphp
|
||||
|
||||
{{-- FIELD JS - will be loaded in the after_scripts section --}}
|
||||
@push('crud_fields_scripts')
|
||||
<script>
|
||||
function bpFieldInitPageOrLinkElement(element) {
|
||||
element = element[0]; // jQuery > Vanilla
|
||||
const select = element.querySelector('select[data-identifier=page_or_link_select]');
|
||||
const values = element.querySelectorAll('.page_or_link_value');
|
||||
// updates hidden fields
|
||||
const updateHidden = () => {
|
||||
let selectedInput = select.value && element.querySelector(`.${select.value}`).firstElementChild;
|
||||
element.querySelectorAll(`input[type="hidden"]`).forEach(hidden => {
|
||||
hidden.value = selectedInput && hidden.getAttribute('name') === selectedInput.getAttribute('for') ? selectedInput.value : '';
|
||||
});
|
||||
}
|
||||
// save input changes to hidden placeholders
|
||||
values.forEach(value => value.firstElementChild.addEventListener('input', updateHidden));
|
||||
// main select change
|
||||
select.addEventListener('change', () => {
|
||||
values.forEach(value => {
|
||||
let isSelected = value.classList.contains(select.value);
|
||||
// toggle visibility and disabled
|
||||
value.classList.toggle('d-none', !isSelected);
|
||||
value.firstElementChild.toggleAttribute('disabled', !isSelected);
|
||||
});
|
||||
// updates hidden fields
|
||||
updateHidden();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@endif
|
||||
{{-- End of Extra CSS and JS --}}
|
||||
{{-- ########################################## --}}
|
||||
@@ -0,0 +1,44 @@
|
||||
<!-- field_type_name -->
|
||||
@include('crud::fields.inc.wrapper_start')
|
||||
@php
|
||||
$field['allows_multiple'] = $field['allows_multiple'] ?? false;
|
||||
$field['options'] = $field['options'] ?? [];
|
||||
$field['value'] = $field['value'] ?? [];
|
||||
|
||||
@endphp
|
||||
<label>{!! $field['label'] !!}</label>
|
||||
<select class="form-control select2-from-array" name="{{ $field['name'] }}[]" @if ($field['allows_multiple']) multiple @endif
|
||||
@include('crud::fields.inc.attributes')>
|
||||
@foreach ($field['options'] as $key => $option)
|
||||
<option value="{{ $key }}" @if (($field['allows_multiple'] && in_array($key, $field['value'])) || $key == $field['value']) selected @endif>{{ $option }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
{{-- HINT --}}
|
||||
@if (isset($field['hint']))
|
||||
<p class="help-block">{!! $field['hint'] !!}</p>
|
||||
@endif
|
||||
@include('crud::fields.inc.wrapper_end')
|
||||
|
||||
@if ($crud->fieldTypeNotLoaded($field))
|
||||
@php
|
||||
$crud->markFieldTypeAsLoaded($field);
|
||||
@endphp
|
||||
|
||||
{{-- FIELD EXTRA CSS --}}
|
||||
{{-- push things in the after_styles section --}}
|
||||
@push('crud_fields_styles')
|
||||
<!-- no styles -->
|
||||
@endpush
|
||||
|
||||
{{-- FIELD EXTRA JS --}}
|
||||
{{-- push things in the after_scripts section --}}
|
||||
@push('crud_fields_scripts')
|
||||
<script>
|
||||
$(function() {
|
||||
$(".select2-from-array").select2({});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@endif
|
||||
@@ -0,0 +1,48 @@
|
||||
<!-- field_type_name -->
|
||||
@include('crud::fields.inc.wrapper_start')
|
||||
@php
|
||||
$key_attribute = (new $field['model']())->getKeyName();
|
||||
$field['attribute'] = $field['attribute'] ?? (new $field['model']())->identifiableAttribute();
|
||||
|
||||
$selected = $field['model']
|
||||
::whereIn('id', old($field['name'], isset($field['value']) ? $field['value']->pluck('id')->toArray() : []))
|
||||
->pluck($field['attribute'], $key_attribute)
|
||||
->toArray();
|
||||
@endphp
|
||||
<label>{!! $field['label'] !!}</label>
|
||||
<select class="form-control select2-relationship-tags" name="{{ $field['name'] }}[]" multiple @include('crud::fields.inc.attributes')>
|
||||
@foreach ($selected as $option)
|
||||
<option value="{{ $option }}" selected>{{ $option }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
{{-- HINT --}}
|
||||
@if (isset($field['hint']))
|
||||
<p class="help-block">{!! $field['hint'] !!}</p>
|
||||
@endif
|
||||
@include('crud::fields.inc.wrapper_end')
|
||||
|
||||
@if ($crud->fieldTypeNotLoaded($field))
|
||||
@php
|
||||
$crud->markFieldTypeAsLoaded($field);
|
||||
@endphp
|
||||
|
||||
{{-- FIELD EXTRA CSS --}}
|
||||
{{-- push things in the after_styles section --}}
|
||||
@push('crud_fields_styles')
|
||||
<!-- no styles -->
|
||||
@endpush
|
||||
|
||||
{{-- FIELD EXTRA JS --}}
|
||||
{{-- push things in the after_scripts section --}}
|
||||
@push('crud_fields_scripts')
|
||||
<script>
|
||||
$(function() {
|
||||
$(".select2-relationship-tags").select2({
|
||||
tags: true
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@endif
|
||||
44
resources/views/core/base/fields/select2_tags.blade.php
Normal file
44
resources/views/core/base/fields/select2_tags.blade.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<!-- field_type_name -->
|
||||
@include('crud::fields.inc.wrapper_start')
|
||||
|
||||
@php
|
||||
$selected = $field['value'] ?? [];
|
||||
@endphp
|
||||
|
||||
<label>{!! $field['label'] !!}</label>
|
||||
<select class="form-control select2-tags" name="{{ $field['name'] }}[]" multiple @include('crud::fields.inc.attributes')>
|
||||
@foreach ($selected as $option)
|
||||
<option value="{{ $option }}" selected>{{ $option }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
{{-- HINT --}}
|
||||
@if (isset($field['hint']))
|
||||
<p class="help-block">{!! $field['hint'] !!}</p>
|
||||
@endif
|
||||
@include('crud::fields.inc.wrapper_end')
|
||||
|
||||
@if ($crud->fieldTypeNotLoaded($field))
|
||||
@php
|
||||
$crud->markFieldTypeAsLoaded($field);
|
||||
@endphp
|
||||
|
||||
{{-- FIELD EXTRA CSS --}}
|
||||
{{-- push things in the after_styles section --}}
|
||||
@push('crud_fields_styles')
|
||||
<!-- no styles -->
|
||||
@endpush
|
||||
|
||||
{{-- FIELD EXTRA JS --}}
|
||||
{{-- push things in the after_scripts section --}}
|
||||
@push('crud_fields_scripts')
|
||||
<script>
|
||||
$(function() {
|
||||
$(".select2-tags").select2({
|
||||
tags: true
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@endif
|
||||
40
resources/views/core/base/fields/select_from_table.blade.php
Normal file
40
resources/views/core/base/fields/select_from_table.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
@php
|
||||
$field['allows_null'] = $field['allows_null'] ?? $crud->model::isColumnNullable($field['name']);
|
||||
$field['value'] = old_empty_or_null($field['name'], '') ?? ($field['value'] ?? ($field['default'] ?? ''));
|
||||
$field['multiple'] = $field['allows_multiple'] ?? ($field['multiple'] ?? false);
|
||||
$field['options']['display_by'] = isset($field['options']['display_by']) ? $field['options']['display_by'] : 'name';
|
||||
$field['options']['value_by'] = isset($field['options']['value_by']) ? $field['options']['value_by'] : 'id';
|
||||
$options = \DB::table($field['options']['table'])
|
||||
->pluck($field['options']['display_by'], $field['options']['value_by'])
|
||||
->toArray();
|
||||
@endphp
|
||||
<!-- select from array -->
|
||||
@include('crud::fields.inc.wrapper_start')
|
||||
<label>{!! $field['label'] !!}</label>
|
||||
@include('crud::fields.inc.translatable_icon')
|
||||
@if ($field['multiple'])
|
||||
<input type="hidden" name="{{ $field['name'] }}" value="" @if (in_array('disabled', $field['attributes'] ?? [])) disabled @endif />
|
||||
@endif
|
||||
|
||||
<select name="{{ $field['name'] }}@if ($field['multiple']) [] @endif" @include('crud::fields.inc.attributes')
|
||||
@if ($field['multiple']) multiple bp-field-main-input @endif>
|
||||
|
||||
@if ($field['allows_null'] && !$field['multiple'])
|
||||
<option value="">-</option>
|
||||
@endif
|
||||
@if (count($options))
|
||||
@foreach ($options as $key => $value)
|
||||
@if ($key == $field['value'] || (is_array($field['value']) && in_array($key, $field['value'])))
|
||||
<option value="{{ $key }}" selected>{{ $value }}</option>
|
||||
@else
|
||||
<option value="{{ $key }}">{{ $value }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
{{-- HINT --}}
|
||||
@if (isset($field['hint']))
|
||||
<p class="help-block">{!! $field['hint'] !!}</p>
|
||||
@endif
|
||||
@include('crud::fields.inc.wrapper_end')
|
||||
30
resources/views/core/base/fields/select_theme.blade.php
Normal file
30
resources/views/core/base/fields/select_theme.blade.php
Normal file
@@ -0,0 +1,30 @@
|
||||
@php
|
||||
$field['value'] = old_empty_or_null($field['name'], '') ?? ($field['value'] ?? ($field['default'] ?? ''));
|
||||
$field['multiple'] = $field['allows_multiple'] ?? ($field['multiple'] ?? false);
|
||||
$options = config('themes', []);
|
||||
@endphp
|
||||
<!-- select from array -->
|
||||
@include('crud::fields.inc.wrapper_start')
|
||||
<label>{!! $field['label'] !!}</label>
|
||||
@include('crud::fields.inc.translatable_icon')
|
||||
@if ($field['multiple'])
|
||||
<input type="hidden" name="{{ $field['name'] }}" value="" @if (in_array('disabled', $field['attributes'] ?? [])) disabled @endif />
|
||||
@endif
|
||||
|
||||
<select name="{{ $field['name'] }}@if ($field['multiple']) [] @endif" @include('crud::fields.inc.attributes')>
|
||||
@if (count($options))
|
||||
@foreach ($options as $key => $value)
|
||||
@if ($key == $field['value'] || (is_array($field['value']) && in_array($key, $field['value'])))
|
||||
<option value="{{ $key }}" selected>{{ $value }}</option>
|
||||
@else
|
||||
<option value="{{ $key }}">{{ $value }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
{{-- HINT --}}
|
||||
@if (isset($field['hint']))
|
||||
<p class="help-block">{!! $field['hint'] !!}</p>
|
||||
@endif
|
||||
@include('crud::fields.inc.wrapper_end')
|
||||
@@ -0,0 +1,91 @@
|
||||
@php
|
||||
$value = isset($field) ? old_empty_or_null($field['name'], '') ?? ($field['value'] ?? null) : null;
|
||||
@endphp
|
||||
|
||||
@php
|
||||
$progress = [
|
||||
'episodes' => 'Tập mới',
|
||||
'status' => 'Trạng thái phim',
|
||||
'episode_time' => 'Thời lượng tập phim',
|
||||
'episode_current' => 'Số tập phim hiện tại',
|
||||
'episode_total' => 'Tổng số tập phim',
|
||||
];
|
||||
|
||||
$info = [
|
||||
'name' => 'Tên phim',
|
||||
'origin_name' => 'Tên gốc phim',
|
||||
'content' => 'Mô tả nội dung phim',
|
||||
'thumb_url' => 'Ảnh Thumb',
|
||||
'poster_url' => 'Ảnh Poster',
|
||||
'trailer_url' => 'Trailer URL',
|
||||
'quality' => 'Chất lượng phim',
|
||||
'language' => 'Ngôn ngữ',
|
||||
'notify' => 'Nội dung thông báo',
|
||||
'showtimes' => 'Giờ chiếu phim',
|
||||
'publish_year' => 'Năm xuất bản',
|
||||
'is_shown_in_theater' => 'Đánh dấu phim chiếu rạp',
|
||||
'is_copyright' => 'Đánh dấu có bản quyền',
|
||||
];
|
||||
|
||||
$relations = [
|
||||
'type' => 'Định dạng phim',
|
||||
'actors' => 'Diễn viên',
|
||||
'directors' => 'Đạo diễn',
|
||||
'categories' => 'Thể loại',
|
||||
'regions' => 'Khu vực',
|
||||
'tags' => 'Từ khóa',
|
||||
'studios' => 'Studio',
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div class="px-3 py-2">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 px-0">
|
||||
<input class="checkall" data-target="progress-checkbox" id="progress-all" type="checkbox">
|
||||
<label for="progress-all">Tiến độ phim</label>
|
||||
</div>
|
||||
@foreach ($progress as $key => $option)
|
||||
<div class="col-12 col-md-6 form-check checkbox">
|
||||
<input class="form-check-input progress-checkbox" id="progress-{{ $loop->index }}" type="checkbox"
|
||||
name="fields[]" value="{{ $key }}" @if (is_null($value) || in_array($key, $value)) checked @endif>
|
||||
<label class="d-inline" for="progress-{{ $loop->index }}">{{ $option }}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 px-0">
|
||||
<input class="checkall" data-target="info-checkbox" id="info-all" type="checkbox">
|
||||
<label for="info-all">Thông tin phim</label>
|
||||
</div>
|
||||
@foreach ($info as $key => $option)
|
||||
<div class="col-12 col-md-6 form-check checkbox">
|
||||
<input class="form-check-input info-checkbox" id="info-{{ $loop->index }}" type="checkbox"
|
||||
name="fields[]" value="{{ $key }}" @if (is_null($value) || in_array($key, $value)) checked @endif>
|
||||
<label class="d-inline" for="info-{{ $loop->index }}">{{ $option }}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 px-0">
|
||||
<input class="checkall" data-target="relation-checkbox" id="relation-all" type="checkbox">
|
||||
<label for="relation-all">Phân loại</label>
|
||||
</div>
|
||||
@foreach ($relations as $key => $option)
|
||||
<div class="col-12 col-md-6 form-check">
|
||||
<input class="form-check-input relation-checkbox" id="relation-{{ $loop->index }}" type="checkbox"
|
||||
name="fields[]" value="{{ $key }}" @if (is_null($value) || in_array($key, $value)) checked @endif>
|
||||
<label class="d-inline" for="relation-{{ $loop->index }}">{{ $option }}</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{-- FIELD JS - will be loaded in the after_scripts section --}}
|
||||
@push('after_scripts')
|
||||
<script>
|
||||
$('.checkall').change(function() {
|
||||
$(`.${$(this).data('target')}`).prop('checked', this.checked);
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
15
resources/views/core/base/inc/main_header.blade.php
Normal file
15
resources/views/core/base/inc/main_header.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<header class="{{ config('backpack.base.header_class') }}">
|
||||
<!-- Logo -->
|
||||
<button class="navbar-toggler sidebar-toggler d-lg-none mr-auto ml-3" type="button" data-toggle="sidebar-show" aria-label="{{ trans('backpack::base.toggle_navigation')}}">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{ url(config('backpack.base.home_link')) }}" title="{{ config('backpack.base.project_name') }}">
|
||||
{!! setting('site_logo') ?? config('backpack.base.project_logo') !!}
|
||||
<h6><span class="badge badge-danger">v{{ config('vsmov.version') }}</span></h6>
|
||||
</a>
|
||||
<button class="navbar-toggler sidebar-toggler d-md-down-none" type="button" data-toggle="sidebar-lg-show" aria-label="{{ trans('backpack::base.toggle_navigation')}}">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
@include(backpack_view('inc.menu'))
|
||||
</header>
|
||||
107
resources/views/core/base/inc/sidebar_content.blade.php
Normal file
107
resources/views/core/base/inc/sidebar_content.blade.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<!-- This file is used to store sidebar items, starting with Backpack\Base 0.9.0 -->
|
||||
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('dashboard') }}"><i class="la la-home nav-icon"></i>
|
||||
{{ trans('backpack::base.dashboard') }}</a></li>
|
||||
<li class="nav-title">Phim</li>
|
||||
<li class='nav-item'>
|
||||
<a class='nav-link' href='{{ backpack_url('movie') }}'><i class='nav-icon la la-play-circle'></i>
|
||||
Quản lý phim</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item nav-dropdown"><a class="nav-link nav-dropdown-toggle" href="#"><i
|
||||
class="nav-icon la la-list"></i> Phân loại</a>
|
||||
<ul class="nav-dropdown-items">
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('catalog') }}'><i class='nav-icon la la-pagelines'></i>
|
||||
Danh sách</a></li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('category') }}'><i class='nav-icon la la-at'></i>
|
||||
Thể loại</a></li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('tag') }}'><i class='nav-icon la la-link'></i>
|
||||
Tags</a>
|
||||
</li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('region') }}'><i
|
||||
class='nav-icon la la-globe'></i> Khu
|
||||
vực</a></li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('actor') }}'><i
|
||||
class='nav-icon la la-gratipay'></i>
|
||||
Diễn viên</a></li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('director') }}'><i
|
||||
class='nav-icon la la-odnoklassniki'></i> Đạo diễn</a></li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('studio') }}'><i
|
||||
class='nav-icon la la-connectdevelop'></i> Studio</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class='nav-item'>
|
||||
<a class='nav-link' href='{{ backpack_url('episode') }}'><i class='nav-icon la la-info-circle'></i>
|
||||
Phim lỗi</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-title">Tuỳ chỉnh</li>
|
||||
<li class="nav-item nav-dropdown"><a class="nav-link nav-dropdown-toggle" href="#"><i
|
||||
class="nav-icon la la-paint-brush"></i> Giao diện</a>
|
||||
<ul class="nav-dropdown-items">
|
||||
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('theme') }}"><i
|
||||
class="nav-icon la la-photo"></i>Chủ đề</a>
|
||||
</li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('menu') }}'><i class='nav-icon la la-list'></i>
|
||||
Menu</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item nav-dropdown"><a class="nav-link nav-dropdown-toggle" href="#"><i
|
||||
class="nav-icon la la-cog"></i> Cài đặt</a>
|
||||
<ul class="nav-dropdown-items">
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('setting/group/generals/edit') }}'><i
|
||||
class='nav-icon la la-wrench'></i>
|
||||
<span>General</span></a></li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('setting/group/metas/edit') }}'><i
|
||||
class='nav-icon la la-chevron-circle-up'></i>
|
||||
<span>SEO</span></a></li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('setting/group/jwplayer/edit') }}'><i
|
||||
class='nav-icon la la-play'></i>
|
||||
<span>Jwplayer</span></a></li>
|
||||
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('setting/group/others/edit') }}'><i
|
||||
class='nav-icon la la-slack'></i>
|
||||
<span>Khác</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class='nav-item'>
|
||||
<a class='nav-link' href='{{ backpack_url('sitemap/create') }}'><i class='nav-icon la la-map'></i>
|
||||
Sitemap</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-title">Mở rộng</li>
|
||||
@foreach (config('plugins', []) as $plugin)
|
||||
@if (count($plugin['entries'] ?? []) > 1)
|
||||
<li class="nav-item nav-dropdown"><a class="nav-link nav-dropdown-toggle" href="#">
|
||||
<i class="nav-icon {{ $plugin['icon'] ?? '' }}"></i> {{ $plugin['name'] ?? '' }}</a>
|
||||
<ul class="nav-dropdown-items">
|
||||
@foreach ($plugin['entries'] ?? [] as $entry)
|
||||
<li class='nav-item'><a class='nav-link' href='{{ $entry['url'] ?? '#' }}'>
|
||||
<i class='nav-icon {{ $entry['icon'] ?? '' }}'></i>
|
||||
<span>{{ $entry['name'] ?? '' }}</span></a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
@else
|
||||
@foreach ($plugin['entries'] ?? [] as $entry)
|
||||
<li class='nav-item'><a class='nav-link' href='{{ $entry['url'] ?? '#' }}'>
|
||||
<i class='nav-icon {{ $entry['icon'] ?? '' }}'></i>
|
||||
<span>{{ $plugin['name'] ?? '' }}</span></a></li>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if (backpack_user()->hasRole('Admin'))
|
||||
<li class="nav-title">{{ trans('backpack::base.administration') }}</li>
|
||||
<li class="nav-item nav-dropdown">
|
||||
<a class="nav-link nav-dropdown-toggle" href="#"><i class="nav-icon la la-users"></i>
|
||||
Authentication</a>
|
||||
<ul class="nav-dropdown-items">
|
||||
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('user') }}"><i
|
||||
class="nav-icon la la-user"></i>
|
||||
<span>Users</span></a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('role') }}"><i
|
||||
class="nav-icon la la-id-badge"></i> <span>Roles</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
13
resources/views/core/base/inc/topbar_right_content.blade.php
Normal file
13
resources/views/core/base/inc/topbar_right_content.blade.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- This file is used to store topbar (right) items -->
|
||||
|
||||
<li class="nav-item dropdown"><a class="nav-link" data-toggle="dropdown" href="#" role="button" aria-haspopup="true"
|
||||
aria-expanded="false" style="position: relative;width: 35px;height: 35px;margin: 0 10px;"><i class="la la-gears"
|
||||
style="font-size: 2.3rem"></i></a>
|
||||
<div
|
||||
class="dropdown-menu {{ config('backpack.base.html_direction') == 'rtl' ? 'dropdown-menu-left' : 'dropdown-menu-right' }} mr-4 pb-1 pt-1">
|
||||
<a class="dropdown-item" href="{{ backpack_url('quick-action/delete-cache') }}">
|
||||
Delete All Cache
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
</div>
|
||||
</li>
|
||||
104
resources/views/core/crud/buttons/bulk_delete.blade.php
Normal file
104
resources/views/core/crud/buttons/bulk_delete.blade.php
Normal file
@@ -0,0 +1,104 @@
|
||||
@if ($crud->hasAccess('bulkDelete') && $crud->get('list.bulkActions'))
|
||||
<a href="javascript:void(0)" onclick="bulkDeleteEntries(this)" class="btn btn-sm btn-secondary bulk-button"><i class="la la-trash"></i> {{ trans('backpack::crud.delete') }}</a>
|
||||
@endif
|
||||
|
||||
@push('after_scripts')
|
||||
<script>
|
||||
if (typeof bulkDeleteEntries != 'function') {
|
||||
function bulkDeleteEntries(button) {
|
||||
|
||||
if (typeof crud.checkedItems === 'undefined' || crud.checkedItems.length == 0)
|
||||
{
|
||||
new Noty({
|
||||
type: "warning",
|
||||
text: "<strong>{!! trans('backpack::crud.bulk_no_entries_selected_title') !!}</strong><br>{!! trans('backpack::crud.bulk_no_entries_selected_message') !!}"
|
||||
}).show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var message = ("{!! trans('backpack::crud.bulk_delete_are_you_sure') !!}").replace(":number", crud.checkedItems.length);
|
||||
var button = $(this);
|
||||
|
||||
// show confirm message
|
||||
swal({
|
||||
title: "{!! trans('backpack::base.warning') !!}",
|
||||
text: message,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "{!! trans('backpack::crud.cancel') !!}",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "bg-secondary",
|
||||
closeModal: true,
|
||||
},
|
||||
delete: {
|
||||
text: "{!! trans('backpack::crud.delete') !!}",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "bg-danger",
|
||||
}
|
||||
},
|
||||
}).then((value) => {
|
||||
if (value) {
|
||||
var ajax_calls = [];
|
||||
var delete_route = "{{ url($crud->route) }}/bulk-delete";
|
||||
|
||||
// submit an AJAX delete call
|
||||
$.ajax({
|
||||
url: delete_route,
|
||||
type: 'POST',
|
||||
data: { entries: crud.checkedItems },
|
||||
success: function(result) {
|
||||
if (Array.isArray(result)) {
|
||||
// Show a success notification bubble
|
||||
new Noty({
|
||||
type: "success",
|
||||
text: "<strong>{!! trans('backpack::crud.bulk_delete_sucess_title') !!}</strong><br>"+crud.checkedItems.length+"{!! trans('backpack::crud.bulk_delete_sucess_message') !!}"
|
||||
}).show();
|
||||
} else {
|
||||
// if the result is an array, it means
|
||||
// we have notification bubbles to show
|
||||
if (result instanceof Object) {
|
||||
// trigger one or more bubble notifications
|
||||
Object.entries(result).forEach(function(entry, index) {
|
||||
var type = entry[0];
|
||||
entry[1].forEach(function(message, i) {
|
||||
new Noty({
|
||||
type: type,
|
||||
text: message
|
||||
}).show();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// Show a warning notification bubble
|
||||
new Noty({
|
||||
type: "warning",
|
||||
text: "<strong>{!! trans('backpack::crud.bulk_delete_error_title') !!}</strong><br>{!! trans('backpack::crud.bulk_delete_error_message') !!}"
|
||||
}).show();
|
||||
}
|
||||
}
|
||||
|
||||
// Move to previous page in case of deleting all the items in table
|
||||
if(crud.table.rows().count() === crud.checkedItems.length) {
|
||||
crud.table.page("previous");
|
||||
}
|
||||
|
||||
crud.checkedItems = [];
|
||||
crud.table.draw(false);
|
||||
},
|
||||
error: function(result) {
|
||||
// Show an alert with the result
|
||||
new Noty({
|
||||
type: "warning",
|
||||
text: "<strong>{!! trans('backpack::crud.bulk_delete_error_title') !!}</strong><br>{!! trans('backpack::crud.bulk_delete_error_message') !!}"
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
140
resources/views/core/crud/filters/select2.blade.php
Normal file
140
resources/views/core/crud/filters/select2.blade.php
Normal file
@@ -0,0 +1,140 @@
|
||||
{{-- Select2 Backpack CRUD filter --}}
|
||||
<li filter-name="{{ $filter->name }}"
|
||||
filter-type="{{ $filter->type }}"
|
||||
filter-key="{{ $filter->key }}"
|
||||
class="nav-item dropdown {{ Request::get($filter->name)?'active':'' }}">
|
||||
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ $filter->label }} <span class="caret"></span></a>
|
||||
<div class="dropdown-menu p-0">
|
||||
<div class="form-group backpack-filter mb-0">
|
||||
<select
|
||||
id="filter_{{ $filter->key }}"
|
||||
name="filter_{{ $filter->key }}"
|
||||
class="form-control input-sm select2"
|
||||
placeholder="{{ $filter->placeholder }}"
|
||||
data-filter-key="{{ $filter->key }}"
|
||||
data-filter-type="select2"
|
||||
data-filter-name="{{ $filter->name }}"
|
||||
data-language="{{ str_replace('_', '-', app()->getLocale()) }}"
|
||||
>
|
||||
<option value="">-</option>
|
||||
@if (is_array($filter->values) && count($filter->values))
|
||||
@foreach($filter->values as $key => $value)
|
||||
<option value="{{ $key }}"
|
||||
@if($filter->isActive() && $filter->currentValue == $key)
|
||||
selected
|
||||
@endif
|
||||
>
|
||||
{{ $value }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
{{-- ########################################### --}}
|
||||
{{-- Extra CSS and JS for this particular filter --}}
|
||||
|
||||
{{-- FILTERS EXTRA CSS --}}
|
||||
{{-- push things in the after_styles section --}}
|
||||
|
||||
@push('crud_list_styles')
|
||||
{{-- include select2 css --}}
|
||||
<link href="{{ asset('packages/select2/dist/css/select2.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('packages/select2-bootstrap-theme/dist/select2-bootstrap.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.form-inline .select2-container {
|
||||
display: inline-block;
|
||||
}
|
||||
.select2-drop-active {
|
||||
border:none;
|
||||
}
|
||||
.select2-container .select2-choices .select2-search-field input, .select2-container .select2-choice, .select2-container .select2-choices {
|
||||
border: none;
|
||||
}
|
||||
.select2-container-active .select2-choice {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.select2-container--bootstrap .select2-dropdown {
|
||||
margin-top: -2px;
|
||||
margin-left: -1px;
|
||||
}
|
||||
.select2-container--bootstrap {
|
||||
position: relative!important;
|
||||
top: 0px!important;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
|
||||
{{-- FILTERS EXTRA JS --}}
|
||||
{{-- push things in the after_scripts section --}}
|
||||
|
||||
@push('crud_list_scripts')
|
||||
{{-- include select2 js --}}
|
||||
<script src="{{ asset('packages/select2/dist/js/select2.full.min.js') }}"></script>
|
||||
@if (app()->getLocale() !== 'en')
|
||||
<script src="{{ asset('packages/select2/dist/js/i18n/' . str_replace('_', '-', app()->getLocale()) . '.js') }}"></script>
|
||||
@endif
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
// trigger select2 for each untriggered select2 box
|
||||
$('select[data-filter-type=select2]').not('[data-filter-enabled]').each(function () {
|
||||
var filterName = $(this).attr('data-filter-name');
|
||||
var filterKey = $(this).attr('data-filter-key');
|
||||
var element = $(this);
|
||||
|
||||
$(this).attr('data-filter-enabled', 'true');
|
||||
|
||||
var obj = $(this).select2({
|
||||
allowClear: true,
|
||||
closeOnSelect: false,
|
||||
theme: "bootstrap",
|
||||
dropdownParent: $(this).parent('.form-group'),
|
||||
placeholder: $(this).attr('placeholder'),
|
||||
}).on('change', function(c) {
|
||||
var value = $(this).val();
|
||||
var parameter = $(this).attr('data-filter-name');
|
||||
|
||||
if(!value) {
|
||||
return;
|
||||
}
|
||||
|
||||
var new_url = updateDatatablesOnFilterChange(filterName, value, true);
|
||||
|
||||
// mark this filter as active in the navbar-filters
|
||||
if (URI(new_url).hasQuery(filterName, true)) {
|
||||
$("li[filter-key="+filterKey+"]").addClass('active');
|
||||
}
|
||||
}).on('select2:unselecting', function (e) {
|
||||
|
||||
updateDatatablesOnFilterChange(filterName, null, true);
|
||||
|
||||
$('#filter_'+filterKey).val(null)
|
||||
$("li[filter-key="+filterKey+"]").removeClass("active");
|
||||
$("li[filter-key="+filterKey+"]").find('.dropdown-menu').removeClass("show");
|
||||
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// when the dropdown is opened, autofocus on the select2
|
||||
$("li[filter-key="+filterKey+"]").on('shown.bs.dropdown', function () {
|
||||
$('select[data-filter-key='+filterKey+']').select2('open');
|
||||
});
|
||||
|
||||
// clear filter event (used here and by the Remove all filters button)
|
||||
$("li[filter-key="+filterKey+"]").on('filter:clear', function(e) {
|
||||
$("li[filter-key="+filterKey+"]").removeClass('active');
|
||||
$('#filter_'+filterKey).val(null).trigger('change');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
{{-- End of Extra CSS and JS --}}
|
||||
{{-- ########################################## --}}
|
||||
72
resources/views/core/crud/filters/simple.blade.php
Normal file
72
resources/views/core/crud/filters/simple.blade.php
Normal file
@@ -0,0 +1,72 @@
|
||||
{{-- Simple Backpack CRUD filter --}}
|
||||
<li filter-name="{{ $filter->name }}"
|
||||
filter-type="{{ $filter->type }}"
|
||||
filter-key="{{ $filter->key }}"
|
||||
class="nav-item {{ Request::get($filter->name)?'active':'' }}">
|
||||
<a class="nav-link" href=""
|
||||
parameter="{{ $filter->name }}"
|
||||
>{{ $filter->label }}</a>
|
||||
</li>
|
||||
|
||||
|
||||
{{-- ########################################### --}}
|
||||
{{-- Extra CSS and JS for this particular filter --}}
|
||||
|
||||
{{-- FILTERS EXTRA CSS --}}
|
||||
{{-- push things in the after_styles section --}}
|
||||
|
||||
{{-- @push('crud_list_styles')
|
||||
no css
|
||||
@endpush --}}
|
||||
|
||||
|
||||
{{-- FILTERS EXTRA JS --}}
|
||||
{{-- push things in the after_scripts section --}}
|
||||
|
||||
@push('crud_list_scripts')
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
$("li[filter-key={{ $filter->key }}] a").click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var parameter = $(this).attr('parameter');
|
||||
|
||||
// behaviour for ajax table
|
||||
var ajax_table = $("#crudTable").DataTable();
|
||||
var current_url = ajax_table.ajax.url();
|
||||
|
||||
if (URI(current_url).hasQuery(parameter)) {
|
||||
var new_url = URI(current_url).removeQuery(parameter, true);
|
||||
} else {
|
||||
var new_url = URI(current_url).addQuery(parameter, true);
|
||||
}
|
||||
|
||||
new_url = normalizeAmpersand(new_url.toString());
|
||||
|
||||
// replace the datatables ajax url with new_url and reload it
|
||||
ajax_table.ajax.url(new_url).load();
|
||||
|
||||
// add filter to URL
|
||||
crud.updateUrl(new_url);
|
||||
|
||||
// mark this filter as active in the navbar-filters
|
||||
if (URI(new_url).hasQuery('{{ $filter->name }}', true)) {
|
||||
$("li[filter-key={{ $filter->key }}]").removeClass('active').addClass('active');
|
||||
$('#remove_filters_button').removeClass('invisible');
|
||||
}
|
||||
else
|
||||
{
|
||||
$("li[filter-key={{ $filter->key }}]").trigger("filter:clear");
|
||||
}
|
||||
});
|
||||
|
||||
// clear filter event (used here and by the Remove all filters button)
|
||||
$("li[filter-key={{ $filter->key }}]").on('filter:clear', function(e) {
|
||||
|
||||
$("li[filter-key={{ $filter->key }}]").removeClass('active');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
{{-- End of Extra CSS and JS --}}
|
||||
{{-- ########################################## --}}
|
||||
@@ -0,0 +1,40 @@
|
||||
@php
|
||||
$name = data_get($entry, $column['name']);
|
||||
$origin_name = data_get($entry, $column['origin_name']);
|
||||
$publish_year = data_get($entry, $column['publish_year']);
|
||||
$episode_current = data_get($entry, $column['episode_current']);
|
||||
$status = data_get($entry, $column['status']);
|
||||
$movie_type = data_get($entry, $column['movie_type']);
|
||||
$config_show_type = [
|
||||
'single' => [
|
||||
'class' => 'bg-secondary',
|
||||
'label' => 'Phim lẻ',
|
||||
],
|
||||
'series' => [
|
||||
'class' => 'bg-primary',
|
||||
'label' => 'Phim bộ',
|
||||
],
|
||||
];
|
||||
$config_show_status = [
|
||||
'trailer' => [
|
||||
'class' => 'bg-warning',
|
||||
'label' => 'Trailer',
|
||||
],
|
||||
'ongoing' => [
|
||||
'class' => 'bg-info',
|
||||
'label' => 'Đang chiếu',
|
||||
],
|
||||
'completed' => [
|
||||
'class' => 'bg-success',
|
||||
'label' => 'Hoàn thành',
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
<div class="">
|
||||
@includeWhen(!empty($column['wrapper']), 'crud::columns.inc.wrapper_start')
|
||||
<div class="text-primary pb-2">{{ $name }} <span class="text-success">[{{ $publish_year }}]</span></div>
|
||||
<div class="text-muted pb-2"><small>({{ $origin_name }}) <span class="text-danger">[{{ $episode_current }}]</span></small></div>
|
||||
<div class="badge {{ $config_show_type[$movie_type]['class'] }} font-weight-normal">{{ $config_show_type[$movie_type]['label'] }}</div>
|
||||
<div class="badge {{ $config_show_status[$status]['class'] }} font-weight-normal">{{ $config_show_status[$status]['label'] }}</div>
|
||||
@includeWhen(!empty($column['wrapper']), 'crud::columns.inc.wrapper_end')
|
||||
</div>
|
||||
56
resources/views/core/movies/create.blade.php
Normal file
56
resources/views/core/movies/create.blade.php
Normal file
@@ -0,0 +1,56 @@
|
||||
@extends(backpack_view('blank'))
|
||||
|
||||
@php
|
||||
$defaultBreadcrumbs = [
|
||||
trans('backpack::crud.admin') => url(config('backpack.base.route_prefix'), 'dashboard'),
|
||||
$crud->entity_name_plural => url($crud->route),
|
||||
trans('backpack::crud.add') => false,
|
||||
];
|
||||
|
||||
// if breadcrumbs aren't defined in the CrudController, use the default breadcrumbs
|
||||
$breadcrumbs = $breadcrumbs ?? $defaultBreadcrumbs;
|
||||
@endphp
|
||||
|
||||
@section('header')
|
||||
<section class="container-fluid">
|
||||
<h2>
|
||||
<span class="text-capitalize">{!! $crud->getHeading() ?? $crud->entity_name_plural !!}</span>
|
||||
<small>{!! $crud->getSubheading() ?? trans('backpack::crud.add') . ' ' . $crud->entity_name !!}.</small>
|
||||
|
||||
@if ($crud->hasAccess('list'))
|
||||
<small><a href="{{ url($crud->route) }}" class="d-print-none font-sm"><i
|
||||
class="la la-angle-double-{{ config('backpack.base.html_direction') == 'rtl' ? 'right' : 'left' }}"></i>
|
||||
{{ trans('backpack::crud.back_to_all') }}
|
||||
<span>{{ $crud->entity_name_plural }}</span></a></small>
|
||||
@endif
|
||||
</h2>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="{{ $crud->getCreateContentClass() }}">
|
||||
<!-- Default box -->
|
||||
|
||||
@include('crud::inc.grouped_errors')
|
||||
|
||||
<form method="post" action="{{ url($crud->route) }}"
|
||||
@if ($crud->hasUploadFields('create')) enctype="multipart/form-data" @endif>
|
||||
{!! csrf_field() !!}
|
||||
<!-- load the view from the application if it exists, otherwise load the one in the package -->
|
||||
@if (view()->exists('vendor.backpack.crud.form_content'))
|
||||
@include('vendor.backpack.crud.form_content', [
|
||||
'fields' => $crud->fields(),
|
||||
'action' => 'create',
|
||||
])
|
||||
@else
|
||||
@include('crud::form_content', ['fields' => $crud->fields(), 'action' => 'create'])
|
||||
@endif
|
||||
<!-- This makes sure that all field assets are loaded. -->
|
||||
<div class="d-none" id="parentLoadedAssets">{{ json_encode(Assets::loaded()) }}</div>
|
||||
|
||||
@include('crud::inc.form_save_buttons')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
71
resources/views/core/movies/edit.blade.php
Normal file
71
resources/views/core/movies/edit.blade.php
Normal file
@@ -0,0 +1,71 @@
|
||||
@extends(backpack_view('blank'))
|
||||
|
||||
@php
|
||||
$defaultBreadcrumbs = [
|
||||
trans('backpack::crud.admin') => backpack_url('dashboard'),
|
||||
$crud->entity_name_plural => url($crud->route),
|
||||
trans('backpack::crud.edit') => false,
|
||||
];
|
||||
|
||||
// if breadcrumbs aren't defined in the CrudController, use the default breadcrumbs
|
||||
$breadcrumbs = $breadcrumbs ?? $defaultBreadcrumbs;
|
||||
@endphp
|
||||
|
||||
@section('header')
|
||||
<section class="container-fluid">
|
||||
<h2>
|
||||
<span class="text-capitalize">{!! $crud->getHeading() ?? $crud->entity_name_plural !!}</span>
|
||||
<small>{!! $crud->getSubheading() ?? trans('backpack::crud.edit').' '.$crud->entity_name !!}.</small>
|
||||
|
||||
@if ($crud->hasAccess('list'))
|
||||
<small><a href="{{ url($crud->route) }}" class="d-print-none font-sm"><i class="la la-angle-double-{{ config('backpack.base.html_direction') == 'rtl' ? 'right' : 'left' }}"></i> {{ trans('backpack::crud.back_to_all') }} <span>{{ $crud->entity_name_plural }}</span></a></small>
|
||||
@endif
|
||||
</h2>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="{{ $crud->getEditContentClass() }}">
|
||||
<!-- Default box -->
|
||||
|
||||
@include('crud::inc.grouped_errors')
|
||||
|
||||
<form method="post"
|
||||
action="{{ url($crud->route.'/'.$entry->getKey()) }}"
|
||||
@if ($crud->hasUploadFields('update', $entry->getKey()))
|
||||
enctype="multipart/form-data"
|
||||
@endif
|
||||
>
|
||||
{!! csrf_field() !!}
|
||||
{!! method_field('PUT') !!}
|
||||
|
||||
@if ($crud->model->translationEnabled())
|
||||
<div class="mb-2 text-right">
|
||||
<!-- Single button -->
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{trans('backpack::crud.language')}}: {{ $crud->model->getAvailableLocales()[request()->input('_locale')?request()->input('_locale'):App::getLocale()] }} <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@foreach ($crud->model->getAvailableLocales() as $key => $locale)
|
||||
<a class="dropdown-item" href="{{ url($crud->route.'/'.$entry->getKey().'/edit') }}?_locale={{ $key }}">{{ $locale }}</a>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<!-- load the view from the application if it exists, otherwise load the one in the package -->
|
||||
@if(view()->exists('vendor.backpack.crud.form_content'))
|
||||
@include('vendor.backpack.crud.form_content', ['fields' => $crud->fields(), 'action' => 'edit'])
|
||||
@else
|
||||
@include('crud::form_content', ['fields' => $crud->fields(), 'action' => 'edit'])
|
||||
@endif
|
||||
<!-- This makes sure that all field assets are loaded. -->
|
||||
<div class="d-none" id="parentLoadedAssets">{{ json_encode(Assets::loaded()) }}</div>
|
||||
@include('crud::inc.form_save_buttons')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
435
resources/views/core/movies/inc/episode.blade.php
Normal file
435
resources/views/core/movies/inc/episode.blade.php
Normal file
@@ -0,0 +1,435 @@
|
||||
<?php
|
||||
$index = 0;
|
||||
$episodes = collect(old('episodes', isset($entry) ? $entry->episodes : []));
|
||||
?>
|
||||
<div class="mb-4">
|
||||
<div class="p-0">
|
||||
<div class="input-group mb-3 col-md-6 px-0">
|
||||
<input id="new-server-name" type="text" value="Thuyết minh #1" placeholder="Tên server" class="form-control">
|
||||
<span class="input-group-append">
|
||||
<button type="button" id="add-server-btn" class="btn btn-success">
|
||||
Thêm
|
||||
<i class="la la-plus"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div id="raw-episode-info" style="display: none" class="form-group">
|
||||
<label>Định dạng (Mỗi dòng 1 tập)</label>
|
||||
<div class="alert alert-info">
|
||||
<h6>Định dạng (<span class="badge badge-danger">Sửa</span>): <span class="text-warning">name|link|type|slug|id</span></h6>
|
||||
<h6>Định dạng (<span class="badge badge-success">Thêm</span>): <span class="text-warning">name|link|type|slug</span></h6>
|
||||
<h6>Định dạng (<span class="badge badge-success">Thêm</span>): <span class="text-warning">name|link|type</span></h6>
|
||||
<h6>Định dạng (<span class="badge badge-success">Thêm</span>): <span class="text-warning">name|link</span></h6>
|
||||
<h6>Định dạng (<span class="badge badge-success">Thêm</span>): <span class="text-warning">link</span></h6>
|
||||
<hr/>
|
||||
<h6><span class="text-warning">id</span>: ID row sql (<span class="badge badge-danger">Không được thêm sửa xóa field này</span>)</h6>
|
||||
<h6><span class="text-warning">type</span>: 1 trong 3 định dạng - <b>mp4,m3u8,embed</b></h6>
|
||||
</div>
|
||||
<textarea class="form-control" id="raw-episode-data" rows="5"></textarea>
|
||||
</div>
|
||||
<div class="input-group mb-3 col-md-6 px-0">
|
||||
<button type="button" class="btn btn-info raw-episode-btn">
|
||||
<i class="las la-pencil-ruler"></i>
|
||||
Sửa nhanh
|
||||
</button>
|
||||
<button style="display: none" type="button" class="btn btn-success ml-1 raw-episode-save-btn">
|
||||
<i class="las la-save"></i>
|
||||
Cập nhật
|
||||
<span class="text-warning"></span>
|
||||
</button>
|
||||
<button style="display: none" type="button" class="btn btn-default ml-1 raw-episode-cancel-btn">
|
||||
<i class="las la-remove-format"></i>
|
||||
Hủy
|
||||
</button>
|
||||
</div>
|
||||
<ul class="nav nav-tabs" role="tablist" id="episode-server-list">
|
||||
@if (count($episodes))
|
||||
@foreach ($episodes->groupBy('server') as $server => $data)
|
||||
<li class="nav-item"><a
|
||||
class="nav-link episode-server @if ($loop->first) active @endif"
|
||||
data-toggle="tab" href="#episode-server-{{ $loop->index }}" role="tab"
|
||||
aria-controls="home" aria-selected="true" contenteditable
|
||||
onblur="updateEpisodeServer(this)">{{ $server }}</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@else
|
||||
<li class="nav-item"><a class="nav-link episode-server active" data-toggle="tab"
|
||||
href="#episode-server-0" role="tab" aria-controls="home" aria-selected="true"
|
||||
contenteditable onblur="updateEpisodeServer(this)">Vietsub
|
||||
#1</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
<div class="tab-content" id="episode-server-data">
|
||||
@if (count($episodes))
|
||||
@foreach ($episodes->groupBy('server') as $server => $data)
|
||||
<div class="tab-pane @if ($loop->first) active @endif"
|
||||
id="episode-server-{{ $loop->index }}" role="tabpanel">
|
||||
<div class="table-responsive mb-3">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="min-width: 100px;">Tên</th>
|
||||
<th style="min-width: 100px;">Slug</th>
|
||||
<th style="min-width: 100px;">Type</th>
|
||||
<th style="min-width: 300px;">Link</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($data->sortBy('name', SORT_NATURAL)->groupBy('name') as $sortedEpisodes)
|
||||
@foreach ($sortedEpisodes as $episode)
|
||||
<tr class="episode">
|
||||
<input type="hidden" name="episodes[{{ $index }}][id]"
|
||||
value="{{ $episode['id'] ?? $episode->id ?? '' }}" data-attr-name="id">
|
||||
<input type="hidden" class="episode-server"
|
||||
name="episodes[{{ $index }}][server]" value="{{ $server }}"
|
||||
data-attr-name="server">
|
||||
<td><input type="text" name="episodes[{{ $index }}][name]"
|
||||
placeholder="Tập 1"
|
||||
value="{{ $episode['name'] ?? $episode->name }}"
|
||||
class="ep_name form-control" data-attr-name="name">
|
||||
</td>
|
||||
<td><input type="text" name="episodes[{{ $index }}][slug]"
|
||||
placeholder="tap-1"
|
||||
value="{{ $episode['slug'] ?? $episode->slug }}"
|
||||
class="form-control" data-attr-name="slug"></td>
|
||||
<td>
|
||||
<select name="episodes[{{ $index }}][type]"
|
||||
data-attr-name="type" class="form-control">
|
||||
@foreach (config('vsmov.episodes.types', []) as $key => $name)
|
||||
<option value="{{ $key }}"
|
||||
@if (($episode['type'] ?? $episode->type) == $key) selected @endif>
|
||||
{{ $name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" name="episodes[{{ $index }}][link]"
|
||||
placeholder="" class="form-control" data-attr-name="link"
|
||||
value="{{ $episode['link'] ?? ($episode->link ?? '') }}">
|
||||
</td>
|
||||
<td class="text-center"><span style="cursor:pointer"
|
||||
class="badge outline-badge-danger delete-episode">Xóa</span></td>
|
||||
</tr>
|
||||
@php $index++; @endphp
|
||||
@endforeach
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-inline justify-content-left mb-3 px-0">
|
||||
<button type="button" class="btn btn-warning add-episode-btn" data-server="{{ $loop->index }}"
|
||||
data-server-name="{{ $server }}">
|
||||
<i class="las la-plus"></i>
|
||||
Thêm tập mới
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger ml-2 float-right delete-server">
|
||||
<i class="las la-trash"></i>
|
||||
Xóa server
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="tab-pane active" id="episode-server-0" role="tabpanel">
|
||||
<div class="form-inline justify-content-left mb-3 px-0">
|
||||
<button type="button" class="btn btn-warning add-episode-btn" data-server="0"
|
||||
data-server-name="Vietsub #1">
|
||||
<i class="las la-plus"></i>
|
||||
Thêm tập mới
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger ml-2 float-right delete-server">
|
||||
<i class="las la-trash"></i>
|
||||
Xóa server
|
||||
</button>
|
||||
</div>
|
||||
<div class="table-responsive" style="max-height: 400px; overflow:auto;">
|
||||
<table class="table table-bordered mb-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tên</th>
|
||||
<th>Slug</th>
|
||||
<th>Type</th>
|
||||
<th>Link</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="episode">
|
||||
<input type="hidden" class="episode-server" name="episodes[0][server]"
|
||||
value="Vietsub #1" data-attr-name="server">
|
||||
<td><input type="text" name="episodes[0][name]" placeholder="1" value="1"
|
||||
class="ep_name form-control" data-attr-name="name">
|
||||
</td>
|
||||
<td><input type="text" name="episodes[0][slug]" placeholder="tap-1"
|
||||
value="tap-1" class="form-control" data-attr-name="slug"></td>
|
||||
<td>
|
||||
<select name="episodes[0][type]" data-attr-name="type" class="form-control">
|
||||
@foreach (config('vsmov.episodes.types', []) as $key => $name)
|
||||
<option value="{{ $key }}">
|
||||
{{ $name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" name="episodes[0][link]" placeholder=""
|
||||
class="form-control" data-attr-name="link"></td>
|
||||
<td class="text-center"><span style="cursor:pointer"
|
||||
class="badge outline-badge-danger delete-episode">Xóa</span></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
|
||||
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script>
|
||||
var editor;
|
||||
|
||||
$("#add-server-btn").click(function(e) {
|
||||
const serverCount = $('#episode-server-list').children('.nav-item').length;
|
||||
const serverName = $('#new-server-name').val();
|
||||
|
||||
const templateList = (i, name) => {
|
||||
return `<li class="nav-item"><a class="nav-link episode-server" data-toggle="tab" href="#episode-server-${i}"
|
||||
role="tab" aria-controls="episode-server-${i}" aria-selected="true" contenteditable>${name}</a>
|
||||
</li>`;
|
||||
}
|
||||
const templateData = (i, name) => {
|
||||
return `<div class="tab-pane" id="episode-server-${i}" role="tabpanel">
|
||||
<div class="table-responsive mb-3" style="max-height: 400px; overflow:auto;">
|
||||
<table class="table table-bordered mb-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Slug</th>
|
||||
<th>Type</th>
|
||||
<th>Link</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-inline justify-content-left mb-3 px-0">
|
||||
<button type="button" class="btn btn-warning mr-2 add-episode-btn" data-server="${i}" data-server-name="${name}">
|
||||
<i class="las la-plus"></i>
|
||||
Thêm tập mới
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger float-right delete-server">
|
||||
<i class="las la-trash"></i>
|
||||
Xóa server
|
||||
</button>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
$('#episode-server-list').append(templateList(serverCount, serverName));
|
||||
$('#episode-server-data').append(templateData(serverCount, serverName));
|
||||
|
||||
$('.episode-server[data-toggle="tab"]').last().click();
|
||||
getRawItems();
|
||||
});
|
||||
|
||||
$(document).on('click', '.delete-server', function(e) {
|
||||
const tab = $(this).closest('.tab-pane');
|
||||
const tabLink = $(`.nav-link[href="#${$(tab).attr('id')}"]`);
|
||||
$(tab).remove();
|
||||
$(tabLink).closest('.nav-item').remove();
|
||||
updateNameAttr();
|
||||
$('.episode-server[data-toggle="tab"]').last().click();
|
||||
});
|
||||
|
||||
const templateEpisode = (i, server, item = null, fake_name = 0) => {
|
||||
var [name, link, type, slug, id] = ['','','','',''];
|
||||
if (item) {
|
||||
let countItem = item.split('|').length;
|
||||
if(countItem === 1) {
|
||||
link = item;
|
||||
} else {
|
||||
[name, link, type, slug, id] = item.split('|');
|
||||
}
|
||||
|
||||
if(!name) {
|
||||
name = fake_name;
|
||||
}
|
||||
if(!type) {
|
||||
if(link.indexOf('.m3u8') !== -1) type = 'm3u8'
|
||||
if(link.indexOf('.mp4') !== -1) type = 'mp4'
|
||||
}
|
||||
if(!slug) slug = `tap-${change_alias(name.toString())}`;
|
||||
}
|
||||
return `<tr class="episode">
|
||||
<input type="hidden" name="episodes[${i}][id]" value="${id}" data-attr-name="id">
|
||||
<input type="hidden" class="episode-server" value="${server}" data-attr-name="server">
|
||||
<td><input type="text" placeholder="${name || '1'}" value="${name || '1'}"
|
||||
class="ep_name form-control" data-attr-name="name">
|
||||
</td>
|
||||
<td><input type="text" placeholder="${slug || 'tap-1'}" value="${slug || 'tap-1'}"
|
||||
class="form-control" data-attr-name="slug"></td>
|
||||
<td>
|
||||
<select data-attr-name="type" class="form-control">
|
||||
@foreach (config('vsmov.episodes.types', []) as $key => $name)
|
||||
<option value="{{ $key }}" ${'{{$key}}' == type ? 'selected' : ''}>{{ $name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" placeholder="" value="${link || ''}"
|
||||
class="form-control" data-attr-name="link"></td>
|
||||
<td class="text-center"><span style="cursor:pointer"
|
||||
class="badge outline-badge-danger delete-episode">Xóa</span></td>
|
||||
</tr>`
|
||||
}
|
||||
|
||||
$(document).on('click', '.add-episode-btn', function(e) {
|
||||
$(`#episode-server-${$(this).data('server')} table tbody`).append(templateEpisode($('.episode')
|
||||
.length, $(this).data('server-name')));
|
||||
updateNameAttr();
|
||||
})
|
||||
|
||||
|
||||
$(document).on('click', '.delete-episode', function(e) {
|
||||
$(this).closest('tr').remove();
|
||||
updateNameAttr();
|
||||
})
|
||||
|
||||
function updateEpisodeServer(el) {
|
||||
$($(el).attr('href')).find('.episode-server').val($(el).html().trim());
|
||||
$($(el).attr('href')).find('.add-episode-btn').data('server-name', $(el).html().trim());
|
||||
}
|
||||
|
||||
function updateNameAttr() {
|
||||
$('.episode').each((index, episode) => {
|
||||
$(episode).find('[data-attr-name]').each((i, attr) => {
|
||||
const attrName = $(attr).attr('data-attr-name').split('.').reduce((a, b) =>
|
||||
`${a}[${b}]`, '')
|
||||
$(attr).attr('name', `episodes[${index}]${attrName}`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function change_alias(string) {
|
||||
slug = string.toLowerCase();
|
||||
slug = slug.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, "a");
|
||||
slug = slug.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, "e");
|
||||
slug = slug.replace(/i|í|ì|ỉ|ĩ|ị/gi, "i");
|
||||
slug = slug.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, "o");
|
||||
slug = slug.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, "u");
|
||||
slug = slug.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, "y");
|
||||
slug = slug.replace(/đ/gi, "d");
|
||||
slug = slug.replace(/\`|\~|\!|\@|\#|\||\$|\%|\^|\&|\*|\(|\)|\+|\=|\,|\.|\/|\?|\>|\<|\'|\"|\:|\;|\–|_/gi, "");
|
||||
slug = slug.replace(/ /gi, "-");
|
||||
slug = slug.replace(/\-\-\-\-\-/gi, "-");
|
||||
slug = slug.replace(/\-\-\-\-/gi, "-");
|
||||
slug = slug.replace(/\-\-\-/gi, "-");
|
||||
slug = slug.replace(/\-\-/gi, "-");
|
||||
slug = slug.replace("à", "a");
|
||||
slug = "@" + slug + "@";
|
||||
slug = slug.replace(/\@\-|\-\@|\@/gi, "");
|
||||
return slug;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js" integrity="sha512-8RnEqURPUc5aqFEN04aQEiPlSAdE0jlFS/9iGgUyNtwFnSKCXhmB6ZTNl7LnDtDWKabJIASzXrzD0K+LYexU9g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css" integrity="sha512-uf06llspW44/LZpHzHT6qBOIVODjWtv4MxCricRxkzvopAlSWnTf6hpZTFxuuZcuNE9CBQhqE0Seu1CoRk84nQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<script>
|
||||
|
||||
function getRawItems(curserver) {
|
||||
if (!$('.raw-episode-save-btn').is(':visible')) return;
|
||||
let currentServerId = $("#episode-server-data .tab-pane.active").attr("id").split('episode-server-')[1];
|
||||
let currentServerName = curserver ?? $(".nav-link.episode-server.active").text();
|
||||
$('.raw-episode-save-btn span').html(currentServerName);
|
||||
|
||||
let arrId = $("input[data-attr-name=id]");
|
||||
let arrServer = $("input[data-attr-name=server]");
|
||||
let arrName = $("input[data-attr-name=name]");
|
||||
let arrSlug = $("input[data-attr-name=slug]");
|
||||
let arrType = $("select[data-attr-name=type]");
|
||||
let arrLink = $("input[data-attr-name=link]");
|
||||
|
||||
let itemsCurrentServer = [];
|
||||
for (let index = 0; index < arrServer.length; index++) {
|
||||
const server = arrServer[index].value;
|
||||
if (server === currentServerName) {
|
||||
let itemId = arrId[index].value;
|
||||
let itemServer = server;
|
||||
let itemName = arrName[index].value;
|
||||
let itemSlug = arrSlug[index].value;
|
||||
let itemType = arrType[index].value;
|
||||
let itemLink = arrLink[index].value;
|
||||
itemsCurrentServer.push(`${itemName}|${itemLink}|${itemType}|${itemSlug}|${itemId}`);
|
||||
}
|
||||
}
|
||||
|
||||
editor = editor ?? CodeMirror.fromTextArea(document.getElementById('raw-episode-data'), {
|
||||
lineNumbers: true
|
||||
});
|
||||
editor.getDoc().setValue(itemsCurrentServer.join("\n"));
|
||||
}
|
||||
$(document).on('click', '.nav-link.episode-server', function(e) {
|
||||
e.preventDefault();
|
||||
if($(this).hasClass('active') === false) getRawItems(e.target.text);
|
||||
})
|
||||
$(document).on('click', '.raw-episode-cancel-btn', function(e) {
|
||||
updateNameAttr();
|
||||
$(this).hide(200);
|
||||
$('.raw-episode-save-btn').hide(200);
|
||||
$('#raw-episode-info').hide(200);
|
||||
$('.raw-episode-btn').show(200);
|
||||
$(".delete-episode").show();
|
||||
|
||||
$(".add-episode-btn").removeAttr("disabled");
|
||||
$(".delete-server").removeAttr("disabled");
|
||||
$("button[type=submit]").removeAttr("disabled");
|
||||
})
|
||||
$(document).on('click', '.raw-episode-btn', function(e) {
|
||||
$(this).hide(200);
|
||||
$(".add-episode-btn").attr("disabled", true);
|
||||
$(".delete-server").attr("disabled", true);
|
||||
$("button[type=submit]").attr("disabled", true);
|
||||
$(".delete-episode").hide();
|
||||
|
||||
$('.raw-episode-save-btn').show(200);
|
||||
$('.raw-episode-cancel-btn').show(200);
|
||||
$('#raw-episode-info').show(200);
|
||||
getRawItems();
|
||||
})
|
||||
|
||||
$(document).on('click', '.raw-episode-save-btn', function(e) {
|
||||
let currentServerId = $("#episode-server-data .tab-pane.active").attr("id").split('episode-server-')[1];
|
||||
let currentServerName = $(".nav-link.episode-server.active").text();
|
||||
let rawItems = editor.getValue();
|
||||
rawItems = rawItems.split("\n");
|
||||
var fake_name = 1;
|
||||
$(`#episode-server-${currentServerId} table tbody`).empty();
|
||||
for (let index = 0; index < rawItems.length; index++) {
|
||||
const item = rawItems[index];
|
||||
if(item !== '') {
|
||||
$(`#episode-server-${currentServerId} table tbody`).append(templateEpisode($('.episode').length, currentServerName, item, fake_name))
|
||||
fake_name++;
|
||||
};
|
||||
}
|
||||
updateNameAttr();
|
||||
$(this).hide(200);
|
||||
$('.raw-episode-cancel-btn').hide(200);
|
||||
$('#raw-episode-info').hide(200);
|
||||
$('.raw-episode-btn').show(200);
|
||||
$(".delete-episode").show();
|
||||
|
||||
$(".add-episode-btn").removeAttr("disabled");
|
||||
$(".delete-server").removeAttr("disabled");
|
||||
$("button[type=submit]").removeAttr("disabled");
|
||||
})
|
||||
</script>
|
||||
259
resources/views/core/sitemap/styles.blade.php
Normal file
259
resources/views/core/sitemap/styles.blade.php
Normal file
@@ -0,0 +1,259 @@
|
||||
<?php echo '<'.'?xml version="1.0" encoding="UTF-8"'.'?'.'>'; ?>
|
||||
<xsl:stylesheet version="2.0"
|
||||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
|
||||
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:kml="http://www.opengis.net/kml/2.2"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
|
||||
<xsl:template match="/">
|
||||
<html
|
||||
xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<xsl:choose>
|
||||
<xsl:when test="kml:kml">
|
||||
<title>Locations Sitemap</title>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<title>XML Sitemap</title>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-size: 14px;
|
||||
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
||||
margin: 0;
|
||||
color: #545353;
|
||||
}
|
||||
a {
|
||||
color: #05809e;
|
||||
text-decoration: none;
|
||||
}
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
font-family: Verdana,Geneva,sans-serif;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#description {
|
||||
background-color: #4275f4;
|
||||
padding: 20px 40px;
|
||||
color: #fff;
|
||||
padding: 30px 30px 20px;
|
||||
}
|
||||
#description h1,
|
||||
#description p,
|
||||
#description a {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
#description h1 {
|
||||
font-size: 2em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
#description p {
|
||||
margin-top: 5px;
|
||||
}
|
||||
#description a {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 20px 30px;
|
||||
background: #fff;
|
||||
max-width: 75%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
table {
|
||||
border: none;
|
||||
border-collapse: collapse;
|
||||
font-size: .9em;
|
||||
width: 100%;
|
||||
}
|
||||
th {
|
||||
background-color: #4275f4;
|
||||
color: #fff;
|
||||
text-align: left;
|
||||
padding: 15px 10px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
td {
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
tbody tr:nth-child(even) {
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
table td a {
|
||||
display: block;
|
||||
}
|
||||
table td a img {
|
||||
max-height: 30px;
|
||||
margin: 6px 3px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:choose>
|
||||
<xsl:when test="kml:kml">
|
||||
<div id="description">
|
||||
<h1>KML File</h1>
|
||||
<p>
|
||||
This KML File is generated by
|
||||
<a href="{{ $domain }}" target="_blank">{{ $title }}</a>. It is used to provide location information to Google.
|
||||
</p>
|
||||
<p>
|
||||
Learn more about
|
||||
<a href="https://developers.google.com/kml/documentation/" target="_blank">KML File</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p class="expl">
|
||||
This KML file contains
|
||||
<xsl:value-of select="count(kml:kml/kml:Document/kml:Folder/kml:Placemark)"/> Locations.
|
||||
|
||||
</p>
|
||||
<p class="expl">
|
||||
<a href="{{ $domain }}/sitemap.xml">← Sitemap Index</a>
|
||||
</p>
|
||||
<table id="sitemap" cellpadding="3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="25%">Name</th>
|
||||
<th width="40%">Address</th>
|
||||
<th width="15%">Phone number</th>
|
||||
<th width="10%">Latitude</th>
|
||||
<th width="10%">Longitude</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
|
||||
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
|
||||
<xsl:for-each select="kml:kml/kml:Document/kml:Folder/kml:Placemark">
|
||||
<tr>
|
||||
<td>
|
||||
<xsl:variable name="itemURL">
|
||||
<xsl:value-of select="atom:link/@href"/>
|
||||
</xsl:variable>
|
||||
<a href="{$itemURL}">
|
||||
<xsl:value-of select="kml:name"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="kml:address"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="kml:phoneNumber"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="kml:LookAt/kml:latitude"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="kml:LookAt/kml:longitude"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<div id="description">
|
||||
<h1>XML Sitemap</h1>
|
||||
<p>
|
||||
This XML Sitemap is generated by
|
||||
<a href="{{ $domain }}" target="_blank">{{ $title }}</a>. It is what search engines like Google use to crawl and re-crawl posts/pages/products/images/archives on your website.
|
||||
</p>
|
||||
<p>
|
||||
Learn more about
|
||||
<a href="http://sitemaps.org" target="_blank">XML Sitemaps</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) > 0">
|
||||
<p>
|
||||
This XML Sitemap Index file contains
|
||||
<strong>
|
||||
<xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/>
|
||||
</strong> sitemaps.
|
||||
</p>
|
||||
<table id="sitemap" cellpadding="3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="75%">Sitemap</th>
|
||||
<th width="25%">Last Modified</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
|
||||
<xsl:variable name="sitemapURL">
|
||||
<xsl:value-of select="sitemap:loc"/>
|
||||
</xsl:variable>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{$sitemapURL}">
|
||||
<xsl:value-of select="sitemap:loc"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</table>
|
||||
</xsl:if>
|
||||
<xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) < 1">
|
||||
<p>
|
||||
This XML Sitemap contains
|
||||
<strong>
|
||||
<xsl:value-of select="count(sitemap:urlset/sitemap:url)"/>
|
||||
</strong> URLs.
|
||||
</p>
|
||||
<p class="expl">
|
||||
<a href="{{ $domain }}/sitemap.xml">← Sitemap Index</a>
|
||||
</p>
|
||||
<table id="sitemap" cellpadding="3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="75%">URL</th>
|
||||
<th width="5%">Images</th>
|
||||
<th title="Last Modification Time" width="20%">Last Mod.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
|
||||
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
|
||||
<xsl:for-each select="sitemap:urlset/sitemap:url">
|
||||
<tr>
|
||||
<td>
|
||||
<xsl:variable name="itemURL">
|
||||
<xsl:value-of select="sitemap:loc"/>
|
||||
</xsl:variable>
|
||||
<a href="{$itemURL}">
|
||||
<xsl:value-of select="sitemap:loc"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="count(image:image)"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</table>
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
Reference in New Issue
Block a user