diff --git a/resources/views/common/custom-head.blade.php b/resources/views/layouts/parts/custom-head.blade.php
similarity index 100%
rename from resources/views/common/custom-head.blade.php
rename to resources/views/layouts/parts/custom-head.blade.php
diff --git a/resources/views/common/custom-styles.blade.php b/resources/views/layouts/parts/custom-styles.blade.php
similarity index 100%
rename from resources/views/common/custom-styles.blade.php
rename to resources/views/layouts/parts/custom-styles.blade.php
diff --git a/resources/views/common/footer.blade.php b/resources/views/layouts/parts/footer.blade.php
similarity index 100%
rename from resources/views/common/footer.blade.php
rename to resources/views/layouts/parts/footer.blade.php
diff --git a/resources/views/layouts/parts/header-links-start.blade.php b/resources/views/layouts/parts/header-links-start.blade.php
new file mode 100644
index 000000000..471198979
--- /dev/null
+++ b/resources/views/layouts/parts/header-links-start.blade.php
@@ -0,0 +1,2 @@
+{{-- This is a placeholder template file provided as a --}}
+{{-- convenience to users of the visual theme system. --}}
\ No newline at end of file
diff --git a/resources/views/layouts/parts/header-links.blade.php b/resources/views/layouts/parts/header-links.blade.php
new file mode 100644
index 000000000..697f406c3
--- /dev/null
+++ b/resources/views/layouts/parts/header-links.blade.php
@@ -0,0 +1,25 @@
+@include('layouts.parts.header-links-start')
+
+@if (user()->hasAppAccess())
+
@icon('search'){{ trans('common.search') }}
+ @if(userCanOnAny('view', \BookStack\Entities\Models\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
+
@icon('bookshelf'){{ trans('entities.shelves') }}
+ @endif
+
@icon('books'){{ trans('entities.books') }}
+ @if(!user()->isGuest() && userCan('settings-manage'))
+
@icon('settings'){{ trans('settings.settings') }}
+ @endif
+ @if(!user()->isGuest() && userCan('users-manage') && !userCan('settings-manage'))
+
@icon('users'){{ trans('settings.users') }}
+ @endif
+@endif
+
+@if(user()->isGuest())
+ @if(setting('registration-enabled') && config('auth.method') === 'standard')
+
@icon('new-user'){{ trans('auth.sign_up') }}
+ @endif
+
@icon('login'){{ trans('auth.log_in') }}
+@endif
\ No newline at end of file
diff --git a/resources/views/layouts/parts/header-logo.blade.php b/resources/views/layouts/parts/header-logo.blade.php
new file mode 100644
index 000000000..c1bbd7849
--- /dev/null
+++ b/resources/views/layouts/parts/header-logo.blade.php
@@ -0,0 +1,8 @@
+
+ @if(setting('app-logo', '') !== 'none')
+
+ @endif
+ @if (setting('app-name-header'))
+ {{ setting('app-name') }}
+ @endif
+
\ No newline at end of file
diff --git a/resources/views/layouts/parts/header-search.blade.php b/resources/views/layouts/parts/header-search.blade.php
new file mode 100644
index 000000000..d5426115c
--- /dev/null
+++ b/resources/views/layouts/parts/header-search.blade.php
@@ -0,0 +1,20 @@
+
\ No newline at end of file
diff --git a/resources/views/common/header-user-menu.blade.php b/resources/views/layouts/parts/header-user-menu.blade.php
similarity index 100%
rename from resources/views/common/header-user-menu.blade.php
rename to resources/views/layouts/parts/header-user-menu.blade.php
diff --git a/resources/views/layouts/parts/header.blade.php b/resources/views/layouts/parts/header.blade.php
new file mode 100644
index 000000000..25f8e8c54
--- /dev/null
+++ b/resources/views/layouts/parts/header.blade.php
@@ -0,0 +1,25 @@
+
diff --git a/resources/views/common/notifications.blade.php b/resources/views/layouts/parts/notifications.blade.php
similarity index 100%
rename from resources/views/common/notifications.blade.php
rename to resources/views/layouts/parts/notifications.blade.php
diff --git a/resources/views/common/skip-to-content.blade.php b/resources/views/layouts/parts/skip-to-content.blade.php
similarity index 100%
rename from resources/views/common/skip-to-content.blade.php
rename to resources/views/layouts/parts/skip-to-content.blade.php
diff --git a/resources/views/layouts/plain.blade.php b/resources/views/layouts/plain.blade.php
index a3ee74143..a644ef789 100644
--- a/resources/views/layouts/plain.blade.php
+++ b/resources/views/layouts/plain.blade.php
@@ -14,8 +14,8 @@
- @include('common.custom-styles')
- @include('common.custom-head')
+ @include('layouts.parts.custom-styles')
+ @include('layouts.parts.custom-head')
@yield('content')
diff --git a/tests/ThemeTest.php b/tests/ThemeTest.php
index f0266cd0c..53361e351 100644
--- a/tests/ThemeTest.php
+++ b/tests/ThemeTest.php
@@ -366,6 +366,20 @@ class ThemeTest extends TestCase
});
}
+ public function test_header_links_start_template_file_can_be_used()
+ {
+ $content = 'This is added text in the header bar';
+
+ $this->usingThemeFolder(function (string $folder) use ($content) {
+ $viewDir = theme_path('layouts/parts');
+ mkdir($viewDir, 0777, true);
+ file_put_contents($viewDir . '/header-links-start.blade.php', $content);
+ $this->setSettings(['registration-enabled' => 'true']);
+
+ $this->get('/login')->assertSee($content);
+ });
+ }
+
protected function usingThemeFolder(callable $callback)
{
// Create a folder and configure a theme