Skip to content

Commit

Permalink
Merge branch 'master' of github.com:freescout-helpdesk/freescout into…
Browse files Browse the repository at this point in the history
… dist
  • Loading branch information
freescout-help-desk committed Jan 5, 2022
2 parents 17a157e + c1b0838 commit f4924c3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 16 deletions.
18 changes: 17 additions & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| or any other location as required by the application or its packages.
*/

'version' => '1.7.26',
'version' => '1.7.27',

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -312,6 +312,22 @@
*/
'user_permissions' => env('APP_USER_PERMISSIONS', ''),

/*
|--------------------------------------------------------------------------
| Dashboard path.
|
|-------------------------------------------------------------------------
*/
'dashboard_path' => env('APP_DASHBOARD_PATH', ''),

/*
|--------------------------------------------------------------------------
| Home page controller.
|
|-------------------------------------------------------------------------
*/
'home_controller' => env('APP_HOMEPAGE_CONTROLLER', 'SecureController@dashboard'),

/*
|--------------------------------------------------------------------------
| Disable update checker
Expand Down
2 changes: 1 addition & 1 deletion resources/views/errors/403.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

@section('message')
{{ __('Access denied') }}
<br/><br/><small>{{ __('Go to') }} <a href="{{ url('/') }}">{{ __('Homepage') }}</a></small>
<br/><br/><small>{{ __('Go to') }} <a href="{{ route('dashboard') }}">{{ __('Homepage') }}</a></small>
@endsection
2 changes: 1 addition & 1 deletion resources/views/errors/404.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

@section('message')
{{ __('Sorry, the page you are looking for could not be found.') }}
<br/><br/><small>{{ __('Go to') }} <a href="{{ url('/') }}">{{ __('Homepage') }}</a></small>
<br/><br/><small>{{ __('Go to') }} <a href="{{ route('dashboard') }}">{{ __('Homepage') }}</a></small>
@endsection
18 changes: 8 additions & 10 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<body class="@if (!Auth::user()) user-is-guest @endif @if (Auth::user() && Auth::user()->isAdmin()) user-is-admin @endif @yield('body_class')" @yield('body_attrs') @if (Auth::user()) data-auth_user_id="{{ Auth::user()->id }}" @endif>
<div id="app">

@if (Auth::user() && empty(app('request')->x_embed))
@if (Auth::user() && empty(app('request')->x_embed) && empty($__env->yieldContent('guest_mode')))

<nav class="navbar navbar-default navbar-static-top">
<div class="container">
Expand All @@ -57,7 +57,7 @@
<i class="glyphicon glyphicon-arrow-left"></i>
</a>
@else
<a class="navbar-brand" href="{{ url('/') }}" title="{{ __('Dashboard') }}">
<a class="navbar-brand" href="{{ route('dashboard') }}" title="{{ __('Dashboard') }}">
<img src="@filter('layout.header_logo', asset('img/logo-brand.svg'))" height="100%" alt="" />
{{-- config('app.name', 'FreeScout') --}}
</a>
Expand All @@ -68,22 +68,19 @@
<!-- Left Side Of Navbar -->
<ul class="nav navbar-nav">
@php
$cache_mailboxes = false;
if (\Helper::isRoute('conversations.view') || \Helper::isRoute('mailboxes.view.folder') || \Helper::isRoute('conversations.search')) {
$cache_mailboxes = true;
}
$mailboxes = Auth::user()->mailboxesCanView($cache_mailboxes);
$mailboxes = Auth::user()->mailboxesCanView(true);
$mailboxes = \Eventy::filter('menu.mailboxes', $mailboxes);
@endphp
@if (count($mailboxes) == 1)
<li class="{{ \App\Misc\Helper::menuSelectedHtml('mailbox') }}"><a href="{{ route('mailboxes.view', ['id'=>$mailboxes[0]->id]) }}">{{ __('Mailbox') }}</a></li>
<li class="{{ \App\Misc\Helper::menuSelectedHtml('mailbox') }}"><a href="{{ \Eventy::filter('mailbox.url', route('mailboxes.view', ['id'=>$mailboxes[0]->id]), $mailboxes[0]) }}">{{ __('Mailbox') }}</a></li>
@elseif (count($mailboxes) > 1)
<li class="dropdown {{ \App\Misc\Helper::menuSelectedHtml('mailbox') }}">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" v-pre>
{{ __('Mailbox') }} <span class="caret"></span>
</a>
<ul class="dropdown-menu dm-scrollable">
@foreach ($mailboxes as $mailbox_item)
<li @if ($mailbox_item->id == app('request')->id)class="active"@endif><a href="{{ route('mailboxes.view', ['id' => $mailbox_item->id]) }}">{{ $mailbox_item->name }}</a></li>
<li @if ($mailbox_item->id == app('request')->id)class="active"@endif><a href="{{ \Eventy::filter('mailbox.url', route('mailboxes.view', ['id' => $mailbox_item->id]), $mailbox_item) }}">{{ $mailbox_item->name }}</a></li>
@endforeach
</ul>
</li>
Expand Down Expand Up @@ -251,7 +248,8 @@
</div>
@endif

@if (!in_array(Route::currentRouteName(), array('mailboxes.view')) && empty(app('request')->x_embed))
@if (!in_array(Route::currentRouteName(), array('mailboxes.view'))
&& empty(app('request')->x_embed) && empty($__env->yieldContent('no_footer')))
<div class="footer">
@if (!\Eventy::filter('footer.text', ''))
&copy; 2018-{{ date('Y') }} <a href="{{ config('app.freescout_url') }}" target="blank">{{ \Config::get('app.name') }}</a> — {{ __('Free open source help desk & shared mailbox') }}
Expand Down
9 changes: 6 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@

Auth::routes();

// Redirects
Route::redirect('/home', '/', 301);
// Authentication redirects to /home
Route::redirect('/home', '/'.config('app.dashboard_path'), 301);

// Public routes
Route::get('/user-setup/{hash}', 'PublicController@userSetup')->name('user_setup');
Route::post('/user-setup/{hash}', 'PublicController@userSetupSave');
Route::get('/storage/attachment/{dir_1}/{dir_2}/{dir_3}/{file_name}', 'PublicController@downloadAttachment')->name('attachment.download');

// General routes for logged in users
Route::get('/', 'SecureController@dashboard')->name('dashboard');
if (config('app.dashboard_path')) {
Route::get('/', config('app.home_controller'));
}
Route::get('/'.config('app.dashboard_path'), 'SecureController@dashboard')->name('dashboard');
Route::get('/app-logs/app', ['uses' => '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index', 'middleware' => ['auth', 'roles'], 'roles' => ['admin']])->name('logs.app');
Route::get('/app-logs/{name?}', ['uses' => 'SecureController@logs', 'middleware' => ['auth', 'roles'], 'roles' => ['admin']])->name('logs');
Route::post('/app-logs/{name?}', ['uses' => 'SecureController@logsSubmit', 'middleware' => ['auth', 'roles'], 'roles' => ['admin']])->name('logs.action');
Expand Down

0 comments on commit f4924c3

Please sign in to comment.