diff --git a/composer.json b/composer.json index ff2c39e..71e9aac 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,27 @@ { - "name": "backpack/theme-coreuiv2", - "description": "UI that uses CoreUI v2 and Bootstrap v4, provided as a legacy theme for Backpack v6.", + "name": "backpack/theme-coreuiv4", + "description": "UI for Backpack v6 that uses CoreUI v4 and Bootstrap v5.", "license": "MIT", "authors": [ { "name": "Cristian Tabacitu", "email": "hello@backpackforlaravel.com", "homepage": "https://backpackforlaravel.com" + }, + { + "name": "Antonio Almeida", + "email": "promatik@gmail.com", + "homepage": "https://backpackforlaravel.com" + }, + { + "name": "Mauro Martinez", + "email": "maurohmartinez@gmail.com", + "homepage": "https://backpackforlaravel.com" } ], - "homepage": "https://github.com/backpack/theme-coreuiv2", + "homepage": "https://github.com/backpack/theme-coreuiv4", "keywords": [ - "Laravel", "Backpack", "Backpack for Laravel", "Backpack Addon", "ThemeCoreuiv2" + "Laravel", "Backpack", "Backpack for Laravel", "Backpack Addon", "ThemeCoreuiv4" ], "require": { "illuminate/support": "~8|~9", @@ -23,12 +33,12 @@ }, "autoload": { "psr-4": { - "Backpack\\ThemeCoreuiv2\\": "src/" + "Backpack\\ThemeCoreuiv4\\": "src/" } }, "autoload-dev": { "psr-4": { - "Backpack\\ThemeCoreuiv2\\Tests\\": "tests" + "Backpack\\ThemeCoreuiv4\\Tests\\": "tests" } }, "scripts": { @@ -37,7 +47,7 @@ "extra": { "laravel": { "providers": [ - "Backpack\\ThemeCoreuiv2\\AddonServiceProvider" + "Backpack\\ThemeCoreuiv4\\AddonServiceProvider" ] } } diff --git a/config/theme-coreuiv2.php b/config/theme-coreuiv2.php deleted file mode 100644 index 035fcd5..0000000 --- a/config/theme-coreuiv2.php +++ /dev/null @@ -1,5 +0,0 @@ - [ + + 'header' => 'app-header bg-light border-0 navbar', + // For background colors use: bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan, bg-white + // For links to be visible on different background colors use: "navbar-dark", "navbar-light", "navbar-color" + + 'body' => 'app aside-menu-fixed sidebar-lg-show', + // Try sidebar-hidden, sidebar-fixed, sidebar-compact, sidebar-lg-show + + 'sidebar' => 'sidebar sidebar-pills bg-light', + // Remove "sidebar-transparent" for standard sidebar look + // Try "sidebar-light" or "sidebar-dark" for dark/light links + // You can also add a background class like bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan + + 'footer' => 'app-footer d-print-none', + // hide it with d-none + // change background color with bg-dark, bg-primary, bg-secondary, bg-danger, bg-warning, bg-success, bg-info, bg-blue, bg-light-blue, bg-indigo, bg-purple, bg-pink, bg-red, bg-orange, bg-yellow, bg-green, bg-teal, bg-cyan, bg-white + + ] + +]; \ No newline at end of file diff --git a/readme.md b/readme.md index 7b7c845..ffa77e3 100644 --- a/readme.md +++ b/readme.md @@ -1,18 +1,12 @@ -# Theme CoreUI v2 +# Theme CoreUI v4 [![Latest Version on Packagist][ico-version]][link-packagist] [![Total Downloads][ico-downloads]][link-downloads] [![The Whole Fruit Manifesto](https://img.shields.io/badge/writing%20standard-the%20whole%20fruit-brightgreen)](https://github.com/the-whole-fruit/manifesto) -This package provides a Theme for the [Backpack for Laravel](https://backpackforlaravel.com/) administration panel, that uses CoreUI v2 and implicitly Bootstrap v4. As a UI (aka UI kit, aka admin panel template) it looks and works as seen on https://backstrap.net/ - as it is a customized version of CoreUI v2. +This package provides a Theme for the [Backpack for Laravel](https://backpackforlaravel.com/) administration panel, that uses [CoreUI v4](https://coreui.io/product/free-bootstrap-admin-template/) and implicitly Bootstrap v5. All esthetic customizations on top of CoreUI are done in separate CSS files, which can be easily edited if you don't like them. -It has been launched in 2021 as part of Backpack's core. In 2023 it has been sparated into this package, as a way to provide 100% backwards-compatibility, for whoever doesn't want to upgrade to the newer themes, like CoreUI v4 and Tabler. - -Why would anybody NOT want to upgrade? Well... because some developers: -- have to support IE; and while Bootstrap v5 is better in every way... it does drop support for IE; -- have customized their blade files so much, that it's impossible to upgrade; - -If you're one of the developers above, fear not... this package offers a way for you to upgrade your project to Backpack v6... while not rocking the boat too much. Please keep in mind we DO NOT plan to add any more features to this theme. It's just here as a crutch for people who can't upgrade. +The file structure inside this package is the same as CoreUI v2, which is the same as Backpack v3, v4 and v5. If you want to upgrade to Bootstrap v5 and a modern theme, but you've heavily customized your blade files... this theme will be the easiest to upgrade to. ## Screenshots @@ -24,14 +18,14 @@ If you're one of the developers above, fear not... this package offers a way for **Step 1.** Install via Composer ``` bash -composer require backpack/theme-coreuiv2 +composer require backpack/theme-coreuiv4 ``` **Step 2.** Go to `config/backpack/base.php` and change your view namespace: ```diff - 'view_namespace' => 'backpack::', -+ 'view_namespace' => 'backpack.theme-coreuiv2::', ++ 'view_namespace' => 'backpack.theme-coreuiv4::', ``` ## Overriding @@ -42,15 +36,15 @@ The more files you copy-paste and customize, the more difficult it will be to up ```bash # create the custom directory if it's not already there -mkdir -p resources/views/vendor/backpack/theme-coreuiv2 +mkdir -p resources/views/vendor/backpack/theme-coreuiv4 # copy the blade file inside the folder we created above -cp -i vendor/backpack/theme-coreuiv2/src/resources/views/dashboard.blade.php resources/views/vendor/backpack/theme-coreuiv2/dashboard.blade.php +cp -i vendor/backpack/theme-coreuiv4/src/resources/views/dashboard.blade.php resources/views/vendor/backpack/theme-coreuiv4/dashboard.blade.php ``` ## Change log -Changes are documented here on Github. Please see the [Releases tab](https://github.com/backpack/theme-coreuiv2/releases). +Changes are documented here on Github. Please see the [Releases tab](https://github.com/backpack/theme-coreuiv4/releases). ## Contributing @@ -69,10 +63,10 @@ If you discover any security related issues, please email hello@backpackforlarav This project was released under MIT, so you can install it on top of any Backpack & Laravel project. Please see the [license file](license.md) for more information. -[ico-version]: https://img.shields.io/packagist/v/backpack/theme-coreuiv2.svg?style=flat-square -[ico-downloads]: https://img.shields.io/packagist/dt/backpack/theme-coreuiv2.svg?style=flat-square +[ico-version]: https://img.shields.io/packagist/v/backpack/theme-coreuiv4.svg?style=flat-square +[ico-downloads]: https://img.shields.io/packagist/dt/backpack/theme-coreuiv4.svg?style=flat-square -[link-packagist]: https://packagist.org/packages/backpack/theme-coreuiv2 -[link-downloads]: https://packagist.org/packages/backpack/theme-coreuiv2 +[link-packagist]: https://packagist.org/packages/backpack/theme-coreuiv4 +[link-downloads]: https://packagist.org/packages/backpack/theme-coreuiv4 [link-author]: https://github.com/backpack [link-contributors]: ../../contributors diff --git a/resources/assets/css/common.css b/resources/assets/css/common.css new file mode 100644 index 0000000..836aab3 --- /dev/null +++ b/resources/assets/css/common.css @@ -0,0 +1,474 @@ +:root { + --table-row-hover: #f2f1ff; +} + +.sidebar .nav-dropdown-items .nav-dropdown { + padding: 0 0 0 .8rem; +} + +.sidebar .nav-dropdown-items .nav-dropdown:not(.open) > a { + font-weight: normal !important; +} + +[dir="rtl"] .sidebar .nav-dropdown-items .nav-dropdown { + padding: 0 .8rem 0 0; +} + +form .form-group.required > label:not(:empty):not(.form-check-label)::after { + content: ' *'; + color: #ff0000; +} + +form .help-block { + margin-top: .25rem; + margin-bottom: .25rem; + color: #73818f; + font-size: 0.9em; +} + +form .nav-tabs .nav-link:hover { + color: #384c74; +} + +form .select2-container--bootstrap .select2-selection--single { + padding-top: 8px; + padding-bottom: 8px; + min-height: 38px; +} + +form .select2-container--bootstrap .select2-selection--multiple { + min-height: 38px; +} + +form .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field { + min-height: 36px; +} + +form .select2-container--bootstrap .select2-selection--multiple .select2-selection__choice { + margin-top: 6px; +} + +form .select2-container--bootstrap .select2-selection--multiple .select2-selection__clear { + margin-top: 8px; +} + +form .select2-container--bootstrap .select2-selection { + border: none !important; +} + +form .select2.select2-container { + border: 1px solid rgba(0, 40, 100, 0.12) !important; +} + +/*Table - List View*/ +#crudTable_wrapper tfoot tr { + font-size: .625rem; + font-weight: var(--tblr-font-weight-bold); + text-transform: uppercase; + letter-spacing: .04em; + line-height: 1rem; + color: var(--tblr-muted); +} + +#crudTable_wrapper div.row .col-sm-12 { + position: relative; +} + +#crudTable_processing.dataTables_processing.card { + all: unset; + position: absolute; + background: rgba(255, 255, 255, 0.9); + height: calc(100% - 6px); + width: calc(100% - 20px); + top: 0; + left: 10px; + z-index: 999; + border-radius: 5px; +} + +#crudTable_processing.dataTables_processing.card > img { + margin: 0; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +#crudTable_processing.dataTables_processing.card > div { + display: none !important; +} + +#crudTable_wrapper #crudTable, +#crudTable_wrapper table.dataTable { + margin-top: 0 !important; +} + +#crudTable_wrapper #crudTable.dtr-inline.collapsed > tbody > tr > .dtr-control:before, +#crudTable_wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > .dtr-control:before { + background-color: transparent; + color: #636161; + font-family: "Line Awesome Free"; + font-weight: 900; + width: 16px; + content: "\f142"; + font-size: 21px; + box-shadow: none; + border: none; + display: inline; + position: relative; + top: 0; + left: 0; + margin: 0 0 0 -0.25rem; +} + +#crudTable_wrapper #crudTable .sorting:before, +#crudTable_wrapper #crudTable .sorting_asc:before, +#crudTable_wrapper #crudTable .sorting_desc:before, +#crudTable_wrapper #crudTable .sorting_asc_disabled:before, +#crudTable_wrapper #crudTable .sorting_desc_disabled:before, +#crudTable_wrapper table.dataTable .sorting:before, +#crudTable_wrapper table.dataTable .sorting_asc:before, +#crudTable_wrapper table.dataTable .sorting_desc:before, +#crudTable_wrapper table.dataTable .sorting_asc_disabled:before, +#crudTable_wrapper table.dataTable .sorting_desc_disabled:before { + right: 0.4em; + top: 1em; + content: "\f0d8"; + font: normal normal normal 14px/1 "Line Awesome Free"; + font-weight: 900; +} + +#crudTable_wrapper #crudTable .sorting:after, +#crudTable_wrapper #crudTable .sorting_asc:after, +#crudTable_wrapper #crudTable .sorting_desc:after, +#crudTable_wrapper #crudTable .sorting_asc_disabled:after, +#crudTable_wrapper #crudTable .sorting_desc_disabled:after, +#crudTable_wrapper table.dataTable .sorting:after, +#crudTable_wrapper table.dataTable .sorting_asc:after, +#crudTable_wrapper table.dataTable .sorting_desc:after, +#crudTable_wrapper table.dataTable .sorting_asc_disabled:after, +#crudTable_wrapper table.dataTable .sorting_desc_disabled:after { + right: 0.4em; + content: "\f0d7"; + font: normal normal normal 14px/1 "Line Awesome Free"; + font-weight: 900; +} + +#crudTable_wrapper #crudTable .crud_bulk_actions_checkbox, +#crudTable_wrapper table.dataTable .crud_bulk_actions_checkbox { + display: flex; + margin: 0 0.6rem 0 0.45rem; +} + +#crudTable_wrapper #crudTable tr th:first-child, +#crudTable_wrapper #crudTable tr td:first-child, +#crudTable_wrapper table.dataTable tr th:first-child, +#crudTable_wrapper table.dataTable tr td:first-child { + display: flex; + align-items: center; + padding-top: 1rem !important; + padding-bottom: 1rem !important; + padding-left: 0.6rem !important; +} + +#crudTable_wrapper .dt-buttons .dt-button-collection, +#crudTable_wrapper tr td .btn-group .dropdown-menu { + max-height: 340px; + overflow-y: auto; +} + +#crudTable_wrapper .dt-buttons .dt-button-collection { + padding: 0; + border: 0; +} + +/*/Table - List View/*/ +.navbar-filters { + min-height: 25px; + border-radius: 0; + margin-bottom: 6px; + margin-top: 0; + background: transparent; + border-color: #f4f4f4; + border: none; +} + +.navbar-filters .navbar-collapse { + padding: 0; + border: 0; +} + +.navbar-filters .navbar-toggle { + padding: 10px 15px; + border-radius: 0; +} + +.navbar-filters .navbar-brand { + height: 25px; + padding: 5px 15px; + font-size: 14px; + text-transform: uppercase; +} + +.navbar-filters li { + margin: 0 2px; +} + +.navbar-filters li > a { + border-radius: 2px; +} + +.navbar-filters li > a:active, +.navbar-filters .navbar-nav > .active > a, +.navbar-filters .navbar-nav > .active > a:focus, +.navbar-filters .navbar-nav > .active > a:hover, +.navbar-filters .navbar-nav > .open > a, +.navbar-filters .navbar-nav > .open > a:focus, +.navbar-filters .navbar-nav > .open > a:hover { + background-color: #e4e7ea; + border-radius: 3px; +} + +.navbar-filters .nav.navbar-nav { + float: none; +} + +.navbar-filters .backpack-filter label { + color: #868686; + font-weight: 600; + text-transform: uppercase; +} + +@media (min-width: 768px) { + .navbar-filters .navbar-nav > li > a { + padding-top: 5px; + padding-bottom: 5px; + } +} + +@media (max-width: 768px) { + .navbar-filters .navbar-nav { + margin: 0; + } +} + +.dataTables_filter { + text-align: right; +} + +.dataTables_filter label { + font-weight: normal; + white-space: nowrap; + text-align: left; +} + +.dataTables_filter input { + display: inline-block; + width: auto; + border-radius: 25px; +} + +@media (max-width: 576px) { + .dataTables_filter label { + width: 100%; + } + + .dataTables_filter input[type="search"] { + width: 100%; + } +} + +.pagination > .disabled > a, +.pagination > .disabled > a:focus, +.pagination > .disabled > a:hover, +.pagination > .disabled > span, +.pagination > .disabled > span:focus, +.pagination > .disabled > span:hover { + background: transparent; +} + +.pagination > li > a { + background: transparent; + border: none; + border-radius: 5px; +} + +.pagination > li > span:hover { + background: white; +} + +.pagination > li:last-child > a, +.pagination > li:last-child > span, +.pagination > li:first-child > a, +.pagination > li:first-child > span { + border-radius: 5px; +} + +.box-body.table-responsive { + padding-left: 15px; + padding-right: 15px; +} + +.dt-buttons, +.modal .details-control { + display: none; +} + +.dtr-bs-modal .modal-body { + padding: 0; +} + +.dtr-bs-modal .crud_bulk_actions_checkbox { + display: none; +} + +.content-wrapper { + min-height: calc(100% - 98px); +} + +.fixed .wrapper { + overflow: visible; +} + +/* SELECT 2 */ +.select2-container--bootstrap .select2-selection { + box-shadow: none !important; + -webkit-box-shadow: none !important; + border: 1px solid rgba(0, 40, 100, 0.12) !important; +} + +.select2-container--bootstrap.select2-container--focus .select2-selection, +.select2-container--bootstrap.select2-container--open .select2-selection { + box-shadow: none !important; + -webkit-box-shadow: none !important; +} + +.select2-container--bootstrap .select2-dropdown { + border-color: rgba(0, 40, 100, 0.12) !important; +} + +/* PACE JS */ +.pace { + -webkit-pointer-events: none; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.pace-inactive { + display: none; +} + +.pace .pace-progress { + background: var(--tblr-primary); + position: fixed; + z-index: 2000; + top: 0; + right: 100%; + width: 100%; + height: 2px; +} + +.alert a.alert-link { + color: inherit !important; + font-weight: 400; + text-decoration: underline !important; +} + +/*# sourceMappingURL=backstrap.css.map */ +.noty_theme__backstrap.noty_bar { + margin: 4px 0; + overflow: hidden; + position: relative; + border: 1px solid transparent; + border-radius: .25rem; +} + +.noty_theme__backstrap.noty_bar .noty_body { + padding: .75rem 1.25rem; + font-weight: 300; +} + +.noty_theme__backstrap.noty_bar .noty_buttons { + padding: 10px; +} + +.noty_theme__backstrap.noty_bar .noty_close_button { + font-size: 1.5rem; + font-weight: 700; + line-height: 1; + color: #161C2D; + text-shadow: 0 1px 0 #FFFFFF; + filter: alpha(opacity=20); + opacity: .5; + background: transparent; +} + +.noty_theme__backstrap.noty_bar .noty_close_button:hover { + background: transparent; + text-decoration: none; + cursor: pointer; + filter: alpha(opacity=50); + opacity: .75; +} + +.noty_theme__backstrap.noty_type__note, +.noty_theme__backstrap.noty_type__notice, +.noty_theme__backstrap.noty_type__alert, +.noty_theme__backstrap.noty_type__notification { + background-color: #FFFFFF; + color: inherit; +} + +.noty_theme__backstrap.noty_type__warning { + color: #F9FBFD; + background-color: #ffc107; + border-color: #d39e00; +} + +.noty_theme__backstrap.noty_type__danger, +.noty_theme__backstrap.noty_type__error { + color: #F9FBFD; + background-color: #df4759; + border-color: #cf2438; +} + +.noty_theme__backstrap.noty_type__info, +.noty_theme__backstrap.noty_type__information { + color: #F9FBFD; + background-color: #467FD0; + border-color: #2e66b5; +} + +.noty_theme__backstrap.noty_type__success { + color: #F9FBFD; + background-color: #42ba96; + border-color: #359478; +} + +.noty_theme__backstrap.noty_type__primary { + color: #F9FBFD; + background-color: #7c69ef; + border-color: #543bea; +} + +.noty_theme__backstrap.noty_type__secondary { + color: #161C2D; + background-color: #D9E2EF; + border-color: #b5c7e0; +} + +.noty_theme__backstrap.noty_type__light { + color: #161C2D; + background-color: #F1F4F8; + border-color: #cfd9e7; +} + +.noty_theme__backstrap.noty_type__dark { + color: #F9FBFD; + background-color: #161C2D; + border-color: #05070b; +} + +/*# sourceMappingURL=style.css.map */ \ No newline at end of file diff --git a/resources/assets/css/coreui4.css b/resources/assets/css/coreui4.css new file mode 100644 index 0000000..619d894 --- /dev/null +++ b/resources/assets/css/coreui4.css @@ -0,0 +1,219 @@ +:root { + --bs-primary: #7c69ef; + --cui-primary: #7c69ef; + --cui-link-color: #7c69ef; + --cui-link-hover-color: #6852ed; + --cui-primary-rgb: 124, 105, 239; + + --cui-input-group-addon-bg: #f9fbfd; + --cui-input-group-addon-border-color: #0028641f; + --cui-input-border-color: #0028641f; + + --cui-form-check-input-checked-bg-color: #7c69ef; + --cui-form-check-input-checked-border-color: #7c69ef; + + --cui-sidebar-1: #5c4fa9; + --cui-sidebar-2: #2c2950; +} + +body { + background-color: #f1f4f8; + font-size: 90%; +} + +.header { + --cui-header-bg: transparent; + --cui-header-border: transparent; +} + +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +.btn-link { + text-decoration: none; +} +.btn-primary { + --cui-btn-bg: #7c69ef; + --cui-btn-border-color: #7c69ef; + --cui-btn-hover-bg: #6852ed; + --cui-btn-hover-border-color: #6852ed; + --cui-btn-active-bg: #6852ed; + --cui-btn-active-border-color: #6852ed; + --cui-btn-disabled-bg: #7c69ef; + --cui-btn-disabled-border-color: #7c69ef; +} +.pagination { + --cui-pagination-bg: #fff; + --cui-pagination-focus-bg: #6852ed; + --cui-pagination-active-bg: #7c69ef; + --cui-pagination-active-border-color: #7c69ef; +} +.card, +.form-group { + margin-bottom: 1.5rem; +} +.form-control, .input-group-text { + border-radius: 0.2rem; +} +.form-group > label { + font-weight: bold; +} +.form-switch > [type="checkbox"] { + transform: scale(1.2); +} + +a.btn:hover, li.paginate_button a { + text-decoration: none !important; +} + +#sidebar.bg-dark-gradient { + background: var(--cui-sidebar-2); + background: linear-gradient(0deg, var(--cui-sidebar-1) 0%, var(--cui-sidebar-2) 100%); +} + +#crudTable { + background-color: #FFFFFF !important; +} + +#crudTable_wrapper .dataTables_length select { + min-width: 3.6rem; + margin-right: 0.4rem; +} + +#crudTable_wrapper #crudTable.dtr-inline.collapsed > tbody > tr > .dtr-control:before, +#crudTable_wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > .dtr-control:before { + top: 0; +} + +#crudTable_wrapper #crudTable td, +#crudTable_wrapper #crudTable th, +#crudTable_wrapper table.dataTable td, +#crudTable_wrapper table.dataTable th { + outline: none; + vertical-align: middle; + line-height: 1em; +} + +#crudTable_wrapper #crudTable thead > tr > th:not(.sorting_disabled), +#crudTable_wrapper #crudTable thead > tr > td, +#crudTable_wrapper table.dataTable thead > tr > th:not(.sorting_disabled), +#crudTable_wrapper table.dataTable thead > tr > td { + padding-right: 30px; +} + +#crudTable_wrapper #crudTable.has-hidden-columns .details-control, +#crudTable_wrapper table.dataTable.has-hidden-columns .details-control { + margin-left: 0.25rem; +} + +#crudTable_wrapper #crudTable[data-has-bulk-actions="1"].has-hidden-columns thead tr th:first-child, +#crudTable_wrapper #crudTable[data-has-bulk-actions="1"].has-hidden-columns tfoot tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="1"].has-hidden-columns thead tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="1"].has-hidden-columns tfoot tr th:first-child { + padding-left: 1.35rem !important; +} + +#crudTable_wrapper #crudTable[data-has-bulk-actions="1"][data-has-details-row="1"] thead tr th:first-child, +#crudTable_wrapper #crudTable[data-has-bulk-actions="1"][data-has-details-row="1"] tfoot tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="1"][data-has-details-row="1"] thead tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="1"][data-has-details-row="1"] tfoot tr th:first-child { + padding-left: 1.6rem !important; +} + +#crudTable_wrapper #crudTable[data-has-bulk-actions="1"][data-has-details-row="1"].has-hidden-columns thead tr th:first-child, +#crudTable_wrapper #crudTable[data-has-bulk-actions="1"][data-has-details-row="1"].has-hidden-columns tfoot tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="1"][data-has-details-row="1"].has-hidden-columns thead tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="1"][data-has-details-row="1"].has-hidden-columns tfoot tr th:first-child { + padding-left: 2.6rem !important; +} + +#crudTable_wrapper #crudTable[data-has-bulk-actions="0"][data-has-details-row="1"] thead tr th:first-child, +#crudTable_wrapper #crudTable[data-has-bulk-actions="0"][data-has-details-row="1"] tfoot tr th:first-child, #crudTable_wrapper #crudTable[data-has-bulk-actions="0"].has-hidden-columns thead tr th:first-child, +#crudTable_wrapper #crudTable[data-has-bulk-actions="0"].has-hidden-columns tfoot tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="0"][data-has-details-row="1"] thead tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="0"][data-has-details-row="1"] tfoot tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="0"].has-hidden-columns thead tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="0"].has-hidden-columns tfoot tr th:first-child { + padding-left: 1.8rem !important; +} + +#crudTable_wrapper #crudTable[data-has-bulk-actions="0"][data-has-details-row="1"].has-hidden-columns thead tr th:first-child, +#crudTable_wrapper #crudTable[data-has-bulk-actions="0"][data-has-details-row="1"].has-hidden-columns tfoot tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="0"][data-has-details-row="1"].has-hidden-columns thead tr th:first-child, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="0"][data-has-details-row="1"].has-hidden-columns tfoot tr th:first-child { + padding-left: 3rem !important; +} + +#crudTable_wrapper #crudTable .details-control, +#crudTable_wrapper table.dataTable .details-control { + display: flex; +} + +#crudTable_wrapper #crudTable .crud_bulk_actions_checkbox input, +#crudTable_wrapper table.dataTable .crud_bulk_actions_checkbox input { + width: 1rem; + height: 1rem; +} + +#crudTable_wrapper #crudTable:not(.has-hidden-columns) tr td:first-child, +#crudTable_wrapper table.dataTable:not(.has-hidden-columns) tr td:first-child { + padding-top: 1.25rem !important; + padding-bottom: 1.25rem !important; +} + +#crudTable_wrapper #crudTable[data-has-bulk-actions="0"] .details-control, +#crudTable_wrapper #crudTable[data-has-bulk-actions="0"][data-has-details-row="0"] .dtr-control:before, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="0"] .details-control, +#crudTable_wrapper table.dataTable[data-has-bulk-actions="0"][data-has-details-row="0"] .dtr-control:before { + margin-right: 0.4rem !important; +} + +#crudTable_wrapper #crudTable[data-responsive-table="0"] thead tr th, +#crudTable_wrapper #crudTable tr td.dataTables_empty, +#crudTable_wrapper #crudTable tr.dt-hasChild + tr td, +#crudTable_wrapper table.dataTable[data-responsive-table="0"] thead tr th, +#crudTable_wrapper table.dataTable tr td.dataTables_empty, +#crudTable_wrapper table.dataTable tr.dt-hasChild + tr td { + display: table-cell; +} + +#crudTable_wrapper .dataTables_scrollBody #crudTable[data-responsive-table="0"] tr th:first-child { + padding-top: 0 !important; + padding-bottom: 0 !important; +} + +table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1):hover { + background-color: rgba(124, 105, 239, 0.1); +} + +.table-hover tbody tr:hover { + background-color: var(--table-row-hover) !important; +} + +/* Headers for operations */ +.main .container-fluid h2 small { + font-size: .5em; + font-weight: 400; +} + +form .select2.select2-container.select2-container--focus, +form .select2.select2-container.select2-container--open { + background-color: #fff; + border: 1px solid var(--primary, #9080f1) !important; + box-shadow: 0 0 0 2px #e1dcfb; + color: #495057; + outline: 0; + border-radius: 4px; +} + +/* Create/Update Operations (Backpack forms) */ + +.tab-container .tab-pane { + background-color: #fff; + padding: 1rem; + border: var(--cui-border-width) var(--cui-border-style) var(--cui-border-color)!important; +} \ No newline at end of file diff --git a/resources/assets/libs/jquery.mjs.nestedSortable2.js b/resources/assets/libs/jquery.mjs.nestedSortable2.js new file mode 100644 index 0000000..07151dd --- /dev/null +++ b/resources/assets/libs/jquery.mjs.nestedSortable2.js @@ -0,0 +1,904 @@ +/* + * jQuery UI Nested Sortable + * v 2.0 / 29 oct 2012 + * http://mjsarfatti.com/sandbox/nestedSortable + * + * Depends on: + * jquery.ui.sortable.js 1.10+ + * + * Copyright (c) 2010-2013 Manuele J Sarfatti + * Licensed under the MIT License + * http://www.opensource.org/licenses/mit-license.php + */ +(function( factory ) { + "use strict"; + + var define = window.define; + + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ + "jquery", + "jquery-ui/sortable" + ], factory ); + } else { + + // Browser globals + factory( window.jQuery ); + } +}(function($) { + "use strict"; + + function isOverAxis( x, reference, size ) { + return ( x > reference ) && ( x < ( reference + size ) ); + } + + $.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, { + + options: { + disableParentChange: false, + doNotClear: false, + expandOnHover: 700, + isAllowed: function() { return true; }, + isTree: false, + listType: "ol", + maxLevels: 0, + protectRoot: false, + rootID: null, + rtl: false, + startCollapsed: false, + tabSize: 20, + + branchClass: "mjs-nestedSortable-branch", + collapsedClass: "mjs-nestedSortable-collapsed", + disableNestingClass: "mjs-nestedSortable-no-nesting", + errorClass: "mjs-nestedSortable-error", + expandedClass: "mjs-nestedSortable-expanded", + hoveringClass: "mjs-nestedSortable-hovering", + leafClass: "mjs-nestedSortable-leaf", + disabledClass: "mjs-nestedSortable-disabled" + }, + + _create: function() { + var self = this, + err; + + this.element.data("ui-sortable", this.element.data("mjs-nestedSortable")); + + // mjs - prevent browser from freezing if the HTML is not correct + if (!this.element.is(this.options.listType)) { + err = "nestedSortable: " + + "Please check that the listType option is set to your actual list type"; + + throw new Error(err); + } + + // if we have a tree with expanding/collapsing functionality, + // force 'intersect' tolerance method + if (this.options.isTree && this.options.expandOnHover) { + this.options.tolerance = "intersect"; + } + + $.ui.sortable.prototype._create.apply(this, arguments); + + // prepare the tree by applying the right classes + // (the CSS is responsible for actual hide/show functionality) + if (this.options.isTree) { + $(this.items).each(function() { + var $li = this.item, + hasCollapsedClass = $li.hasClass(self.options.collapsedClass), + hasExpandedClass = $li.hasClass(self.options.expandedClass); + + if ($li.children(self.options.listType).length) { + $li.addClass(self.options.branchClass); + // expand/collapse class only if they have children + + if ( !hasCollapsedClass && !hasExpandedClass ) { + if (self.options.startCollapsed) { + $li.addClass(self.options.collapsedClass); + } else { + $li.addClass(self.options.expandedClass); + } + } + } else { + $li.addClass(self.options.leafClass); + } + }); + } + }, + + _destroy: function() { + this.element + .removeData("mjs-nestedSortable") + .removeData("ui-sortable"); + return $.ui.sortable.prototype._destroy.apply(this, arguments); + }, + + _mouseDrag: function(event) { + var i, + item, + itemElement, + intersection, + self = this, + o = this.options, + scrolled = false, + $document = $(document), + previousTopOffset, + parentItem, + level, + childLevels, + itemAfter, + itemBefore, + newList, + method, + a, + previousItem, + nextItem, + helperIsNotSibling; + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if (this.options.scroll) { + if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { + + if ( + ( + this.overflowOffset.top + + this.scrollParent[0].offsetHeight + ) - + event.pageY < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollTop() + o.scrollSpeed; + this.scrollParent.scrollTop(scrolled); + } else if ( + event.pageY - + this.overflowOffset.top < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollTop() - o.scrollSpeed; + this.scrollParent.scrollTop(scrolled); + } + + if ( + ( + this.overflowOffset.left + + this.scrollParent[0].offsetWidth + ) - + event.pageX < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollLeft() + o.scrollSpeed; + this.scrollParent.scrollLeft(scrolled); + } else if ( + event.pageX - + this.overflowOffset.left < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollLeft() - o.scrollSpeed; + this.scrollParent.scrollLeft(scrolled); + } + + } else { + + if ( + event.pageY - + $document.scrollTop() < + o.scrollSensitivity + ) { + scrolled = $document.scrollTop() - o.scrollSpeed; + $document.scrollTop(scrolled); + } else if ( + $(window).height() - + ( + event.pageY - + $document.scrollTop() + ) < + o.scrollSensitivity + ) { + scrolled = $document.scrollTop() + o.scrollSpeed; + $document.scrollTop(scrolled); + } + + if ( + event.pageX - + $document.scrollLeft() < + o.scrollSensitivity + ) { + scrolled = $document.scrollLeft() - o.scrollSpeed; + $document.scrollLeft(scrolled); + } else if ( + $(window).width() - + ( + event.pageX - + $document.scrollLeft() + ) < + o.scrollSensitivity + ) { + scrolled = $document.scrollLeft() + o.scrollSpeed; + $document.scrollLeft(scrolled); + } + + } + + if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { + $.ui.ddmanager.prepareOffsets(this, event); + } + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + // mjs - find the top offset before rearrangement, + previousTopOffset = this.placeholder.offset().top; + + //Set the helper position + if (!this.options.axis || this.options.axis !== "y") { + this.helper[0].style.left = this.position.left + "px"; + } + if (!this.options.axis || this.options.axis !== "x") { + this.helper[0].style.top = (this.position.top) + "px"; + } + + // mjs - check and reset hovering state at each cycle + this.hovering = this.hovering ? this.hovering : null; + this.mouseentered = this.mouseentered ? this.mouseentered : false; + + // mjs - let's start caching some variables + (function() { + var _parentItem = this.placeholder.parent().parent(); + if (_parentItem && _parentItem.closest(".ui-sortable").length) { + parentItem = _parentItem; + } + }.call(this)); + + level = this._getLevel(this.placeholder); + childLevels = this._getChildLevels(this.helper); + newList = document.createElement(o.listType); + + // dragDirection object is required by jquery.ui.sortable.js 1.13+ + this.dragDirection = { + vertical: this._getDragVerticalDirection(), + horizontal: this._getDragHorizontalDirection() + }; + + //Rearrange + for (i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + item = this.items[i]; + itemElement = item.item[0]; + intersection = this._intersectsWithPointer(item); + if (!intersection) { + continue; + } + + // Only put the placeholder inside the current Container, skip all + // items form other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this moving items in "sub-sortables" can cause the placeholder to jitter + // beetween the outer and inner container. + if (item.instance !== this.currentContainer) { + continue; + } + + // No action if intersected item is disabled + // and the element above or below in the direction we're going is also disabled + if (itemElement.className.indexOf(o.disabledClass) !== -1) { + // Note: intersection hardcoded direction values from + // jquery.ui.sortable.js:_intersectsWithPointer + if (intersection === 2) { + // Going down + itemAfter = this.items[i + 1]; + if (itemAfter && itemAfter.item.hasClass(o.disabledClass)) { + continue; + } + + } else if (intersection === 1) { + // Going up + itemBefore = this.items[i - 1]; + if (itemBefore && itemBefore.item.hasClass(o.disabledClass)) { + continue; + } + } + } + + method = intersection === 1 ? "next" : "prev"; + + // cannot intersect with itself + // no useless actions that have been done before + // no action if the item moved is the parent of the item checked + if (itemElement !== this.currentItem[0] && + this.placeholder[method]()[0] !== itemElement && + !$.contains(this.placeholder[0], itemElement) && + ( + this.options.type === "semi-dynamic" ? + !$.contains(this.element[0], itemElement) : + true + ) + ) { + + // mjs - we are intersecting an element: + // trigger the mouseenter event and store this state + if (!this.mouseentered) { + $(itemElement).mouseenter(); + this.mouseentered = true; + } + + // mjs - if the element has children and they are hidden, + // show them after a delay (CSS responsible) + if (o.isTree && $(itemElement).hasClass(o.collapsedClass) && o.expandOnHover) { + if (!this.hovering) { + $(itemElement).addClass(o.hoveringClass); + this.hovering = window.setTimeout(function() { + $(itemElement) + .removeClass(o.collapsedClass) + .addClass(o.expandedClass); + + self.refreshPositions(); + self._trigger("expand", event, self._uiHash()); + }, o.expandOnHover); + } + } + + this.direction = intersection === 1 ? "down" : "up"; + + // mjs - rearrange the elements and reset timeouts and hovering state + if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { + $(itemElement).mouseleave(); + this.mouseentered = false; + $(itemElement).removeClass(o.hoveringClass); + if (this.hovering) { + window.clearTimeout(this.hovering); + } + this.hovering = null; + + // mjs - do not switch container if + // it's a root item and 'protectRoot' is true + // or if it's not a root item but we are trying to make it root + if (o.protectRoot && + !( + this.currentItem[0].parentNode === this.element[0] && + // it's a root item + itemElement.parentNode !== this.element[0] + // it's intersecting a non-root item + ) + ) { + if (this.currentItem[0].parentNode !== this.element[0] && + itemElement.parentNode === this.element[0] + ) { + + if ( !$(itemElement).children(o.listType).length) { + itemElement.appendChild(newList); + if (o.isTree) { + $(itemElement) + .removeClass(o.leafClass) + .addClass(o.branchClass + " " + o.expandedClass); + } + } + + if (this.direction === "down") { + a = $(itemElement).prev().children(o.listType); + } else { + a = $(itemElement).children(o.listType); + } + + if (a[0] !== undefined) { + this._rearrange(event, null, a); + } + + } else { + this._rearrange(event, item); + } + } else if (!o.protectRoot) { + this._rearrange(event, item); + } + } else { + break; + } + + // Clear emtpy ul's/ol's + this._clearEmpty(itemElement); + + this._trigger("change", event, this._uiHash()); + break; + } + } + + // mjs - to find the previous sibling in the list, + // keep backtracking until we hit a valid list item. + (function() { + var _previousItem = this.placeholder.prev(); + if (_previousItem.length) { + previousItem = _previousItem; + } else { + previousItem = null; + } + }.call(this)); + + if (previousItem != null) { + while ( + previousItem[0].nodeName.toLowerCase() !== "li" || + previousItem[0].className.indexOf(o.disabledClass) !== -1 || + previousItem[0] === this.currentItem[0] || + previousItem[0] === this.helper[0] + ) { + if (previousItem[0].previousSibling) { + previousItem = $(previousItem[0].previousSibling); + } else { + previousItem = null; + break; + } + } + } + + // mjs - to find the next sibling in the list, + // keep stepping forward until we hit a valid list item. + (function() { + var _nextItem = this.placeholder.next(); + if (_nextItem.length) { + nextItem = _nextItem; + } else { + nextItem = null; + } + }.call(this)); + + if (nextItem != null) { + while ( + nextItem[0].nodeName.toLowerCase() !== "li" || + nextItem[0].className.indexOf(o.disabledClass) !== -1 || + nextItem[0] === this.currentItem[0] || + nextItem[0] === this.helper[0] + ) { + if (nextItem[0].nextSibling) { + nextItem = $(nextItem[0].nextSibling); + } else { + nextItem = null; + break; + } + } + } + + this.beyondMaxLevels = 0; + + // mjs - if the item is moved to the left, send it one level up + // but only if it's at the bottom of the list + if (parentItem != null && + nextItem == null && + !(o.protectRoot && parentItem[0].parentNode == this.element[0]) && + ( + o.rtl && + ( + this.positionAbs.left + + this.helper.outerWidth() > parentItem.offset().left + + parentItem.outerWidth() + ) || + !o.rtl && (this.positionAbs.left < parentItem.offset().left) + ) + ) { + + parentItem.after(this.placeholder[0]); + helperIsNotSibling = !parentItem + .children(o.listItem) + .children("li:visible:not(.ui-sortable-helper)") + .length; + if (o.isTree && helperIsNotSibling) { + parentItem + .removeClass(this.options.branchClass + " " + this.options.expandedClass) + .addClass(this.options.leafClass); + } + if(typeof parentItem !== 'undefined') + this._clearEmpty(parentItem[0]); + this._trigger("change", event, this._uiHash()); + // mjs - if the item is below a sibling and is moved to the right, + // make it a child of that sibling + } else if (previousItem != null && + !previousItem.hasClass(o.disableNestingClass) && + ( + previousItem.children(o.listType).length && + previousItem.children(o.listType).is(":visible") || + !previousItem.children(o.listType).length + ) && + !(o.protectRoot && this.currentItem[0].parentNode === this.element[0]) && + ( + o.rtl && + ( + this.positionAbs.left + + this.helper.outerWidth() < + previousItem.offset().left + + previousItem.outerWidth() - + o.tabSize + ) || + !o.rtl && + (this.positionAbs.left > previousItem.offset().left + o.tabSize) + ) + ) { + + this._isAllowed(previousItem, level, level + childLevels + 1); + + if (!previousItem.children(o.listType).length) { + previousItem[0].appendChild(newList); + if (o.isTree) { + previousItem + .removeClass(o.leafClass) + .addClass(o.branchClass + " " + o.expandedClass); + } + } + + // mjs - if this item is being moved from the top, add it to the top of the list. + if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) { + previousItem.children(o.listType).prepend(this.placeholder); + } else { + // mjs - otherwise, add it to the bottom of the list. + previousItem.children(o.listType)[0].appendChild(this.placeholder[0]); + } + if(typeof parentItem !== 'undefined') + this._clearEmpty(parentItem[0]); + this._trigger("change", event, this._uiHash()); + } else { + this._isAllowed(parentItem, level, level + childLevels); + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if ($.ui.ddmanager) { + $.ui.ddmanager.drag(this, event); + } + + //Call callbacks + this._trigger("sort", event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event) { + // mjs - if the item is in a position not allowed, send it back + if (this.beyondMaxLevels) { + + this.placeholder.removeClass(this.options.errorClass); + + if (this.domPosition.prev) { + $(this.domPosition.prev).after(this.placeholder); + } else { + $(this.domPosition.parent).prepend(this.placeholder); + } + + this._trigger("revert", event, this._uiHash()); + + } + + // mjs - clear the hovering timeout, just to be sure + $("." + this.options.hoveringClass) + .mouseleave() + .removeClass(this.options.hoveringClass); + + this.mouseentered = false; + if (this.hovering) { + window.clearTimeout(this.hovering); + } + this.hovering = null; + + this._relocate_event = event; + this._pid_current = $(this.domPosition.parent).parent().attr("id"); + this._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0; + $.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event. + }, + + // mjs - this function is slightly modified + // to make it easier to hover over a collapsed element and have it expand + _intersectsWithSides: function(item) { + + var half = this.options.isTree ? .8 : .5, + isOverBottomHalf = isOverAxis( + this.positionAbs.top + this.offset.click.top, + item.top + (item.height * half), + item.height + ), + isOverTopHalf = isOverAxis( + this.positionAbs.top + this.offset.click.top, + item.top - (item.height * half), + item.height + ), + isOverRightHalf = isOverAxis( + this.positionAbs.left + this.offset.click.left, + item.left + (item.width / 2), + item.width + ), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ( + (horizontalDirection === "right" && isOverRightHalf) || + (horizontalDirection === "left" && !isOverRightHalf) + ); + } else { + return verticalDirection && ( + (verticalDirection === "down" && isOverBottomHalf) || + (verticalDirection === "up" && isOverTopHalf) + ); + } + + }, + + _contactContainers: function() { + + if (this.options.protectRoot && this.currentItem[0].parentNode === this.element[0] ) { + return; + } + + $.ui.sortable.prototype._contactContainers.apply(this, arguments); + + }, + + _clear: function() { + var i, + item; + + $.ui.sortable.prototype._clear.apply(this, arguments); + + //relocate event + if (!(this._pid_current === this._uiHash().item.parent().parent().attr("id") && + this._sort_current === this._uiHash().item.index())) { + this._trigger("relocate", this._relocate_event, this._uiHash()); + } + + // mjs - clean last empty ul/ol + for (i = this.items.length - 1; i >= 0; i--) { + item = this.items[i].item[0]; + this._clearEmpty(item); + } + + }, + + serialize: function(options) { + + var o = $.extend({}, this.options, options), + items = this._getItemsAsjQuery(o && o.connected), + str = []; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || "id") || "") + .match(o.expression || (/(.+)[-=_](.+)/)), + pid = ($(o.item || this).parent(o.listType) + .parent(o.items) + .attr(o.attribute || "id") || "") + .match(o.expression || (/(.+)[-=_](.+)/)); + + if (res) { + str.push( + ( + (o.key || res[1]) + + "[" + + (o.key && o.expression ? res[1] : res[2]) + "]" + ) + + "=" + + (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID)); + } + }); + + if (!str.length && o.key) { + str.push(o.key + "="); + } + + return str.join("&"); + + }, + + toHierarchy: function(options) { + + var o = $.extend({}, this.options, options), + ret = []; + + $(this.element).children(o.items).each(function() { + var level = _recursiveItems(this); + ret.push(level); + }); + + return ret; + + function _recursiveItems(item) { + var id = ($(item).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[-=_](.+)/)), + currentItem; + if (id) { + currentItem = { + "id": id[2] + }; + + if ($(item).children(o.listType).children(o.items).length > 0) { + currentItem.children = []; + $(item).children(o.listType).children(o.items).each(function() { + var level = _recursiveItems(this); + currentItem.children.push(level); + }); + } + return currentItem; + } + } + }, + + toArray: function(options) { + + var o = $.extend({}, this.options, options), + sDepth = o.startDepthCount || 0, + ret = [], + left = 1; + + if (!o.excludeRoot) { + ret.push({ + "item_id": o.rootID, + "parent_id": null, + "depth": sDepth, + "left": left, + "right": ($(o.items, this.element).length + 1) * 2 + }); + left++; + } + + $(this.element).children(o.items).each(function() { + left = _recursiveArray(this, sDepth + 1, left); + }); + + ret = ret.sort(function(a, b) { return (a.left - b.left); }); + + return ret; + + function _recursiveArray(item, depth, _left) { + + var right = _left + 1, + id, + pid, + parentItem; + + if ($(item).children(o.listType).children(o.items).length > 0) { + depth++; + $(item).children(o.listType).children(o.items).each(function() { + right = _recursiveArray($(this), depth, right); + }); + depth--; + } + + id = ($(item).attr(o.attribute || "id")).match(o.expression || (/(.+)[-=_](.+)/)); + + if (depth === sDepth + 1) { + pid = o.rootID; + } else { + parentItem = ($(item).parent(o.listType) + .parent(o.items) + .attr(o.attribute || "id")) + .match(o.expression || (/(.+)[-=_](.+)/)); + pid = parentItem[2]; + } + + if (id) { + ret.push({ + "item_id": id[2], + "parent_id": pid, + "depth": depth, + "left": _left, + "right": right + }); + } + + _left = right + 1; + return _left; + } + + }, + + _clearEmpty: function (item) { + function replaceClass(elem, search, replace, swap) { + if (swap) { + search = [replace, replace = search][0]; + } + + $(elem).removeClass(search).addClass(replace); + } + + var o = this.options, + childrenList = $(item).children(o.listType), + hasChildren = childrenList.is(':not(:empty)'); + + var doNotClear = + o.doNotClear || + hasChildren || + o.protectRoot && $(item)[0] === this.element[0]; + + if (o.isTree) { + replaceClass(item, o.branchClass, o.leafClass, doNotClear); + } + + if (!doNotClear) { + childrenList.remove(); + } + }, + + _getLevel: function(item) { + + var level = 1, + list; + + if (this.options.listType) { + list = item.closest(this.options.listType); + while (list && list.length > 0 && !list.is(".ui-sortable")) { + level++; + list = list.parent().closest(this.options.listType); + } + } + + return level; + }, + + _getChildLevels: function(parent, depth) { + var self = this, + o = this.options, + result = 0; + depth = depth || 0; + + $(parent).children(o.listType).children(o.items).each(function(index, child) { + result = Math.max(self._getChildLevels(child, depth + 1), result); + }); + + return depth ? result + 1 : result; + }, + + _isAllowed: function(parentItem, level, levels) { + var o = this.options, + // this takes into account the maxLevels set to the recipient list + maxLevels = this + .placeholder + .closest(".ui-sortable") + .nestedSortable("option", "maxLevels"), + + // Check if the parent has changed to prevent it, when o.disableParentChange is true + oldParent = this.currentItem.parent().parent(), + disabledByParentchange = o.disableParentChange && ( + //From somewhere to somewhere else, except the root + typeof parentItem !== 'undefined' && !oldParent.is(parentItem) || + typeof parentItem === 'undefined' && oldParent.is("li") //From somewhere to the root + ); + // mjs - is the root protected? + // mjs - are we nesting too deep? + if ( + disabledByParentchange || + !o.isAllowed(this.placeholder, parentItem, this.currentItem) + ) { + this.placeholder.addClass(o.errorClass); + if (maxLevels < levels && maxLevels !== 0) { + this.beyondMaxLevels = levels - maxLevels; + } else { + this.beyondMaxLevels = 1; + } + } else { + if (maxLevels < levels && maxLevels !== 0) { + this.placeholder.addClass(o.errorClass); + this.beyondMaxLevels = levels - maxLevels; + } else { + this.placeholder.removeClass(o.errorClass); + this.beyondMaxLevels = 0; + } + } + } + + })); + + $.mjs.nestedSortable.prototype.options = $.extend( + {}, + $.ui.sortable.prototype.options, + $.mjs.nestedSortable.prototype.options + ); +})); diff --git a/resources/assets/libs/source-sans-pro.css b/resources/assets/libs/source-sans-pro.css new file mode 100644 index 0000000..bc374be --- /dev/null +++ b/resources/assets/libs/source-sans-pro.css @@ -0,0 +1,95 @@ +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 200; + font-style: normal; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-ExtraLight.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 200; + font-style: italic; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-ExtraLightIt.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 300; + font-style: normal; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-Light.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 300; + font-style: italic; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-LightIt.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 400; + font-style: normal; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-Regular.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 400; + font-style: italic; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-It.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 600; + font-style: normal; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-Semibold.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 600; + font-style: italic; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-SemiboldIt.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 700; + font-style: normal; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-Bold.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 700; + font-style: italic; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-BoldIt.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 900; + font-style: normal; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-Black.ttf.woff2') format('woff2'); +} + +@font-face{ + font-family: 'Source Sans Pro'; + font-weight: 900; + font-style: italic; + font-stretch: normal; + src: url('WOFF2/TTF/SourceSans3-BlackIt.ttf.woff2') format('woff2'); +} diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 6054f43..ae3b32d 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -2,18 +2,18 @@ {{-- Main Content --}} @section('content') -
+

{{ trans('backpack::base.reset_password') }}