Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5613ead566 | ||
|
|
4cdf11be3d
|
||
|
|
0fc181bf12
|
||
|
|
059d2b9d66
|
||
|
|
136451dc5a
|
||
|
|
1ee453dcfe
|
||
|
|
2a26008e87
|
||
|
|
031aa196d1
|
||
|
|
c3b9fa56fb
|
||
|
|
0922ee217f
|
||
|
|
7a1b9ecda1
|
||
|
|
5f0958f42e
|
||
|
|
db0dce27b4
|
||
|
|
754a67c5d0
|
||
|
|
ace4c69bd8
|
||
|
|
42d8728b1b
|
||
|
|
efab6d8eed
|
||
|
|
aa03855bb3
|
||
|
|
7fd3a0d45c
|
||
|
|
506f403a00
|
||
|
|
b8efe490a7
|
||
|
|
e11815b795
|
||
|
|
d925928ea9
|
||
|
|
0d08276d44
|
||
|
|
54a2d84a00
|
||
|
|
a70e09bddc
|
||
|
|
6e8b708749
|
||
|
|
4a4d6d3bdf
|
||
|
|
2e7318c097
|
||
|
|
e2f5d155ff
|
||
|
|
ba9be40c78
|
||
|
|
0a612e72c7
|
||
|
|
949ffc6221
|
||
|
|
820450c48c
|
||
|
|
3a7c747ac4
|
||
|
|
02bcac7889
|
||
|
|
6831592661
|
||
|
|
d3a84bad04
|
||
|
|
756cafdbff
|
||
|
|
9356b06ef5
|
||
|
|
b5258f840e
|
||
|
|
b35f04d220
|
||
|
|
d4ae9e0e43 | ||
|
|
859187bafa
|
||
|
|
9e6e699db0
|
||
|
|
993350073c
|
||
|
|
9a6604a40b
|
||
|
|
85a4361d0c
|
||
|
|
53bae19d3e | ||
|
|
d4174cf7d2
|
||
|
|
de496eaea1
|
||
|
|
94db6aa51d
|
||
|
|
c33fcd1d7c
|
||
|
|
3d4bef0e56
|
||
|
|
19b0e68b8b
|
||
|
|
ba74aa9977
|
||
|
|
224240708d
|
||
|
|
4049f9df53
|
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
DOCKER_APP_PORT=8080
|
DOCKER_WEB_PORT=8080
|
||||||
DOCKER_CAPTCHA_PORT=8081
|
DOCKER_CAPTCHA_PORT=8081
|
||||||
DOCKER_CAPTCHA_WEBSOCKET_PORT=8082
|
DOCKER_CAPTCHA_WEBSOCKET_PORT=8082
|
||||||
DOCKER_DB_PORT=3306
|
DOCKER_DB_PORT=3306
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ final class Translations
|
|||||||
'site.Choose version',
|
'site.Choose version',
|
||||||
'site.alert-status-not-supported',
|
'site.alert-status-not-supported',
|
||||||
'site.alert-status-future',
|
'site.alert-status-future',
|
||||||
|
'Home',
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach (DocumentationVersionStatus::cases() as $status) {
|
foreach (DocumentationVersionStatus::cases() as $status) {
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
<?php declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Enums;
|
|
||||||
|
|
||||||
use Illuminate\Cache\TaggedCache;
|
|
||||||
use Illuminate\Support\Facades\Cache;
|
|
||||||
|
|
||||||
enum CacheTag: string
|
|
||||||
{
|
|
||||||
case Project = 'project';
|
|
||||||
case ProjectTranslation = 'project_translation';
|
|
||||||
case DocumantationVersion = 'documantation_version';
|
|
||||||
|
|
||||||
public function getCache(): TaggedCache
|
|
||||||
{
|
|
||||||
return Cache::tags($this->value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,8 +3,12 @@
|
|||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller as BaseController;
|
use App\Http\Controllers\Controller as BaseController;
|
||||||
|
use Illuminate\Support\Facades\Config;
|
||||||
|
|
||||||
abstract class Controller extends BaseController
|
abstract class Controller extends BaseController
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
Config::set('breadcrumbs.view', 'breadcrumbs.admin');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ final class LanguagesController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly LanguageService $languageService,
|
private readonly LanguageService $languageService,
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function newLanguage(NewLanguageRequest $request): JsonResponse
|
public function newLanguage(NewLanguageRequest $request): JsonResponse
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ final class AboutController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly AboutService $aboutService,
|
private readonly AboutService $aboutService,
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function languages(int $project, Request $request): View
|
public function languages(int $project, Request $request): View
|
||||||
{
|
{
|
||||||
|
|||||||
+14
-6
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin\Projects;
|
|||||||
|
|
||||||
use App\Dto\QuerySettingsDto;
|
use App\Dto\QuerySettingsDto;
|
||||||
use App\Http\Controllers\Admin\Controller;
|
use App\Http\Controllers\Admin\Controller;
|
||||||
|
use App\Http\Requests\Admin\Projects\DocumentationCategories\CreateRequest;
|
||||||
use App\Http\Requests\Admin\Projects\DocumentationCategories\IndexRequest;
|
use App\Http\Requests\Admin\Projects\DocumentationCategories\IndexRequest;
|
||||||
use App\Http\Requests\Admin\Projects\DocumentationCategories\StoreUpdateRequest;
|
use App\Http\Requests\Admin\Projects\DocumentationCategories\StoreUpdateRequest;
|
||||||
use App\Services\Admin\Project\DocumentationCategoryService;
|
use App\Services\Admin\Project\DocumentationCategoryService;
|
||||||
@@ -15,7 +16,9 @@ final class DocumentationCategoriesController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly DocumentationCategoryService $documentationCategoryService,
|
private readonly DocumentationCategoryService $documentationCategoryService,
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function index(int $projectId, int $versionId, IndexRequest $request): View
|
public function index(int $projectId, int $versionId, IndexRequest $request): View
|
||||||
{
|
{
|
||||||
@@ -32,18 +35,23 @@ final class DocumentationCategoriesController extends Controller
|
|||||||
$this->errors($result);
|
$this->errors($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin/projects/documentation-categories/index', $result->getData());
|
return view('admin/projects/documentation-versions/documentation-categories/index', $result->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create(int $projectId, int $versionId, Request $request): View
|
public function create(int $projectId, int $versionId, CreateRequest $request): View
|
||||||
{
|
{
|
||||||
|
$parentId = null;
|
||||||
|
if ($request->has('category')) {
|
||||||
|
$parentId = (int) $request->input('category');
|
||||||
|
}
|
||||||
|
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
$result = $this->documentationCategoryService->create($projectId, $versionId, $user);
|
$result = $this->documentationCategoryService->create($projectId, $versionId, $user, $parentId);
|
||||||
if ($result->isError()) {
|
if ($result->isError()) {
|
||||||
$this->errors($result);
|
$this->errors($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin/projects/documentation-categories/create', $result->getData());
|
return view('admin/projects/documentation-versions/documentation-categories/create', $result->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit(int $projectId, int $versionId, int $id, Request $request): View
|
public function edit(int $projectId, int $versionId, int $id, Request $request): View
|
||||||
@@ -54,7 +62,7 @@ final class DocumentationCategoriesController extends Controller
|
|||||||
$this->errors($result);
|
$this->errors($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin/projects/documentation-categories/edit', $result->getData());
|
return view('admin/projects/documentation-versions/documentation-categories/edit', $result->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(int $projectId, int $versionId, StoreUpdateRequest $request): RedirectResponse
|
public function store(int $projectId, int $versionId, StoreUpdateRequest $request): RedirectResponse
|
||||||
|
|||||||
+5
-3
@@ -15,7 +15,9 @@ final class DocumentationVersionController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly DocumentationVersionService $documentationVersionService,
|
private readonly DocumentationVersionService $documentationVersionService,
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function index(int $projectId, IndexRequest $request): View
|
public function index(int $projectId, IndexRequest $request): View
|
||||||
{
|
{
|
||||||
@@ -35,10 +37,10 @@ final class DocumentationVersionController extends Controller
|
|||||||
return view('admin/projects/documentation-versions/index', $result->getData());
|
return view('admin/projects/documentation-versions/index', $result->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show(int $projectId, int $id, Request $request): View
|
public function show(int $projectId, int $id, Request $request, ?int $category = null): View
|
||||||
{
|
{
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
$result = $this->documentationVersionService->show($projectId, $id, $user);
|
$result = $this->documentationVersionService->show($projectId, $id, $category, $user);
|
||||||
if ($result->isError()) {
|
if ($result->isError()) {
|
||||||
$this->errors($result);
|
$this->errors($result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin\Projects;
|
|||||||
|
|
||||||
use App\Dto\QuerySettingsDto;
|
use App\Dto\QuerySettingsDto;
|
||||||
use App\Http\Controllers\Admin\Controller;
|
use App\Http\Controllers\Admin\Controller;
|
||||||
|
use App\Http\Requests\Admin\Projects\Documentations\CreateRequest;
|
||||||
use App\Http\Requests\Admin\Projects\Documentations\IndexRequest;
|
use App\Http\Requests\Admin\Projects\Documentations\IndexRequest;
|
||||||
use App\Http\Requests\Admin\Projects\Documentations\StoreUpdateRequest;
|
use App\Http\Requests\Admin\Projects\Documentations\StoreUpdateRequest;
|
||||||
use App\Services\Admin\Project\DocumentationService;
|
use App\Services\Admin\Project\DocumentationService;
|
||||||
@@ -15,7 +16,9 @@ final class DocumentationsController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly DocumentationService $documentationService,
|
private readonly DocumentationService $documentationService,
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function index(int $projectId, int $versionId, IndexRequest $request): View
|
public function index(int $projectId, int $versionId, IndexRequest $request): View
|
||||||
{
|
{
|
||||||
@@ -32,18 +35,23 @@ final class DocumentationsController extends Controller
|
|||||||
$this->errors($result);
|
$this->errors($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin/projects/documentations/index', $result->getData());
|
return view('admin/projects/documentation-versions/documentations/index', $result->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create(int $projectId, int $versionId, Request $request): View
|
public function create(int $projectId, int $versionId, CreateRequest $request): View
|
||||||
{
|
{
|
||||||
|
$categoryId = null;
|
||||||
|
if ($request->has('category')) {
|
||||||
|
$categoryId = (int) $request->input('category');
|
||||||
|
}
|
||||||
|
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
$result = $this->documentationService->create($projectId, $versionId, $user);
|
$result = $this->documentationService->create($projectId, $versionId, $user, $categoryId);
|
||||||
if ($result->isError()) {
|
if ($result->isError()) {
|
||||||
$this->errors($result);
|
$this->errors($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin/projects/documentations/create', $result->getData());
|
return view('admin/projects/documentation-versions/documentations/create', $result->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit(int $projectId, int $versionId, int $id, Request $request): View
|
public function edit(int $projectId, int $versionId, int $id, Request $request): View
|
||||||
@@ -54,7 +62,7 @@ final class DocumentationsController extends Controller
|
|||||||
$this->errors($result);
|
$this->errors($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin/projects/documentations/edit', $result->getData());
|
return view('admin/projects/documentation-versions/documentations/edit', $result->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(int $projectId, int $versionId, StoreUpdateRequest $request): RedirectResponse
|
public function store(int $projectId, int $versionId, StoreUpdateRequest $request): RedirectResponse
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ final class FeedbacksController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly FeedbackService $feedbackService,
|
private readonly FeedbackService $feedbackService,
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function index(IndexRequest $request): View
|
public function index(IndexRequest $request): View
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ final class LinksController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly LinkService $linkService
|
private readonly LinkService $linkService
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function index(int $projectId, IndexRequest $request): View
|
public function index(int $projectId, IndexRequest $request): View
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ final class ServiceTranslateController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ServiceTranslateService $serviceTranslateService,
|
private readonly ServiceTranslateService $serviceTranslateService,
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function view(int $projectId, Request $request): View
|
public function view(int $projectId, Request $request): View
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Admin\Projects;
|
namespace App\Http\Controllers\Admin\Projects;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Admin\Controller;
|
||||||
use App\Http\Requests\Admin\Projects\Translations\UpdateRequest;
|
use App\Http\Requests\Admin\Projects\Translations\UpdateRequest;
|
||||||
use App\Services\Admin\Project\TranslationService;
|
use App\Services\Admin\Project\TranslationService;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
@@ -13,7 +13,9 @@ final class TranslationsController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TranslationService $translationService,
|
private readonly TranslationService $translationService,
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function languages(int $projectId, Request $request): View
|
public function languages(int $projectId, Request $request): View
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ final class ProjectsController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ProjectService $projectService
|
private readonly ProjectService $projectService
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function index(IndexRequest $request): View
|
public function index(IndexRequest $request): View
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ final class RolesController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly RoleService $roleService
|
private readonly RoleService $roleService
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
public function index(IndexRequest $request): View
|
public function index(IndexRequest $request): View
|
||||||
{
|
{
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ final class UsersController extends Controller
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly UserService $userService
|
private readonly UserService $userService
|
||||||
) { }
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
public function index(IndexRequest $request): View
|
public function index(IndexRequest $request): View
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ final class DocumentationController extends Controller
|
|||||||
|
|
||||||
public function defaultVersion(Request $request): RedirectResponse | View
|
public function defaultVersion(Request $request): RedirectResponse | View
|
||||||
{
|
{
|
||||||
$project = $request->get('project');
|
$project = $request->attributes->get('project');
|
||||||
$websiteTranslations = $request->get('websiteTranslations');
|
$websiteTranslations = $request->attributes->get('websiteTranslations');
|
||||||
|
|
||||||
$result = $this->documentationService->defaultVersion($project, $request->user());
|
$result = $this->documentationService->defaultVersion($project, $request->user());
|
||||||
if ($result->isError()) {
|
if ($result->isError()) {
|
||||||
@@ -40,9 +40,9 @@ final class DocumentationController extends Controller
|
|||||||
public function index(Request $request): View
|
public function index(Request $request): View
|
||||||
{
|
{
|
||||||
$documentation = new Documentation(
|
$documentation = new Documentation(
|
||||||
project: $request->get('project'),
|
project: $request->attributes->get('project'),
|
||||||
version: $request->get('version'),
|
version: $request->attributes->get('version'),
|
||||||
websiteTranslations: $request->get('websiteTranslations'),
|
websiteTranslations: $request->attributes->get('websiteTranslations'),
|
||||||
user: $request->user(),
|
user: $request->user(),
|
||||||
);
|
);
|
||||||
$result = $this->documentationService->index($documentation);
|
$result = $this->documentationService->index($documentation);
|
||||||
@@ -57,9 +57,9 @@ final class DocumentationController extends Controller
|
|||||||
public function category(string $slug, Request $request): View
|
public function category(string $slug, Request $request): View
|
||||||
{
|
{
|
||||||
$documentation = new Documentation(
|
$documentation = new Documentation(
|
||||||
project: $request->get('project'),
|
project: $request->attributes->get('project'),
|
||||||
version: $request->get('version'),
|
version: $request->attributes->get('version'),
|
||||||
websiteTranslations: $request->get('websiteTranslations'),
|
websiteTranslations: $request->attributes->get('websiteTranslations'),
|
||||||
user: $request->user(),
|
user: $request->user(),
|
||||||
);
|
);
|
||||||
$result = $this->documentationService->category($slug, $documentation);
|
$result = $this->documentationService->category($slug, $documentation);
|
||||||
@@ -77,9 +77,9 @@ final class DocumentationController extends Controller
|
|||||||
public function view(string $slug, Request $request): View
|
public function view(string $slug, Request $request): View
|
||||||
{
|
{
|
||||||
$documentation = new Documentation(
|
$documentation = new Documentation(
|
||||||
project: $request->get('project'),
|
project: $request->attributes->get('project'),
|
||||||
version: $request->get('version'),
|
version: $request->attributes->get('version'),
|
||||||
websiteTranslations: $request->get('websiteTranslations'),
|
websiteTranslations: $request->attributes->get('websiteTranslations'),
|
||||||
user: $request->user(),
|
user: $request->user(),
|
||||||
);
|
);
|
||||||
$result = $this->documentationService->view($slug, $documentation);
|
$result = $this->documentationService->view($slug, $documentation);
|
||||||
|
|||||||
@@ -17,16 +17,16 @@ final class FeedbackController extends Controller
|
|||||||
public function index(Request $request): View
|
public function index(Request $request): View
|
||||||
{
|
{
|
||||||
return view('site.feedback.index', [
|
return view('site.feedback.index', [
|
||||||
'project' => $request->get('project'),
|
'project' => $request->attributes->get('project'),
|
||||||
'websiteTranslations' => $request->get('websiteTranslations'),
|
'websiteTranslations' => $request->attributes->get('websiteTranslations'),
|
||||||
'captcha' => config('app.captcha', false),
|
'captcha' => config('app.captcha', false),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function send(SendRequest $request): RedirectResponse
|
public function send(SendRequest $request): RedirectResponse
|
||||||
{
|
{
|
||||||
$project = $request->get('project');
|
$project = $request->attributes->get('project');
|
||||||
$websiteTranslations = $request->get('websiteTranslations');
|
$websiteTranslations = $request->attributes->get('websiteTranslations');
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
$data = $request->getDto();
|
$data = $request->getDto();
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ final class ProjectsController extends Controller
|
|||||||
public function index(Request $request): View
|
public function index(Request $request): View
|
||||||
{
|
{
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
$project = $request->get('project');
|
$project = $request->attributes->get('project');
|
||||||
|
|
||||||
if (\is_null($project)) {
|
if (\is_null($project)) {
|
||||||
$with = ['storage'];
|
$with = ['storage'];
|
||||||
@@ -27,7 +27,7 @@ final class ProjectsController extends Controller
|
|||||||
return \view('site.projects.index', $result->getData());
|
return \view('site.projects.index', $result->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
$websiteTranslations = $request->get('websiteTranslations');
|
$websiteTranslations = $request->attributes->get('websiteTranslations');
|
||||||
$result = $this->projectService->getAboutByProject($project, $websiteTranslations, $user);
|
$result = $this->projectService->getAboutByProject($project, $websiteTranslations, $user);
|
||||||
if ($result->isError()) {
|
if ($result->isError()) {
|
||||||
$this->errors($result);
|
$this->errors($result);
|
||||||
|
|||||||
@@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
final readonly class DocumentationVersion
|
final readonly class DocumentationVersion
|
||||||
{
|
{
|
||||||
public function handle(Request $request, \Closure $next): Response
|
public function handle(Request $request, \Closure $next): Response
|
||||||
{
|
{
|
||||||
$project = $request->get('project');
|
$project = $request->attributes->get('project');
|
||||||
$versionSlug = $request->route()?->parameter('version');
|
$versionSlug = $request->route()?->parameter('version');
|
||||||
if ($versionSlug === null || $project === null) {
|
if ($versionSlug === null || $project === null) {
|
||||||
\abort(Response::HTTP_NOT_FOUND);
|
\abort(Response::HTTP_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
$seconds = 3600;
|
$seconds = 3600;
|
||||||
$version = CacheTag::DocumantationVersion->getCache()->remember(self::class . $project->id . '-' . $versionSlug, $seconds, function () use ($project, $versionSlug) {
|
$version = Cache::remember(self::class . $project->id . '-' . $versionSlug, $seconds, function () use ($project, $versionSlug) {
|
||||||
return $project->documentationVersions()->where('slug', $versionSlug)->first() ?? false;
|
return $project->documentationVersions()->where('slug', $versionSlug)->first() ?? false;
|
||||||
});
|
});
|
||||||
if ($version === false) {
|
if ($version === false) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ final class IsProject
|
|||||||
{
|
{
|
||||||
public function handle(Request $request, \Closure $next): Response
|
public function handle(Request $request, \Closure $next): Response
|
||||||
{
|
{
|
||||||
$project = $request->get('project');
|
$project = $request->attributes->get('project');
|
||||||
if (\is_null($project)) {
|
if (\is_null($project)) {
|
||||||
\abort(Response::HTTP_NOT_FOUND);
|
\abort(Response::HTTP_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ final class IsWebsiteTranslations
|
|||||||
{
|
{
|
||||||
public function handle(Request $request, \Closure $next): Response
|
public function handle(Request $request, \Closure $next): Response
|
||||||
{
|
{
|
||||||
$websiteTranslations = $request->get('websiteTranslations');
|
$websiteTranslations = $request->attributes->get('websiteTranslations');
|
||||||
if (\is_null($websiteTranslations)) {
|
if (\is_null($websiteTranslations)) {
|
||||||
\abort(Response::HTTP_NOT_FOUND);
|
\abort(Response::HTTP_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ final class ProjectAndLanguage extends ProjectLanguage
|
|||||||
}
|
}
|
||||||
|
|
||||||
$seconds = 3600;
|
$seconds = 3600;
|
||||||
$project = CacheTag::Project->getCache()->remember(self::class . $projectCode, $seconds, function () use ($projectCode) {
|
$project = Cache::remember(self::class . $projectCode, $seconds, function () use ($projectCode) {
|
||||||
return $this->projectRepository->getProjectByCode($projectCode) ?? false;
|
return $this->projectRepository->getProjectByCode($projectCode) ?? false;
|
||||||
});
|
});
|
||||||
if ($project === false) {
|
if ($project === false) {
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ final class ProjectDomainAndLanguage extends ProjectLanguage
|
|||||||
}
|
}
|
||||||
|
|
||||||
$seconds = 3600;
|
$seconds = 3600;
|
||||||
$project = CacheTag::Project->getCache()->remember(self::class . $httpHost, $seconds, function () use ($httpHost) {
|
$project = Cache::remember(self::class . $httpHost, $seconds, function () use ($httpHost) {
|
||||||
return $this->projectRepository->getProjectByHttpHost($httpHost) ?? false;
|
return $this->projectRepository->getProjectByHttpHost($httpHost) ?? false;
|
||||||
});
|
});
|
||||||
if ($project === false) {
|
if ($project === false) {
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Repositories\ProjectLanguageRepository;
|
use App\Repositories\ProjectLanguageRepository;
|
||||||
use App\Repositories\ProjectRepository;
|
use App\Repositories\ProjectRepository;
|
||||||
use App\Repositories\ProjectTranslationRepository;
|
use App\Repositories\ProjectTranslationRepository;
|
||||||
use App\Services\WebsiteTranslations;
|
use App\Services\WebsiteTranslations;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
abstract class ProjectLanguage
|
abstract class ProjectLanguage
|
||||||
{
|
{
|
||||||
@@ -21,7 +21,7 @@ abstract class ProjectLanguage
|
|||||||
protected function getWebsiteTranslations(Project $project, ?string $languageCode): ?WebsiteTranslations
|
protected function getWebsiteTranslations(Project $project, ?string $languageCode): ?WebsiteTranslations
|
||||||
{
|
{
|
||||||
$seconds = 3600 * 3;
|
$seconds = 3600 * 3;
|
||||||
$language = CacheTag::Project->getCache()->remember(self::class . $project->id . '-' . $languageCode, $seconds, function () use ($project, $languageCode) {
|
$language = Cache::remember(self::class . $project->id . '-' . $languageCode, $seconds, function () use ($project, $languageCode) {
|
||||||
return $this->projectLanguageRepository->getProjectLanguageByCodeOrDefault($project, $languageCode) ?? false;
|
return $this->projectLanguageRepository->getProjectLanguageByCodeOrDefault($project, $languageCode) ?? false;
|
||||||
});
|
});
|
||||||
if ($language === false) {
|
if ($language === false) {
|
||||||
@@ -34,7 +34,7 @@ abstract class ProjectLanguage
|
|||||||
}
|
}
|
||||||
|
|
||||||
$seconds = 3600 * 24;
|
$seconds = 3600 * 24;
|
||||||
$translations = CacheTag::ProjectTranslation->getCache()->remember(self::class . '-translations-' . $project->id . '-' . $language->id, $seconds, function () use ($project, $language) {
|
$translations = Cache::remember(self::class . '-translations-' . $project->id . '-' . $language->id, $seconds, function () use ($project, $language) {
|
||||||
return $this->projectTranslationRepository->getProjectTranslations($project->id, $language->id)->all()->pluck('text', 'code')->toArray();
|
return $this->projectTranslationRepository->getProjectTranslations($project->id, $language->id)->all()->pluck('text', 'code')->toArray();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ final class StoreUpdateRequest extends FormRequest implements FormRequestDto
|
|||||||
{
|
{
|
||||||
return new StoreUpdate(
|
return new StoreUpdate(
|
||||||
title: $this->input('title'),
|
title: $this->input('title'),
|
||||||
description: $this->input('description'),
|
description: (string) $this->input('description', ''),
|
||||||
storages: $this->storages(),
|
storages: $this->storages(),
|
||||||
isTranslateAutomatically: (bool) $this->input('translate-automatically', false),
|
isTranslateAutomatically: (bool) $this->input('translate-automatically', false),
|
||||||
);
|
);
|
||||||
|
|||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Requests\Admin\Projects\DocumentationCategories;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
final class CreateRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'category' => ['nullable', 'integer', 'min:1'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Http\Requests\Admin\Projects\Documentations;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
final class CreateRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'category' => ['nullable', 'integer', 'min:1'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ final class UpdateRequest extends FormRequest implements FormRequestDto
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'language.*.id' => ['required', 'numeric', 'min:1'],
|
'language.*.id' => ['required', 'numeric', 'min:1'],
|
||||||
'language.*.code' => ['nullable', 'string', 'min:2', 'max:50'],
|
'language.*.code' => ['nullable', 'string', 'min:2', 'max:50', 'required_with:language.*.source_language_id'],
|
||||||
'language.*.source_language_id' => ['nullable', 'numeric', 'min:1', 'different:language.*.id'],
|
'language.*.source_language_id' => ['nullable', 'numeric', 'min:1', 'different:language.*.id'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ final class Documentation extends Model
|
|||||||
'slug',
|
'slug',
|
||||||
'is_public',
|
'is_public',
|
||||||
'category_id',
|
'category_id',
|
||||||
|
'sort',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ use App\Services\Search\CreateSearchInstanceCommand;
|
|||||||
use App\Dto\Builder\DocumentationCategory as DocumentationCategoryBuilderDto;
|
use App\Dto\Builder\DocumentationCategory as DocumentationCategoryBuilderDto;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
final readonly class DocumentationCategoryRepository
|
final readonly class DocumentationCategoryRepository
|
||||||
@@ -93,4 +96,52 @@ final readonly class DocumentationCategoryRepository
|
|||||||
->pluck('title', 'id')
|
->pluck('title', 'id')
|
||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPathFromRoot(int $categoryId, ?ProjectLanguage $projectLanguage): Collection
|
||||||
|
{
|
||||||
|
$seconds = 3600;
|
||||||
|
return Cache::remember(self::class . $categoryId . '_' . $projectLanguage->id ?? 0, $seconds, function () use ($categoryId, $projectLanguage) {
|
||||||
|
$rows = DB::select(
|
||||||
|
<<<SQL
|
||||||
|
WITH RECURSIVE chain AS (
|
||||||
|
SELECT id, parent_id, 0 AS depth
|
||||||
|
FROM documentation_categories
|
||||||
|
WHERE id = ?
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT dc.id, dc.parent_id, chain.depth + 1 AS depth
|
||||||
|
FROM documentation_categories dc
|
||||||
|
INNER JOIN chain ON chain.parent_id = dc.id
|
||||||
|
)
|
||||||
|
SELECT id, depth
|
||||||
|
FROM chain
|
||||||
|
ORDER BY depth DESC
|
||||||
|
SQL,
|
||||||
|
[$categoryId]
|
||||||
|
);
|
||||||
|
|
||||||
|
$idsInOrder = collect($rows)->pluck('id')->all();
|
||||||
|
|
||||||
|
$with = [
|
||||||
|
'content' => function (HasOne $hasOne) use ($projectLanguage) {
|
||||||
|
/** @var ?ProjectLanguage $projectLanguage */
|
||||||
|
$hasOne->when($projectLanguage, function (Builder $query, ProjectLanguage $projectLanguage) {
|
||||||
|
$query->where('language_id', $projectLanguage->id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
$categories = DocumentationCategory::query()
|
||||||
|
->whereIn('id', $idsInOrder)
|
||||||
|
->with($with)
|
||||||
|
->get()
|
||||||
|
->keyBy('id');
|
||||||
|
|
||||||
|
return collect($idsInOrder)
|
||||||
|
->map(fn (int $id) => $categories->get($id))
|
||||||
|
->filter()
|
||||||
|
->values();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ use App\ServiceResults\ServiceResultArray;
|
|||||||
use App\ServiceResults\ServiceResultError;
|
use App\ServiceResults\ServiceResultError;
|
||||||
use App\ServiceResults\ServiceResultSuccess;
|
use App\ServiceResults\ServiceResultSuccess;
|
||||||
use App\ServiceResults\StoreUpdateResult;
|
use App\ServiceResults\StoreUpdateResult;
|
||||||
|
use App\Services\ClearCacheCommandHandler;
|
||||||
use App\Services\DocumentationCategory\DocumentationCategoryCommandHandler;
|
use App\Services\DocumentationCategory\DocumentationCategoryCommandHandler;
|
||||||
use App\Services\DocumentationCategoryContent\ModelSyncCommand;
|
use App\Services\DocumentationCategoryContent\ModelSyncCommand;
|
||||||
use App\Services\Service;
|
use App\Services\Service;
|
||||||
@@ -34,6 +35,7 @@ final class DocumentationCategoryService extends Service
|
|||||||
private readonly DocumentationCategoryRepository $documentationCategoryRepository,
|
private readonly DocumentationCategoryRepository $documentationCategoryRepository,
|
||||||
private readonly DocumentationCategoryCommandHandler $categoryCommandHandler,
|
private readonly DocumentationCategoryCommandHandler $categoryCommandHandler,
|
||||||
private readonly ModelSyncCommand $contentSaveCommand,
|
private readonly ModelSyncCommand $contentSaveCommand,
|
||||||
|
private readonly ClearCacheCommandHandler $clearCacheCommandHandler,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
public function index(int $projectId, int $versionId, DocumentationCategoryBuilderDto $documentationCategoryBuilderDto, QuerySettingsDto $querySettingsDto, User $user): ServiceResultError | ServiceResultArray
|
public function index(int $projectId, int $versionId, DocumentationCategoryBuilderDto $documentationCategoryBuilderDto, QuerySettingsDto $querySettingsDto, User $user): ServiceResultError | ServiceResultArray
|
||||||
@@ -75,7 +77,7 @@ final class DocumentationCategoryService extends Service
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create(int $projectId, int $versionId, User $user): ServiceResultError | ServiceResultArray
|
public function create(int $projectId, int $versionId, User $user, ?int $parentId = null): ServiceResultError | ServiceResultArray
|
||||||
{
|
{
|
||||||
$version = $this->documentationVersionRepository->getVersionById($versionId);
|
$version = $this->documentationVersionRepository->getVersionById($versionId);
|
||||||
$project = $version?->project;
|
$project = $version?->project;
|
||||||
@@ -88,12 +90,20 @@ final class DocumentationCategoryService extends Service
|
|||||||
}
|
}
|
||||||
|
|
||||||
$defaultLanguage = $project->languages->where('is_default', 1)->first();
|
$defaultLanguage = $project->languages->where('is_default', 1)->first();
|
||||||
|
$category = new DocumentationCategory();
|
||||||
|
$categoryPath = null;
|
||||||
|
if ($parentId !== null) {
|
||||||
|
$category->parent_id = $parentId;
|
||||||
|
$categoryPath = $this->documentationCategoryRepository->getPathFromRoot($parentId, $defaultLanguage);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->result([
|
return $this->result([
|
||||||
'version' => $version,
|
'version' => $version,
|
||||||
'project' => $project,
|
'project' => $project,
|
||||||
'category' => new DocumentationCategory(),
|
'category' => $category,
|
||||||
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage),
|
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage),
|
||||||
'serviceTranslationEnable' => config('translation_service.enable', false),
|
'serviceTranslationEnable' => config('translation_service.enable', false),
|
||||||
|
'categoryPath' => $categoryPath,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,17 +124,20 @@ final class DocumentationCategoryService extends Service
|
|||||||
return $this->errFobidden(__('Access is denied'));
|
return $this->errFobidden(__('Access is denied'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$defaultLanguage = $project->languages->where('is_default', 1)->first();
|
||||||
$withCategories = [];
|
$withCategories = [];
|
||||||
|
$categoryPath = null;
|
||||||
if ($category->parent_id) {
|
if ($category->parent_id) {
|
||||||
$withCategories[] = $category->parent_id;
|
$withCategories[] = $category->parent_id;
|
||||||
|
$categoryPath = $this->documentationCategoryRepository->getPathFromRoot($category->parent_id, $defaultLanguage);
|
||||||
}
|
}
|
||||||
$defaultLanguage = $project->languages->where('is_default', 1)->first();
|
|
||||||
return $this->result([
|
return $this->result([
|
||||||
'version' => $version,
|
'version' => $version,
|
||||||
'project' => $project,
|
'project' => $project,
|
||||||
'category' => $category,
|
'category' => $category,
|
||||||
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage, $category, $withCategories),
|
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage, $category, $withCategories),
|
||||||
'serviceTranslationEnable' => config('translation_service.enable', false),
|
'serviceTranslationEnable' => config('translation_service.enable', false),
|
||||||
|
'categoryPath' => $categoryPath,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,6 +173,8 @@ final class DocumentationCategoryService extends Service
|
|||||||
if (\config('translation_service.enable', false)) {
|
if (\config('translation_service.enable', false)) {
|
||||||
$this->translateContent($category, $data->getContents());
|
$this->translateContent($category, $data->getContents());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (ServiceException $e) {
|
} catch (ServiceException $e) {
|
||||||
return $e->getServiceResultError();
|
return $e->getServiceResultError();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
@@ -214,6 +229,8 @@ final class DocumentationCategoryService extends Service
|
|||||||
if (\config('translation_service.enable', false)) {
|
if (\config('translation_service.enable', false)) {
|
||||||
$this->translateContent($category, $data->getContents());
|
$this->translateContent($category, $data->getContents());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (ServiceException $e) {
|
} catch (ServiceException $e) {
|
||||||
return $e->getServiceResultError();
|
return $e->getServiceResultError();
|
||||||
} catch (ParentException $e) {
|
} catch (ParentException $e) {
|
||||||
@@ -250,6 +267,8 @@ final class DocumentationCategoryService extends Service
|
|||||||
DB::transaction(function () use ($category) {
|
DB::transaction(function () use ($category) {
|
||||||
$this->categoryCommandHandler->handleDestroy($category);
|
$this->categoryCommandHandler->handleDestroy($category);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
report($e);
|
report($e);
|
||||||
return $this->errService(__('Server Error'));
|
return $this->errService(__('Server Error'));
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ final class DocumentationService extends Service
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create(int $projectId, int $versionId, User $user): ServiceResultError | ServiceResultArray
|
public function create(int $projectId, int $versionId, User $user, ?int $categoryId = null): ServiceResultError | ServiceResultArray
|
||||||
{
|
{
|
||||||
$version = $this->documentationVersionRepository->getVersionById($versionId);
|
$version = $this->documentationVersionRepository->getVersionById($versionId);
|
||||||
$project = $version?->project;
|
$project = $version?->project;
|
||||||
@@ -88,12 +88,20 @@ final class DocumentationService extends Service
|
|||||||
}
|
}
|
||||||
|
|
||||||
$defaultLanguage = $project->languages->where('is_default', 1)->first();
|
$defaultLanguage = $project->languages->where('is_default', 1)->first();
|
||||||
|
$documentation = new Documentation();
|
||||||
|
$categoryPath = null;
|
||||||
|
if ($categoryId !== null) {
|
||||||
|
$documentation->category_id = $categoryId;
|
||||||
|
$categoryPath = $this->documentationCategoryRepository->getPathFromRoot($categoryId, $defaultLanguage);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->result([
|
return $this->result([
|
||||||
'version' => $version,
|
'version' => $version,
|
||||||
'project' => $project,
|
'project' => $project,
|
||||||
'documentation' => new Documentation(),
|
'documentation' => $documentation,
|
||||||
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage),
|
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage),
|
||||||
'serviceTranslationEnable' => config('translation_service.enable', false),
|
'serviceTranslationEnable' => config('translation_service.enable', false),
|
||||||
|
'categoryPath' => $categoryPath,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,17 +122,20 @@ final class DocumentationService extends Service
|
|||||||
return $this->errFobidden(__('Access is denied'));
|
return $this->errFobidden(__('Access is denied'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$defaultLanguage = $project->languages->where('is_default', 1)->first();
|
||||||
$withCategories = [];
|
$withCategories = [];
|
||||||
|
$categoryPath = null;
|
||||||
if ($documentation->category_id) {
|
if ($documentation->category_id) {
|
||||||
$withCategories[] = $documentation->category_id;
|
$withCategories[] = $documentation->category_id;
|
||||||
|
$categoryPath = $this->documentationCategoryRepository->getPathFromRoot($documentation->category_id, $defaultLanguage);
|
||||||
}
|
}
|
||||||
$defaultLanguage = $project->languages->where('is_default', 1)->first();
|
|
||||||
return $this->result([
|
return $this->result([
|
||||||
'version' => $version,
|
'version' => $version,
|
||||||
'project' => $project,
|
'project' => $project,
|
||||||
'documentation' => $documentation,
|
'documentation' => $documentation,
|
||||||
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage, null, $withCategories),
|
'categories' => $this->documentationCategoryRepository->getForSelect($version, $defaultLanguage, null, $withCategories),
|
||||||
'serviceTranslationEnable' => config('translation_service.enable', false),
|
'serviceTranslationEnable' => config('translation_service.enable', false),
|
||||||
|
'categoryPath' => $categoryPath,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,17 @@
|
|||||||
|
|
||||||
namespace App\Services\Admin\Project;
|
namespace App\Services\Admin\Project;
|
||||||
|
|
||||||
|
use App\Dto\Builder\Documentation as DocumentationBuilderDto;
|
||||||
|
use App\Dto\Builder\DocumentationCategory as DocumentationCategoryBuilderDto;
|
||||||
use App\Dto\QuerySettingsDto;
|
use App\Dto\QuerySettingsDto;
|
||||||
use App\Dto\Builder\DocumentationVersion as DocumentationVersionBuilderDto;
|
use App\Dto\Builder\DocumentationVersion as DocumentationVersionBuilderDto;
|
||||||
use App\Dto\Service\Admin\Project\DocumentationVersion\StoreUpdate;
|
use App\Dto\Service\Admin\Project\DocumentationVersion\StoreUpdate;
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use App\Enums\DocumentationVersionStatus;
|
use App\Enums\DocumentationVersionStatus;
|
||||||
use App\Models\DocumentationVersion;
|
use App\Models\DocumentationVersion;
|
||||||
|
use App\Models\ProjectLanguage;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Repositories\DocumentationCategoryRepository;
|
||||||
|
use App\Repositories\DocumentationRepository;
|
||||||
use App\Repositories\DocumentationVersionRepository;
|
use App\Repositories\DocumentationVersionRepository;
|
||||||
use App\Repositories\ProjectRepository;
|
use App\Repositories\ProjectRepository;
|
||||||
use App\ServiceResults\ServiceResultArray;
|
use App\ServiceResults\ServiceResultArray;
|
||||||
@@ -18,6 +22,8 @@ use App\ServiceResults\StoreUpdateResult;
|
|||||||
use App\Services\ClearCacheCommandHandler;
|
use App\Services\ClearCacheCommandHandler;
|
||||||
use App\Services\DocumentationVersion\DocumentationVersionCommandHandler;
|
use App\Services\DocumentationVersion\DocumentationVersionCommandHandler;
|
||||||
use App\Services\Service;
|
use App\Services\Service;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
final class DocumentationVersionService extends Service
|
final class DocumentationVersionService extends Service
|
||||||
@@ -27,6 +33,9 @@ final class DocumentationVersionService extends Service
|
|||||||
private readonly DocumentationVersionRepository $documentationVersionRepository,
|
private readonly DocumentationVersionRepository $documentationVersionRepository,
|
||||||
private readonly DocumentationVersionCommandHandler $documentationVersionCommandHandler,
|
private readonly DocumentationVersionCommandHandler $documentationVersionCommandHandler,
|
||||||
private readonly ClearCacheCommandHandler $clearCacheCommandHandler,
|
private readonly ClearCacheCommandHandler $clearCacheCommandHandler,
|
||||||
|
|
||||||
|
private readonly DocumentationCategoryRepository $documentationCategoryRepository,
|
||||||
|
private readonly DocumentationRepository $documentationRepository
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
public function index(int $projectId, DocumentationVersionBuilderDto $documentationVersionBuilderDto, QuerySettingsDto $querySettingsDto, User $user): ServiceResultError | ServiceResultArray
|
public function index(int $projectId, DocumentationVersionBuilderDto $documentationVersionBuilderDto, QuerySettingsDto $querySettingsDto, User $user): ServiceResultError | ServiceResultArray
|
||||||
@@ -55,7 +64,7 @@ final class DocumentationVersionService extends Service
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show(int $projectId, int $versionId, User $user): ServiceResultError | ServiceResultArray
|
public function show(int $projectId, int $versionId, ?int $categoryId, User $user): ServiceResultError | ServiceResultArray
|
||||||
{
|
{
|
||||||
$project = $this->projectRepository->getProjectById($projectId);
|
$project = $this->projectRepository->getProjectById($projectId);
|
||||||
if (\is_null($project)) {
|
if (\is_null($project)) {
|
||||||
@@ -71,9 +80,52 @@ final class DocumentationVersionService extends Service
|
|||||||
return $this->errFobidden(__('Access is denied'));
|
return $this->errFobidden(__('Access is denied'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$defaultLanguage = $project->languages()->where('is_default', 1)->first();
|
||||||
|
|
||||||
|
$category = null;
|
||||||
|
$categoryPath = null;
|
||||||
|
if (!\is_null($categoryId)) {
|
||||||
|
$category = $this->documentationCategoryRepository->getCategoryById($categoryId);
|
||||||
|
if (\is_null($category) || $category->version_id !== $version->id) {
|
||||||
|
return $this->errNotFound(__('Not Found'));
|
||||||
|
}
|
||||||
|
if ($user->cannot('view', $category)) {
|
||||||
|
return $this->errFobidden(__('Access is denied'));
|
||||||
|
}
|
||||||
|
$categoryPath = $this->documentationCategoryRepository->getPathFromRoot($category->id, $defaultLanguage);
|
||||||
|
}
|
||||||
|
|
||||||
|
$with = [
|
||||||
|
'content' => function (HasOne $hasOne) use ($defaultLanguage) {
|
||||||
|
/** @var ?ProjectLanguage $defaultLanguage */
|
||||||
|
$hasOne->when($defaultLanguage, function (Builder $query, ProjectLanguage $defaultLanguage) {
|
||||||
|
$query->where('language_id', $defaultLanguage->id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
$categoryDto = new DocumentationCategoryBuilderDto\Category($category->id ?? null);
|
||||||
|
$categories = $this->documentationCategoryRepository
|
||||||
|
->getCategories(
|
||||||
|
$version->id,
|
||||||
|
new DocumentationCategoryBuilderDto(parentId: $categoryDto),
|
||||||
|
$with
|
||||||
|
)->all();
|
||||||
|
$documents = $this->documentationRepository
|
||||||
|
->getDocumentations(
|
||||||
|
$version->id,
|
||||||
|
new DocumentationBuilderDto(categoryId: $categoryDto),
|
||||||
|
$with
|
||||||
|
)->all();
|
||||||
|
|
||||||
return $this->result([
|
return $this->result([
|
||||||
'version' => $version,
|
'version' => $version,
|
||||||
'project' => $project,
|
'project' => $project,
|
||||||
|
|
||||||
|
'category' => $category,
|
||||||
|
'categoryPath' => $categoryPath,
|
||||||
|
'categories' => $categories,
|
||||||
|
'documentations' => $documents,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +193,7 @@ final class DocumentationVersionService extends Service
|
|||||||
$dataVersion = $this->getDataVersion($data);
|
$dataVersion = $this->getDataVersion($data);
|
||||||
return $this->documentationVersionCommandHandler->handleStore($project, $dataVersion);
|
return $this->documentationVersionCommandHandler->handleStore($project, $dataVersion);
|
||||||
});
|
});
|
||||||
$this->clearCacheCommandHandler->byTag(CacheTag::DocumantationVersion);
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
report($e);
|
report($e);
|
||||||
return $this->errService(__('Server Error'));
|
return $this->errService(__('Server Error'));
|
||||||
@@ -178,7 +230,7 @@ final class DocumentationVersionService extends Service
|
|||||||
$dataVersion = $this->getDataVersion($data);
|
$dataVersion = $this->getDataVersion($data);
|
||||||
return $this->documentationVersionCommandHandler->handleUpdate($version, $dataVersion);
|
return $this->documentationVersionCommandHandler->handleUpdate($version, $dataVersion);
|
||||||
});
|
});
|
||||||
$this->clearCacheCommandHandler->byTag(CacheTag::DocumantationVersion);
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
report($e);
|
report($e);
|
||||||
return $this->errService(__('Server Error'));
|
return $this->errService(__('Server Error'));
|
||||||
@@ -207,7 +259,7 @@ final class DocumentationVersionService extends Service
|
|||||||
DB::transaction(function () use ($version) {
|
DB::transaction(function () use ($version) {
|
||||||
$this->documentationVersionCommandHandler->handleDestroy($version);
|
$this->documentationVersionCommandHandler->handleDestroy($version);
|
||||||
});
|
});
|
||||||
$this->clearCacheCommandHandler->byTag(CacheTag::DocumantationVersion);
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
report($e);
|
report($e);
|
||||||
return $this->errService(__('Server Error'));
|
return $this->errService(__('Server Error'));
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Services\Admin\Project;
|
|||||||
use App\Dto\Service\Admin\Project\Translation\Translations;
|
use App\Dto\Service\Admin\Project\Translation\Translations;
|
||||||
use App\Dto\Service\Admin\Project\Translation\Translation;
|
use App\Dto\Service\Admin\Project\Translation\Translation;
|
||||||
use App\Dto\Service\Admin\Project\Translation\Update;
|
use App\Dto\Service\Admin\Project\Translation\Update;
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use App\Jobs\Translate\ProcessTranslationText;
|
use App\Jobs\Translate\ProcessTranslationText;
|
||||||
use App\Models\ProjectTranslation;
|
use App\Models\ProjectTranslation;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
@@ -83,7 +82,7 @@ final class TranslationService extends Service
|
|||||||
DB::transaction(function () use ($data, $project, $language) {
|
DB::transaction(function () use ($data, $project, $language) {
|
||||||
$this->translationModelSyncCommand->execute($project, $language, $data->getTranslations());
|
$this->translationModelSyncCommand->execute($project, $language, $data->getTranslations());
|
||||||
});
|
});
|
||||||
$this->clearCacheCommandHandler->byTag(CacheTag::ProjectTranslation);
|
$this->clearCacheCommandHandler->all();
|
||||||
if (\config('translation_service.enable', false)) {
|
if (\config('translation_service.enable', false)) {
|
||||||
$this->translateContent($projectId, $languageId, $data);
|
$this->translateContent($projectId, $languageId, $data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Services\Admin;
|
|||||||
use App\Dto\Builder\Project as ProjectBuilderDto;
|
use App\Dto\Builder\Project as ProjectBuilderDto;
|
||||||
use App\Dto\QuerySettingsDto;
|
use App\Dto\QuerySettingsDto;
|
||||||
use App\Dto\Service\Admin\Project\StoreUpdate;
|
use App\Dto\Service\Admin\Project\StoreUpdate;
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use App\Enums\Morph;
|
use App\Enums\Morph;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Models\ProjectLanguage;
|
use App\Models\ProjectLanguage;
|
||||||
@@ -134,7 +133,7 @@ final class ProjectService extends Service
|
|||||||
|
|
||||||
return $project;
|
return $project;
|
||||||
});
|
});
|
||||||
$this->clearCacheCommandHandler->byTag(CacheTag::Project);
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
report($e);
|
report($e);
|
||||||
return $this->errService(__('Server Error'));
|
return $this->errService(__('Server Error'));
|
||||||
@@ -177,7 +176,7 @@ final class ProjectService extends Service
|
|||||||
|
|
||||||
return $project;
|
return $project;
|
||||||
});
|
});
|
||||||
$this->clearCacheCommandHandler->byTag(CacheTag::Project);
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
report($e);
|
report($e);
|
||||||
return $this->errService(__('Server Error'));
|
return $this->errService(__('Server Error'));
|
||||||
@@ -202,7 +201,7 @@ final class ProjectService extends Service
|
|||||||
DB::transaction(function () use ($project) {
|
DB::transaction(function () use ($project) {
|
||||||
$this->projectCommandHandler->handleDestroy($project);
|
$this->projectCommandHandler->handleDestroy($project);
|
||||||
});
|
});
|
||||||
$this->clearCacheCommandHandler->byTag(CacheTag::Project);
|
$this->clearCacheCommandHandler->all();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
report($e);
|
report($e);
|
||||||
return $this->errService(__('Server Error'));
|
return $this->errService(__('Server Error'));
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Enums\CacheTag;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
final readonly class ClearCacheCommandHandler
|
final readonly class ClearCacheCommandHandler
|
||||||
{
|
{
|
||||||
public function byTag(CacheTag $tag): void
|
public function all(): void
|
||||||
{
|
{
|
||||||
$tag->getCache()->flush();
|
Cache::flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
namespace App\Services\Site;
|
namespace App\Services\Site;
|
||||||
|
|
||||||
use App\Dto\Service\Site\Documentation;
|
use App\Dto\Service\Site\Documentation;
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use App\Enums\DocumentationVersionStatus;
|
use App\Enums\DocumentationVersionStatus;
|
||||||
use App\Models\DocumentationCategory;
|
use App\Models\DocumentationCategory;
|
||||||
use App\Models\Documentation as ModelDocumentation;
|
use App\Models\Documentation as ModelDocumentation;
|
||||||
@@ -22,6 +21,7 @@ use App\Dto\Builder\Documentation as DocumentationBuilderDto;
|
|||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
final class DocumentationService extends Service
|
final class DocumentationService extends Service
|
||||||
{
|
{
|
||||||
@@ -37,8 +37,7 @@ final class DocumentationService extends Service
|
|||||||
if ($user?->cannot('viewAny', DocumentationVersion::class)) {
|
if ($user?->cannot('viewAny', DocumentationVersion::class)) {
|
||||||
$isPublic = 1;
|
$isPublic = 1;
|
||||||
}
|
}
|
||||||
$version = CacheTag::DocumantationVersion->getCache()
|
$version = Cache::remember(self::class . $project->id . '_' . $isPublic ?? 0, $seconds, function () use ($project, $isPublic) {
|
||||||
->remember(self::class . $project->id . '_' . $isPublic ?? 0, $seconds, function () use ($project, $isPublic) {
|
|
||||||
$versions = $project->documentationVersions()
|
$versions = $project->documentationVersions()
|
||||||
->when($isPublic, function (Builder $query) {
|
->when($isPublic, function (Builder $query) {
|
||||||
$query->where('is_public', 1);
|
$query->where('is_public', 1);
|
||||||
@@ -78,10 +77,16 @@ final class DocumentationService extends Service
|
|||||||
return $this->errFobidden(__('Access is denied'));
|
return $this->errFobidden(__('Access is denied'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$categoryPath = null;
|
||||||
|
if ($category->parent_id) {
|
||||||
|
$categoryPath = $this->documentationCategoryRepository->getPathFromRoot($category->parent_id, $documentation->getWebsiteTranslations()->getLanguage());
|
||||||
|
}
|
||||||
|
|
||||||
$data = array_merge($documentation->toArray(), [
|
$data = array_merge($documentation->toArray(), [
|
||||||
'category' => $category,
|
'category' => $category,
|
||||||
'categories' => $this->getCategories($documentation, $category->id),
|
'categories' => $this->getCategories($documentation, $category->id),
|
||||||
'documentations' => $this->getDocumentations($documentation, $category->id),
|
'documentations' => $this->getDocumentations($documentation, $category->id),
|
||||||
|
'categoryPath' => $categoryPath,
|
||||||
]);
|
]);
|
||||||
return $this->resultSitePage($documentation->getProject(), $documentation->getWebsiteTranslations(), $data, \is_null($category->content?->title));
|
return $this->resultSitePage($documentation->getProject(), $documentation->getWebsiteTranslations(), $data, \is_null($category->content?->title));
|
||||||
}
|
}
|
||||||
@@ -99,8 +104,14 @@ final class DocumentationService extends Service
|
|||||||
return $this->errFobidden(__('Access is denied'));
|
return $this->errFobidden(__('Access is denied'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$categoryPath = null;
|
||||||
|
if ($document->category_id) {
|
||||||
|
$categoryPath = $this->documentationCategoryRepository->getPathFromRoot($document->category_id, $documentation->getWebsiteTranslations()->getLanguage());
|
||||||
|
}
|
||||||
|
|
||||||
$data = array_merge($documentation->toArray(), [
|
$data = array_merge($documentation->toArray(), [
|
||||||
'documentation' => $document,
|
'documentation' => $document,
|
||||||
|
'categoryPath' => $categoryPath,
|
||||||
]);
|
]);
|
||||||
return $this->resultSitePage($documentation->getProject(), $documentation->getWebsiteTranslations(), $data, \is_null($document->content?->title));
|
return $this->resultSitePage($documentation->getProject(), $documentation->getWebsiteTranslations(), $data, \is_null($document->content?->title));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ final readonly class ResizeCommandHandler
|
|||||||
{
|
{
|
||||||
public function resize(Storage $storage, int $width, int $height): Storage
|
public function resize(Storage $storage, int $width, int $height): Storage
|
||||||
{
|
{
|
||||||
$image = InterventionImage::read($storage->path);
|
$image = InterventionImage::decodePath($storage->path);
|
||||||
if ($image->width() < $width && $image->height() < $height) {
|
if ($image->width() < $width && $image->height() < $height) {
|
||||||
return $storage;
|
return $storage;
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ final readonly class ResizeCommandHandler
|
|||||||
|
|
||||||
public function width(Storage $storage, int $width): Storage
|
public function width(Storage $storage, int $width): Storage
|
||||||
{
|
{
|
||||||
$image = InterventionImage::read($storage->path);
|
$image = InterventionImage::decodePath($storage->path);
|
||||||
if ($image->width() < $width) {
|
if ($image->width() < $width) {
|
||||||
return $storage;
|
return $storage;
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ final readonly class ResizeCommandHandler
|
|||||||
|
|
||||||
public function height(Storage $storage, int $height): Storage
|
public function height(Storage $storage, int $height): Storage
|
||||||
{
|
{
|
||||||
$image = InterventionImage::read($storage->path);
|
$image = InterventionImage::decodePath($storage->path);
|
||||||
if ($image->height() < $height) {
|
if ($image->height() < $height) {
|
||||||
return $storage;
|
return $storage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace app\View\Components\Site;
|
namespace app\View\Components\Site;
|
||||||
|
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Services\WebsiteTranslations;
|
use App\Services\WebsiteTranslations;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\View\Component;
|
use Illuminate\View\Component;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
@@ -24,7 +24,7 @@ final class ChooseLanguage extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
$seconds = 3600 * 12;
|
$seconds = 3600 * 12;
|
||||||
$languages = CacheTag::Project->getCache()->remember(self::class . $this->project->id, $seconds, function () {
|
$languages = Cache::remember(self::class . $this->project->id, $seconds, function () {
|
||||||
return $this->project->languages;
|
return $this->project->languages;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,12 @@
|
|||||||
|
|
||||||
namespace App\View\Components\Site;
|
namespace App\View\Components\Site;
|
||||||
|
|
||||||
use App\Enums\CacheTag;
|
|
||||||
use App\Models\DocumentationVersion;
|
use App\Models\DocumentationVersion;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Services\WebsiteTranslations;
|
use App\Services\WebsiteTranslations;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\View\Component;
|
use Illuminate\View\Component;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
@@ -29,8 +28,7 @@ final class ChooseVersion extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
$seconds = 3600 * 12;
|
$seconds = 3600 * 12;
|
||||||
$versions = CacheTag::DocumantationVersion->getCache()
|
$versions = Cache::remember(self::class . $this->project->id . '-' . $isPublic ?? 0, $seconds, function () use ($isPublic) {
|
||||||
->remember(self::class . $this->project->id . '-' . $isPublic ?? 0, $seconds, function () use ($isPublic) {
|
|
||||||
return $this->project->documentationVersions()
|
return $this->project->documentationVersions()
|
||||||
->when($isPublic, function (Builder $query) {
|
->when($isPublic, function (Builder $query) {
|
||||||
$query->where('is_public', 1);
|
$query->where('is_public', 1);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ use Illuminate\Foundation\Application;
|
|||||||
use Illuminate\Foundation\Configuration\Exceptions;
|
use Illuminate\Foundation\Configuration\Exceptions;
|
||||||
use Illuminate\Foundation\Configuration\Middleware;
|
use Illuminate\Foundation\Configuration\Middleware;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
return Application::configure(basePath: dirname(__DIR__))
|
return Application::configure(basePath: dirname(__DIR__))
|
||||||
->withRouting(
|
->withRouting(
|
||||||
@@ -19,8 +20,15 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
->withMiddleware(function (Middleware $middleware) {
|
->withMiddleware(function (Middleware $middleware) {
|
||||||
//
|
|
||||||
})
|
})
|
||||||
->withExceptions(function (Exceptions $exceptions) {
|
->withExceptions(function (Exceptions $exceptions) {
|
||||||
//
|
$exceptions->respond(function (Response $response) {
|
||||||
|
if ($response->getStatusCode() === 419) {
|
||||||
|
return back()
|
||||||
|
->withInput()
|
||||||
|
->withErrors(['csrf' => __('http-statuses.csrfError')]);
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
})->create();
|
})->create();
|
||||||
|
|||||||
@@ -0,0 +1,262 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Diglactic\Breadcrumbs\Breadcrumbs;
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.home', function ($trail) {
|
||||||
|
$trail->push(__('Home'), route('admin.home'), ['icon' => '<svg class="icon icon-xxs" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path></svg>']);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Roles
|
||||||
|
Breadcrumbs::for('admin.roles.index', function ($trail) {
|
||||||
|
$trail->parent('admin.home');
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.User group'), route('admin.roles.index'));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.roles.create', function ($trail) {
|
||||||
|
$trail->parent('admin.roles.index');
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.roles.create'));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.roles.edit', function ($trail, \App\Models\Role $role) {
|
||||||
|
$trail->parent('admin.roles.index');
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.roles.edit', $role));
|
||||||
|
});
|
||||||
|
// End Roles
|
||||||
|
|
||||||
|
// Users
|
||||||
|
Breadcrumbs::for('admin.users.index', function ($trail) {
|
||||||
|
$trail->parent('admin.home');
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Users'), route('admin.users.index'));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.users.create', function ($trail) {
|
||||||
|
$trail->parent('admin.users.index');
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.users.create'));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.users.edit', function ($trail, \App\Models\User $user) {
|
||||||
|
$trail->parent('admin.users.index');
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.users.edit', $user));
|
||||||
|
});
|
||||||
|
// End Users
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.feedbacks.index', function ($trail) {
|
||||||
|
$trail->parent('admin.home');
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Feedback'), route('admin.feedbacks.index'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Projects
|
||||||
|
Breadcrumbs::for('admin.projects.index', function ($trail) {
|
||||||
|
$trail->parent('admin.home');
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Projects'), route('admin.projects.index'));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.create', function ($trail) {
|
||||||
|
$trail->parent('admin.projects.index');
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.projects.create'));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.edit', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.index');
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.projects.edit', $project));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.show', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.index');
|
||||||
|
|
||||||
|
$trail->push($project->name, route('admin.projects.show', $project));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.feedbacks.index', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.show', $project);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Feedback'), route('admin.projects.feedbacks.index', $project));
|
||||||
|
});
|
||||||
|
// End Projects
|
||||||
|
|
||||||
|
// Projects translations
|
||||||
|
Breadcrumbs::for('admin.projects.translations.languages', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.show', $project);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Translations'), route('admin.projects.translations.languages', $project));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.translations.edit', function ($trail, \App\Models\Project $project, \App\Models\ProjectLanguage $language) {
|
||||||
|
$trail->parent('admin.projects.translations.languages', $project);
|
||||||
|
|
||||||
|
$trail->push($language->title, route('admin.projects.translations.edit', ['project' => $project->id, 'language' => $language->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.service-translate.view', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.show', $project);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Setting up automatic translation'), route('admin.projects.service-translate.view', $project));
|
||||||
|
});
|
||||||
|
// End Projects translations
|
||||||
|
|
||||||
|
// Projects links
|
||||||
|
Breadcrumbs::for('admin.projects.links.index', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.show', $project);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Links project'), route('admin.projects.links.index', $project));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.links.create', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.links.index', $project);
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.projects.links.create', $project));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.links.edit', function ($trail, \App\Models\Project $project, \App\Models\ProjectLink $link) {
|
||||||
|
$trail->parent('admin.projects.links.index', $project);
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.projects.links.edit', ['project' => $project->id, 'link' => $link->id]));
|
||||||
|
});
|
||||||
|
// End Projects links
|
||||||
|
|
||||||
|
// Projects about
|
||||||
|
Breadcrumbs::for('admin.projects.about.languages', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.show', $project);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.About project'), route('admin.projects.about.languages', $project));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.about.edit', function ($trail, \App\Models\Project $project, \App\Models\ProjectLanguage $language) {
|
||||||
|
$trail->parent('admin.projects.about.languages', $project);
|
||||||
|
|
||||||
|
$trail->push($language->title, route('admin.projects.about.edit', ['project' => $project->id, 'language' => $language->id]));
|
||||||
|
});
|
||||||
|
// End Projects about
|
||||||
|
|
||||||
|
// Projects documentation-versions
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.index', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.show', $project);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Documentation version'), route('admin.projects.documentation-versions.index', $project));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.create', function ($trail, \App\Models\Project $project) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.index', $project);
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.projects.documentation-versions.create', $project));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.edit', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.index', $project);
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.projects.documentation-versions.edit', ['project' => $project->id, 'documentation_version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.show', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.index', $project);
|
||||||
|
|
||||||
|
$trail->push($version->title, route('admin.projects.documentation-versions.show', ['project' => $project->id, 'documentation_version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.category-path', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \Illuminate\Support\Collection $categoryPath) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.show', $project, $version);
|
||||||
|
|
||||||
|
foreach ($categoryPath as $pathItem) {
|
||||||
|
$trail->push(
|
||||||
|
$pathItem->content->title,
|
||||||
|
route('admin.projects.documentation-versions.category.show', [
|
||||||
|
'project' => $project->id,
|
||||||
|
'version' => $version->id,
|
||||||
|
'category' => $pathItem->id,
|
||||||
|
])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.show.category', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \App\Models\DocumentationCategory $category, ?\Illuminate\Support\Collection $categoryPath) {
|
||||||
|
$path = $categoryPath ?? collect([$category]);
|
||||||
|
|
||||||
|
$trail->parent('admin.projects.documentation-versions.category-path', $project, $version, $path);
|
||||||
|
});
|
||||||
|
// End Projects documentation-versions
|
||||||
|
|
||||||
|
// Projects documentation-versions documentations
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.documentations.index', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.show', $project, $version);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Documentation'), route('admin.projects.documentation-versions.documentations.index', ['project' => $project->id, 'version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.documentations.create', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.documentations.index', $project, $version);
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.projects.documentation-versions.documentations.create', ['project' => $project->id, 'version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.category-path.documentations', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \Illuminate\Support\Collection $categoryPath) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.category-path', $project, $version, $categoryPath);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Documentation'), route('admin.projects.documentation-versions.documentations.index', ['project' => $project->id, 'version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.category-path.documentations.create', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \Illuminate\Support\Collection $categoryPath) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.category-path.documentations', $project, $version, $categoryPath);
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.projects.documentation-versions.documentations.create', ['project' => $project->id, 'version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.documentations.edit', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \App\Models\Documentation $documentation) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.documentations.index', $project, $version);
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.projects.documentation-versions.documentations.edit', ['project' => $project->id, 'version' => $version->id, 'documentation' => $documentation->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.category-path.documentations.edit', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \App\Models\Documentation $documentation, \Illuminate\Support\Collection $categoryPath) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.category-path.documentations', $project, $version, $categoryPath);
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.projects.documentation-versions.documentations.edit', ['project' => $project->id, 'version' => $version->id, 'documentation' => $documentation->id]));
|
||||||
|
});
|
||||||
|
// End Projects documentation-versions documentations
|
||||||
|
|
||||||
|
// Projects documentation-versions categories
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.categories.index', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.show', $project, $version);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Categories'), route('admin.projects.documentation-versions.categories.index', ['project' => $project->id, 'version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.categories.create', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.categories.index', $project, $version);
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.projects.documentation-versions.categories.create', ['project' => $project->id, 'version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.category-path.categories', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \Illuminate\Support\Collection $categoryPath) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.category-path', $project, $version, $categoryPath);
|
||||||
|
|
||||||
|
$trail->push(__('admin-sections.Categories'), route('admin.projects.documentation-versions.categories.index', ['project' => $project->id, 'version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.category-path.categories.create', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \Illuminate\Support\Collection $categoryPath) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.category-path.categories', $project, $version, $categoryPath);
|
||||||
|
|
||||||
|
$trail->push(__('Create'), route('admin.projects.documentation-versions.categories.create', ['project' => $project->id, 'version' => $version->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.categories.edit', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \App\Models\DocumentationCategory $category) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.categories.index', $project, $version);
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.projects.documentation-versions.categories.edit', ['project' => $project->id, 'version' => $version->id, 'category' => $category->id]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('admin.projects.documentation-versions.category-path.categories.edit', function ($trail, \App\Models\Project $project, \App\Models\DocumentationVersion $version, \App\Models\DocumentationCategory $category, \Illuminate\Support\Collection $categoryPath) {
|
||||||
|
$trail->parent('admin.projects.documentation-versions.category-path.categories', $project, $version, $categoryPath);
|
||||||
|
|
||||||
|
$trail->push(__('Edit'), route('admin.projects.documentation-versions.categories.edit', ['project' => $project->id, 'version' => $version->id, 'category' => $category->id]));
|
||||||
|
});
|
||||||
|
// End Projects documentation-versions categories
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\DocumentationCategory;
|
||||||
|
use App\Models\DocumentationVersion;
|
||||||
|
use App\Models\Documentation;
|
||||||
|
use App\Services\WebsiteTranslations;
|
||||||
|
use App\Enums\Site\ProjectSection;
|
||||||
|
use App\Models\Project;
|
||||||
|
use Diglactic\Breadcrumbs\Breadcrumbs;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
|
Breadcrumbs::for('home', function ($trail, Project $project, WebsiteTranslations $websiteTranslations) {
|
||||||
|
$trail->push($websiteTranslations->translate('Home'), ProjectSection::Home->url($project, $websiteTranslations->getLanguage()));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('feedbacks.index', function ($trail, Project $project, WebsiteTranslations $websiteTranslations) {
|
||||||
|
$trail->parent('home', $project, $websiteTranslations);
|
||||||
|
|
||||||
|
$trail->push($websiteTranslations->translate('site.Feedback'), ProjectSection::Feedback->url($project, $websiteTranslations->getLanguage()));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Documentation
|
||||||
|
Breadcrumbs::for('documentation.no-default-version', function ($trail, Project $project, WebsiteTranslations $websiteTranslations) {
|
||||||
|
$trail->parent('home', $project, $websiteTranslations);
|
||||||
|
|
||||||
|
$trail->push($websiteTranslations->translate('site.Documentation'), ProjectSection::Documentation->url($project, $websiteTranslations->getLanguage()));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('documentation.index', function ($trail, Project $project, WebsiteTranslations $websiteTranslations, DocumentationVersion $version) {
|
||||||
|
$trail->parent('home', $project, $websiteTranslations);
|
||||||
|
|
||||||
|
$trail->push($websiteTranslations->translate('site.Documentation'), ProjectSection::DocumentationVersion->url($project, $websiteTranslations->getLanguage(), ['version' => $version->slug]));
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('documentation.category-path', function ($trail, Project $project, WebsiteTranslations $websiteTranslations, DocumentationVersion $version, Collection $categoryPath) {
|
||||||
|
$trail->parent('documentation.index', $project, $websiteTranslations, $version);
|
||||||
|
foreach ($categoryPath as $pathItem) {
|
||||||
|
$trail->push(
|
||||||
|
$pathItem->content->title,
|
||||||
|
ProjectSection::DocumentationCategory->url($project, $websiteTranslations->getLanguage(), ['version' => $version->slug, 'slug' => $pathItem->slug])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('documentation.category', function ($trail, Project $project, WebsiteTranslations $websiteTranslations, DocumentationVersion $version, DocumentationCategory $category, ?Collection $categoryPath) {
|
||||||
|
$trail->parent('documentation.category-path', $project, $websiteTranslations, $version, $categoryPath ?? collect());
|
||||||
|
$trail->push(
|
||||||
|
$category->content->title,
|
||||||
|
ProjectSection::DocumentationCategory->url($project, $websiteTranslations->getLanguage(), ['version' => $version->slug, 'slug' => $category->slug])
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('documentation.view', function ($trail, Project $project, WebsiteTranslations $websiteTranslations, DocumentationVersion $version, Documentation $documentation, ?Collection $categoryPath) {
|
||||||
|
$trail->parent('documentation.category-path', $project, $websiteTranslations, $version, $categoryPath ?? collect());
|
||||||
|
$trail->push(
|
||||||
|
$documentation->content->title,
|
||||||
|
ProjectSection::Documentation->url($project, $websiteTranslations->getLanguage(), ['version' => $version->slug, 'slug' => $documentation->slug])
|
||||||
|
);
|
||||||
|
});
|
||||||
|
// End Documentation
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://getcomposer.org/schema.json",
|
||||||
"name": "laravel/laravel",
|
"name": "laravel/laravel",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"description": "The skeleton application for the Laravel framework.",
|
"description": "The skeleton application for the Laravel framework.",
|
||||||
@@ -6,23 +7,23 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.3",
|
"php": "^8.3",
|
||||||
"intervention/image-laravel": "^1.2",
|
"diglactic/laravel-breadcrumbs": "^10.1",
|
||||||
|
"intervention/image-laravel": "^4.0",
|
||||||
"kor-elf/captcha-rule-for-laravel": "^1.0",
|
"kor-elf/captcha-rule-for-laravel": "^1.0",
|
||||||
"kor-elf/translate-laravel": "1.3.0",
|
"kor-elf/translate-laravel": "^2.0",
|
||||||
"laravel/framework": "^11.0",
|
"laravel/framework": "^13.8",
|
||||||
"laravel/tinker": "^2.9",
|
"laravel/tinker": "^3.0",
|
||||||
"staudenmeir/laravel-adjacency-list": "^1.0"
|
"staudenmeir/laravel-adjacency-list": "^1.26"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-debugbar": "^3.13",
|
"barryvdh/laravel-debugbar": "^4.3",
|
||||||
"fakerphp/faker": "^1.23",
|
"fakerphp/faker": "^1.23",
|
||||||
"laravel-lang/common": "^6.2",
|
"laravel/pail": "^1.2.5",
|
||||||
"laravel/pint": "^1.13",
|
"laravel/pao": "^1.0.6",
|
||||||
"laravel/sail": "^1.26",
|
"laravel/pint": "^1.27",
|
||||||
"mockery/mockery": "^1.6",
|
"mockery/mockery": "^1.6",
|
||||||
"nunomaduro/collision": "^8.0",
|
"nunomaduro/collision": "^8.6",
|
||||||
"phpunit/phpunit": "^10.5",
|
"phpunit/phpunit": "^12.5.12"
|
||||||
"spatie/laravel-ignition": "^2.4"
|
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -37,6 +38,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"setup": [
|
||||||
|
"composer install",
|
||||||
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
|
||||||
|
"@php artisan key:generate",
|
||||||
|
"@php artisan migrate --force",
|
||||||
|
"npm install --ignore-scripts",
|
||||||
|
"npm run build"
|
||||||
|
],
|
||||||
|
"dev": [
|
||||||
|
"Composer\\Config::disableProcessTimeout",
|
||||||
|
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
|
||||||
|
],
|
||||||
|
"test": [
|
||||||
|
"@php artisan config:clear --ansi @no_additional_args",
|
||||||
|
"@php artisan test"
|
||||||
|
],
|
||||||
"post-autoload-dump": [
|
"post-autoload-dump": [
|
||||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
"@php artisan package:discover --ansi"
|
"@php artisan package:discover --ansi"
|
||||||
@@ -51,6 +68,9 @@
|
|||||||
"@php artisan key:generate --ansi",
|
"@php artisan key:generate --ansi",
|
||||||
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
|
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
|
||||||
"@php artisan migrate --graceful --ansi"
|
"@php artisan migrate --graceful --ansi"
|
||||||
|
],
|
||||||
|
"pre-package-uninstall": [
|
||||||
|
"Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
|
|||||||
Generated
+2377
-3948
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| View Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Choose a view to display when Breadcrumbs::render() is called.
|
||||||
|
| Built in templates are:
|
||||||
|
|
|
||||||
|
| - 'breadcrumbs::bootstrap5' - Bootstrap 5
|
||||||
|
| - 'breadcrumbs::bootstrap4' - Bootstrap 4
|
||||||
|
| - 'breadcrumbs::bulma' - Bulma
|
||||||
|
| - 'breadcrumbs::foundation6' - Foundation 6
|
||||||
|
| - 'breadcrumbs::json-ld' - JSON-LD Structured Data
|
||||||
|
| - 'breadcrumbs::materialize' - Materialize
|
||||||
|
| - 'breadcrumbs::tailwind' - Tailwind CSS
|
||||||
|
| - 'breadcrumbs::uikit' - UIkit
|
||||||
|
|
|
||||||
|
| Or a custom view, e.g. '_partials/breadcrumbs'.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'view' => 'breadcrumbs.site',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Breadcrumbs File(s)
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The file(s) where breadcrumbs are defined. e.g.
|
||||||
|
|
|
||||||
|
| - base_path('routes/breadcrumbs.php')
|
||||||
|
| - glob(base_path('breadcrumbs/*.php'))
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'files' => [
|
||||||
|
base_path('breadcrumbs/site.php'),
|
||||||
|
base_path('breadcrumbs/admin.php'),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Exceptions
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Determine when to throw an exception.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException)
|
||||||
|
'unnamed-route-exception' => true,
|
||||||
|
|
||||||
|
// When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException)
|
||||||
|
'missing-route-bound-breadcrumb-exception' => true,
|
||||||
|
|
||||||
|
// When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException)
|
||||||
|
'invalid-named-breadcrumb-exception' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Classes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Subclass the default classes for more advanced customisations.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Manager
|
||||||
|
'manager-class' => Diglactic\Breadcrumbs\Manager::class,
|
||||||
|
|
||||||
|
// Generator
|
||||||
|
'generator-class' => Diglactic\Breadcrumbs\Generator::class,
|
||||||
|
|
||||||
|
];
|
||||||
@@ -38,6 +38,9 @@
|
|||||||
"Connection Timed Out": "Connection Timed Out",
|
"Connection Timed Out": "Connection Timed Out",
|
||||||
"Continue": "Continue",
|
"Continue": "Continue",
|
||||||
"Create": "Create",
|
"Create": "Create",
|
||||||
|
"Create documentation": "Create documentation",
|
||||||
|
"Create category": "Create category",
|
||||||
|
"Create version documentation": "Create a version of the documentation",
|
||||||
"Create :name": "Create :name",
|
"Create :name": "Create :name",
|
||||||
"Created": "Created",
|
"Created": "Created",
|
||||||
"Delete": "Delete",
|
"Delete": "Delete",
|
||||||
|
|||||||
@@ -17,4 +17,6 @@ return [
|
|||||||
'Documentation' => 'Documentation',
|
'Documentation' => 'Documentation',
|
||||||
'Categories' => 'Categories',
|
'Categories' => 'Categories',
|
||||||
'Setting up automatic translation' => 'Setting up automatic translation',
|
'Setting up automatic translation' => 'Setting up automatic translation',
|
||||||
|
'Documentation not found' => 'Documentation not found',
|
||||||
|
'No categories found' => 'No categories found',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'Do not translate' => 'Do not translate',
|
||||||
|
'Mark as not to translate' => 'Mark as not to translate',
|
||||||
|
];
|
||||||
@@ -81,4 +81,5 @@ return [
|
|||||||
'598' => 'Network Read Timeout Error',
|
'598' => 'Network Read Timeout Error',
|
||||||
'599' => 'Network Connect Timeout Error',
|
'599' => 'Network Connect Timeout Error',
|
||||||
'unknownError' => 'Unknown Error',
|
'unknownError' => 'Unknown Error',
|
||||||
|
'csrfError' => 'It looks like your session has expired. Please try again.',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -38,6 +38,9 @@
|
|||||||
"Connection Timed Out": "Соединение не отвечает",
|
"Connection Timed Out": "Соединение не отвечает",
|
||||||
"Continue": "Продолжай",
|
"Continue": "Продолжай",
|
||||||
"Create": "Создать",
|
"Create": "Создать",
|
||||||
|
"Create documentation": "Создать документацию",
|
||||||
|
"Create category": "Создать категорию",
|
||||||
|
"Create version documentation": "Создать версию документации",
|
||||||
"Create :name": "Создать :name",
|
"Create :name": "Создать :name",
|
||||||
"Created": "Создано",
|
"Created": "Создано",
|
||||||
"Delete": "Удалить",
|
"Delete": "Удалить",
|
||||||
|
|||||||
@@ -17,4 +17,6 @@ return [
|
|||||||
'Documentation' => 'Документация',
|
'Documentation' => 'Документация',
|
||||||
'Categories' => 'Категории',
|
'Categories' => 'Категории',
|
||||||
'Setting up automatic translation' => 'Настройка автоматического перевода',
|
'Setting up automatic translation' => 'Настройка автоматического перевода',
|
||||||
|
'Documentation not found' => 'Документация не найдена',
|
||||||
|
'No categories found' => 'Категории не найдены',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'Do not translate' => 'Не переводить',
|
||||||
|
'Mark as not to translate' => 'Пометить как не переводить',
|
||||||
|
];
|
||||||
@@ -81,4 +81,5 @@ return [
|
|||||||
'598' => 'Истекло время ожидания',
|
'598' => 'Истекло время ожидания',
|
||||||
'599' => 'Истекло время подключения',
|
'599' => 'Истекло время подключения',
|
||||||
'unknownError' => 'Неизвестная ошибка',
|
'unknownError' => 'Неизвестная ошибка',
|
||||||
|
'csrfError' => 'Похоже, что срок действия Вашей сессии истек. Пожалуйста, попробуйте еще раз.',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap');
|
||||||
@import "reset";
|
@import "reset";
|
||||||
@import "forms";
|
@import "forms";
|
||||||
|
@import "breadcrumb";
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
.breadcrumb-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: .5rem 1rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
list-style: none;
|
||||||
|
background-color: #eee;
|
||||||
|
border-radius: .5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb-item+.breadcrumb-item {
|
||||||
|
padding-left: .5rem
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb-item+.breadcrumb-item:before {
|
||||||
|
float: left;
|
||||||
|
padding-right: .5rem;
|
||||||
|
color: #4b5563;
|
||||||
|
content: "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb-item.active {
|
||||||
|
color: #4b5563;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb-item {
|
||||||
|
font-size: .75rem
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb-item,.breadcrumb-item a {
|
||||||
|
color: #374151;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: .75rem;
|
||||||
|
}
|
||||||
|
.breadcrumb-item a:hover {
|
||||||
|
color: #00040b;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 576px) {
|
||||||
|
.breadcrumb-item,.breadcrumb-item a {
|
||||||
|
font-size:.875rem
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -69,3 +69,25 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
|
<li class="d-block d-sm-none">
|
||||||
|
<span role="separator" class="dropdown-divider my-1 mt-3 d-block"></span>
|
||||||
|
<ul class="nav flex-column pt-3 pt-md-0">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link d-flex align-items-center" href="{{ route('profile.edit') }}">
|
||||||
|
<span class="sidebar-icon">
|
||||||
|
<svg class="icon icon-xs me-2" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 0 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z" clip-rule="evenodd"></path></svg>
|
||||||
|
</span>
|
||||||
|
<span class="sidebar-text">{{ __('My Profile') }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link d-flex align-items-center" href="{{ route('profile.settings') }}">
|
||||||
|
<span class="sidebar-icon">
|
||||||
|
<svg class="icon icon-xs me-2" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clip-rule="evenodd"></path></svg>
|
||||||
|
</span>
|
||||||
|
<span class="sidebar-text">{{ __('Settings') }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Project') . ': ' . $project->name)
|
@section('meta_title', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.about.edit', $project, $language))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Project') . ': ' . $project->name)
|
@section('meta_title', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.about.languages', $project))
|
||||||
@php
|
@php
|
||||||
$contents = $project->contents;
|
$contents = $project->contents;
|
||||||
@endphp
|
@endphp
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Projects'))
|
@section('meta_title', __('admin-sections.Projects'))
|
||||||
@section('h1', __('admin-sections.Projects'))
|
@section('h1', __('admin-sections.Projects'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.create'))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects._top')
|
@include('admin.projects._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
@section('meta_title', __('admin-sections.Categories'))
|
|
||||||
@section('h1')
|
|
||||||
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
|
||||||
@endsection
|
|
||||||
<x-admin.layout>
|
|
||||||
@include('admin.projects.documentation-categories._top')
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12 mb-4">
|
|
||||||
<div class="card border-0 shadow components-section">
|
|
||||||
<div class="card-body">
|
|
||||||
<h3 id="category" class="mb-4">{{ __('admin-sections.Categories') }}</h3>
|
|
||||||
<form method="post" action="{{ route('admin.projects.documentation-versions.categories.update', ['project' => $project->id, 'version' => $version->id, 'category' => $category->id]) }}">
|
|
||||||
@method('PUT')
|
|
||||||
@include('admin.projects.documentation-categories._from')
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</x-admin.layout>
|
|
||||||
+23
-7
@@ -1,18 +1,34 @@
|
|||||||
|
<div class="mb-2">
|
||||||
<div class="mb-4">
|
|
||||||
@can('create', \App\Models\DocumentationVersion::class)
|
@can('create', \App\Models\DocumentationVersion::class)
|
||||||
<a href="{{ route('admin.projects.documentation-versions.create', ['project' => $project->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2">
|
<a href="{{ route('admin.projects.documentation-versions.create', ['project' => $project->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
<svg class="icon icon-xs me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
<svg class="icon icon-xs me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
||||||
{{ __('Create') }}
|
{{ __('Create version documentation') }}
|
||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
@can('viewAny', \App\Models\DocumentationVersion::class)
|
@can('viewAny', \App\Models\DocumentationVersion::class)
|
||||||
<a href="{{ route('admin.projects.documentation-versions.index', ['project' => $project->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2">
|
<a href="{{ route('admin.projects.documentation-versions.index', ['project' => $project->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
</svg>
|
</svg>
|
||||||
{{ __('List') }}
|
{{ __('admin-sections.Documentation version') }}
|
||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
|
@if(!empty($version) && $version->id)
|
||||||
|
@can('viewAny', \App\Models\Documentation::class)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.documentations.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
|
</svg>
|
||||||
|
{{ __('admin-sections.Documentation') }}
|
||||||
|
</a>
|
||||||
|
@endcan
|
||||||
|
@can('viewAny', \App\Models\DocumentationCategory::class)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.categories.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
|
</svg>
|
||||||
|
{{ __('admin-sections.Categories') }}
|
||||||
|
</a>
|
||||||
|
@endcan
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Documentation version'))
|
@section('meta_title', __('admin-sections.Documentation version'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.create', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentation-versions._top')
|
@include('admin.projects.documentation-versions._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
+12
-4
@@ -1,12 +1,12 @@
|
|||||||
<div class="mb-4">
|
<div class="mb-2">
|
||||||
@can('create', \App\Models\DocumentationCategory::class)
|
@can('create', \App\Models\DocumentationCategory::class)
|
||||||
<a href="{{ route('admin.projects.documentation-versions.categories.create', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2">
|
<a href="{{ route('admin.projects.documentation-versions.categories.create', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
<svg class="icon icon-xs me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
<svg class="icon icon-xs me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
||||||
{{ __('Create') }}
|
{{ __('Create') }}
|
||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
@can('viewAny', \App\Models\DocumentationCategory::class)
|
@can('viewAny', \App\Models\DocumentationCategory::class)
|
||||||
<a href="{{ route('admin.projects.documentation-versions.categories.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2">
|
<a href="{{ route('admin.projects.documentation-versions.categories.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
</svg>
|
</svg>
|
||||||
@@ -14,12 +14,20 @@
|
|||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
@can('viewAny', \App\Models\Documentation::class)
|
@can('viewAny', \App\Models\Documentation::class)
|
||||||
<a href="{{ route('admin.projects.documentation-versions.documentations.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2">
|
<a href="{{ route('admin.projects.documentation-versions.documentations.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
</svg>
|
</svg>
|
||||||
{{ __('admin-sections.Documentation') }}
|
{{ __('admin-sections.Documentation') }}
|
||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
|
@can('viewAny', \App\Models\DocumentationVersion::class)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.index', ['project' => $project->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
|
</svg>
|
||||||
|
{{ __('admin-sections.Documentation version') }}
|
||||||
|
</a>
|
||||||
|
@endcan
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
+7
-2
@@ -2,15 +2,20 @@
|
|||||||
@section('h1')
|
@section('h1')
|
||||||
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
||||||
@endsection
|
@endsection
|
||||||
|
@if(!empty($categoryPath))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.category-path.categories.create', $project, $version, $categoryPath))
|
||||||
|
@else
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.categories.create', $project, $version))
|
||||||
|
@endif
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentation-categories._top')
|
@include('admin.projects.documentation-versions.documentation-categories._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
<div class="card border-0 shadow components-section">
|
<div class="card border-0 shadow components-section">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 id="category" class="mb-4">{{ __('admin-sections.Categories') }}</h3>
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Categories') }}</h3>
|
||||||
<form method="post" action="{{ route('admin.projects.documentation-versions.categories.store', ['project' => $project->id, 'version' => $version->id]) }}">
|
<form method="post" action="{{ route('admin.projects.documentation-versions.categories.store', ['project' => $project->id, 'version' => $version->id]) }}">
|
||||||
@include('admin.projects.documentation-categories._from')
|
@include('admin.projects.documentation-versions.documentation-categories._from')
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
@section('meta_title', __('admin-sections.Categories'))
|
||||||
|
@section('h1')
|
||||||
|
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
||||||
|
@endsection
|
||||||
|
@if(!empty($categoryPath))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.category-path.categories.edit', $project, $version, $category, $categoryPath))
|
||||||
|
@else
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.categories.edit', $project, $version, $category))
|
||||||
|
@endif
|
||||||
|
<x-admin.layout>
|
||||||
|
@include('admin.projects.documentation-versions.documentation-categories._top')
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 mb-4">
|
||||||
|
<div class="card border-0 shadow components-section">
|
||||||
|
<div class="card-body">
|
||||||
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Categories') }}</h3>
|
||||||
|
<form method="post"
|
||||||
|
action="{{ route('admin.projects.documentation-versions.categories.update', ['project' => $project->id, 'version' => $version->id, 'category' => $category->id]) }}">
|
||||||
|
@method('PUT')
|
||||||
|
@include('admin.projects.documentation-versions.documentation-categories._from')
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-admin.layout>
|
||||||
+2
-1
@@ -2,8 +2,9 @@
|
|||||||
@section('h1')
|
@section('h1')
|
||||||
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
||||||
@endsection
|
@endsection
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.categories.index', $project, $version))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentation-categories._top')
|
@include('admin.projects.documentation-versions.documentation-categories._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 id="category" class="mb-4">{{ __('admin-sections.Categories') }}</h3>
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Categories') }}</h3>
|
||||||
+12
-4
@@ -1,12 +1,12 @@
|
|||||||
<div class="mb-4">
|
<div class="mb-2">
|
||||||
@can('create', \App\Models\Documentation::class)
|
@can('create', \App\Models\Documentation::class)
|
||||||
<a href="{{ route('admin.projects.documentation-versions.documentations.create', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2">
|
<a href="{{ route('admin.projects.documentation-versions.documentations.create', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
<svg class="icon icon-xs me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
<svg class="icon icon-xs me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
||||||
{{ __('Create') }}
|
{{ __('Create') }}
|
||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
@can('viewAny', \App\Models\Documentation::class)
|
@can('viewAny', \App\Models\Documentation::class)
|
||||||
<a href="{{ route('admin.projects.documentation-versions.documentations.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2">
|
<a href="{{ route('admin.projects.documentation-versions.documentations.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
</svg>
|
</svg>
|
||||||
@@ -14,12 +14,20 @@
|
|||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
@can('viewAny', \App\Models\DocumentationCategory::class)
|
@can('viewAny', \App\Models\DocumentationCategory::class)
|
||||||
<a href="{{ route('admin.projects.documentation-versions.categories.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2">
|
<a href="{{ route('admin.projects.documentation-versions.categories.index', ['project' => $project->id, 'version' => $version->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
</svg>
|
</svg>
|
||||||
{{ __('admin-sections.Categories') }}
|
{{ __('admin-sections.Categories') }}
|
||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
|
@can('viewAny', \App\Models\DocumentationVersion::class)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.index', ['project' => $project->id]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
|
<svg class="icon icon-xs me-2" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"></path>
|
||||||
|
</svg>
|
||||||
|
{{ __('admin-sections.Documentation version') }}
|
||||||
|
</a>
|
||||||
|
@endcan
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
+7
-2
@@ -2,15 +2,20 @@
|
|||||||
@section('h1')
|
@section('h1')
|
||||||
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
||||||
@endsection
|
@endsection
|
||||||
|
@if(!empty($categoryPath))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.category-path.documentations.create', $project, $version, $categoryPath))
|
||||||
|
@else
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.documentations.create', $project, $version))
|
||||||
|
@endif
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentations._top')
|
@include('admin.projects.documentation-versions.documentations._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
<div class="card border-0 shadow components-section">
|
<div class="card border-0 shadow components-section">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 id="category" class="mb-4">{{ __('admin-sections.Documentation') }}</h3>
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Documentation') }}</h3>
|
||||||
<form method="post" action="{{ route('admin.projects.documentation-versions.documentations.store', ['project' => $project->id, 'version' => $version->id]) }}">
|
<form method="post" action="{{ route('admin.projects.documentation-versions.documentations.store', ['project' => $project->id, 'version' => $version->id]) }}">
|
||||||
@include('admin.projects.documentations._from')
|
@include('admin.projects.documentation-versions.documentations._from')
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
+7
-2
@@ -2,8 +2,13 @@
|
|||||||
@section('h1')
|
@section('h1')
|
||||||
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
||||||
@endsection
|
@endsection
|
||||||
|
@if(!empty($categoryPath))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.category-path.documentations.edit', $project, $version, $documentation, $categoryPath))
|
||||||
|
@else
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.documentations.edit', $project, $version, $documentation))
|
||||||
|
@endif
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentations._top')
|
@include('admin.projects.documentation-versions.documentations._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
<div class="card border-0 shadow components-section">
|
<div class="card border-0 shadow components-section">
|
||||||
@@ -11,7 +16,7 @@
|
|||||||
<h3 id="category" class="mb-4">{{ __('admin-sections.Documentation') }}</h3>
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Documentation') }}</h3>
|
||||||
<form method="post" action="{{ route('admin.projects.documentation-versions.documentations.update', ['project' => $project->id, 'version' => $version->id, 'documentation' => $documentation->id]) }}">
|
<form method="post" action="{{ route('admin.projects.documentation-versions.documentations.update', ['project' => $project->id, 'version' => $version->id, 'documentation' => $documentation->id]) }}">
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
@include('admin.projects.documentations._from')
|
@include('admin.projects.documentation-versions.documentations._from')
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
+2
-1
@@ -2,8 +2,9 @@
|
|||||||
@section('h1')
|
@section('h1')
|
||||||
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
{{ __('admin-sections.Project') . ': ' . $project->name . ' (' . $version->title . ')' }}
|
||||||
@endsection
|
@endsection
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.documentations.index', $project, $version))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentations._top')
|
@include('admin.projects.documentation-versions.documentations._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 id="category" class="mb-4">{{ __('admin-sections.Documentation') }}</h3>
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Documentation') }}</h3>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Documentation version'))
|
@section('meta_title', __('admin-sections.Documentation version'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.edit', $project, $version))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentation-versions._top')
|
@include('admin.projects.documentation-versions._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Documentation version'))
|
@section('meta_title', __('admin-sections.Documentation version'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.index', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentation-versions._top')
|
@include('admin.projects.documentation-versions._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
|
|||||||
+134
-19
@@ -1,45 +1,160 @@
|
|||||||
@section('meta_title', __('admin-sections.Documentation version'))
|
@section('meta_title', __('admin-sections.Documentation version'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@if(!empty($category))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.show.category', $project, $version, $category, $categoryPath ?? null))
|
||||||
|
@else
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.documentation-versions.show', $project, $version))
|
||||||
|
@endif
|
||||||
|
@php
|
||||||
|
$categoryId = null;
|
||||||
|
if (!empty($category) && $category->id) {
|
||||||
|
$categoryId = $category->id;
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.documentation-versions._top')
|
@include('admin.projects.documentation-versions._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 id="category" class="mb-4">{{ __('admin-sections.Documentation version') }}: {{ $version->title }}</h3>
|
<h3 id="category" class="mb-4">
|
||||||
|
{{ __('admin-sections.Documentation version') }}: {{ $version->title }}
|
||||||
|
</h3>
|
||||||
|
@if(!empty($category))
|
||||||
|
<h3 class="mb-4">
|
||||||
|
{{ __('admin-sections.Categories') }}: {{ $category->content?->title }}
|
||||||
|
</h3>
|
||||||
|
@endif
|
||||||
|
@can('create', \App\Models\Documentation::class)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.documentations.create', ['project' => $project->id, 'version' => $version->id, 'category' => $categoryId]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
|
<svg class="icon icon-xs me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
||||||
|
{{ __('Create documentation') }}
|
||||||
|
</a>
|
||||||
|
@endcan
|
||||||
|
@can('create', \App\Models\DocumentationCategory::class)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.categories.create', ['project' => $project->id, 'version' => $version->id, 'category' => $categoryId]) }}" class="btn btn-secondary d-inline-flex align-items-center me-2 mb-3">
|
||||||
|
<svg class="icon icon-xs me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
|
||||||
|
{{ __('Create category') }}
|
||||||
|
</a>
|
||||||
|
@endcan
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-centered table-nowrap mb-0 rounded">
|
<table class="table table-centered table-nowrap mb-0 rounded">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="border-0">{{ __('admin-sections.Sections') }}</th>
|
<th class="border-0">{{ __('validation.attributes.type') }}</th>
|
||||||
|
<th class="border-0">{{ __('validation.attributes.title') }}</th>
|
||||||
|
<th class="border-0">{{ __('validation.attributes.slug') }}</th>
|
||||||
|
<th class="border-0">{{ __('validation.attributes.is_public') }}</th>
|
||||||
|
<th class="border-0 rounded-end" style="width: 150px"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@can('viewAny', \App\Models\Documentation::class)
|
@forelse($categories as $category)
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ route('admin.projects.documentation-versions.documentations.index', ['project' => $project->id, 'version' => $version->id]) }}" class="fw-bold">
|
|
||||||
<svg width="16" height="16" class="align-text-top" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"></path>
|
|
||||||
</svg>
|
|
||||||
{{ __('admin-sections.Documentation') }}
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endcan
|
|
||||||
@can('viewAny', \App\Models\DocumentationCategory::class)
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a href="{{ route('admin.projects.documentation-versions.categories.index', ['project' => $project->id, 'version' => $version->id]) }}" class="fw-bold">
|
|
||||||
<svg width="16" height="16" class="align-text-top" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"></path>
|
|
||||||
</svg>
|
|
||||||
{{ __('admin-sections.Categories') }}
|
{{ __('admin-sections.Categories') }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@can('view', $category)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.category.show', ['project' => $project->id, 'version' => $version->id, 'category' => $category->id]) }}" class="text-decoration-none text-dark">
|
||||||
|
{{ $category->content?->title }}
|
||||||
</a>
|
</a>
|
||||||
|
@else
|
||||||
|
{{ $category->content?->title }}
|
||||||
|
@endcan
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ $category->slug }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@if($category->is_public)
|
||||||
|
{{ __('Yes') }}
|
||||||
|
@else
|
||||||
|
{{ __('No') }}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@can('update', $category)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.categories.edit', ['project' => $project->id, 'version' => $version->id, 'category' => $category->id]) }}" class="btn btn-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ __('Edit') }}">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="align-text-top" viewBox="0 0 16 16">
|
||||||
|
<path d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"/>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
@endcan
|
||||||
|
@can('delete', $category)
|
||||||
|
<form method="post" class="d-inline-block" action="{{ route('admin.projects.documentation-versions.categories.destroy', ['project' => $project->id, 'version' => $version->id, 'category' => $category->id]) }}">
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button type="submit" class="btn btn-danger click-confirm" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ __('Delete') }}">
|
||||||
|
<svg data-slot="icon" fill="currentColor" width="20" height="20" class="align-text-center" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12"></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
@endcan
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
<div class="text-center">
|
||||||
|
{{ __('admin-sections.No categories found') }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
@forelse($documentations as $documentation)
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{ __('admin-sections.Documentation') }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ $documentation->content?->title }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ $documentation->slug }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@if($documentation->is_public)
|
||||||
|
{{ __('Yes') }}
|
||||||
|
@else
|
||||||
|
{{ __('No') }}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@can('update', $documentation)
|
||||||
|
<a href="{{ route('admin.projects.documentation-versions.documentations.edit', ['project' => $project->id, 'version' => $version->id, 'documentation' => $documentation->id]) }}" class="btn btn-primary" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ __('Edit') }}">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="align-text-top" viewBox="0 0 16 16">
|
||||||
|
<path d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"/>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
|
@can('delete', $documentation)
|
||||||
|
<form method="post" class="d-inline-block" action="{{ route('admin.projects.documentation-versions.documentations.destroy', ['project' => $project->id, 'version' => $version->id, 'documentation' => $documentation->id]) }}">
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button type="submit" class="btn btn-danger click-confirm" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ __('Delete') }}">
|
||||||
|
<svg data-slot="icon" fill="currentColor" width="20" height="20" class="align-text-center" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12"></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
@endcan
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
<div class="text-center">
|
||||||
|
{{ __('admin-sections.Documentation not found') }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@push('scripts')
|
||||||
|
@include('admin._scripts._click-confirm', ['alert' => __('Do you want to delete?')])
|
||||||
|
@endpush
|
||||||
</x-admin.layout>
|
</x-admin.layout>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
@section('meta_title', __('admin-sections.Projects'))
|
@section('meta_title', __('admin-sections.Projects'))
|
||||||
@section('h1', __('admin-sections.Projects'))
|
@section('h1', __('admin-sections.Projects'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.edit', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects._top')
|
@include('admin.projects._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
<div class="card border-0 shadow components-section">
|
<div class="card border-0 shadow components-section">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Project') . ': ' . $project->name }}</h3>
|
||||||
<form method="post" action="{{ route('admin.projects.update', $project) }}">
|
<form method="post" action="{{ route('admin.projects.update', $project) }}">
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
@include('admin.projects._from')
|
@include('admin.projects._from')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Feedback'))
|
@section('meta_title', __('admin-sections.Feedback'))
|
||||||
@section('h1', __('admin-sections.Feedback'))
|
@section('h1', __('admin-sections.Feedback'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.feedbacks.index'))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Project') . ': ' . $project->name . ' - ' . __('admin-sections.Feedback'))
|
@section('meta_title', __('admin-sections.Project') . ': ' . $project->name . ' - ' . __('admin-sections.Feedback'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.feedbacks.index', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Projects'))
|
@section('meta_title', __('admin-sections.Projects'))
|
||||||
@section('h1', __('admin-sections.Projects'))
|
@section('h1', __('admin-sections.Projects'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.index'))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects._top')
|
@include('admin.projects._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Links project'))
|
@section('meta_title', __('admin-sections.Links project'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.links.create', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.links._top')
|
@include('admin.projects.links._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Links project'))
|
@section('meta_title', __('admin-sections.Links project'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.links.edit', $project, $link))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.links._top')
|
@include('admin.projects.links._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Links project'))
|
@section('meta_title', __('admin-sections.Links project'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.links.index', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects.links._top')
|
@include('admin.projects.links._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
@section('meta_title', __('admin-sections.Setting up automatic translation') . '. ' . __('admin-sections.Project') . ': ' . $project->name)
|
@section('meta_title', __('admin-sections.Setting up automatic translation') . '. ' . __('admin-sections.Project') . ': ' . $project->name)
|
||||||
@section('h1', __('admin-sections.Setting up automatic translation') . '. ' . __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.service-translate.view', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
<div class="card border-0 shadow components-section">
|
<div class="card border-0 shadow components-section">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Setting up automatic translation') }}</h3>
|
||||||
<form method="post" action="{{ route('admin.projects.service-translate.update', ['project' => $project->id]) }}">
|
<form method="post" action="{{ route('admin.projects.service-translate.update', ['project' => $project->id]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Project') . ': ' . $project->name)
|
@section('meta_title', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.show', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.projects._top')
|
@include('admin.projects._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
@section('meta_title', __('admin-sections.Translations'))
|
@section('meta_title', __('admin-sections.Translations'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.translations.edit', $project, $language))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
<div class="card border-0 shadow components-section">
|
<div class="card border-0 shadow components-section">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 id="category" class="mb-4">{{ __('admin-sections.Translations') }}</h3>
|
<h3 id="category" class="mb-4">{{ __('admin-sections.Translations') . ': ' . $language->title }}</h3>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<form method="post" action="{{ route('admin.projects.translations.update', ['project' => $project->id, 'language' => $language->id]) }}">
|
<form method="post" action="{{ route('admin.projects.translations.update', ['project' => $project->id, 'language' => $language->id]) }}">
|
||||||
@if($serviceTranslationEnable)
|
@if($serviceTranslationEnable)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Translations'))
|
@section('meta_title', __('admin-sections.Translations'))
|
||||||
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
@section('h1', __('admin-sections.Project') . ': ' . $project->name)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.projects.translations.languages', $project))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-4">
|
<div class="col-12 mb-4">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.User group'))
|
@section('meta_title', __('admin-sections.User group'))
|
||||||
@section('h1', __('admin-sections.User group'))
|
@section('h1', __('admin-sections.User group'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.roles.create'))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.roles._top')
|
@include('admin.roles._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.User group'))
|
@section('meta_title', __('admin-sections.User group'))
|
||||||
@section('h1', __('admin-sections.User group'))
|
@section('h1', __('admin-sections.User group'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.roles.edit', $role))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.roles._top')
|
@include('admin.roles._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.User group'))
|
@section('meta_title', __('admin-sections.User group'))
|
||||||
@section('h1', __('admin-sections.User group'))
|
@section('h1', __('admin-sections.User group'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.roles.index'))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.roles._top')
|
@include('admin.roles._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Users'))
|
@section('meta_title', __('admin-sections.Users'))
|
||||||
@section('h1', __('admin-sections.Users'))
|
@section('h1', __('admin-sections.Users'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.users.create'))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.users._top')
|
@include('admin.users._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Users'))
|
@section('meta_title', __('admin-sections.Users'))
|
||||||
@section('h1', __('admin-sections.Users'))
|
@section('h1', __('admin-sections.Users'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.users.edit', $user))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.users._top')
|
@include('admin.users._top')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@section('meta_title', __('admin-sections.Users'))
|
@section('meta_title', __('admin-sections.Users'))
|
||||||
@section('h1', __('admin-sections.Users'))
|
@section('h1', __('admin-sections.Users'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('admin.users.index'))
|
||||||
<x-admin.layout>
|
<x-admin.layout>
|
||||||
@include('admin.users._top')
|
@include('admin.users._top')
|
||||||
<div class="card border-0 shadow mb-4">
|
<div class="card border-0 shadow mb-4">
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
@unless ($breadcrumbs->isEmpty())
|
||||||
|
<nav aria-label="breadcrumb" class="d-none d-md-inline-block">
|
||||||
|
<ol class="breadcrumb breadcrumb-dark breadcrumb-transparent">
|
||||||
|
@foreach ($breadcrumbs as $breadcrumb)
|
||||||
|
@if ($breadcrumb->url && !$loop->last)
|
||||||
|
<li class="breadcrumb-item"><a href="{{ $breadcrumb->url }}" aria-label="{{ $breadcrumb->title }}">
|
||||||
|
@if(!empty($breadcrumb->icon))
|
||||||
|
{!! $breadcrumb->icon !!}
|
||||||
|
@else
|
||||||
|
{{ $breadcrumb->title }}
|
||||||
|
@endif
|
||||||
|
</a></li>
|
||||||
|
@else
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">
|
||||||
|
@if(!empty($breadcrumb->icon))
|
||||||
|
{!! $breadcrumb->icon !!}
|
||||||
|
@else
|
||||||
|
{{ $breadcrumb->title }}
|
||||||
|
@endif
|
||||||
|
</li>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
@endunless
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
@unless ($breadcrumbs->isEmpty())
|
||||||
|
<nav aria-label="breadcrumb" class="breadcrumb">
|
||||||
|
<ol class="breadcrumb-container">
|
||||||
|
@foreach ($breadcrumbs as $breadcrumb)
|
||||||
|
@if ($breadcrumb->url && !$loop->last)
|
||||||
|
<li class="breadcrumb-item"><a href="{{ $breadcrumb->url }}">{{ $breadcrumb->title }}</a></li>
|
||||||
|
@else
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">{{ $breadcrumb->title }}</li>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
@endunless
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
@endphp
|
@endphp
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="{{ $tinyId }}">{{ $title }}</label>
|
<label for="{{ $tinyId }}">{{ $title }}</label>
|
||||||
<textarea class="form-control {{ $attributes->get('class') }} textarea-tinymce @error($requestName) is-invalid @enderror" name="{{ $name }}" id="{{ $tinyId }}" rows="3">{{ $value }}</textarea>
|
<textarea class="form-control {{ $attributes->get('class') }} textarea-tinymce @error($requestName) is-invalid @enderror" name="{{ $name }}" id="{{ $tinyId }}" style="height: 600px;">{{ $value }}</textarea>
|
||||||
@foreach($images as $image)
|
@foreach($images as $image)
|
||||||
@continue( empty($image['file']) )
|
@continue( empty($image['file']) )
|
||||||
<input type="hidden" value="{{ $image['file'] }}" name="{{ $storageUpload->getInputName() }}[content_images][][file]';">
|
<input type="hidden" value="{{ $image['file'] }}" name="{{ $storageUpload->getInputName() }}[content_images][][file]';">
|
||||||
@@ -95,14 +95,96 @@
|
|||||||
xhr.send(formData);
|
xhr.send(formData);
|
||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
tinymce.PluginManager.add('translateNo', (editor) => {
|
||||||
|
const ATTR = 'translate';
|
||||||
|
const VALUE = 'no';
|
||||||
|
|
||||||
|
const isTranslateNo = (node) =>
|
||||||
|
node && node.nodeType === 1 && node.getAttribute(ATTR) === VALUE;
|
||||||
|
|
||||||
|
const toggleTranslateNo = () => {
|
||||||
|
const selectedNode = editor.selection.getNode();
|
||||||
|
|
||||||
|
if (isTranslateNo(selectedNode)) {
|
||||||
|
// Remove translate="no", expand span
|
||||||
|
if (selectedNode.tagName === 'SPAN') {
|
||||||
|
editor.dom.remove(selectedNode, true); // true = сохранить детей
|
||||||
|
} else {
|
||||||
|
editor.dom.setAttrib(selectedNode, ATTR, null);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If inside translate="no", remove the mark
|
||||||
|
const wrapper = editor.dom.getParent(selectedNode, `[${ATTR}="${VALUE}"]`);
|
||||||
|
if (wrapper) {
|
||||||
|
if (wrapper.tagName === 'SPAN') {
|
||||||
|
editor.dom.remove(wrapper, true);
|
||||||
|
} else {
|
||||||
|
editor.dom.setAttrib(wrapper, ATTR, null);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, wrap the selection
|
||||||
|
editor.formatter.register('translateNo', {
|
||||||
|
inline: 'span',
|
||||||
|
attributes: { [ATTR]: VALUE },
|
||||||
|
remove: 'all'
|
||||||
|
});
|
||||||
|
editor.formatter.apply('translateNo');
|
||||||
|
};
|
||||||
|
|
||||||
|
editor.ui.registry.addToggleButton('translateNo', {
|
||||||
|
icon: 'translate',
|
||||||
|
tooltip: '{{ __('editor.Do not translate') }}',
|
||||||
|
onAction: toggleTranslateNo,
|
||||||
|
onSetup: (api) => {
|
||||||
|
const setActive = () => {
|
||||||
|
const node = editor.selection.getNode();
|
||||||
|
api.setActive(
|
||||||
|
isTranslateNo(node) ||
|
||||||
|
!!editor.dom.getParent(node, `[${ATTR}="${VALUE}"]`)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
editor.on('NodeChange', setActive);
|
||||||
|
return () => editor.off('NodeChange', setActive);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.ui.registry.addMenuItem('translateNo', {
|
||||||
|
text: '{{ __('editor.Mark as not to translate') }}',
|
||||||
|
icon: 'translate',
|
||||||
|
onAction: toggleTranslateNo
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
tinymce.init({
|
tinymce.init({
|
||||||
|
content_style: `
|
||||||
|
span[translate="no"] {
|
||||||
|
background: rgba(255, 215, 0, 0.35);
|
||||||
|
outline: 1px dashed #e0a800;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
span[translate="no"]:hover::before {
|
||||||
|
position: absolute;
|
||||||
|
content: "{{ __('editor.Do not translate') }}";
|
||||||
|
left: 0;
|
||||||
|
bottom: 100%;
|
||||||
|
background: #e0a800;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding: 0.25rem;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
`,
|
||||||
selector: '#{{ $tinyId }}',
|
selector: '#{{ $tinyId }}',
|
||||||
@if(in_array(app()->getLocale(), ['ru'], true))
|
@if(in_array(app()->getLocale(), ['ru'], true))
|
||||||
language: '{{ app()->getLocale() }}',
|
language: '{{ app()->getLocale() }}',
|
||||||
@endif
|
@endif
|
||||||
license_key: '{{ $tinymceLicenseKey }}',
|
license_key: '{{ $tinymceLicenseKey }}',
|
||||||
plugins: 'advlist code emoticons link lists table codesample media my-image',
|
plugins: 'advlist code emoticons link lists table codesample media my-image translateNo',
|
||||||
toolbar: 'bold italic | bullist numlist | link image emoticons media codesample',
|
toolbar: 'bold italic | bullist numlist | link image emoticons media codesample translateNo',
|
||||||
referrer_policy: 'origin',
|
referrer_policy: 'origin',
|
||||||
@if($storageUpload !== null)
|
@if($storageUpload !== null)
|
||||||
images_upload_handler: imageUpload,
|
images_upload_handler: imageUpload,
|
||||||
|
|||||||
@@ -69,11 +69,12 @@
|
|||||||
<nav class="navbar navbar-top navbar-expand navbar-dashboard navbar-dark ps-0 pe-2 pb-2 pb-lg-3">
|
<nav class="navbar navbar-top navbar-expand navbar-dashboard navbar-dark ps-0 pe-2 pb-2 pb-lg-3">
|
||||||
<div class="container-fluid px-0">
|
<div class="container-fluid px-0">
|
||||||
<div class="d-flex justify-content-between w-100" id="navbarSupportedContent">
|
<div class="d-flex justify-content-between w-100" id="navbarSupportedContent">
|
||||||
<div class="d-flex align-items-center">
|
<div>
|
||||||
|
@yield('breadcrumbs', '')
|
||||||
<h1 class="h3">@yield('h1', '')</h1>
|
<h1 class="h3">@yield('h1', '')</h1>
|
||||||
</div>
|
</div>
|
||||||
<!-- Navbar links -->
|
<!-- Navbar links -->
|
||||||
<ul class="navbar-nav align-items-center">
|
<ul class="navbar-nav d-none d-lg-flex">
|
||||||
<li class="nav-item dropdown ms-lg-3">
|
<li class="nav-item dropdown ms-lg-3">
|
||||||
<a class="nav-link dropdown-toggle pt-1 px-0" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
<a class="nav-link dropdown-toggle pt-1 px-0" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
<div class="media d-flex align-items-center">
|
<div class="media d-flex align-items-center">
|
||||||
@@ -106,7 +107,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
@includeWhen($errors->any(), 'layout.private._errors', ['errors' => $errors->all()])
|
@includeWhen($errors->any(), 'layout.private._errors', ['errors' => $errors->all()])
|
||||||
@includeWhen(Session::has('success'), 'layout.private._success', ['success' => Session::get('success')])
|
@includeWhen(Session::has('success'), 'layout.private._success', ['success' => Session::get('success')])
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
<meta name="description" content="@yield('meta_description', '')" />
|
<meta name="description" content="@yield('meta_description', '')" />
|
||||||
|
|
||||||
@vite('resources/site/scss/app.scss')
|
@vite('resources/site/scss/app.scss')
|
||||||
|
|
||||||
|
@stack('head')
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
@@ -39,13 +41,14 @@
|
|||||||
<nav id="menu">
|
<nav id="menu">
|
||||||
<div class="menu__title">{{ $websiteTranslations->translate('site.Menu') }}</div>
|
<div class="menu__title">{{ $websiteTranslations->translate('site.Menu') }}</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{{ \App\Enums\Site\ProjectSection::Home->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['home', 'language.home', 'project.home', 'project.language.home'])])>{{ $websiteTranslations->translate('site.About project') }}</a></li>
|
<li><a href="{{ \App\Enums\Site\ProjectSection::Home->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['home', 'language.home', 'project.home', 'project.language.home', 'home-language'])])>{{ $websiteTranslations->translate('site.About project') }}</a></li>
|
||||||
<li><a href="{{ \App\Enums\Site\ProjectSection::Documentation->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['documentation', 'documentation.home'])])>{{ $websiteTranslations->translate('site.Documentation') }}</a></li>
|
<li><a href="{{ \App\Enums\Site\ProjectSection::Documentation->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['documentation.*'])])>{{ $websiteTranslations->translate('site.Documentation') }}</a></li>
|
||||||
<li><a href="{{ \App\Enums\Site\ProjectSection::Feedback->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['feedback', 'language.feedback', 'project.feedback', 'project.language.feedback'])])>{{ $websiteTranslations->translate('site.Feedback') }}</a></li>
|
<li><a href="{{ \App\Enums\Site\ProjectSection::Feedback->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['feedback', 'language.feedback', 'project.feedback', 'project.language.feedback', 'feedback-language'])])>{{ $websiteTranslations->translate('site.Feedback') }}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="section-container">
|
<div class="section-container">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@yield('breadcrumbs', '')
|
||||||
@if($attributes->has('documentationVersion'))
|
@if($attributes->has('documentationVersion'))
|
||||||
<x-site.documentation-version :websiteTranslations="$websiteTranslations" :version="$attributes->get('documentationVersion')" />
|
<x-site.documentation-version :websiteTranslations="$websiteTranslations" :version="$attributes->get('documentationVersion')" />
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
@section('meta_title', $websiteTranslations->translate('site.Feedback'))
|
@section('meta_title', $websiteTranslations->translate('site.Feedback'))
|
||||||
@section('h1', $websiteTranslations->translate('site.Feedback'))
|
@section('h1', $websiteTranslations->translate('site.Feedback'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('feedbacks.index', $project, $websiteTranslations))
|
||||||
|
@push('head')
|
||||||
|
{{ Breadcrumbs::view('breadcrumbs::json-ld', 'feedbacks.index', $project, $websiteTranslations) }}
|
||||||
|
@endpush
|
||||||
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations">
|
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations">
|
||||||
@if(Session::has('success') !== true)
|
@if(Session::has('success') !== true)
|
||||||
<form method="post" action="{{ \App\Enums\Site\ProjectSection::FeedbackSend->url($project, $websiteTranslations->getLanguage()) }}">
|
<form method="post" action="{{ \App\Enums\Site\ProjectSection::FeedbackSend->url($project, $websiteTranslations->getLanguage()) }}">
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user