Merge pull request 'Migrate the template to Joomla 4' (#1) from dev/j4-compatibility into master

Reviewed-on: #1
This commit is contained in:
Christian Wolf 2022-04-09 14:57:51 +00:00
commit a7942b2e1c
26 changed files with 646 additions and 357 deletions

View File

@ -2,7 +2,7 @@
# UPDATE_PATH=/srv/slt-update # UPDATE_PATH=/srv/slt-update
PACKAGES = slt.tar.gz PACKAGES = slt.tar.gz
export DL_PREFIX=https://slt.wolf-stuttgart.net/update/template export DL_PREFIX=https://slt.wolf-stuttgart.net/update/template/files
RSYNC_OPTIONS=-rltDz --delete --delete-delay --delete-excluded --exclude '.gitignore' RSYNC_OPTIONS=-rltDz --delete --delete-delay --delete-excluded --exclude '.gitignore'
RSYNC_USER=christian RSYNC_USER=christian

16
releases/slt-0.0.1.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.1</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.1.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

16
releases/slt-0.0.10.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.10</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.10.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

16
releases/slt-0.0.3.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.3</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.3.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

16
releases/slt-0.0.4.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.4</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.4.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

16
releases/slt-0.0.5.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.5</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.5.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

16
releases/slt-0.0.6.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.6</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.6.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

16
releases/slt-0.0.7.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.7</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.7.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

16
releases/slt-0.0.8.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.8</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.8.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

16
releases/slt-0.0.9.xml Normal file
View File

@ -0,0 +1,16 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>0.0.9</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-0.0.9.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="3.[012345678]|3.10"/>
</update>

BIN
releases/slt-1.0.0.tar.gz Normal file

Binary file not shown.

20
releases/slt-1.0.0.xml Normal file
View File

@ -0,0 +1,20 @@
<update>
<name>SLT Template</name>
<description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element>
<type>template</type>
<client>site</client>
<version>1.0.0</version>
<downloads>
<downloadurl type="full" format="tar.gz">$DL_PREFIX/slt-1.0.0.tar.gz</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
<!--<tag>rc</tag>-->
<!--<tag>beta</tag>-->
<!--<tag>alpha</tag>-->
<!--<tag>dev</tag>-->
</tags>
<maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version="4[.].*"/>
</update>

View File

@ -3,14 +3,18 @@
<description>Template for the SLT for the Joomla! CMS</description> <description>Template for the SLT for the Joomla! CMS</description>
<element>slt</element> <element>slt</element>
<type>template</type> <type>template</type>
<client>0</client> <client>site</client>
<version>__VERSION__</version> <version>$VERSION</version>
<downloads> <downloads>
<downloadurl type="full" format="__FORMAT__">__DOWNLOAD_URL__</downloadurl> <downloadurl type="full" format="$FORMAT">$DOWNLOAD_URL</downloadurl>
</downloads> </downloads>
<tags> <tags>
<tag>stable</tag> <tag>stable</tag>
<!--<tag>rc</tag>-->
<!--<tag>beta</tag>-->
<!--<tag>alpha</tag>-->
<!--<tag>dev</tag>-->
</tags> </tags>
<maintainer>Christian Wolf</maintainer> <maintainer>Christian Wolf</maintainer>
<targetplatform name="joomla" version=".*"/> <targetplatform name="joomla" version="4[.].*"/>
</update> </update>

View File

@ -5,7 +5,10 @@ MINOR=`cat serial/minor`
RELEASE=`cat serial/release` RELEASE=`cat serial/release`
TOTRELEASE="$MAJOR.$MINOR.$RELEASE" TOTRELEASE="$MAJOR.$MINOR.$RELEASE"
outname="releases/slt-$TOTRELEASE.tar.gz" filebase="slt-$TOTRELEASE"
filename="$filebase.tar.gz"
outname="releases/$filename"
xmlname="releases/$filebase.xml"
mkdir -p releases mkdir -p releases
@ -17,3 +20,9 @@ if [ -f "$outname" ]; then
fi fi
cp slt.tar.gz "$outname" cp slt.tar.gz "$outname"
export VERSION="$TOTRELEASE"
export FORMAT='tar.gz'
export DOWNLOAD_URL="\$DL_PREFIX/$filename"
cat res/update.template | envsubst > "$xmlname"

View File

@ -1,22 +1,11 @@
#!/bin/bash #!/bin/bash
# DL_PREFIX="https://slt.wolf-stuttgart.net/update/template"
cat res/prefix.template > slt-update.xml cat res/prefix.template > slt-update.xml
find releases -name slt-\* | sort -V | while read f find releases -name slt-\*.xml | sort -V | while read f
do do
# Replace DL_PREFIX in the XML parts and combine them
VSTR=`echo "$f" | sed -E 's@releases/slt-@@; s@^([0-9]+\.[0-9]+\.[0-9]+).*$@\1@'` cat "$f" | envsubst >> slt-update.xml
FILE=`echo "$f" | sed 's@releases/@@'`
FORMAT=`echo "$f" | sed -E 's@^.*[0-9]+\.[0-9]+\.[0-9]+\.@@'`
sed '
s@__VERSION__@'"$VSTR"'@g;
s@__DOWNLOAD_URL__@'"$DL_PREFIX/files/$FILE"'@g;
s@__FORMAT__@'"$FORMAT"'@g
' res/update.template >> slt-update.xml
done done

View File

@ -1 +1 @@
0 1

View File

@ -1 +1 @@
10 0

View File

@ -5,6 +5,7 @@
"stylelint-scss" "stylelint-scss"
], ],
"rules": { "rules": {
"indentation": 4 "indentation": 4,
"selector-class-pattern": "^([a-z][a-z0-9]*)((-|__)[a-z0-9]+)*$"
} }
} }

