Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1 Child templates 1/2 #35874

Merged
merged 43 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d241177
New mode for cassiopeia and atum
dgrammatiko Nov 16, 2021
ef80ff9
DB Changes
dgrammatiko Oct 22, 2021
0f90503
Fix wrong import paths
dgrammatiko Oct 22, 2021
a3d78ff
SQL for updates
dgrammatiko Oct 22, 2021
045cb06
Deleted files and folder for changing core templates to inheritable
richard67 Oct 22, 2021
deb07b5
Better version comments
richard67 Oct 22, 2021
702cd80
Move custom files in core templates to media folder on update
richard67 Oct 22, 2021
ae8898a
Better English in the comment
richard67 Oct 22, 2021
98f27ac
Fix some paths
dgrammatiko Oct 22, 2021
09580b5
System templates
dgrammatiko Oct 22, 2021
74a811e
Deleted files and folders for system templates
richard67 Oct 23, 2021
d6c9de1
Move template preview files, too
richard67 Oct 23, 2021
a89990c
Create parent folders if necessary at target path
richard67 Oct 23, 2021
0147e58
Don't delete template previews
richard67 Oct 23, 2021
a18b856
Revert special handling for core template preview images
richard67 Oct 23, 2021
4b5d7e2
move images to the correct folder
dgrammatiko Oct 23, 2021
65f88f5
Fix the logos
dgrammatiko Nov 9, 2021
08974e7
One more path fixed
dgrammatiko Nov 9, 2021
a3f4c3c
Revert the tinyMCE changes here
dgrammatiko Nov 9, 2021
a1fad2a
Fix the roboto path
dgrammatiko Nov 22, 2021
05d9091
Merge branch '4.1-dev' into 4.1-dev-child-templates
dgrammatiko Nov 24, 2021
8e884a8
Fix the fontawesome path
dgrammatiko Nov 25, 2021
fb1a059
Merge branch '4.1-dev' into 4.1-dev-child-templates
dgrammatiko Nov 25, 2021
fa4c33a
Merge branch '4.1-dev' into 4.1-dev-child-templates
dgrammatiko Nov 26, 2021
b6f2f74
.css files imports are relative to the path of the file importing
dgrammatiko Nov 26, 2021
dc65503
Add missing import
dgrammatiko Nov 27, 2021
65c625e
Merge branch '4.1-dev' into 4.1-dev-child-templates
dgrammatiko Nov 27, 2021
ebff3bb
Use realpath instaed of the Path::clean
dgrammatiko Nov 28, 2021
0b4ff1d
RecursiveDirectoryIterator && mkdir
dgrammatiko Nov 28, 2021
16a3e5f
Meh
dgrammatiko Nov 28, 2021
ab7291d
Mehhh
dgrammatiko Nov 28, 2021
cf656eb
Update administrator/components/com_admin/script.php
dgrammatiko Nov 28, 2021
1d2d60a
No dots and dirs
dgrammatiko Nov 28, 2021
9ed0e07
Use the flag for the dots
dgrammatiko Nov 28, 2021
c42dd9a
Update administrator/components/com_admin/script.php
dgrammatiko Nov 28, 2021
c85573c
sql
dgrammatiko Nov 28, 2021
a7ae061
Merge branch '4.1-dev' into 4.1-dev-child-templates
richard67 Nov 28, 2021
829e0d2
Cassiopeia Roboto
dgrammatiko Nov 28, 2021
88a0627
Update paths to local font schemes in template style parameters on da…
richard67 Nov 28, 2021
95d7aa2
Merge pull request #8 from richard67/4.1-dev-child-templates-mod-1
dgrammatiko Nov 28, 2021
689f35c
Roboto font path
dgrammatiko Nov 28, 2021
4e5a9dc
Merge branch '4.1-dev' into 4.1-dev-child-templates
bembelimen Nov 28, 2021
edd3015
Merge branch '4.1-dev' into 4.1-dev-child-templates
bembelimen Nov 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
319 changes: 319 additions & 0 deletions administrator/components/com_admin/script.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--
-- Convert core templates to new mode
--
UPDATE `#__template_styles` SET `inheritable` = 1 WHERE `template` = 'atum' AND `client_id` = 1 OR `template` = 'cassiopeia' AND `client_id` = 0;

