-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Init bootstrap theme with sidebar & Ui translations package (#29)
![Capture d’écran du 2024-09-15 15-04-58](https://github.com/user-attachments/assets/0e5cd484-8735-4817-999c-bdfcf4837920)
- Loading branch information
Showing
42 changed files
with
7,701 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Menu; | ||
|
||
use Knp\Menu\ItemInterface; | ||
use Sylius\AdminUi\Knp\Menu\MenuBuilderInterface; | ||
use Symfony\Component\DependencyInjection\Attribute\AsDecorator; | ||
|
||
#[AsDecorator(decorates: 'sylius_admin_ui.knp.menu_builder')] | ||
final class AdminMenuBuilder implements MenuBuilderInterface | ||
{ | ||
public function __construct(private MenuBuilderInterface $menuBuilder) | ||
{ | ||
} | ||
|
||
public function createMenu(array $options): ItemInterface | ||
{ | ||
$menu = $this->menuBuilder->createMenu($options); | ||
|
||
$menu | ||
->addChild('dashboard') | ||
->setLabel('sylius.ui.dashboard') | ||
->setLabelAttribute('icon', 'dashboard') | ||
; | ||
|
||
$this->addLibrarySubMenu($menu); | ||
$this->addConfigurationSubMenu($menu); | ||
|
||
return $menu; | ||
} | ||
|
||
private function addLibrarySubMenu(ItemInterface $menu): void | ||
{ | ||
$library = $menu | ||
->addChild('library') | ||
->setLabel('app.ui.library') | ||
->setLabelAttribute('icon', 'users') | ||
; | ||
|
||
$library->addChild('books', ['route' => 'app_admin_book_index']) | ||
->setLabel('app.ui.books') | ||
->setLabelAttribute('icon', 'book') | ||
; | ||
|
||
$library->addChild('authors') | ||
->setLabel('app.ui.authors') | ||
->setLabelAttribute('icon', 'folder') | ||
; | ||
} | ||
|
||
private function addConfigurationSubMenu(ItemInterface $menu): void | ||
{ | ||
$library = $menu | ||
->addChild('configuration') | ||
->setLabel('Configuration') | ||
->setLabelAttribute('icon', 'dashboard') | ||
; | ||
|
||
$library->addChild('channels') | ||
->setLabel('Channels') | ||
->setLabelAttribute('icon', 'shuffle'); | ||
|
||
$library->addChild('countries') | ||
->setLabel('Countries') | ||
->setLabelAttribute('icon', 'flag'); | ||
|
||
$library->addChild('zones') | ||
->setLabel('Zones') | ||
->setLabelAttribute('icon', 'globe'); | ||
|
||
$library->addChild('administrators') | ||
->setLabel('Admin Users') | ||
->setLabelAttribute('icon', 'lock'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
imports: | ||
- { resource: '../../src/BootstrapTheme/config/app.php' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules | ||
/public |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
import './styles/main.scss'; | ||
|
||
import './scripts/bootstrap'; |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* eslint-env browser */ | ||
import * as bootstrap from 'bootstrap'; | ||
|
||
// Fix dropdowns | ||
(() => { | ||
document.querySelectorAll('.dropdown-static').forEach((dropdownToggleEl) => { | ||
const parent = dropdownToggleEl.closest('[data-bs-toggle="dropdown"]'); | ||
if (parent) { | ||
let dropdown = new bootstrap.Dropdown(parent, { | ||
popperConfig(defaultBsPopperConfig) { | ||
return { ...defaultBsPopperConfig, strategy: 'fixed' }; | ||
}, | ||
}); | ||
} | ||
}); | ||
})(); | ||
|
||
window.bootstrap = bootstrap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/*! | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
* { | ||
--tblr-breadcrumb-item-active-color: var(--tblr-gray-500); | ||
--tblr-breadcrumb-divider-color: var(--tblr-gray-300); | ||
} | ||
|
||
[data-bs-theme=dark] { | ||
--tblr-bg-surface: #1E2433; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Inter'; | ||
src: url('../fonts/Inter-VariableFont_slnt,wght.ttf') format('truetype-variations'); | ||
font-weight: 1 999; | ||
} | ||
|
||
body { | ||
font-feature-settings: "cv03", "cv04", "cv11"; | ||
} | ||
|
||
a { | ||
text-underline-offset: 0.25em; | ||
} | ||
|
||
a.link-reset { | ||
text-decoration: none; | ||
} | ||
|
||
.btn-collapse { | ||
&.collapsed { | ||
.icon-chevron-right { | ||
display: inline-flex; | ||
} | ||
.icon-chevron-down { | ||
display: none; | ||
} | ||
} | ||
|
||
&:not(.collapsed) { | ||
.icon-chevron-right { | ||
display: none; | ||
} | ||
.icon-chevron-down { | ||
display: inline-flex; | ||
} | ||
} | ||
} | ||
|
||
.breadcrumb-item a { | ||
text-decoration: none; | ||
|
||
&:hover { | ||
color: $primary | ||
} | ||
} | ||
|
||
html[data-bs-theme="light"] [data-theme-switch="light"] { | ||
display: none; | ||
} | ||
|
||
html[data-bs-theme="dark"] [data-theme-switch="dark"] { | ||
display: none; | ||
} | ||
|
||
.switch-collapse { | ||
display: none; | ||
} | ||
|
||
label:has(input:checked) ~ .switch-collapse { | ||
display: block; | ||
} |
Oops, something went wrong.