View File

@ -1,4 +1,4 @@
#left-menu .current-page-menu ul.menu { #left-menu .current-page-menu ul.mod-menu {
background-color: transparent; background-color: transparent;
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;

View File

@ -5,10 +5,11 @@ define('JPATH_BASE', '../../../');
require_once ( JPATH_BASE .'/includes/defines.php' ); require_once ( JPATH_BASE .'/includes/defines.php' );
require_once ( JPATH_BASE .'/includes/framework.php' ); require_once ( JPATH_BASE .'/includes/framework.php' );
/* Create the Application */ $container = \Joomla\CMS\Factory::getContainer();
$mainframe = JFactory::getApplication('site'); $container->alias(\Joomla\Session\SessionInterface::class, 'session.web.site');
$mainframe->initialise(); $mainframe = $container->get(\Joomla\CMS\Application\SiteApplication::class);
$params = JFactory::getApplication()->getTemplate(true)->params; $template = $mainframe->getTemplate(true);
$params = $template->params;
header("content-type: text/css"); header("content-type: text/css");
@ -24,8 +25,6 @@ header("Cache-Control: must-revalidate, max-age=$offset, public");
$leftImageValue = (empty($params['imgleft']) ? "none" : "url(\"" . JPATH_BASE. "/" . $params['imgleft'] . "\")") ; $leftImageValue = (empty($params['imgleft']) ? "none" : "url(\"" . JPATH_BASE. "/" . $params['imgleft'] . "\")") ;
$rightImageValue = (empty($params['imgright']) ? "none" : "url(\"" . JPATH_BASE . "/" . $params['imgright'] . "\")") $rightImageValue = (empty($params['imgright']) ? "none" : "url(\"" . JPATH_BASE . "/" . $params['imgright'] . "\")")
// $leftImageValue = (empty($params['imgleft']) ? "none" : "url(\"" . $this->baseurl . "/" . $params['imgleft'] . "\")") ;
// $rightImageValue = (empty($params['imgright']) ? "none" : "url(\"" . $this->baseurl . "/" . $params['imgright'] . "\")")
?> ?>
@ -67,7 +66,7 @@ a, a:hover, a:active, a:visited
color: <?php echo $params['licolor3']; ?>; color: <?php echo $params['licolor3']; ?>;
} }
ul.menu { ul.mod-menu {
background-color: <?php echo $params['bgcolor1']; ?>; background-color: <?php echo $params['bgcolor1']; ?>;
color: <?php echo $params['fgcolor1']; ?>; color: <?php echo $params['fgcolor1']; ?>;
} }
@ -77,8 +76,8 @@ ul.menu {
color: <?php echo $params['fgcolor1']; ?>; color: <?php echo $params['fgcolor1']; ?>;
} }
ul.menu li.current > a, ul.mod-menu li.current > a,
ul.menu li.current:hover > a ul.mod-menu li.current:hover > a
{ {
background-color: <?php echo $params['bgcolor2']; ?>; background-color: <?php echo $params['bgcolor2']; ?>;
color: <?php echo $params['licolor2']; ?>; color: <?php echo $params['licolor2']; ?>;
@ -86,27 +85,27 @@ ul.menu li.current:hover > a
ul.nav > li > a:hover, ul.nav > li > a:hover,
ul.nav > li > a:focus, ul.nav > li > a:focus,
ul.nav-child > li > a:hover, ul.mod-menu__sub > li > a:hover,
ul.nav-child > li > a:focus ul.mod-menu__sub > li > a:focus
{ {
background-color: <?php echo $params['bgcolor3']; ?>; background-color: <?php echo $params['bgcolor3']; ?>;
color: <?php echo $params['licolor3']; ?>; color: <?php echo $params['licolor3']; ?>;
} }
#topmenu, #topmenu,
#topmenu > ul.menu { #topmenu > ul.mod-menu {
background-color: <?php echo $params['topbgcolor1']; ?>; background-color: <?php echo $params['topbgcolor1']; ?>;
color: <?php echo $params['topfgcolor1']; ?>; color: <?php echo $params['topfgcolor1']; ?>;
} }
#topmenu .nav-child > li.current #topmenu .mod-menu__sub > li.current
{ {
background-color: <?php echo $params['topbgcolor2']; ?>; background-color: <?php echo $params['topbgcolor2']; ?>;
color: <?php echo $params['topfgcolor2']; ?>; color: <?php echo $params['topfgcolor2']; ?>;
} }
#topmenu .nav-child { #topmenu .mod-menu__sub {
background-color: <?php echo $params['topbgcolor3']; ?>; background-color: <?php echo $params['topbgcolor3']; ?>;
color: <?php echo $params['topfgcolor3']; ?>; color: <?php echo $params['topfgcolor3']; ?>;
} }
@ -114,8 +113,8 @@ ul.nav-child > li > a:focus
#topmenu .nav > li:hover, #topmenu .nav > li:hover,
#topmenu .nav > li:focus, #topmenu .nav > li:focus,
#topmenu .nav > li.active, #topmenu .nav > li.active,
#topmenu .nav-child > li:hover, #topmenu .mod-menu__sub > li:hover,
#topmenu .nav-child > li:focus #topmenu .mod-menu__sub > li:focus
{ {
background-color: <?php echo $params['topbgcolor2']; ?>; background-color: <?php echo $params['topbgcolor2']; ?>;
color: <?php echo $params['topfgcolor2']; ?>; color: <?php echo $params['topfgcolor2']; ?>;

View File

@ -8,7 +8,7 @@
display: block; display: block;
margin: 15px 0 15px 5px; margin: 15px 0 15px 5px;
> ul.menu { > ul.mod-menu {
padding: 10px; padding: 10px;
li > a { li > a {
@ -17,15 +17,27 @@
} }
} }
.nav {
display: block;
li > a {
display: block;
}
}
.nav > li, .nav > li,
.nav-child > li { .mod-menu__sub > li {
padding: 5px 0; padding: 5px 0;
border-top-style: solid; border-top-style: solid;
border-width: 1px; border-width: 1px;
&:first-child {
border-top-style: none;
}
} }
.nav > li:first-child, // .nav > li:first-child,
.nav-child > li:first-child { // .mod-menu__sub > li:first-child {
border-top-style: none; // border-top-style: none;
} // }
} }

