From 489b3e2c21836e8ddc3530a8b464dbf9bc8178d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Wed, 1 Feb 2023 22:58:39 +0100 Subject: [PATCH] Use webpack entrypoints for bootstrap and bootswatch themes This allows us to utilize the webpack versioning mechanism, to avoid display issues, when upgrading bootstrap --- assets/themes/bootstrap.js | 20 +++++++++++++++++ assets/themes/cerulean.js | 20 +++++++++++++++++ assets/themes/cosmo.js | 20 +++++++++++++++++ assets/themes/cyborg.js | 20 +++++++++++++++++ assets/themes/darkly.js | 20 +++++++++++++++++ assets/themes/flatly.js | 20 +++++++++++++++++ assets/themes/journal.js | 20 +++++++++++++++++ assets/themes/litera.js | 20 +++++++++++++++++ assets/themes/lumen.js | 20 +++++++++++++++++ assets/themes/lux.js | 20 +++++++++++++++++ assets/themes/materia.js | 20 +++++++++++++++++ assets/themes/minty.js | 20 +++++++++++++++++ assets/themes/morph.js | 20 +++++++++++++++++ assets/themes/pulse.js | 20 +++++++++++++++++ assets/themes/quartz.js | 20 +++++++++++++++++ assets/themes/sandstone.js | 20 +++++++++++++++++ assets/themes/simplex.js | 20 +++++++++++++++++ assets/themes/sketchy.js | 20 +++++++++++++++++ assets/themes/slate.js | 20 +++++++++++++++++ assets/themes/solar.js | 20 +++++++++++++++++ assets/themes/spacelab.js | 20 +++++++++++++++++ assets/themes/superhero.js | 20 +++++++++++++++++ assets/themes/united.js | 20 +++++++++++++++++ assets/themes/vapor.js | 20 +++++++++++++++++ assets/themes/yeti.js | 20 +++++++++++++++++ assets/themes/zephyr.js | 20 +++++++++++++++++ package.json | 1 - src/Entity/UserSystem/User.php | 4 ++-- templates/base.html.twig | 6 ++--- webpack.config.js | 40 +++++++++++---------------------- yarn.lock | 41 +++------------------------------- 31 files changed, 541 insertions(+), 71 deletions(-) create mode 100644 assets/themes/bootstrap.js create mode 100644 assets/themes/cerulean.js create mode 100644 assets/themes/cosmo.js create mode 100644 assets/themes/cyborg.js create mode 100644 assets/themes/darkly.js create mode 100644 assets/themes/flatly.js create mode 100644 assets/themes/journal.js create mode 100644 assets/themes/litera.js create mode 100644 assets/themes/lumen.js create mode 100644 assets/themes/lux.js create mode 100644 assets/themes/materia.js create mode 100644 assets/themes/minty.js create mode 100644 assets/themes/morph.js create mode 100644 assets/themes/pulse.js create mode 100644 assets/themes/quartz.js create mode 100644 assets/themes/sandstone.js create mode 100644 assets/themes/simplex.js create mode 100644 assets/themes/sketchy.js create mode 100644 assets/themes/slate.js create mode 100644 assets/themes/solar.js create mode 100644 assets/themes/spacelab.js create mode 100644 assets/themes/superhero.js create mode 100644 assets/themes/united.js create mode 100644 assets/themes/vapor.js create mode 100644 assets/themes/yeti.js create mode 100644 assets/themes/zephyr.js diff --git a/assets/themes/bootstrap.js b/assets/themes/bootstrap.js new file mode 100644 index 00000000..2c6e64cb --- /dev/null +++ b/assets/themes/bootstrap.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootstrap/dist/css/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/cerulean.js b/assets/themes/cerulean.js new file mode 100644 index 00000000..8c1672ea --- /dev/null +++ b/assets/themes/cerulean.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/cerulean/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/cosmo.js b/assets/themes/cosmo.js new file mode 100644 index 00000000..7933dcdf --- /dev/null +++ b/assets/themes/cosmo.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/cosmo/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/cyborg.js b/assets/themes/cyborg.js new file mode 100644 index 00000000..beeeae4d --- /dev/null +++ b/assets/themes/cyborg.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/cyborg/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/darkly.js b/assets/themes/darkly.js new file mode 100644 index 00000000..af64150e --- /dev/null +++ b/assets/themes/darkly.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/darkly/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/flatly.js b/assets/themes/flatly.js new file mode 100644 index 00000000..bc44a64b --- /dev/null +++ b/assets/themes/flatly.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/flatly/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/journal.js b/assets/themes/journal.js new file mode 100644 index 00000000..486ef744 --- /dev/null +++ b/assets/themes/journal.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/journal/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/litera.js b/assets/themes/litera.js new file mode 100644 index 00000000..aeb3e970 --- /dev/null +++ b/assets/themes/litera.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/litera/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/lumen.js b/assets/themes/lumen.js new file mode 100644 index 00000000..52d82235 --- /dev/null +++ b/assets/themes/lumen.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/lumen/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/lux.js b/assets/themes/lux.js new file mode 100644 index 00000000..412deb12 --- /dev/null +++ b/assets/themes/lux.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/lux/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/materia.js b/assets/themes/materia.js new file mode 100644 index 00000000..ac5336d2 --- /dev/null +++ b/assets/themes/materia.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/materia/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/minty.js b/assets/themes/minty.js new file mode 100644 index 00000000..4df143ea --- /dev/null +++ b/assets/themes/minty.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/minty/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/morph.js b/assets/themes/morph.js new file mode 100644 index 00000000..125429b7 --- /dev/null +++ b/assets/themes/morph.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/morph/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/pulse.js b/assets/themes/pulse.js new file mode 100644 index 00000000..96ad9d39 --- /dev/null +++ b/assets/themes/pulse.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/pulse/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/quartz.js b/assets/themes/quartz.js new file mode 100644 index 00000000..cf0342aa --- /dev/null +++ b/assets/themes/quartz.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/quartz/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/sandstone.js b/assets/themes/sandstone.js new file mode 100644 index 00000000..6cc70a8d --- /dev/null +++ b/assets/themes/sandstone.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/sandstone/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/simplex.js b/assets/themes/simplex.js new file mode 100644 index 00000000..647add42 --- /dev/null +++ b/assets/themes/simplex.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/simplex/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/sketchy.js b/assets/themes/sketchy.js new file mode 100644 index 00000000..6e082da9 --- /dev/null +++ b/assets/themes/sketchy.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/sketchy/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/slate.js b/assets/themes/slate.js new file mode 100644 index 00000000..5473d47e --- /dev/null +++ b/assets/themes/slate.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/slate/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/solar.js b/assets/themes/solar.js new file mode 100644 index 00000000..7bfc815c --- /dev/null +++ b/assets/themes/solar.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/solar/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/spacelab.js b/assets/themes/spacelab.js new file mode 100644 index 00000000..69233502 --- /dev/null +++ b/assets/themes/spacelab.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/spacelab/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/superhero.js b/assets/themes/superhero.js new file mode 100644 index 00000000..0a6e2b52 --- /dev/null +++ b/assets/themes/superhero.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/superhero/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/united.js b/assets/themes/united.js new file mode 100644 index 00000000..e6b34919 --- /dev/null +++ b/assets/themes/united.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/united/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/vapor.js b/assets/themes/vapor.js new file mode 100644 index 00000000..e5ebb0da --- /dev/null +++ b/assets/themes/vapor.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/vapor/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/yeti.js b/assets/themes/yeti.js new file mode 100644 index 00000000..bc9537e2 --- /dev/null +++ b/assets/themes/yeti.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/yeti/bootstrap.css"; \ No newline at end of file diff --git a/assets/themes/zephyr.js b/assets/themes/zephyr.js new file mode 100644 index 00000000..9f3dc926 --- /dev/null +++ b/assets/themes/zephyr.js @@ -0,0 +1,20 @@ +/* + * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). + * + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import "bootswatch/dist/zephyr/bootstrap.css"; \ No newline at end of file diff --git a/package.json b/package.json index 8bc58099..aa430f53 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "bs-custom-file-input": "^1.3.4", "clipboard": "^2.0.4", "compression-webpack-plugin": "^10.0.0", - "copy-webpack-plugin": "^11.0.0", "darkmode-js": "^1.5.0", "datatables.net-bs5": "^1.10.20", "datatables.net-buttons-bs5": "^2.2.2", diff --git a/src/Entity/UserSystem/User.php b/src/Entity/UserSystem/User.php index 08badb34..a725e9da 100644 --- a/src/Entity/UserSystem/User.php +++ b/src/Entity/UserSystem/User.php @@ -69,8 +69,8 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe public const ID_ANONYMOUS = 1; public const AVAILABLE_THEMES = ['bootstrap', 'cerulean', 'cosmo', 'cyborg', 'darkly', 'flatly', 'journal', - 'litera', 'lumen', 'lux', 'materia', 'minty', 'pulse', 'sandstone', 'simplex', 'sketchy', 'slate', 'solar', - 'spacelab', 'united', 'yeti', ]; + 'litera', 'lumen', 'lux', 'materia', 'minty', 'morph', 'pulse', 'quartz', 'sandstone', 'simplex', 'sketchy', 'slate', 'solar', + 'spacelab', 'superhero', 'united', 'vapor', 'yeti', 'zephyr']; /** * @var bool Determines if the user is disabled (user can not log in) diff --git a/templates/base.html.twig b/templates/base.html.twig index 13de1610..8cf2f507 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -41,10 +41,10 @@ - {% if theme and theme in constant('App\\Entity\\UserSystem\\User::AVAILABLE_THEMES') %} - + {% if theme and theme in constant('App\\Entity\\UserSystem\\User::AVAILABLE_THEMES') and encore_entry_exists('theme_' ~ theme) %} + {{ encore_entry_link_tags('theme_' ~ theme) }} {% else %} - + {{ encore_entry_link_tags('theme_bootstrap') }} {% endif %} {{ encore_entry_link_tags('app') }} diff --git a/webpack.config.js b/webpack.config.js index 2725f03a..19596143 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ /* * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony) * - * Copyright (C) 2019 Jan Böhmer (https://github.com/jbtronics) + * Copyright (C) 2019 - 2023 Jan Böhmer (https://github.com/jbtronics) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -20,7 +20,6 @@ */ var Encore = require('@symfony/webpack-encore'); -const CopyPlugin = require('copy-webpack-plugin'); const zlib = require('zlib'); const CompressionPlugin = require("compression-webpack-plugin"); @@ -61,6 +60,9 @@ Encore .addEntry('app', './assets/js/app.js') .addEntry('webauthn_tfa', './assets/js/webauthn_tfa.js') + + + // enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js) .enableStimulusBridge('./assets/controllers.json') //.addEntry('page1', './assets/js/page1.js') @@ -87,6 +89,8 @@ Encore //.enableVersioning(Encore.isProduction()) .enableVersioning() + + // configure Babel // .configureBabel((config) => { // config.plugins.push('@babel/a-babel-plugin'); @@ -109,21 +113,6 @@ Encore // uncomment to get integrity="..." attributes on your script & link tags // requires WebpackEncoreBundle 1.4 or higher .enableIntegrityHashes(Encore.isProduction()) - .addPlugin(new CopyPlugin({ - patterns: [ - { - from: 'node_modules/bootswatch/dist/*/*.min.css', - to({ context, absoluteFilename }) { - const regexp = /.*([\/\\])(.+)([\/\\]).*\.css$/g; - const array = [...absoluteFilename.matchAll(regexp)]; - return 'themes/'+array[0][2]+'[ext]'; - } - }, - { - from: 'node_modules/bootstrap/dist/css/bootstrap.min.css', - to: 'themes/bootstrap.css' - } - ]})) // uncomment if you're having problems with a jQuery plugin .autoProvidejQuery() @@ -163,19 +152,16 @@ Encore ; +//These are all the themes that are available in bootswatch +const AVAILABLE_THEMES = ['bootstrap', 'cerulean', 'cosmo', 'cyborg', 'darkly', 'flatly', 'journal', + 'litera', 'lumen', 'lux', 'materia', 'minty', 'morph', 'pulse', 'quartz', 'sandstone', 'simplex', 'sketchy', 'slate', 'solar', + 'spacelab', 'superhero', 'united', 'vapor', 'yeti', 'zephyr']; - -//Copy bootstrap map if in debug mode -if (Encore.isDev()) { - Encore.addPlugin(new CopyPlugin({ - patterns: [ - { - from: 'node_modules/bootstrap/dist/css/bootstrap.min.css.map', - to: 'themes/bootstrap.min.css.map' - } - ]})) +for (const theme of AVAILABLE_THEMES) { + Encore.addEntry('theme_' + theme, './assets/themes/'+theme+'.js'); } + if (Encore.isProduction()) { Encore.addPlugin(new CompressionPlugin({ filename: '[path][base].br', diff --git a/yarn.lock b/yarn.lock index 06239556..451c60be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2667,18 +2667,6 @@ cookie@0.5.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== -copy-webpack-plugin@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz#96d4dbdb5f73d02dd72d0528d1958721ab72e04a" - integrity sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ== - dependencies: - fast-glob "^3.2.11" - glob-parent "^6.0.1" - globby "^13.1.1" - normalize-path "^3.0.0" - schema-utils "^4.0.0" - serialize-javascript "^6.0.0" - core-js-compat@^3.25.1: version "3.27.2" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.27.2.tgz#607c50ad6db8fd8326af0b2883ebb987be3786da" @@ -3692,13 +3680,6 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - glob-to-regexp@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" @@ -3735,17 +3716,6 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^13.1.1: - version "13.1.3" - resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.3.tgz#f62baf5720bcb2c1330c8d4ef222ee12318563ff" - integrity sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw== - dependencies: - dir-glob "^3.0.1" - fast-glob "^3.2.11" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^4.0.0" - globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -3956,7 +3926,7 @@ icss-utils@^5.0.0, icss-utils@^5.1.0: resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== -ignore@^5.1.1, ignore@^5.2.0: +ignore@^5.1.1: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== @@ -4084,7 +4054,7 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: +is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -4480,7 +4450,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: +merge2@^1.2.3, merge2@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -5819,11 +5789,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slash@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" - integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== - sockjs@^0.3.24: version "0.3.24" resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce"