Skip to content

Commit

Permalink
Move wysiwyg svg sprite declaration at main layout level
Browse files Browse the repository at this point in the history
  • Loading branch information
m4n1ok authored and ifox committed Mar 2, 2020
1 parent 5f798ef commit 6bb6e25
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 42 deletions.
70 changes: 35 additions & 35 deletions views/layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
@if(config('twill.dev_mode', false))
{!! file_get_contents(twillAsset('icons.svg')) !!}
{!! file_get_contents(twillAsset('icons-files.svg')) !!}
{!! file_get_contents(twillAsset('icons-wysiwyg.svg')) !!}
@else
{!! File::exists(public_path(twillAsset('icons.svg'))) ? File::get(public_path(twillAsset('icons.svg'))) : '' !!}
{!! File::exists(public_path(twillAsset('icons-files.svg'))) ? File::get(public_path(twillAsset('icons-files.svg'))) : '' !!}
{!! File::exists(public_path(twillAsset('icons-wysiwyg.svg'))) ? File::get(public_path(twillAsset('icons-wysiwyg.svg'))) : '' !!}
@endif
@stack('svg_sprite')
</div>
@if(config('twill.enabled.search', false))
@partialView(($moduleName ?? null), 'navigation._overlay_navigation', ['search' => true])
Expand All @@ -36,45 +37,44 @@
<transition name="fade_search-overlay" @after-enter="afterAnimate">
<div class="headerSearch__wrapper" :style="positionStyle" v-show="open" v-cloak>
<div class="headerSearch__overlay" :style="positionStyle" @click="toggleSearch"></div>
<a17-search endpoint="{{ route(config('twill.dashboard.search_endpoint')) }}" :open="open" :opened="opened"></a17-search>
</div>
</transition>
</div>
@endif
<a17-search endpoint="{{ route(config('twill.dashboard.search_endpoint')) }}" :open="open"
:opened="opened"></a17-search>
</div>
</transition>
</div>
</header>
@hasSection('primaryNavigation')
@yield('primaryNavigation')
@else
@partialView(($moduleName ?? null), 'navigation._primary_navigation')
@partialView(($moduleName ?? null), 'navigation._breadcrumb')
@partialView(($moduleName ?? null), 'navigation._secondary_navigation')
@endif
<section class="main">
<div class="app" id="app" v-cloak>
@yield('content')
@if (config('twill.enabled.media-library') || config('twill.enabled.file-library'))
<a17-medialibrary ref="mediaLibrary"
:authorized="{{ json_encode(auth('twill_users')->user()->can('upload')) }}" :extra-metadatas="{{ json_encode(array_values(config('twill.media_library.extra_metadatas_fields', []))) }}"
:translatable-metadatas="{{ json_encode(array_values(config('twill.media_library.translatable_metadatas_fields', []))) }}"
></a17-medialibrary>
<a17-dialog ref="warningMediaLibrary" modal-title="Delete media" confirm-label="Delete">
<p class="modal--tiny-title"><strong>Delete media</strong></p>
<p>Are you sure ?<br />This change can't be undone.</p>
</a17-dialog>
@endif
<a17-notif variant="success"></a17-notif>
<a17-notif variant="error"></a17-notif>
<a17-notif variant="info" :auto-hide="false" :important="false"></a17-notif>
<a17-notif variant="warning" :auto-hide="false" :important="false"></a17-notif>
</div>
<div class="appLoader">
</div>
</header>
@hasSection('primaryNavigation')
@yield('primaryNavigation')
@else
@partialView(($moduleName ?? null), 'navigation._primary_navigation')
@partialView(($moduleName ?? null), 'navigation._breadcrumb')
@partialView(($moduleName ?? null), 'navigation._secondary_navigation')
@endif
<section class="main">
<div class="app" id="app" v-cloak>
@yield('content')
@if (config('twill.enabled.media-library') || config('twill.enabled.file-library'))
<a17-medialibrary ref="mediaLibrary"
:authorized="{{ json_encode(auth('twill_users')->user()->can('upload')) }}"
:extra-metadatas="{{ json_encode(array_values(config('twill.media_library.extra_metadatas_fields', []))) }}"
:translatable-metadatas="{{ json_encode(array_values(config('twill.media_library.translatable_metadatas_fields', []))) }}"
></a17-medialibrary>
<a17-dialog ref="warningMediaLibrary" modal-title="Delete media" confirm-label="Delete">
<p class="modal--tiny-title"><strong>Delete media</strong></p>
<p>Are you sure ?<br/>This change can't be undone.</p>
</a17-dialog>
@endif
<a17-notif variant="success"></a17-notif>
<a17-notif variant="error"></a17-notif>
<a17-notif variant="info" :auto-hide="false" :important="false"></a17-notif>
<a17-notif variant="warning" :auto-hide="false" :important="false"></a17-notif>
</div>
<div class="appLoader">
<span>
<span class="loader"><span></span></span>
</span>
</div>
@include('twill::partials.footer')
</section>
</div>
<script>
window['{{ config('twill.js_namespace') }}'] = {};
Expand Down
7 changes: 0 additions & 7 deletions views/partials/form/_wysiwyg.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@
@endpushonce
@endif


@if(File::exists(public_path("/assets/admin/icons/icons-wysiwyg.svg")))
@pushonce('svg_sprite:wysiwyg')
{!! File::get(public_path("/assets/admin/icons/icons-wysiwyg.svg")) !!}
@endpushonce
@endif

@if($wysiwyg === 'quill')
@if($translated)
<a17-locale
Expand Down

0 comments on commit 6bb6e25

Please sign in to comment.