UPDATE `#__template_styles`
SET `params` = REPLACE(`params`,'"useFontScheme":"templates\\/cassiopeia\\/css\\/','"useFontScheme":"media\\/templates\\/site\\/cassiopeia\\/css\\/')
WHERE `template` = 'cassiopeia'
AND `client_id` = 0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--
-- Convert core templates to new mode
--
UPDATE "#__template_styles" SET "inheritable" = 1 WHERE "template" = 'atum' AND "client_id" = 1 OR "template" = 'cassiopeia' AND "client_id" = 0;

UPDATE "#__template_styles"
SET "params" = REPLACE("params",'"useFontScheme":"templates\\/cassiopeia\\/css\\/','"useFontScheme":"media\\/templates\\/site\\/cassiopeia\\/css\\/')
WHERE "template" = 'cassiopeia'
AND "client_id" = 0;
4 changes: 2 additions & 2 deletions administrator/templates/atum/error_full.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
// Template params
$logoBrandLarge = $this->params->get('logoBrandLarge')
? Uri::root() . htmlspecialchars($this->params->get('logoBrandLarge'), ENT_QUOTES)
: $this->baseurl . '/templates/' . $this->template . '/images/logos/brand-large.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/brand-large.svg';
$logoBrandSmall = $this->params->get('logoBrandSmall')
? Uri::root() . htmlspecialchars($this->params->get('logoBrandSmall'), ENT_QUOTES)
: $this->baseurl . '/templates/' . $this->template . '/images/logos/brand-small.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/brand-small.svg';

$logoBrandLargeAlt = empty($this->params->get('logoBrandLargeAlt')) && empty($this->params->get('emptyLogoBrandLargeAlt'))
? 'alt=""'
Expand Down
6 changes: 3 additions & 3 deletions administrator/templates/atum/error_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
// Template params
$logoBrandLarge = $this->params->get('logoBrandLarge')
? Uri::root() . htmlspecialchars($this->params->get('logoBrandLarge'), ENT_QUOTES)
: $this->baseurl . '/templates/' . $this->template . '/images/logos/brand-large.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/brand-large.svg';
$loginLogo = $this->params->get('loginLogo')
? Uri::root() . $this->params->get('loginLogo')
: $this->baseurl . '/templates/' . $this->template . '/images/logos/login.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/login.svg';
$logoBrandSmall = $this->params->get('logoBrandSmall')
? Uri::root() . htmlspecialchars($this->params->get('logoBrandSmall'), ENT_QUOTES)
: $this->baseurl . '/templates/' . $this->template . '/images/logos/brand-small.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/brand-small.svg';

$logoBrandLargeAlt = empty($this->params->get('logoBrandLargeAlt')) && empty($this->params->get('emptyLogoBrandLargeAlt'))
? 'alt=""'
Expand Down
4 changes: 2 additions & 2 deletions administrator/templates/atum/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
// Template params
$logoBrandLarge = $this->params->get('logoBrandLarge')
? Uri::root() . htmlspecialchars($this->params->get('logoBrandLarge'), ENT_QUOTES)
: $this->baseurl . '/templates/' . $this->template . '/images/logos/brand-large.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/brand-large.svg';
$logoBrandSmall = $this->params->get('logoBrandSmall')
? Uri::root() . htmlspecialchars($this->params->get('logoBrandSmall'), ENT_QUOTES)
: $this->baseurl . '/templates/' . $this->template . '/images/logos/brand-small.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/brand-small.svg';

$logoBrandLargeAlt = empty($this->params->get('logoBrandLargeAlt')) && empty($this->params->get('emptyLogoBrandLargeAlt'))
? 'alt=""'
Expand Down
6 changes: 3 additions & 3 deletions administrator/templates/atum/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
// Template params
$logoBrandLarge = $this->params->get('logoBrandLarge')
? Uri::root() . htmlspecialchars($this->params->get('logoBrandLarge'), ENT_QUOTES)
: $this->baseurl . '/templates/' . $this->template . '/images/logos/brand-large.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/brand-large.svg';
$loginLogo = $this->params->get('loginLogo')
? Uri::root() . $this->params->get('loginLogo')
: $this->baseurl . '/templates/' . $this->template . '/images/logos/login.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/login.svg';
$logoBrandSmall = $this->params->get('logoBrandSmall')
? Uri::root() . htmlspecialchars($this->params->get('logoBrandSmall'), ENT_QUOTES)
: $this->baseurl . '/templates/' . $this->template . '/images/logos/brand-small.svg';
: Uri::root() . 'media/templates/administrator/atum/images/logos/brand-small.svg';

