diff --git a/app/CMS/Modules/ServiceProviders/ServiceProvider.php b/app/CMS/Modules/ServiceProviders/ServiceProvider.php index af2b69a6..f73a9f3a 100644 --- a/app/CMS/Modules/ServiceProviders/ServiceProvider.php +++ b/app/CMS/Modules/ServiceProviders/ServiceProvider.php @@ -13,6 +13,7 @@ abstract class ServiceProvider extends LaravelServiceProvider protected $defer = false; protected $alias = false; protected $path = false; + protected $publishViews = true; abstract protected function setModuleAlias(); @@ -59,7 +60,7 @@ abstract class ServiceProvider extends LaravelServiceProvider return $path . '/modules/' . $this->alias; }, \Config::get('view.paths')), [$sourcePath]), $this->alias); - if (is_dir($sourcePath)) { + if (is_dir($sourcePath) && $this->publishViews) { $this->publishes([$sourcePath => $viewPath], 'module-views'); } } diff --git a/resources/assets/admin/js/app.js b/resources/assets/admin/js/app.js index fa203f89..5c2dc532 100644 --- a/resources/assets/admin/js/app.js +++ b/resources/assets/admin/js/app.js @@ -82,7 +82,6 @@ $ (function () { }); }); - function setSameHeights($container) { $container = $container || $ ('.sameheight-container'); @@ -197,7 +196,7 @@ $ (function () { setThemeSettings (); - setSameHeights(); + setSameHeights (); /************************************************ * Events @@ -380,9 +379,18 @@ $ (document).ready (function () { var confirmTitle = $ (this).data ('title'); var confirmMessage = $ (this).data ('message'); - var href = $ (this).attr ('href'); - $ ('#confirm-button').attr ('href', href); + var tag = $ (this).prop ('tagName'); + if (tag === 'A') { + var href = $ (this).attr ('href'); + + $ ('#confirm-button').attr ('href', href); + } else if (tag === 'BUTTON') { + var form = $(this).closest('form'); + $ ('#confirm-button').click (function () { + form.submit(); + }) + } if (confirmTitle) titleElement.text (confirmTitle); @@ -392,7 +400,7 @@ $ (document).ready (function () { $ ('#confirm-modal').modal ('show'); - $('.main-wrapper').addClass('blur'); + $ ('.main-wrapper').addClass ('blur'); e.preventDefault (); }); @@ -400,7 +408,7 @@ $ (document).ready (function () { $ ('#confirm-modal').on ('hidden.bs.modal', function () { $ ('#confirmation-title').text (previousTitle); $ ('#confirmation-message').text (previousMessage); - $('.main-wrapper').removeClass('blur'); + $ ('.main-wrapper').removeClass ('blur'); }); $ ('#lockUrl').change (function () { @@ -433,24 +441,24 @@ $ (document).ready (function () { $ ("#" + tabCard.prop ('id') + "-tab").addClass ('tab-with-error'); }); - $('#removeTitlePhoto').click(function () { - $('#titlePhotoContainer').remove(); + $ ('#removeTitlePhoto').click (function () { + $ ('#titlePhotoContainer').remove (); // $('existingTitlePhoto').val(null); }); - $('form').areYouSure(); + $ ('form').areYouSure (); }); -$('.checkbox').change(function() { - var e = $(this); - var checked = e.is(':checked'); - var id = e.data('id'); +$ ('.checkbox').change (function () { + var e = $ (this); + var checked = e.is (':checked'); + var id = e.data ('id'); - $('.child-'+id).prop('checked', checked); + $ ('.child-' + id).prop ('checked', checked); // check also parent - if (e.hasClass('child-checkbox') && checked){ - var parent = e.data('parent'); - $('#checkbox-parent-'+parent).prop('checked', true); + if (e.hasClass ('child-checkbox') && checked) { + var parent = e.data ('parent'); + $ ('#checkbox-parent-' + parent).prop ('checked', true); } }); \ No newline at end of file diff --git a/resources/assets/sass/admin/_common/items-list.scss b/resources/assets/sass/admin/_common/items-list.scss index 7b1a00f4..239d417d 100644 --- a/resources/assets/sass/admin/_common/items-list.scss +++ b/resources/assets/sass/admin/_common/items-list.scss @@ -24,13 +24,14 @@ display: flex; flex-flow: column nowrap; +} - &.striped { - & > div { + .striped { + & > div, & tr { border-bottom: 1px solid $item-list-color-border; } - & > div:nth-child(2n + 1) { + & > div:nth-child(2n + 1), & tr:nth-child(2n + 1) { background-color: lighten($color-divider, 12%); @include media-down(sm) { @@ -42,7 +43,6 @@ border-bottom: none; } } -} /* ******************************************* * Item general styles diff --git a/resources/views/admin/snippets/buttons/delete.blade.php b/resources/views/admin/snippets/buttons/delete.blade.php new file mode 100644 index 00000000..8fee6356 --- /dev/null +++ b/resources/views/admin/snippets/buttons/delete.blade.php @@ -0,0 +1,6 @@ +
+ {!! csrf_field() !!} + {!! method_field('DELETE') !!} + + +
\ No newline at end of file