View File

@ -8,7 +8,7 @@
} }
} }
.nav-child { .mod-menu__sub {
font-size: small; font-size: small;
> li > a { > li > a {
@ -19,13 +19,13 @@
} }
.nav, .nav,
.nav-child { .mod-menu__sub {
padding: 0; padding: 0;
> li { > li {
display: block; display: block;
> .nav-child { > .mod-menu__sub {
padding-left: 10px; padding-left: 10px;
margin-left: 10px; margin-left: 10px;
@ -37,7 +37,7 @@
} }
ul.nav > li > a:hover, ul.nav > li > a:hover,
ul.nav-child > li > a:hover { ul.mod-menu__sub > li > a:hover {
/* background-color: inherit; */ /* background-color: inherit; */
/* FIXME */ /* FIXME */

View File

@ -34,6 +34,8 @@
padding: 0; padding: 0;
border: none; border: none;
margin-left: 0; margin-left: 0;
display: flex;
flex-direction: column;
} }
li { li {
@ -41,7 +43,7 @@
margin-right: 5px; margin-right: 5px;
} }
.nav-child > li { .mod-menu__sub > li {
margin: 0; margin: 0;
} }
@ -54,7 +56,7 @@
border: none; border: none;
} }
> ul.menu { > ul.mod-menu {
background-color: initial; background-color: initial;
color: initial; color: initial;
margin-bottom: initial; margin-bottom: initial;

View File

@ -6,10 +6,8 @@
text-align: center; text-align: center;
@include abstract.for-desktop { @include abstract.for-desktop {
position: fixed;
display: flex; display: flex;
width: 100vw; width: 100vw;
z-index: 5000;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
@ -28,9 +26,10 @@
} }
.nav > li, .nav > li,
.nav-child > li { .mod-menu__sub > li {
padding: 0; padding: 0;
border-style: none; border-style: none;
height: 100%;
} }
.nav { .nav {
@ -38,13 +37,11 @@
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: space-between; justify-content: space-between;
position: relative;
align-items: center; align-items: center;
@include abstract.for-desktop { @include abstract.for-desktop {
padding: 0 10px; padding: 0 10px;
margin: 0; margin: 0;
height: 40px;
width: 980px; width: 980px;
} }
@ -57,8 +54,9 @@
} }
> a { > a {
position: relative;
font-size: large; font-size: large;
display: block;
height: 100%;
@include abstract.for-desktop { @include abstract.for-desktop {
font-size: large; font-size: large;
@ -72,12 +70,11 @@
background-color: inherit; background-color: inherit;
} }
> .nav-child { > .mod-menu__sub {
position: absolute; position: absolute;
display: none; display: none;
@include abstract.for-desktop { @include abstract.for-desktop {
z-index: 3000;
margin: 0 20px 10px 0; margin: 0 20px 10px 0;
border: none; border: none;
padding: 0; padding: 0;
@ -93,10 +90,6 @@
@include abstract.for-desktop { @include abstract.for-desktop {
padding: 10px 5px 10px 4px; padding: 10px 5px 10px 4px;
// border-left-color: transparent;
// border-left-style: solid;
// border-left-width: 6px;
border-left: 6px solid transparent; border-left: 6px solid transparent;
} }
} }
@ -107,7 +100,7 @@
} }
} }
&:hover > .nav-child { &:hover > .mod-menu__sub {
display: block; display: block;
@include abstract.for-desktop { @include abstract.for-desktop {
@ -126,49 +119,53 @@
color: inherit; color: inherit;
} }
.nav-child > li:hover > a:hover, .mod-menu__sub > li:hover > a:hover,
.nav-child > li:focus > a:hover, .mod-menu__sub > li:focus > a:hover,
.nav-child > li:hover > a:focus { .mod-menu__sub > li:hover > a:focus {
text-decoration: none; text-decoration: none;
} }
} }
// Special colors for topics // Special colors for topics
> ul.nav .nav-child a.lehre { > ul.nav .mod-menu__sub a.lehre {
border-left-color: abstract.$color-lehre; border-left-color: abstract.$color-lehre;
} }
> ul.nav .nav-child a.breitensport { > ul.nav .mod-menu__sub a.breitensport {
border-left-color: abstract.$color-breitensport; border-left-color: abstract.$color-breitensport;
} }
> ul.nav .nav-child a.jugend { > ul.nav .mod-menu__sub a.jugend {
border-left-color: abstract.$color-jugend; border-left-color: abstract.$color-jugend;
} }
> ul.nav .nav-child a.jmd { > ul.nav .mod-menu__sub a.jmd {
border-left-color: abstract.$color-jmd; border-left-color: abstract.$color-jmd;
} }
> ul.nav .nav-child a.fachverbaende { > ul.nav .mod-menu__sub a.fachverbaende {
border-left-color: abstract.$color-fachverbaende; border-left-color: abstract.$color-fachverbaende;
} }
> ul.nav .nav-child a.sport { > ul.nav .mod-menu__sub a.sport {
border-left-color: abstract.$color-sport; border-left-color: abstract.$color-sport;
} }
} }
#topmenu-div { #topmenu-div {
@include abstract.for-desktop { @include abstract.for-desktop {
position: sticky;
top: 0;
width: 100vw; width: 100vw;
height: 40px; height: 40px;
z-index: 1;
} }
} }
a.facebook { a.facebook {
img { img {
display: none; display: none;
height: 25px;
@include abstract.for-desktop { @include abstract.for-desktop {
display: inline; display: inline;

View File

@ -4,7 +4,7 @@ defined('_JEXEC') or die;
use Joomla\CMS\Uri\Uri; use Joomla\CMS\Uri\Uri;
JHTML::_('behavior.framework', true); //JHTML::_('behavior.framework', true);
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$doc = JFactory::getDocument(); $doc = JFactory::getDocument();
@ -15,18 +15,11 @@ JHtml::_('bootstrap.loadCss', true, $this->direction);
// Add jQuery framework // Add jQuery framework
JHtml::_('jquery.framework'); JHtml::_('jquery.framework');
// Add template js
//JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true));
// Add html5 shiv
//JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
// Add Stylesheets // Add Stylesheets
JHtml::_('stylesheet', 'templates/system/css/system.css', array('version' => 'auto', 'relative' => false)); JHtml::_('stylesheet', 'templates/system/css/system.css', array('version' => 'auto', 'relative' => false));
// JHtml::_('stylesheet', 'media/jui/css/icomoon.css', array('version' => 'auto', 'relative' => false));
JHtml::_('stylesheet', 'style.css', array('version' => 'auto', 'relative' => true)); JHtml::_('stylesheet', 'style.css', array('version' => 'auto', 'relative' => true));
$doc->addStyleSheet($this->baseurl.'/media/jui/css/icomoon.css'); $doc->addStyleSheet($this->baseurl.'/media/system/css/joomla-fontawesome.css');
$doc->addStyleSheet($this->baseurl.'/templates/slt/css/dynamic-styles.css.php?Itemid=' . $app->input->getInt('Itemid')); $doc->addStyleSheet($this->baseurl.'/templates/slt/css/dynamic-styles.css.php?Itemid=' . $app->input->getInt('Itemid'));
// Add Javascript for mobile menu // Add Javascript for mobile menu
@ -46,8 +39,7 @@ JHtml::_('script', 'user.js', array('version' => 'auto', 'relative' => true));
<head> <head>
<jdoc:include type="head" /> <jdoc:include type="head" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head> </head>
<body> <body>

664
slt/package-lock.json generated

File diff suppressed because it is too large Load Diff