Skip to content

Commit 52fc42c

Browse files
committed
fix tabs
1 parent d877817 commit 52fc42c

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ All Notable changes to `Backpack CRUD` will be documented in this file.
88

99
-----------
1010

11+
## 4.0.48 - 2020-03-06
12+
13+
### Fixed
14+
- Create/Update operation tabs no longer worked because of Str::slug() helper;
15+
16+
1117
## 4.0.47 - 2020-03-05
1218

1319
### Fixed

src/resources/views/crud/form_content.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{-- See if we're using tabs --}}
44
@if ($crud->tabsEnabled() && count($crud->getTabs()))
55
@include('crud::inc.show_tabbed_fields')
6-
<input type="hidden" name="current_tab" value="{{ str_slug($crud->getTabs()[0], "") }}" />
6+
<input type="hidden" name="current_tab" value="{{ str_slug($crud->getTabs()[0]) }}" />
77
@else
88
<div class="card">
99
<div class="card-body row">

src/resources/views/crud/inc/show_tabbed_fields.blade.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,21 @@
4040
<ul class="nav {{ $horizontalTabs ? 'nav-tabs' : 'flex-column nav-pills'}} {{ $horizontalTabs ? '' : 'col-md-3' }}" role="tablist">
4141
@foreach ($crud->getTabs() as $k => $tab)
4242
<li role="presentation" class="nav-item">
43-
<a href="#tab_{{ str_slug($tab, "") }}" aria-controls="tab_{{ str_slug($tab, "") }}" role="tab" tab_name="{{ str_slug($tab, "") }}" data-toggle="tab" class="nav-link {{ isset($tabWithError) ? ($tab == $tabWithError ? 'active' : '') : ($k == 0 ? 'active' : '') }}">{{ $tab }}</a>
43+
<a href="#tab_{{ str_slug($tab) }}"
44+
aria-controls="tab_{{ str_slug($tab) }}"
45+
role="tab"
46+
tab_name="{{ str_slug($tab) }}"
47+
data-toggle="tab"
48+
class="nav-link {{ isset($tabWithError) ? ($tab == $tabWithError ? 'active' : '') : ($k == 0 ? 'active' : '') }}"
49+
>{{ $tab }}</a>
4450
</li>
4551
@endforeach
4652
</ul>
4753

4854
<div class="tab-content p-0 {{$horizontalTabs ? '' : 'col-md-9'}}">
4955

5056
@foreach ($crud->getTabs() as $k => $tab)
51-
<div role="tabpanel" class="tab-pane {{ isset($tabWithError) ? ($tab == $tabWithError ? ' active' : '') : ($k == 0 ? ' active' : '') }}" id="tab_{{ str_slug($tab, "") }}">
57+
<div role="tabpanel" class="tab-pane {{ isset($tabWithError) ? ($tab == $tabWithError ? ' active' : '') : ($k == 0 ? ' active' : '') }}" id="tab_{{ str_slug($tab) }}">
5258

5359
<div class="row">
5460
@include('crud::inc.show_fields', ['fields' => $crud->getTabFields($tab)])

0 commit comments

Comments
 (0)