added documents api

This commit is contained in:
Amanmyrat 2022-11-29 15:54:43 +05:00
parent ca33e5066c
commit a7697a1775
58 changed files with 9535 additions and 116 deletions

View File

@ -0,0 +1,59 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Requests\DocumentRequest;
use Backpack\CRUD\app\Http\Controllers\CrudController;
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
/**
* Class DocumentCrudController
* @package App\Http\Controllers\Admin
* @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
*/
class DocumentCrudController extends CrudController
{
use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
use \Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
public function setup()
{
$this->crud->setModel('App\Models\Document');
$this->crud->setRoute(config('backpack.base.route_prefix') . '/document');
$this->crud->setEntityNameStrings('document', 'documents');
}
protected function setupListOperation()
{
// TODO: remove setFromDb() and manually define Columns, maybe Filters
CRUD::column('title');
CRUD::column('file');
}
protected function setupCreateOperation()
{
$this->crud->setValidation(DocumentRequest::class);
// TODO: remove setFromDb() and manually define Fields
CRUD::field('title');
CRUD::field('file')->type('upload')->upload(true);
}
protected function setupUpdateOperation()
{
$this->setupCreateOperation();
}
protected function setupReorderOperation()
{
// define which model attribute will be shown on draggable elements
$this->crud->set('reorder.label', 'title');
// define how deep the admin is allowed to nest the items
// for infinite levels, set it to 0
$this->crud->set('reorder.max_level', 1);
}
}

View File

@ -33,7 +33,7 @@ class ApiController extends Controller
{
$this->fractal = new Manager;
$this->locale = $request->header('X-Localization') ?? 'tk';
$this->locale = $request->header('X-Localization') ?? 'tm';
}
/**

View File

@ -8,7 +8,6 @@ use App\Transformers\CategoryTransformer;
class CategoryController extends ApiController
{
public function index()
{
$categories = Category::orderBy('lft', 'desc')->get();

View File

@ -0,0 +1,16 @@
<?php
namespace App\Http\Controllers\Api;
use App\Models\Document;
use App\Transformers\DocumentTransformer;
class DocumentController extends ApiController
{
public function index()
{
$documents = Document::orderBy('lft', 'desc')->get();
return $this->respondWithCollection($documents, new DocumentTransformer($this->locale));
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
use Illuminate\Foundation\Http\FormRequest;
class DocumentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
// only allow updates if the user is logged in
return backpack_auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
// 'name' => 'required|min:5|max:255'
];
}
/**
* Get the validation attributes that apply to the request.
*
* @return array
*/
public function attributes()
{
return [
//
];
}
/**
* Get the validation messages that apply to the request.
*
* @return array
*/
public function messages()
{
return [
//
];
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreDocumentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateDocumentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

39
app/Models/Document.php Normal file
View File

@ -0,0 +1,39 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
use Illuminate\Support\Str;
class Document extends Model
{
use \Backpack\CRUD\app\Models\Traits\CrudTrait;
use HasFactory;
use HasTranslations;
protected $guarded = [''];
public $translatable = ['title', 'file'];
public static function boot()
{
parent::boot();
static::deleting(function($obj) {
\Storage::disk('public_folder')->delete($obj->image);
});
}
public function setFileAttribute($value)
{
$attribute_name = "file";
$disk = config('backpack.base.root_disk_name');
$destination_path = "public/uploads/files";
$this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path, $fileName = null);
return $this->attributes[$attribute_name]; // uncomment if this is a translatable field
}
}

View File

@ -0,0 +1,94 @@
<?php
namespace App\Policies;
use App\Models\Document;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
class DocumentPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view any models.
*
* @param \App\Models\User $user
* @return \Illuminate\Auth\Access\Response|bool
*/
public function viewAny(User $user)
{
//
}
/**
* Determine whether the user can view the model.
*
* @param \App\Models\User $user
* @param \App\Models\Document $document
* @return \Illuminate\Auth\Access\Response|bool
*/
public function view(User $user, Document $document)
{
//
}
/**
* Determine whether the user can create models.
*
* @param \App\Models\User $user
* @return \Illuminate\Auth\Access\Response|bool
*/
public function create(User $user)
{
//
}
/**
* Determine whether the user can update the model.
*
* @param \App\Models\User $user
* @param \App\Models\Document $document
* @return \Illuminate\Auth\Access\Response|bool
*/
public function update(User $user, Document $document)
{
//
}
/**
* Determine whether the user can delete the model.
*
* @param \App\Models\User $user
* @param \App\Models\Document $document
* @return \Illuminate\Auth\Access\Response|bool
*/
public function delete(User $user, Document $document)
{
//
}
/**
* Determine whether the user can restore the model.
*
* @param \App\Models\User $user
* @param \App\Models\Document $document
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restore(User $user, Document $document)
{
//
}
/**
* Determine whether the user can permanently delete the model.
*
* @param \App\Models\User $user
* @param \App\Models\Document $document
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDelete(User $user, Document $document)
{
//
}
}

View File

@ -18,7 +18,7 @@ class CategoryTransformer extends TransformerAbstract
{
return [
'id' => $category->id,
'title' => $category->getTranslations('title', [$this->locale]),
'title' => $category->getTranslations('title', [$this->locale])[$this->locale],
];
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Transformers;
use App\Models\Document;
use Illuminate\Support\Str;
use League\Fractal\TransformerAbstract;
class DocumentTransformer extends TransformerAbstract
{
private $locale;
public function __construct($locale)
{
$this->locale = $locale;
}
public function transform(Document $document)
{
$file = Str::replaceFirst('public/', '', $document->getTranslations('file',[$this->locale])[$this->locale]);
return [
'id' => $document->id,
'title' => $document->getTranslations('title',[$this->locale]),
'file' => url($file),
];
}
}

View File

@ -23,7 +23,6 @@ class NewsTransformer extends TransformerAbstract
'description' => $news->getTranslations('description', [$this->locale]),
'date' => $news->date,
'image' => url($news->image),
'locale' => $this->locale,
];
}
}

1279
bootstrap/cache/config.php vendored Normal file

File diff suppressed because it is too large Load Diff

5935
bootstrap/cache/routes-v7.php vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -95,7 +95,7 @@ return [
|
*/
'fallback_locale' => 'tk',
'fallback_locale' => 'tm',
/*
|--------------------------------------------------------------------------
@ -108,7 +108,7 @@ return [
|
*/
'faker_locale' => 'tk_TK',
'faker_locale' => 'tm_TM',
/*
|--------------------------------------------------------------------------

View File

@ -428,7 +428,7 @@ return [
// "to" => "Tonga",
// "tr_TR" => "Turkish (Turkey)",
// "tr" => "Turkish",
"tk" => "Turkmen",
"tm" => "Turkmen",
// "uk_UA" => "Ukrainian (Ukraine)",
// "uk" => "Ukrainian",
// "ur_IN" => "Urdu (India)",

View File

@ -5,5 +5,5 @@ return [
/*
* If a translation has not been set for a given locale, use this locale instead.
*/
'fallback_locale' => 'tk',
'fallback_locale' => 'tm',
];

View File

@ -0,0 +1,20 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class DocumentFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
//
];
}
}

View File

