Compare commits
6
Commits
7a1b9ecda1
...
136451dc5a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
136451dc5a
|
||
|
|
1ee453dcfe
|
||
|
|
2a26008e87
|
||
|
|
031aa196d1
|
||
|
|
c3b9fa56fb
|
||
|
|
0922ee217f
|
@@ -77,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));
|
||||||
}
|
}
|
||||||
@@ -98,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));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,60 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Models\DocumentationCategory;
|
||||||
|
use App\Models\DocumentationVersion;
|
||||||
|
use App\Models\Documentation;
|
||||||
use App\Services\WebsiteTranslations;
|
use App\Services\WebsiteTranslations;
|
||||||
|
use App\Enums\Site\ProjectSection;
|
||||||
|
use App\Models\Project;
|
||||||
use Diglactic\Breadcrumbs\Breadcrumbs;
|
use Diglactic\Breadcrumbs\Breadcrumbs;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
Breadcrumbs::for('home', function ($trail, WebsiteTranslations $websiteTranslations) {
|
Breadcrumbs::for('home', function ($trail, Project $project, WebsiteTranslations $websiteTranslations) {
|
||||||
$trail->push($websiteTranslations->translate('Home'), route('home'));
|
$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,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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -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">
|
||||||
@@ -46,6 +48,7 @@
|
|||||||
</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()) }}">
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
@section('meta_title', $category->content?->title . ' - ' . $project->name . ' ' . $version->title)
|
@section('meta_title', $category->content?->title . ' - ' . $project->name . ' ' . $version->title)
|
||||||
@section('h1', $category->content?->title)
|
@section('h1', $category->content?->title)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('documentation.category', $project, $websiteTranslations, $version, $category, $categoryPath))
|
||||||
|
@push('head')
|
||||||
|
{{ Breadcrumbs::view('breadcrumbs::json-ld', 'documentation.category', $project, $websiteTranslations, $version, $category, $categoryPath) }}
|
||||||
|
@endpush
|
||||||
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations" :documentationVersion="$version">
|
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations" :documentationVersion="$version">
|
||||||
@foreach($categories as $category)
|
@foreach($categories as $category)
|
||||||
@continue(! $category->content?->title)
|
@continue(! $category->content?->title)
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
@section('meta_title', $websiteTranslations->translate('site.Documentation') . ' - ' . $project->name . ' ' . $version->title)
|
@section('meta_title', $websiteTranslations->translate('site.Documentation') . ' - ' . $project->name . ' ' . $version->title)
|
||||||
@section('h1', $websiteTranslations->translate('site.Documentation'))
|
@section('h1', $websiteTranslations->translate('site.Documentation'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('documentation.index', $project, $websiteTranslations, $version))
|
||||||
|
@push('head')
|
||||||
|
{{ Breadcrumbs::view('breadcrumbs::json-ld', 'documentation.index', $project, $websiteTranslations, $version) }}
|
||||||
|
@endpush
|
||||||
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations" :documentationVersion="$version">
|
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations" :documentationVersion="$version">
|
||||||
@foreach($categories as $category)
|
@foreach($categories as $category)
|
||||||
@continue(! $category->content?->title)
|
@continue(! $category->content?->title)
|
||||||
|
|||||||
+4
-1
@@ -1,6 +1,9 @@
|
|||||||
@section('meta_title', $websiteTranslations->translate('site.Documentation not created'))
|
@section('meta_title', $websiteTranslations->translate('site.Documentation not created'))
|
||||||
@section('h1', $websiteTranslations->translate('site.Documentation not created'))
|
@section('h1', $websiteTranslations->translate('site.Documentation not created'))
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('documentation.no-default-version', $project, $websiteTranslations))
|
||||||
|
@push('head')
|
||||||
|
{{ Breadcrumbs::view('breadcrumbs::json-ld', 'documentation.no-default-version', $project, $websiteTranslations) }}
|
||||||
|
@endpush
|
||||||
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations">
|
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations">
|
||||||
|
|
||||||
</x-site.layout>
|
</x-site.layout>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
@section('meta_title', $documentation->content?->title . ' - ' . $project->name . ' ' . $version->title)
|
@section('meta_title', $documentation->content?->title . ' - ' . $project->name . ' ' . $version->title)
|
||||||
@section('h1', $documentation->content?->title)
|
@section('h1', $documentation->content?->title)
|
||||||
|
@section('breadcrumbs', Breadcrumbs::render('documentation.view', $project, $websiteTranslations, $version, $documentation, $categoryPath))
|
||||||
|
@push('head')
|
||||||
|
{{ Breadcrumbs::view('breadcrumbs::json-ld', 'documentation.view', $project, $websiteTranslations, $version, $documentation, $categoryPath) }}
|
||||||
|
@endpush
|
||||||
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations" :documentationVersion="$version">
|
<x-site.layout :project="$project" :websiteTranslations="$websiteTranslations" :documentationVersion="$version">
|
||||||
<div class="line-numbers">{!! $documentation->content->content !!}</div>
|
<div class="line-numbers">{!! $documentation->content->content !!}</div>
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
|
|||||||
@@ -24,6 +24,10 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.breadcrumb .icon {
|
||||||
|
margin-top: -2px;
|
||||||
|
}
|
||||||
|
|
||||||
@each $color, $value in $theme-colors {
|
@each $color, $value in $theme-colors {
|
||||||
.breadcrumb-#{$color} {
|
.breadcrumb-#{$color} {
|
||||||
background: $value;
|
background: $value;
|
||||||
|
|||||||
Reference in New Issue
Block a user