Skip to content

Commit

Permalink
Page builder fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
clevyr-anthony committed Aug 15, 2023
1 parent 1caead9 commit e29d4b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/resources/views/crud/form/form_content.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<input type="hidden" name="http_referrer" value={{ session('referrer_url_override') ?? old('http_referrer') ?? \URL::previous() ?? url($crud->route) }}>
<input type="hidden" name="_http_referrer" value={{ session('referrer_url_override') ?? old('_http_referrer') ?? \URL::previous() ?? url($crud->route) }}>

{{-- See if we're using tabs --}}
@if ($crud->tabsEnabled() && count($crud->getTabs()))
Expand Down Expand Up @@ -218,7 +218,7 @@ function preventUnload(event) {
});
@endif
$("a[data-toggle='tab']").click(function(){
$("a[data-bs-toggle='tab']").click(function(){
var currentTabName = $(this).attr('tab_name');
$("input[name='_current_tab']").val(currentTabName);
});
Expand Down
32 changes: 16 additions & 16 deletions src/resources/views/crud/form/show_tabbed_fields.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
tab_name="{{ $tabSlug }}" {{-- tab name for Bootstrap v4 --}}
data-name="{{ $tabSlug }}" {{-- tab name for Bootstrap v5 --}}
data-bs-toggle="tab" {{-- tab name for Bootstrap v5 --}}
class="nav-link text-decoration-none {{ isset($tabWithError) && $tabWithError ? ($tab == $tabWithError ? 'active' : '') : ($k == 0 ? 'active' : '') }}"
class="nav-link text-decoration-none {{ isset($tabWithError) && $tabWithError ? ($tab === $tabWithError ? 'active' : '') : ($k === 0 ? 'active' : '') }}"
>{{ $tab }}</a>
</li>
@endforeach
Expand All @@ -71,9 +71,11 @@ class="nav-link text-decoration-none {{ isset($tabWithError) && $tabWithError ?
<a href="#tab_page-layout"
aria-controls="tab_page-layout"
role="tab"
tab_name="tab_page-layout"
data-toggle="tab"
class="nav-link {{ isset($tabWithError) ? ($tab == $tabWithError ? 'active' : '') : ($k == 1 ? 'active' : '') }}"
tab_name="tab_page-layout"
data-name="page-layout"
data-bs-toggle="tab"
class="nav-link text-decoration-none {{ isset($tabWithError) && $tabWithError ? ($tab === $tabWithError ? 'active' : '') : ($k === 1 ? 'active' : '') }}"
>Page Layout</a>
</li>
@endif
Expand All @@ -85,10 +87,12 @@ class="nav-link {{ isset($tabWithError) ? ($tab == $tabWithError ? 'active' : ''
<a href="#tab_page-content"
aria-controls="tab_page-content"
role="tab"
tab_name="tab_page-content"
data-toggle="tab"
tab_name="tab_page-content"
data-name="page-content"
data-bs-toggle="tab"
{{ !$has_sections ? 'disabled' : '' }}
class="nav-link {{ !$has_sections ? 'disabled' : '' }} {{ isset($tabWithError) ? ($tab == $tabWithError ? 'active' : '') : ($k == 2 ? 'active' : '') }}"
class="nav-link text-decoration-none {{ !$has_sections ? 'disabled' : '' }} {{ isset($tabWithError) ? ($tab == $tabWithError ? 'active' : '') : ($k == 2 ? 'active' : '') }}"
>
<span class="la la-exclamation-circle has-sections-icon {{ $has_sections ? 'd-none' : 'd-inline' }}"></span>
Page Content
Expand All @@ -108,23 +112,19 @@ class="nav-link {{ !$has_sections ? 'disabled' : '' }} {{ isset($tabWithError) ?

<div class="tab-content p-0 {{ $col }}">
@foreach ($crud->getTabs() as $k => $tab)
<div role="tabpanel" class="tab-pane {{ isset($tabWithError) ? ($tab == $tabWithError ? ' active' : '') : ($k == 0 ? ' active' : '') }}" id="tab_{{ Str::slug($tab) }}">
<div role="tabpanel" class="tab-pane {{ $tabWithError ? ($tab === $tabWithError ? ' active' : '') : ($k === 0 ? ' active' : '') }}" id="tab_{{ Str::slug($tab) }}">
<div class="row">
@include('crud::inc.show_fields', ['fields' => $crud->getTabFields($tab)])
</div>
</div>
@endforeach

@if ($is_dynamic)
<div role="tabpanel" class="tab-pane" id="tab_page-layout">
<div class="row">
@if ($is_dynamic)
@include('pagebuilder::crud.form.page_editor_dynamic_layout')
@else
@include('pagebuilder::crud.form.page_editor')
@endif
</div>
</div>
@if($is_dynamic)
<div role="tabpanel" class="tab-pane" id="tab_page-layout">
<div class="row">
@include('pagebuilder::crud.form.page_editor_dynamic_layout')
</div>
</div>
@endif

<div role="tabpanel" class="tab-pane" id="tab_page-content">
Expand Down

0 comments on commit e29d4b7

Please sign in to comment.