$logoBrandLargeAlt = empty($this->params->get('logoBrandLargeAlt')) && empty($this->params->get('emptyLogoBrandLargeAlt'))
? 'alt=""'
Expand Down
37 changes: 0 additions & 37 deletions administrator/templates/atum/scss/vendor/_bootstrap.scss

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 4 additions & 5 deletions administrator/templates/atum/templateDetails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<authorEmail>[email protected]</authorEmail>
<copyright>(C) 2016 Open Source Matters, Inc.</copyright>
<description>TPL_ATUM_XML_DESCRIPTION</description>
<inheritable>1</inheritable>
<files>
<filename>component.php</filename>
<filename>cpanel.php</filename>
Expand All @@ -17,15 +18,13 @@
<filename>joomla.asset.json</filename>
<filename>login.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_preview.png</filename>
<filename>template_thumbnail.png</filename>
<folder>css</folder>
<folder>html</folder>
<folder>images</folder>
<folder>scss</folder>
</files>
<media destination="templates/administrator/atum" folder="media">
<folder>js</folder>
<folder>css</folder>
<folder>scss</folder>
<folder>images</folder>
</media>
<positions>
<!-- used directly in the template -->
Expand Down
2 changes: 1 addition & 1 deletion administrator/templates/system/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/** @var \Joomla\CMS\Document\ErrorDocument $this */

// Load template CSS file
$this->getWebAssetManager()->registerAndUseStyle('template.system.error', 'administrator/templates/system/css/error.css');
$this->getWebAssetManager()->registerAndUseStyle('template.system.error', 'media/system/css/system-admin-error.min.css');

