Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] add back button to header #1374

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions config/telescope.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@

'path' => env('TELESCOPE_PATH', 'telescope'),

/*
|--------------------------------------------------------------------------
| Telescope Back to system URL
|--------------------------------------------------------------------------
| This is the URI path redirect on click "back" button. You
| can set value to `null` for hide button on header.
| also label shown on hover.
|
*/

'back_button_url' => config('app.url', null),

'back_button_label' => 'Back to system',

/*
|--------------------------------------------------------------------------
| Telescope Storage Driver
Expand Down
6 changes: 6 additions & 0 deletions resources/views/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@

<div class="container mb-5">
<div class="d-flex align-items-stretch py-4 header">
<a href="{{ config('telescope.back_button_url') }}" v-if="{{ config('telescope.back_button_url') ? 1 : 0 }}" class="btn btn-muted mr-3 d-flex align-items-center py-2" title="{{ config('telescope.back_button_label') }}">
<svg viewBox="0 0 20 20" fill="currentColor" class="icon">
<path class="fill-primary" d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z"></path>
</svg>
</a>

<router-link to="/" class="logo d-flex align-items-center">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">
<path class="fill-primary" d="M0 40a39.87 39.87 0 0 1 11.72-28.28A40 40 0 1 1 0 40zm34 10a4 4 0 0 1-4-4v-2a2 2 0 1 0-4 0v2a4 4 0 0 1-4 4h-2a2 2 0 1 0 0 4h2a4 4 0 0 1 4 4v2a2 2 0 1 0 4 0v-2a4 4 0 0 1 4-4h2a2 2 0 1 0 0-4h-2zm24-24a6 6 0 0 1-6-6v-3a3 3 0 0 0-6 0v3a6 6 0 0 1-6 6h-3a3 3 0 0 0 0 6h3a6 6 0 0 1 6 6v3a3 3 0 0 0 6 0v-3a6 6 0 0 1 6-6h3a3 3 0 0 0 0-6h-3zm-4 36a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM21 28a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"></path>
Expand Down