@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDocumentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('documents', function (Blueprint $table) {
$table->id();
$table->text('title');
$table->text('file');
$table->integer('parent_id')->default(0)->nullable();
$table->integer('lft')->default(0);
$table->integer('rgt')->default(0);
$table->integer('depth')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('documents');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class DocumentSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}

View File

@ -10990,7 +10990,7 @@
90: "'ynjy",
};
moment.defineLocale('tk', {
moment.defineLocale('tm', {
months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(
'_'
),

View File

@ -16659,7 +16659,7 @@
90: "'ynjy",
};
hooks.defineLocale('tk', {
hooks.defineLocale('tm', {
months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(
'_'
),

View File

@ -0,0 +1,198 @@
%PDF-1.3
%âãÏÓ
1 0 obj
<<
/Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
>>
endobj
2 0 obj
<<
/Type /Outlines
/Count 0
>>
endobj
3 0 obj
<<
/Type /Pages
/Count 2
/Kids [ 4 0 R 6 0 R ]
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 5 0 R
>>
endobj
5 0 obj
<< /Length 1074 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( A Simple PDF File ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( This is a small demonstration .pdf file - ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( just for use in the Virtual Mechanics tutorials. More text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 628.8480 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 616.8960 Td
( text. And more text. Boring, zzzzz. And more text. And more text. And ) Tj
ET
BT
/F1 0010 Tf
69.2500 604.9440 Td
( more text. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 592.9920 Td
( And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 569.0880 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 557.1360 Td
( text. And more text. And more text. Even more. Continued on page 2 ...) Tj
ET
endstream
endobj
6 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 7 0 R
>>
endobj
7 0 obj
<< /Length 676 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( Simple PDF File 2 ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( ...continued from page 1. Yet more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 676.6560 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( text. Oh, how boring typing this stuff. But not as boring as watching ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( paint dry. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 640.8000 Td
( Boring. More, a little more text. The end, and just as well. ) Tj
ET
endstream
endobj
8 0 obj
[/PDF /Text]
endobj
9 0 obj
<<
/Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding
>>
endobj
10 0 obj
<<
/Creator (Rave \(http://www.nevrona.com/rave\))
/Producer (Nevrona Designs)
/CreationDate (D:20060301072826)
>>
endobj
xref
0 11
0000000000 65535 f
0000000019 00000 n
0000000093 00000 n
0000000147 00000 n
0000000222 00000 n
0000000390 00000 n
0000001522 00000 n
0000001690 00000 n
0000002423 00000 n
0000002456 00000 n
0000002574 00000 n
trailer
<<
/Size 11
/Root 1 0 R
/Info 10 0 R
>>
startxref
2714
%%EOF

View File

@ -0,0 +1,198 @@
%PDF-1.3
%âãÏÓ
1 0 obj
<<
/Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
>>
endobj
2 0 obj
<<
/Type /Outlines
/Count 0
>>
endobj
3 0 obj
<<
/Type /Pages
/Count 2
/Kids [ 4 0 R 6 0 R ]
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 5 0 R
>>
endobj
5 0 obj
<< /Length 1074 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( A Simple PDF File ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( This is a small demonstration .pdf file - ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( just for use in the Virtual Mechanics tutorials. More text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 628.8480 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 616.8960 Td
( text. And more text. Boring, zzzzz. And more text. And more text. And ) Tj
ET
BT
/F1 0010 Tf
69.2500 604.9440 Td
( more text. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 592.9920 Td
( And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 569.0880 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 557.1360 Td
( text. And more text. And more text. Even more. Continued on page 2 ...) Tj
ET
endstream
endobj
6 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 7 0 R
>>
endobj
7 0 obj
<< /Length 676 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( Simple PDF File 2 ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( ...continued from page 1. Yet more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 676.6560 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( text. Oh, how boring typing this stuff. But not as boring as watching ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( paint dry. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 640.8000 Td
( Boring. More, a little more text. The end, and just as well. ) Tj
ET
endstream
endobj
8 0 obj
[/PDF /Text]
endobj
9 0 obj
<<
/Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding
>>
endobj
10 0 obj
<<
/Creator (Rave \(http://www.nevrona.com/rave\))
/Producer (Nevrona Designs)
/CreationDate (D:20060301072826)
>>
endobj
xref
0 11
0000000000 65535 f
0000000019 00000 n
0000000093 00000 n
0000000147 00000 n
0000000222 00000 n
0000000390 00000 n
0000001522 00000 n
0000001690 00000 n
0000002423 00000 n
0000002456 00000 n
0000002574 00000 n
trailer
<<
/Size 11
/Root 1 0 R
/Info 10 0 R
>>
startxref
2714
%%EOF

View File

@ -0,0 +1,198 @@
%PDF-1.3
%âãÏÓ
1 0 obj
<<
/Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
>>
endobj
2 0 obj
<<
/Type /Outlines
/Count 0
>>
endobj
3 0 obj
<<
/Type /Pages
/Count 2
/Kids [ 4 0 R 6 0 R ]
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 5 0 R
>>
endobj
5 0 obj
<< /Length 1074 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( A Simple PDF File ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( This is a small demonstration .pdf file - ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( just for use in the Virtual Mechanics tutorials. More text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 628.8480 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 616.8960 Td
( text. And more text. Boring, zzzzz. And more text. And more text. And ) Tj
ET
BT
/F1 0010 Tf
69.2500 604.9440 Td
( more text. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 592.9920 Td
( And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 569.0880 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 557.1360 Td
( text. And more text. And more text. Even more. Continued on page 2 ...) Tj
ET
endstream
endobj
6 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 7 0 R
>>
endobj
7 0 obj
<< /Length 676 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( Simple PDF File 2 ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( ...continued from page 1. Yet more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 676.6560 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( text. Oh, how boring typing this stuff. But not as boring as watching ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( paint dry. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 640.8000 Td
( Boring. More, a little more text. The end, and just as well. ) Tj
ET
endstream
endobj
8 0 obj
[/PDF /Text]
endobj
9 0 obj
<<
/Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding
>>
endobj
10 0 obj
<<
/Creator (Rave \(http://www.nevrona.com/rave\))
/Producer (Nevrona Designs)
/CreationDate (D:20060301072826)
>>
endobj
xref
0 11
0000000000 65535 f
0000000019 00000 n
0000000093 00000 n
0000000147 00000 n
0000000222 00000 n
0000000390 00000 n
0000001522 00000 n
0000001690 00000 n
0000002423 00000 n
0000002456 00000 n
0000002574 00000 n
trailer
<<
/Size 11
/Root 1 0 R
/Info 10 0 R
>>
startxref
2714
%%EOF

View File

@ -0,0 +1,198 @@
%PDF-1.3
%âãÏÓ
1 0 obj
<<
/Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R
>>
endobj
2 0 obj
<<
/Type /Outlines
/Count 0
>>
endobj
3 0 obj
<<
/Type /Pages
/Count 2
/Kids [ 4 0 R 6 0 R ]
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 5 0 R
>>
endobj
5 0 obj
<< /Length 1074 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( A Simple PDF File ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( This is a small demonstration .pdf file - ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( just for use in the Virtual Mechanics tutorials. More text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 628.8480 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 616.8960 Td
( text. And more text. Boring, zzzzz. And more text. And more text. And ) Tj
ET
BT
/F1 0010 Tf
69.2500 604.9440 Td
( more text. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 592.9920 Td
( And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 569.0880 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 557.1360 Td
( text. And more text. And more text. Even more. Continued on page 2 ...) Tj
ET
endstream
endobj
6 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources <<
/Font <<
/F1 9 0 R
>>
/ProcSet 8 0 R
>>
/MediaBox [0 0 612.0000 792.0000]
/Contents 7 0 R
>>
endobj
7 0 obj
<< /Length 676 >>
stream
2 J
BT
0 0 0 rg
/F1 0027 Tf
57.3750 722.2800 Td
( Simple PDF File 2 ) Tj
ET
BT
/F1 0010 Tf
69.2500 688.6080 Td
( ...continued from page 1. Yet more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 676.6560 Td
( And more text. And more text. And more text. And more text. And more ) Tj
ET
BT
/F1 0010 Tf
69.2500 664.7040 Td
( text. Oh, how boring typing this stuff. But not as boring as watching ) Tj
ET
BT
/F1 0010 Tf
69.2500 652.7520 Td
( paint dry. And more text. And more text. And more text. And more text. ) Tj
ET
BT
/F1 0010 Tf
69.2500 640.8000 Td
( Boring. More, a little more text. The end, and just as well. ) Tj
ET
endstream
endobj
8 0 obj
[/PDF /Text]
endobj
9 0 obj
<<
/Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding
>>
endobj
10 0 obj
<<
/Creator (Rave \(http://www.nevrona.com/rave\))
/Producer (Nevrona Designs)
/CreationDate (D:20060301072826)
>>
endobj
xref
0 11
0000000000 65535 f
0000000019 00000 n
0000000093 00000 n
0000000147 00000 n
0000000222 00000 n
0000000390 00000 n
0000001522 00000 n
0000001690 00000 n
0000002423 00000 n
0000002456 00000 n
0000002574 00000 n
trailer
<<
/Size 11
/Root 1 0 R
/Info 10 0 R
>>
startxref
2714
%%EOF

View File

@ -3,4 +3,5 @@
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('category') }}"><i class="nav-icon la la-question"></i> Categories</a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('trading') }}"><i class="nav-icon la la-question"></i> Tradings</a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('news') }}"><i class="nav-icon la la-question"></i> News</a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url('news') }}"><i class="nav-icon la la-question"></i> News</a></li>
<li class='nav-item'><a class='nav-link' href='{{ backpack_url('document') }}'><i class='nav-icon la la-question'></i> Documents</a></li>

View File

@ -8,6 +8,7 @@ use App\Http\Controllers\Api\ImportController;
use App\Http\Controllers\Api\TradingsController;
use App\Http\Controllers\Api\NewsController;
use App\Http\Controllers\Api\CategoryController;
use App\Http\Controllers\Api\DocumentController;
/*
|--------------------------------------------------------------------------
@ -30,3 +31,4 @@ Route::get('other-filters', [FiltersController::class, 'otherFilters']);
Route::get('categories', [CategoryController::class, 'index']);
Route::get('tradings', [TradingsController::class, 'index']);
Route::get('news', [NewsController::class, 'index']);
Route::get('documents', [DocumentController::class, 'index']);

View File

@ -19,4 +19,5 @@ Route::group([
Route::crud('category', 'CategoryCrudController');
Route::crud('trading', 'TradingCrudController');
Route::crud('news', 'NewsCrudController');
Route::crud('document', 'DocumentCrudController');
}); // this should be the absolute last line of this file

View File

@ -1 +0,0 @@
a:5:{s:6:"_token";s:40:"KwWSECrELeCMOoLG40FMcHyFrXOZbujGRZR8G3fZ";s:9:"_previous";a:1:{s:3:"url";s:32:"http://127.0.0.1:8000/admin/news";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}s:3:"url";a:0:{}s:55:"login_backpack_59ba36addc2b2f9401580f014c7f58ea4e30989d";i:11;}

View File

@ -0,0 +1,21 @@
<?php
// if field name is array we check if any of the arrayed fields is translatable
$translatable = false;
if($crud->model->translationEnabled()) {
foreach((array) $field['name'] as $field_name){
if($crud->model->isTranslatableAttribute($field_name)) {
$translatable = true;
}
}
// if the field is a fake one (value is stored in a JSON column instead of a direct db column)
// and that JSON column is translatable, then the field itself should be translatable
if(isset($field['store_in']) && $crud->model->isTranslatableAttribute($field['store_in'])) {
$translatable = true;
}
}
?>
<?php if($translatable && config('backpack.crud.show_translatable_field_icon')): ?>
<i class="la la-flag-checkered pull-<?php echo e(config('backpack.crud.translatable_field_icon_position')); ?>" style="margin-top: 3px;" title="This field is translatable."></i>
<?php endif; ?>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/fields/inc/translatable_icon.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,174 @@
<input type="hidden" name="http_referrer" value=<?php echo e(session('referrer_url_override') ?? old('http_referrer') ?? \URL::previous() ?? url($crud->route)); ?>>
<?php if($crud->tabsEnabled() && count($crud->getTabs())): ?>
<?php echo $__env->make('crud::inc.show_tabbed_fields', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<input type="hidden" name="current_tab" value="<?php echo e(Str::slug($crud->getTabs()[0])); ?>" />
<?php else: ?>
<div class="card">
<div class="card-body row">
<?php echo $__env->make('crud::inc.show_fields', ['fields' => $crud->fields()], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
<?php endif; ?>
<?php $__env->startSection('after_styles'); ?>
<link rel="stylesheet" href="<?php echo e(asset('packages/backpack/crud/css/crud.css').'?v='.config('backpack.base.cachebusting_string')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('packages/backpack/crud/css/form.css').'?v='.config('backpack.base.cachebusting_string')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('packages/backpack/crud/css/'.$action.'.css').'?v='.config('backpack.base.cachebusting_string')); ?>">
<!-- CRUD FORM CONTENT - crud_fields_styles stack -->
<?php echo $__env->yieldPushContent('crud_fields_styles'); ?>
<style>
.form-group.required label:not(:empty):not(.form-check-label)::after {
content: '';
}
.form-group.required > label:not(:empty):not(.form-check-label)::after {
content: ' *';
color: #ff0000;
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('after_scripts'); ?>
<script src="<?php echo e(asset('packages/backpack/crud/js/crud.js').'?v='.config('backpack.base.cachebusting_string')); ?>"></script>
<script src="<?php echo e(asset('packages/backpack/crud/js/form.js').'?v='.config('backpack.base.cachebusting_string')); ?>"></script>
<script src="<?php echo e(asset('packages/backpack/crud/js/'.$action.'.js').'?v='.config('backpack.base.cachebusting_string')); ?>"></script>
<!-- CRUD FORM CONTENT - crud_fields_scripts stack -->
<?php echo $__env->yieldPushContent('crud_fields_scripts'); ?>
<script>
function initializeFieldsWithJavascript(container) {
var selector;
if (container instanceof jQuery) {
selector = container;
} else {
selector = $(container);
}
selector.find("[data-init-function]").not("[data-initialized=true]").each(function () {
var element = $(this);
var functionName = element.data('init-function');
if (typeof window[functionName] === "function") {
window[functionName](element);
// mark the element as initialized, so that its function is never called again
element.attr('data-initialized', 'true');
}
});
}
jQuery('document').ready(function($){
// trigger the javascript for all fields that have their js defined in a separate method
initializeFieldsWithJavascript('form');
// Save button has multiple actions: save and exit, save and edit, save and new
var saveActions = $('#saveActions'),
crudForm = saveActions.parents('form'),
saveActionField = $('[name="save_action"]');
saveActions.on('click', '.dropdown-menu a', function(){
var saveAction = $(this).data('value');
saveActionField.val( saveAction );
crudForm.submit();
});
// Ctrl+S and Cmd+S trigger Save button click
$(document).keydown(function(e) {
if ((e.which == '115' || e.which == '83' ) && (e.ctrlKey || e.metaKey))
{
e.preventDefault();
$("button[type=submit]").trigger('click');
return false;
}
return true;
});
// prevent duplicate entries on double-clicking the submit form
crudForm.submit(function (event) {
$("button[type=submit]").prop('disabled', true);
});
// Place the focus on the first element in the form
<?php if( $crud->getAutoFocusOnFirstField() ): ?>
<?php
$focusField = Arr::first($fields, function($field) {
return isset($field['auto_focus']) && $field['auto_focus'] == true;
});
?>
<?php if($focusField): ?>
<?php
$focusFieldName = isset($focusField['value']) && is_iterable($focusField['value']) ? $focusField['name'] . '[]' : $focusField['name'];
?>
window.focusField = $('[name="<?php echo e($focusFieldName); ?>"]').eq(0),
<?php else: ?>
var focusField = $('form').find('input, textarea, select').not('[type="hidden"]').eq(0),
<?php endif; ?>
fieldOffset = focusField.offset().top,
scrollTolerance = $(window).height() / 2;
focusField.trigger('focus');
if( fieldOffset > scrollTolerance ){
$('html, body').animate({scrollTop: (fieldOffset - 30)});
}
<?php endif; ?>
// Add inline errors to the DOM
<?php if($crud->inlineErrorsEnabled() && $errors->any()): ?>
window.errors = <?php echo json_encode($errors->messages()); ?>;
// console.error(window.errors);
$.each(errors, function(property, messages){
var normalizedProperty = property.split('.').map(function(item, index){
return index === 0 ? item : '['+item+']';
}).join('');
var field = $('[name="' + normalizedProperty + '[]"]').length ?
$('[name="' + normalizedProperty + '[]"]') :
$('[name="' + normalizedProperty + '"]'),
container = field.parents('.form-group');
container.addClass('text-danger');
container.children('input, textarea, select').addClass('is-invalid');
$.each(messages, function(key, msg){
// highlight the input that errored
var row = $('<div class="invalid-feedback d-block">' + msg + '</div>');
row.appendTo(container);
// highlight its parent tab
<?php if($crud->tabsEnabled()): ?>
var tab_id = $(container).closest('[role="tabpanel"]').attr('id');
$("#form_tabs [aria-controls="+tab_id+"]").addClass('text-danger');
<?php endif; ?>
});
});
<?php endif; ?>
$("a[data-toggle='tab']").click(function(){
currentTabName = $(this).attr('tab_name');
$("input[name='current_tab']").val(currentTabName);
});
if (window.location.hash) {
$("input[name='current_tab']").val(window.location.hash.substr(1));
}
});
</script>
<?php $__env->stopSection(); ?>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/form_content.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,17 @@
<?php
$error_number = 404;
?>
<?php $__env->startSection('title'); ?>
Page not found.
<?php $__env->stopSection(); ?>
<?php $__env->startSection('description'); ?>
<?php
$default_error_message = "Please <a href='javascript:history.back()''>go back</a> or return to <a href='".url('')."'>our homepage</a>.";
?>
<?php echo isset($exception)? ($exception->getMessage()?e($exception->getMessage()):$default_error_message): $default_error_message; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('errors.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp2\htdocs\exchange\resources\views/errors/404.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,26 @@
<?php
$field['wrapper'] = $field['wrapper'] ?? $field['wrapperAttributes'] ?? [];
// each wrapper attribute can be a callback or a string
// for those that are callbacks, run the callbacks to get the final string to use
foreach($field['wrapper'] as $attributeKey => $value) {
$field['wrapper'][$attributeKey] = !is_string($value) && is_callable($value) ? $value($crud, $field, $entry ?? null) : $value ?? '';
}
// if the field is required in the FormRequest, it should have an asterisk
$required = (isset($action) && $crud->isRequired($field['name'], $action)) ? ' required' : '';
// if the developer has intentionally set the required attribute on the field
// forget whatever is in the FormRequest, do what the developer wants
$required = isset($field['showAsterisk']) ? ($field['showAsterisk'] ? ' required' : '') : $required;
$field['wrapper']['class'] = $field['wrapper']['class'] ?? "form-group col-sm-12";
$field['wrapper']['class'] = $field['wrapper']['class'].$required;
$field['wrapper']['element'] = $field['wrapper']['element'] ?? 'div';
?>
<<?php echo e($field['wrapper']['element']); ?>
<?php $__currentLoopData = $field['wrapper']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attribute => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo e($attribute); ?>="<?php echo e($value); ?>"
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/fields/inc/wrapper_start.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,11 @@
<?php $__currentLoopData = $fields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<!-- load the view from type and view_namespace attribute if set -->
<?php
$fieldsViewNamespace = $field['view_namespace'] ?? 'crud::fields';
?>
<?php echo $__env->make($fieldsViewNamespace.'.'.$field['type'], ['field' => $field], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/inc/show_fields.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,3 @@
<?php if($crud->get('reorder.enabled') && $crud->hasAccess('reorder')): ?>
<a href="<?php echo e(url($crud->route.'/reorder')); ?>" class="btn btn-outline-primary" data-style="zoom-in"><span class="ladda-label"><i class="la la-arrows"></i> <?php echo e(trans('backpack::crud.reorder')); ?> <?php echo e($crud->entity_name_plural); ?></span></a>
<?php endif; ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/buttons/reorder.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,10 @@
<?php if($crud->groupedErrorsEnabled() && $errors->any()): ?>
<div class="alert alert-danger pb-0">
<ul class="list-unstyled">
<?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li><i class="la la-info-circle"></i> <?php echo e($error); ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
</div>
<?php endif; ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/inc/grouped_errors.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,15 @@
<!-- textarea -->
<?php echo $__env->make('crud::fields.inc.wrapper_start', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<label><?php echo $field['label']; ?></label>
<?php echo $__env->make('crud::fields.inc.translatable_icon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<textarea
name="<?php echo e($field['name']); ?>"
<?php echo $__env->make('crud::fields.inc.attributes', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
><?php echo e(old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? ''); ?></textarea>
<?php if(isset($field['hint'])): ?>
<p class="help-block"><?php echo $field['hint']; ?></p>
<?php endif; ?>
<?php echo $__env->make('crud::fields.inc.wrapper_end', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/fields/textarea.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,13 @@
<?php
$widgets['before_content'][] = [
'type' => 'jumbotron',
'heading' => trans('backpack::base.welcome'),
'content' => trans('backpack::base.use_sidebar'),
'button_link' => backpack_url('logout'),
'button_text' => trans('backpack::base.logout'),
];
?>
<?php $__env->startSection('content'); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make(backpack_view('blank'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\base/dashboard.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="<?php echo e(app()->getLocale()); ?>" dir="<?php echo e(config('backpack.base.html_direction')); ?>">
<head>
<?php echo $__env->make(backpack_view('inc.head'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</head>
<body class="app flex-row align-items-center">
<?php echo $__env->yieldContent('header'); ?>
<div class="container">
<?php echo $__env->yieldContent('content'); ?>
</div>
<footer class="app-footer sticky-footer">
<?php echo $__env->make('backpack::inc.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</footer>
<?php echo $__env->yieldContent('before_scripts'); ?>
<?php echo $__env->yieldPushContent('before_scripts'); ?>
<?php echo $__env->make(backpack_view('inc.scripts'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->yieldContent('after_scripts'); ?>
<?php echo $__env->yieldPushContent('after_scripts'); ?>
</body>
</html>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\base/layouts/plain.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,25 @@
<?php
// preserve backwards compatibility with Widgets in Backpack 4.0
if (isset($widget['wrapperClass'])) {
$widget['wrapper']['class'] = $widget['wrapperClass'];
}
?>
<?php echo $__env->renderWhen(!empty($widget['wrapper']), 'backpack::widgets.inc.wrapper_start', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>
<div class="jumbotron mb-2">
<?php if(isset($widget['heading'])): ?>
<h1 class="display-3"><?php echo $widget['heading']; ?></h1>
<?php endif; ?>
<?php if(isset($widget['content'])): ?>
<p><?php echo $widget['content']; ?></p>
<?php endif; ?>
<?php if(isset($widget['button_link'])): ?>
<p class="lead">
<a class="btn btn-primary" href="<?php echo e($widget['button_link']); ?>" role="button"><?php echo e($widget['button_text']); ?></a>
</p>
<?php endif; ?>
</div>
<?php echo $__env->renderWhen(!empty($widget['wrapper']), 'backpack::widgets.inc.wrapper_end', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\base/widgets/jumbotron.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,72 @@
<?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;
?>
<?php $__env->startSection('header'); ?>
<section class="container-fluid">
<h2>
<span class="text-capitalize"><?php echo $crud->getHeading() ?? $crud->entity_name_plural; ?></span>
<small><?php echo $crud->getSubheading() ?? trans('backpack::crud.edit').' '.$crud->entity_name; ?>.</small>
<?php if($crud->hasAccess('list')): ?>
<small><a href="<?php echo e(url($crud->route)); ?>" class="d-print-none font-sm"><i class="la la-angle-double-<?php echo e(config('backpack.base.html_direction') == 'rtl' ? 'right' : 'left'); ?>"></i> <?php echo e(trans('backpack::crud.back_to_all')); ?> <span><?php echo e($crud->entity_name_plural); ?></span></a></small>
<?php endif; ?>
</h2>
</section>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="<?php echo e($crud->getEditContentClass()); ?>">
<!-- Default box -->
<?php echo $__env->make('crud::inc.grouped_errors', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<form method="post"
action="<?php echo e(url($crud->route.'/'.$entry->getKey())); ?>"
<?php if($crud->hasUploadFields('update', $entry->getKey())): ?>
enctype="multipart/form-data"
<?php endif; ?>
>
<?php echo csrf_field(); ?>
<?php echo method_field('PUT'); ?>
<?php 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">
<?php echo e(trans('backpack::crud.language')); ?>: <?php echo e($crud->model->getAvailableLocales()[request()->input('locale')?request()->input('locale'):App::getLocale()]); ?> &nbsp; <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<?php $__currentLoopData = $crud->model->getAvailableLocales(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $locale): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<a class="dropdown-item" href="<?php echo e(url($crud->route.'/'.$entry->getKey().'/edit')); ?>?locale=<?php echo e($key); ?>"><?php echo e($locale); ?></a>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
</div>
</div>
<?php endif; ?>
<!-- load the view from the application if it exists, otherwise load the one in the package -->
<?php if(view()->exists('vendor.backpack.crud.form_content')): ?>
<?php echo $__env->make('vendor.backpack.crud.form_content', ['fields' => $crud->fields(), 'action' => 'edit'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php else: ?>
<?php echo $__env->make('crud::form_content', ['fields' => $crud->fields(), 'action' => 'edit'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php endif; ?>
<?php echo $__env->make('crud::inc.form_save_buttons', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</form>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make(backpack_view('blank'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/edit.blade.php ENDPATH**/ ?>

View File

@ -1,42 +0,0 @@
<?php
$value = data_get($entry, $column['name']);
if($value) {
$column['height'] = $column['height'] ?? "25px";
$column['width'] = $column['width'] ?? "auto";
$column['radius'] = $column['radius'] ?? "3px";
$column['prefix'] = $column['prefix'] ?? '';
if (is_array($value)) {
$value = json_encode($value);
}
if (preg_match('/^data\:image\//', $value)) { // base64_image
$href = $src = $value;
} elseif (isset($column['disk'])) { // image from a different disk (like s3 bucket)
$href = $src = Storage::disk($column['disk'])->url($column['prefix'].$value);
} else { // plain-old image, from a local disk
$href = $src = asset( $column['prefix'] . $value);
}
$column['wrapper']['element'] = $column['wrapper']['element'] ?? 'a';
$column['wrapper']['href'] = $column['wrapper']['href'] ?? $href;
$column['wrapper']['target'] = $column['wrapper']['target'] ?? '_blank';
}
?>
<span>
<?php if( empty($value) ): ?>
-
<?php else: ?>
<?php echo $__env->renderWhen(!empty($column['wrapper']), 'crud::columns.inc.wrapper_start', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>
<img src="<?php echo e($src); ?>" style="
max-height: <?php echo e($column['height']); ?>;
width: <?php echo e($column['width']); ?>;
border-radius: <?php echo e($column['radius']); ?>;"
/>
<?php echo $__env->renderWhen(!empty($column['wrapper']), 'crud::columns.inc.wrapper_end', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>
<?php endif; ?>
</span>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/columns/image.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,56 @@
<?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;
?>
<?php $__env->startSection('header'); ?>
<section class="container-fluid">
<h2>
<span class="text-capitalize"><?php echo $crud->getHeading() ?? $crud->entity_name_plural; ?></span>
<small><?php echo $crud->getSubheading() ?? trans('backpack::crud.add').' '.$crud->entity_name; ?>.</small>
<?php if($crud->hasAccess('list')): ?>
<small><a href="<?php echo e(url($crud->route)); ?>" class="d-print-none font-sm"><i class="la la-angle-double-<?php echo e(config('backpack.base.html_direction') == 'rtl' ? 'right' : 'left'); ?>"></i> <?php echo e(trans('backpack::crud.back_to_all')); ?> <span><?php echo e($crud->entity_name_plural); ?></span></a></small>
<?php endif; ?>
</h2>
</section>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="<?php echo e($crud->getCreateContentClass()); ?>">
<!-- Default box -->
<?php echo $__env->make('crud::inc.grouped_errors', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<form method="post"
action="<?php echo e(url($crud->route)); ?>"
<?php if($crud->hasUploadFields('create')): ?>
enctype="multipart/form-data"
<?php endif; ?>
>
<?php echo csrf_field(); ?>
<!-- load the view from the application if it exists, otherwise load the one in the package -->
<?php if(view()->exists('vendor.backpack.crud.form_content')): ?>
<?php echo $__env->make('vendor.backpack.crud.form_content', [ 'fields' => $crud->fields(), 'action' => 'create' ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php else: ?>
<?php echo $__env->make('crud::form_content', [ 'fields' => $crud->fields(), 'action' => 'create' ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php endif; ?>
<?php echo $__env->make('crud::inc.form_save_buttons', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</form>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make(backpack_view('blank'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/create.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1 @@
</<?php echo e($field['wrapper']['element'] ?? 'div'); ?>><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/fields/inc/wrapper_end.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,178 @@
<?php
$field['wrapper'] = $field['wrapper'] ?? $field['wrapperAttributes'] ?? [];
$field['wrapper']['data-init-function'] = $field['wrapper']['data-init-function'] ?? 'bpFieldInitUploadElement';
$field['wrapper']['data-field-name'] = $field['wrapper']['data-field-name'] ?? $field['name'];
?>
<!-- text input -->
<?php echo $__env->make('crud::fields.inc.wrapper_start', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<label><?php echo $field['label']; ?></label>
<?php echo $__env->make('crud::fields.inc.translatable_icon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php if(!empty($field['value'])): ?>
<div class="existing-file">
<?php if(isset($field['disk'])): ?>
<?php if(isset($field['temporary'])): ?>
<a target="_blank" href="<?php echo e((asset(\Storage::disk($field['disk'])->temporaryUrl(Arr::get($field, 'prefix', '').$field['value'], Carbon\Carbon::now()->addMinutes($field['temporary']))))); ?>">
<?php else: ?>
<a target="_blank" href="<?php echo e((asset(\Storage::disk($field['disk'])->url(Arr::get($field, 'prefix', '').$field['value'])))); ?>">
<?php endif; ?>
<?php else: ?>
<a target="_blank" href="<?php echo e((asset(Arr::get($field, 'prefix', '').$field['value']))); ?>">
<?php endif; ?>
<?php echo e($field['value']); ?>
</a>
<a href="#" class="file_clear_button btn btn-light btn-sm float-right" title="Clear file"><i class="la la-remove"></i></a>
<div class="clearfix"></div>
</div>
<?php endif; ?>
<div class="backstrap-file <?php echo e(isset($field['value']) && $field['value']!=null?'d-none':''); ?>">
<input
type="file"
name="<?php echo e($field['name']); ?>"
value="<?php echo e(old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? ''); ?>"
<?php echo $__env->make('crud::fields.inc.attributes', ['default_class' => isset($field['value']) && $field['value']!=null?'file_input backstrap-file-input':'file_input backstrap-file-input'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
>
<label class="backstrap-file-label" for="customFile"></label>
</div>
<?php if(isset($field['hint'])): ?>
<p class="help-block"><?php echo $field['hint']; ?></p>
<?php endif; ?>
<?php echo $__env->make('crud::fields.inc.wrapper_end', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php if($crud->fieldTypeNotLoaded($field)): ?>
<?php
$crud->markFieldTypeAsLoaded($field);
?>
<?php $__env->startPush('crud_fields_styles'); ?>
<style type="text/css">
.existing-file {
border: 1px solid rgba(0,40,100,.12);
border-radius: 5px;
padding-left: 10px;
vertical-align: middle;
}
.existing-file a {
padding-top: 5px;
display: inline-block;
font-size: 0.9em;
}
.backstrap-file {
position: relative;
display: inline-block;
width: 100%;
height: calc(1.5em + 0.75rem + 2px);
margin-bottom: 0;
}
.backstrap-file-input {
position: relative;
z-index: 2;
width: 100%;
height: calc(1.5em + 0.75rem + 2px);
margin: 0;
opacity: 0;
}
.backstrap-file-input:focus ~ .backstrap-file-label {
border-color: #acc5ea;
box-shadow: 0 0 0 0rem rgba(70, 127, 208, 0.25);
}
.backstrap-file-input:disabled ~ .backstrap-file-label {
background-color: #e4e7ea;
}
.backstrap-file-input:lang(en) ~ .backstrap-file-label::after {
content: "Browse";
}
.backstrap-file-input ~ .backstrap-file-label[data-browse]::after {
content: attr(data-browse);
}
.backstrap-file-label {
position: absolute;
top: 0;
right: 0;
left: 0;
z-index: 1;
height: calc(1.5em + 0.75rem + 2px);
padding: 0.375rem 0.75rem;
font-weight: 400;
line-height: 1.5;
color: #5c6873;
background-color: #fff;
border: 1px solid #e4e7ea;
border-radius: 0.25rem;
font-weight: 400!important;
}
.backstrap-file-label::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
z-index: 3;
display: block;
height: calc(1.5em + 0.75rem);
padding: 0.375rem 0.75rem;
line-height: 1.5;
color: #5c6873;
content: "Browse";
background-color: #f0f3f9;
border-left: inherit;
border-radius: 0 0.25rem 0.25rem 0;
}
</style>
<?php $__env->stopPush(); ?>
<?php $__env->startPush('crud_fields_scripts'); ?>
<!-- no scripts -->
<script>
function bpFieldInitUploadElement(element) {
var fileInput = element.find(".file_input");
var fileClearButton = element.find(".file_clear_button");
var fieldName = element.attr('data-field-name');
var inputWrapper = element.find(".backstrap-file");
var inputLabel = element.find(".backstrap-file-label");
fileClearButton.click(function(e) {
e.preventDefault();
$(this).parent().addClass('d-none');
fileInput.parent().removeClass('d-none');
fileInput.attr("value", "").replaceWith(fileInput.clone(true));
// redo the selector, so we can use the same fileInput variable going forward
fileInput = element.find(".file_input");
// add a hidden input with the same name, so that the setXAttribute method is triggered
$("<input type='hidden' name='"+fieldName+"' value=''>").insertAfter(fileInput);
});
fileInput.change(function() {
var path = $(this).val();
var path = path.replace("C:\\fakepath\\", "");
inputLabel.html(path);
// remove the hidden input, so that the setXAttribute method is no longer triggered
$(this).next("input[type=hidden]").remove();
});
}
</script>
<?php $__env->stopPush(); ?>
<?php endif; ?>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/fields/upload.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,10 @@
<?php
$field['attributes'] = $field['attributes'] ?? [];
$field['attributes']['class'] = $field['attributes']['class'] ?? $default_class ?? 'form-control';
?>
<?php $__currentLoopData = $field['attributes']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attribute => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_string($attribute)): ?>
<?php echo e($attribute); ?>="<?php echo e($value); ?>"
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/fields/inc/attributes.blade.php ENDPATH**/ ?>

View File

@ -3,4 +3,5 @@
<li class="nav-item"><a class="nav-link" href="<?php echo e(backpack_url('category')); ?>"><i class="nav-icon la la-question"></i> Categories</a></li>
<li class="nav-item"><a class="nav-link" href="<?php echo e(backpack_url('trading')); ?>"><i class="nav-icon la la-question"></i> Tradings</a></li>
<li class="nav-item"><a class="nav-link" href="<?php echo e(backpack_url('news')); ?>"><i class="nav-icon la la-question"></i> News</a></li><?php /**PATH C:\xampp2\htdocs\exchange\resources\views/vendor/backpack/base/inc/sidebar_content.blade.php ENDPATH**/ ?>
<li class="nav-item"><a class="nav-link" href="<?php echo e(backpack_url('news')); ?>"><i class="nav-icon la la-question"></i> News</a></li>
<li class='nav-item'><a class='nav-link' href='<?php echo e(backpack_url('document')); ?>'><i class='nav-icon la la-question'></i> Documents</a></li><?php /**PATH C:\xampp2\htdocs\exchange\resources\views/vendor/backpack/base/inc/sidebar_content.blade.php ENDPATH**/ ?>

View File

@ -1,17 +0,0 @@
<?php
// this is made available by columns like select and select_multiple
$related_key = $related_key ?? null;
// each wrapper attribute can be a callback or a string
// for those that are callbacks, run the callbacks to get the final string to use
foreach($column['wrapper'] as $attribute => $value) {
$column['wrapper'][$attribute] = !is_string($value) && is_callable($value) ? $value($crud, $column, $entry, $related_key) : $value ?? '';
}
?>
<<?php echo e($column['wrapper']['element'] ?? 'a'); ?>
<?php $__currentLoopData = Arr::except($column['wrapper'], 'element'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo e($element); ?>="<?php echo e($value); ?>"
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/columns/inc/wrapper_start.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,16 @@
<?php
// if not otherwise specified, the hidden input should take up no space in the form
$field['wrapper'] = $field['wrapper'] ?? $field['wrapperAttributes'] ?? [];
$field['wrapper']['class'] = $field['wrapper']['class'] ?? "hidden";
?>
<!-- hidden input -->
<?php echo $__env->make('crud::fields.inc.wrapper_start', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<input
type="hidden"
name="<?php echo e($field['name']); ?>"
value="<?php echo e(old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? ''); ?>"
<?php echo $__env->make('crud::fields.inc.attributes', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
>
<?php echo $__env->make('crud::fields.inc.wrapper_end', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/fields/hidden.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,56 @@
<?php
$title = 'Error '.$error_number;
?>
<?php $__env->startSection('after_styles'); ?>
<style>
.error_number {
font-size: 156px;
font-weight: 600;
line-height: 100px;
}
.error_number small {
font-size: 56px;
font-weight: 700;
}
.error_number hr {
margin-top: 60px;
margin-bottom: 0;
width: 50px;
}
.error_title {
margin-top: 40px;
font-size: 36px;
font-weight: 400;
}
.error_description {
font-size: 24px;
font-weight: 400;
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-12 text-center">
<div class="error_number">
<small>ERROR</small><br>
<?php echo e($error_number); ?>
<hr>
</div>
<div class="error_title text-muted">
<?php echo $__env->yieldContent('title'); ?>
</div>
<div class="error_description text-muted">
<small>
<?php echo $__env->yieldContent('description'); ?>
</small>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make(backpack_user() && (Str::startsWith(\Request::path(), config('backpack.base.route_prefix'))) ? 'backpack::layouts.top_left' : 'backpack::layouts.plain', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp2\htdocs\exchange\resources\views/errors/layout.blade.php ENDPATH**/ ?>

View File

@ -1,13 +0,0 @@
<?php
// this is made available by columns like select and select_multiple
$related_key = $related_key ?? null;
// define the wrapper element
$wrapperElement = $column['wrapper']['element'] ?? 'a';
if(!is_string($wrapperElement) && is_callable($wrapperElement)) {
$wrapperElement = $wrapperElement($crud, $column, $entry, $related_key);
}
?>
</<?php echo e($wrapperElement); ?>>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/columns/inc/wrapper_end.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,36 @@
<?php if(isset($saveAction['active']) && !is_null($saveAction['active']['value'])): ?>
<div id="saveActions" class="form-group">
<input type="hidden" name="save_action" value="<?php echo e($saveAction['active']['value']); ?>">
<?php if(!empty($saveAction['options'])): ?>
<div class="btn-group" role="group">
<?php endif; ?>
<button type="submit" class="btn btn-success">
<span class="la la-save" role="presentation" aria-hidden="true"></span> &nbsp;
<span data-value="<?php echo e($saveAction['active']['value']); ?>"><?php echo e($saveAction['active']['label']); ?></span>
</button>
<div class="btn-group" role="group">
<?php if(!empty($saveAction['options'])): ?>
<button id="btnGroupDrop1" type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span><span class="sr-only">&#x25BC;</span></button>
<div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
<?php $__currentLoopData = $saveAction['options']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<a class="dropdown-item" href="javascript:void(0);" data-value="<?php echo e($value); ?>"><?php echo e($label); ?></a>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<?php endif; ?>
</div>
<?php if(!empty($saveAction['options'])): ?>
</div>
<?php endif; ?>
<?php if(!$crud->hasOperationSetting('showCancelButton') || $crud->getOperationSetting('showCancelButton') == true): ?>
<a href="<?php echo e($crud->hasAccess('list') ? url($crud->route) : url()->previous()); ?>" class="btn btn-default"><span class="la la-ban"></span> &nbsp;<?php echo e(trans('backpack::crud.cancel')); ?></a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/inc/form_save_buttons.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,298 @@
<?php
$defaultBreadcrumbs = [
trans('backpack::crud.admin') => url(config('backpack.base.route_prefix'), 'dashboard'),
$crud->entity_name_plural => url($crud->route),
trans('backpack::crud.reorder') => false,
];
// if breadcrumbs aren't defined in the CrudController, use the default breadcrumbs
$breadcrumbs = $breadcrumbs ?? $defaultBreadcrumbs;
?>
<?php $__env->startSection('header'); ?>
<div class="container-fluid">
<h2>
<span class="text-capitalize"><?php echo $crud->getHeading() ?? $crud->entity_name_plural; ?></span>
<small><?php echo $crud->getSubheading() ?? trans('backpack::crud.reorder').' '.$crud->entity_name_plural; ?>.</small>
<?php if($crud->hasAccess('list')): ?>
<small><a href="<?php echo e(url($crud->route)); ?>" class="d-print-none font-sm"><i class="la la-angle-double-left"></i> <?php echo e(trans('backpack::crud.back_to_all')); ?> <span><?php echo e($crud->entity_name_plural); ?></span></a></small>
<?php endif; ?>
</h2>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<?php
function tree_element($entry, $key, $all_entries, $crud)
{
if (! isset($entry->tree_element_shown)) {
// mark the element as shown
$all_entries[$key]->tree_element_shown = true;
$entry->tree_element_shown = true;
// show the tree element
echo '<li id="list_'.$entry->getKey().'">';
echo '<div><span class="disclose"><span></span></span>'.object_get($entry, $crud->get('reorder.label')).'</div>';
// see if this element has any children
$children = [];
foreach ($all_entries as $key => $subentry) {
if ($subentry->parent_id == $entry->getKey()) {
$children[] = $subentry;
}
}
$children = collect($children)->sortBy('lft');
// if it does have children, show them
if (count($children)) {
echo '<ol>';
foreach ($children as $key => $child) {
$children[$key] = tree_element($child, $child->getKey(), $all_entries, $crud);
}
echo '</ol>';
}
echo '</li>';
}
return $entry;
}
?>
<div class="row mt-4">
<div class="<?php echo e($crud->getReorderContentClass()); ?>">
<div class="card p-4">
<p><?php echo e(trans('backpack::crud.reorder_text')); ?></p>
<ol class="sortable mt-0">
<?php
$all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName());
$root_entries = $all_entries->filter(function ($item) {
return $item->parent_id == 0;
});
foreach ($root_entries as $key => $entry) {
$root_entries[$key] = tree_element($entry, $key, $all_entries, $crud);
}
?>
</ol>
</div><!-- /.card -->
<button id="toArray" class="btn btn-success" data-style="zoom-in"><i class="la la-save"></i> <?php echo e(trans('backpack::crud.save')); ?></button>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('after_styles'); ?>
<style>
.ui-sortable .placeholder {
outline: 1px dashed #4183C4;
/*-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
margin: -1px;*/
}
.ui-sortable .mjs-nestedSortable-error {
background: #fbe3e4;
border-color: transparent;
}
.ui-sortable ol {
margin: 0;
padding: 0;
padding-left: 30px;
}
ol.sortable, ol.sortable ol {
margin: 0 0 0 25px;
padding: 0;
list-style-type: none;
}
ol.sortable {
margin: 2em 0;
}
.sortable li {
margin: 5px 0 0 0;
padding: 0;
}
.sortable li div {
border: 1px solid #ddd;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding: 6px;
margin: 0;
cursor: move;
background-color: #f4f4f4;
color: #444;
border-color: #00acd6;
}
.sortable li.mjs-nestedSortable-branch div {
/*background-color: #00c0ef;*/
/*border-color: #00acd6;*/
}
.sortable li.mjs-nestedSortable-leaf div {
/*background-color: #00c0ef;*/
border: 1px solid #ddd;
}
li.mjs-nestedSortable-collapsed.mjs-nestedSortable-hovering div {
border-color: #999;
background: #fafafa;
}
.ui-sortable .disclose {
cursor: pointer;
width: 10px;
display: none;
}
.sortable li.mjs-nestedSortable-collapsed > ol {
display: none;
}
.sortable li.mjs-nestedSortable-branch > div > .disclose {
display: inline-block;
}
.sortable li.mjs-nestedSortable-collapsed > div > .disclose > span:before {
content: '+ ';
}
.sortable li.mjs-nestedSortable-expanded > div > .disclose > span:before {
content: '- ';
}
.ui-sortable h1 {
font-size: 2em;
margin-bottom: 0;
}
.ui-sortable h2 {
font-size: 1.2em;
font-weight: normal;
font-style: italic;
margin-top: .2em;
margin-bottom: 1.5em;
}
.ui-sortable h3 {
font-size: 1em;
margin: 1em 0 .3em;;
}
.ui-sortable p, .ui-sortable ol, .ui-sortable ul, .ui-sortable pre, .ui-sortable form {
margin-top: 0;
margin-bottom: 1em;
}
.ui-sortable dl {
margin: 0;
}
.ui-sortable dd {
margin: 0;
padding: 0 0 0 1.5em;
}
.ui-sortable code {
background: #e5e5e5;
}
.ui-sortable input {
vertical-align: text-bottom;
}
.ui-sortable .notice {
color: #c33;
}
</style>
<link rel="stylesheet" href="<?php echo e(asset('packages/backpack/crud/css/crud.css').'?v='.config('backpack.base.cachebusting_string')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('packages/backpack/crud/css/reorder.css').'?v='.config('backpack.base.cachebusting_string')); ?>">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('after_scripts'); ?>
<script src="<?php echo e(asset('packages/backpack/crud/js/crud.js').'?v='.config('backpack.base.cachebusting_string')); ?>" type="text/javascript" ></script>
<script src="<?php echo e(asset('packages/backpack/crud/js/reorder.js').'?v='.config('backpack.base.cachebusting_string')); ?>" type="text/javascript" ></script>
<script src="<?php echo e(asset('packages/jquery-ui-dist/jquery-ui.min.js')); ?>" type="text/javascript" ></script>
<script src="<?php echo e(asset('packages/nestedSortable/jquery.mjs.nestedSortable2.js')); ?>" type="text/javascript" ></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
// initialize the nested sortable plugin
$('.sortable').nestedSortable({
forcePlaceholderSize: true,
handle: 'div',
helper: 'clone',
items: 'li',
opacity: .6,
placeholder: 'placeholder',
revert: 250,
tabSize: 25,
tolerance: 'pointer',
toleranceElement: '> div',
maxLevels: <?php echo e($crud->get('reorder.max_level') ?? 3); ?>,
isTree: true,
expandOnHover: 700,
startCollapsed: false
});
$('.disclose').on('click', function() {
$(this).closest('li').toggleClass('mjs-nestedSortable-collapsed').toggleClass('mjs-nestedSortable-expanded');
});
$('#toArray').click(function(e){
// get the current tree order
arraied = $('ol.sortable').nestedSortable('toArray', {startDepthCount: 0});
// log it
//console.log(arraied);
// send it with POST
$.ajax({
url: '<?php echo e(url(Request::path())); ?>',
type: 'POST',
data: { tree: arraied },
})
.done(function() {
new Noty({
type: "success",
text: "<strong><?php echo e(trans('backpack::crud.reorder_success_title')); ?></strong><br><?php echo e(trans('backpack::crud.reorder_success_message')); ?>"
}).show();
})
.fail(function() {
new Noty({
type: "error",
text: "<strong><?php echo e(trans('backpack::crud.reorder_error_title')); ?></strong><br><?php echo e(trans('backpack::crud.reorder_error_message')); ?>"
}).show();
})
.always(function() {
console.log("complete");
});
});
$.ajaxPrefilter(function(options, originalOptions, xhr) {
var token = $('meta[name="csrf_token"]').attr('content');
if (token) {
return xhr.setRequestHeader('X-XSRF-TOKEN', token);
}
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make(backpack_view('blank'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/reorder.blade.php ENDPATH**/ ?>

View File

@ -0,0 +1,22 @@
<!-- text input -->
<?php echo $__env->make('crud::fields.inc.wrapper_start', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<label><?php echo $field['label']; ?></label>
<?php echo $__env->make('crud::fields.inc.translatable_icon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php if(isset($field['prefix']) || isset($field['suffix'])): ?> <div class="input-group"> <?php endif; ?>
<?php if(isset($field['prefix'])): ?> <div class="input-group-prepend"><span class="input-group-text"><?php echo $field['prefix']; ?></span></div> <?php endif; ?>
<input
type="text"
name="<?php echo e($field['name']); ?>"
value="<?php echo e(old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? ''); ?>"
<?php echo $__env->make('crud::fields.inc.attributes', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
>
<?php if(isset($field['suffix'])): ?> <div class="input-group-append"><span class="input-group-text"><?php echo $field['suffix']; ?></span></div> <?php endif; ?>
<?php if(isset($field['prefix']) || isset($field['suffix'])): ?> </div> <?php endif; ?>
<?php if(isset($field['hint'])): ?>
<p class="help-block"><?php echo $field['hint']; ?></p>
<?php endif; ?>
<?php echo $__env->make('crud::fields.inc.wrapper_end', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php /**PATH C:\xampp2\htdocs\exchange\vendor\backpack\crud\src\resources\views\crud/fields/text.blade.php ENDPATH**/ ?>