// Set page title
$this->setTitle($this->error->getCode() . ' - ' . htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ $badge-font-size: .75rem;
$jicon-css-prefix: icon !default;
$fa-css-prefix: fa !default;
$fa-font-path: "../../../../media/vendor/fontawesome-free/webfonts";
$roboto-font-path: "../../../../media/vendor/roboto-fontface/fonts";
$roboto-font-path: "../../../../../media/vendor/roboto-fontface/fonts";

// Font weights
$thin-weight: 100;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bootstrap functions
@import "../../../../media/vendor/bootstrap/scss/functions";
@import "../../../../../../media/vendor/bootstrap/scss/functions";

// Atum Variables
@import "variables";
Expand All @@ -8,12 +8,12 @@
@import "vendor/bootstrap";

// Fonts
@import "../../../../media/vendor/roboto-fontface/scss/roboto/sass/roboto-fontface";
@import "../../../../../../media/vendor/roboto-fontface/scss/roboto/sass/roboto-fontface";

@import "blocks/global"; // Leave this first

// jQuery Minicolors
@import "../../../../build/media_source/system/scss/jquery-minicolors";
@import "../../../../../../media/system/scss/jquery-minicolors";

// Vendor overrides
@import "vendor/bootstrap/badge";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Variables

// Media, Jumbotron & Print removed https://getbootstrap.com/docs/5.0/migration/
// Code is now in reboot https://github.com/twbs/bootstrap/pull/28917/files

@import "../../../../../../../media/vendor/bootstrap/scss/variables";
@import "../../../../../../../media/vendor/bootstrap/scss/mixins";
@import "../root";
@import "../../../../../../../media/vendor/bootstrap/scss/reboot";
@import "../../../../../../../media/vendor/bootstrap/scss/type";
@import "../../../../../../../media/vendor/bootstrap/scss/images";
@import "../../../../../../../media/vendor/bootstrap/scss/containers";
@import "../../../../../../../media/vendor/bootstrap/scss/grid";
@import "../../../../../../../media/vendor/bootstrap/scss/tables";
@import "../../../../../../../media/vendor/bootstrap/scss/forms";
@import "../../../../../../../media/vendor/bootstrap/scss/buttons";
@import "../../../../../../../media/vendor/bootstrap/scss/transitions";
@import "../../../../../../../media/vendor/bootstrap/scss/dropdown";
@import "../../../../../../../media/vendor/bootstrap/scss/accordion";
@import "../../../../../../../media/vendor/bootstrap/scss/button-group";
@import "../../../../../../../media/vendor/bootstrap/scss/nav";
@import "../../../../../../../media/vendor/bootstrap/scss/navbar";
@import "../../../../../../../media/vendor/bootstrap/scss/card";
@import "../../../../../../../media/vendor/bootstrap/scss/breadcrumb";
@import "../../../../../../../media/vendor/bootstrap/scss/pagination";
@import "../../../../../../../media/vendor/bootstrap/scss/badge";
@import "../../../../../../../media/vendor/bootstrap/scss/alert";
@import "../../../../../../../media/vendor/bootstrap/scss/progress";
@import "../../../../../../../media/vendor/bootstrap/scss/list-group";
@import "../../../../../../../media/vendor/bootstrap/scss/close";
@import "../../../../../../../media/vendor/bootstrap/scss/modal";
@import "../../../../../../../media/vendor/bootstrap/scss/tooltip";
@import "../../../../../../../media/vendor/bootstrap/scss/popover";
@import "../../../../../../../media/vendor/bootstrap/scss/carousel";
@import "../../../../../../../media/vendor/bootstrap/scss/utilities";
@import "../../../../../../../media/vendor/bootstrap/scss/utilities/api";
@import "../../../../../../../media/vendor/bootstrap/scss/helpers";
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Awesomplete
@import "../../../../../../../../node_modules/awesomplete/awesomplete";

.awesomplete {
display: block;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@import "../../../../../../media/vendor/bootstrap/scss/functions";
@import "../../../../../../../../media/vendor/bootstrap/scss/functions";

// Atum Variables
@import "../../variables";

@import "../../../../../../media/vendor/bootstrap/scss/variables";
@import "../../../../../../media/vendor/bootstrap/scss/mixins";
@import "../../../../../../../../media/vendor/bootstrap/scss/variables";
@import "../../../../../../../../media/vendor/bootstrap/scss/mixins";

// choices.js
@import "../../../../../../node_modules/choices.js/src/styles/choices";
@import "../../../../../../../../node_modules/choices.js/src/styles/choices";

.choices {
border: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Override the font path
$fa-css-prefix: fa;
$fa-font-path: "../../../../../../vendor/fontawesome-free/webfonts" !default;

// Font Awesome 5 Free
@import "../../../../../../../../media/vendor/fontawesome-free/scss/fontawesome";
@import "../../../../../../../../media/vendor/fontawesome-free/scss/regular";
@import "../../../../../../../../media/vendor/fontawesome-free/scss/solid";

// Brands must be imported last
@import "../../../../../../../../media/vendor/fontawesome-free/scss/brands";

// B/C for Icomoon
@import "../../../../../../system/scss/icomoon";

// RTL override
html[dir=rtl] .float-right {
float: left;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../../variables";
@import "../../../../../../node_modules/joomla-ui-custom-elements/dist/css/joomla-alert";
@import "../../../../../../../../node_modules/joomla-ui-custom-elements/dist/css/joomla-alert";

// The following is a restyle for the system alerts

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@import "../../../../../../media/vendor/bootstrap/scss/functions";
@import "../../../../../../../../media/vendor/bootstrap/scss/functions";

// Atum Variables
@import "../../variables";

@import "../../../../../../media/vendor/bootstrap/scss/variables";
@import "../../../../../../media/vendor/bootstrap/scss/mixins";
@import "../../../../../../../../media/vendor/bootstrap/scss/variables";
@import "../../../../../../../../media/vendor/bootstrap/scss/mixins";

// Tabs

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Minicolours
@import "../../../../../../node_modules/@claviska/jquery-minicolors/jquery.minicolors";
@import "../../../../../../../../node_modules/@claviska/jquery-minicolors/jquery.minicolors";

.minicolors-theme-bootstrap {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Fonts
$roboto-font-path: "../../../../media/vendor/roboto-fontface/fonts" !default;
@import "../../../../media/vendor/roboto-fontface/scss/roboto/sass/roboto-fontface";
$roboto-font-path: "../../../../../vendor/roboto-fontface/fonts" !default;
@import "../../../../../../../media/vendor/roboto-fontface/scss/roboto/sass/roboto-fontface";

:root {
--cassiopeia-font-family-body: "Roboto", sans-serif;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bootstrap functions
@import "../../../media/vendor/bootstrap/scss/functions";
@import "../../../../../../media/vendor/bootstrap/scss/functions";

// Variables, Functions and Mixins
@import "tools/tools";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Bootstrap functions
@import "../../../media/vendor/bootstrap/scss/functions";
@import "../../../../../../media/vendor/bootstrap/scss/functions";

// Variables, Functions and Mixins
@import "tools/tools";

// Bootstrap
@import "../../../media/vendor/bootstrap/scss/variables";
@import "../../../media/vendor/bootstrap/scss/bootstrap";
@import "../../../../../../media/vendor/bootstrap/scss/variables";
@import "../../../../../../media/vendor/bootstrap/scss/bootstrap";

// jQuery Minicolors
@import "../../../media/system/scss/jquery-minicolors";
@import "../../../../../../media/system/scss/jquery-minicolors";

// Blocks
@import "blocks/global"; // Leave this first
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Vendor
@import "../../../../media/vendor/bootstrap/scss/functions";
@import "../../../../../../../media/vendor/bootstrap/scss/functions";


// Variables
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@import "../../../../../media/vendor/bootstrap/scss/functions";
@import "../../../../../media/vendor/bootstrap/scss/variables";
@import "../../../../../media/vendor/bootstrap/scss/mixins";
@import "../../../../../../../../media/vendor/bootstrap/scss/functions";
@import "../../../../../../../../media/vendor/bootstrap/scss/variables";
@import "../../../../../../../../media/vendor/bootstrap/scss/mixins";

// choices.js
@import "../../../../../media/vendor/choicesjs/scss/choices";
@import "../../../../../../../../media/vendor/choicesjs/scss/choices";

// Cassiopea Variables, Functions and Mixins
@import "../../tools/tools";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../../tools/tools";
@import "../../../../../media/vendor/joomla-custom-elements/css/joomla-alert.css";
@import "../../../../../../vendor/joomla-custom-elements/css/joomla-alert.css";

// The following is a restyle for the system alerts
#system-message-container {
Expand Down
4 changes: 2 additions & 2 deletions installation/sql/mysql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,8 @@ CREATE TABLE IF NOT EXISTS `#__template_styles` (
--

INSERT INTO `#__template_styles` (`id`, `template`, `client_id`, `home`, `title`, `inheritable`, `parent`, `params`) VALUES
(10, 'atum', 1, '1', 'Atum - Default', 0, '', '{"hue":"hsl(214, 63%, 20%)","bg-light":"#f0f4fb","text-dark":"#495057","text-light":"#ffffff","link-color":"#2a69b8","special-color":"#001b4c","monochrome":"0","loginLogo":"","loginLogoAlt":"","logoBrandLarge":"","logoBrandLargeAlt":"","logoBrandSmall":"","logoBrandSmallAlt":""}'),
(11, 'cassiopeia', 0, '1', 'Cassiopeia - Default', 0, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0}');
(10, 'atum', 1, '1', 'Atum - Default', 1, '', '{"hue":"hsl(214, 63%, 20%)","bg-light":"#f0f4fb","text-dark":"#495057","text-light":"#ffffff","link-color":"#2a69b8","special-color":"#001b4c","monochrome":"0","loginLogo":"","loginLogoAlt":"","logoBrandLarge":"","logoBrandLargeAlt":"","logoBrandSmall":"","logoBrandSmallAlt":""}'),
(11, 'cassiopeia', 0, '1', 'Cassiopeia - Default', 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0}');

-- --------------------------------------------------------

Expand Down
Loading