Skip to content

Commit

Permalink
Rewrite #2053 for Contao 5.3 (5.x)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoglo committed Apr 4, 2024
1 parent 28c3779 commit df706f1
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 26 deletions.
6 changes: 3 additions & 3 deletions core-bundle/contao/drivers/DC_File.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function edit()
}
}

$return .= "\n\n" . '<fieldset class="' . $class . ($legend ? '' : ' nolegend') . '" data-controller="contao--toggle-fieldset" data-contao--toggle-fieldset-id-value="' . $key . '" data-contao--toggle-fieldset-table-value="' . $this->strTable . '" data-contao--toggle-fieldset-collapsed-class="collapsed" data-contao--jump-targets-target="section" data-contao--jump-targets-label-value="' . ($GLOBALS['TL_LANG'][$this->strTable][$key] ?? $key) . '" data-action="contao--jump-targets:scrollto->contao--toggle-fieldset#open">' . $legend;
$return .= "\n\n" . '<fieldset class="' . $class . ($legend ? '' : ' nolegend') . '" data-controller="contao--toggle-fieldset" data-contao--toggle-fieldset-id-value="' . $key . '" data-contao--toggle-fieldset-table-value="' . $this->strTable . '" data-contao--toggle-fieldset-collapsed-class="collapsed" data-contao--jump-targets-target="section" data-contao--jump-targets-label-value="' . ($GLOBALS['TL_LANG'][$this->strTable][$key] ?? $key) . '" data-action="contao--jump-targets:scrollto->contao--toggle-fieldset#open">' . $legend . "\n" . '<div class="widget-group">';

// Build rows of the current box
foreach ($v as $vv)
Expand All @@ -207,7 +207,7 @@ public function edit()
{
$thisId = 'sub_' . substr($vv, 1, -1);
$blnAjax = $ajaxId == $thisId && Environment::get('isAjaxRequest');
$return .= "\n " . '<div id="' . $thisId . '" class="subpal cf">';
$return .= "\n " . '<div id="' . $thisId . '" class="subpal widget-group">';

continue;
}
Expand Down Expand Up @@ -246,7 +246,7 @@ public function edit()
}

$class = 'tl_box';
$return .= "\n" . '</fieldset>';
$return .= "\n</div>\n</fieldset>";
}
}

Expand Down
10 changes: 5 additions & 5 deletions core-bundle/contao/drivers/DC_Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,7 @@ public function edit($intId=null, $ajaxId=null)
}
}

$return .= "\n\n" . '<fieldset class="' . $class . ($legend ? '' : ' nolegend') . '" data-controller="contao--toggle-fieldset" data-contao--toggle-fieldset-id-value="' . $key . '" data-contao--toggle-fieldset-table-value="' . $this->strTable . '" data-contao--toggle-fieldset-collapsed-class="collapsed" data-contao--jump-targets-target="section" data-contao--jump-targets-label-value="' . ($GLOBALS['TL_LANG'][$this->strTable][$key] ?? $key) . '" data-action="contao--jump-targets:scrollto->contao--toggle-fieldset#open">' . $legend;
$return .= "\n\n" . '<fieldset class="' . $class . ($legend ? '' : ' nolegend') . '" data-controller="contao--toggle-fieldset" data-contao--toggle-fieldset-id-value="' . $key . '" data-contao--toggle-fieldset-table-value="' . $this->strTable . '" data-contao--toggle-fieldset-collapsed-class="collapsed" data-contao--jump-targets-target="section" data-contao--jump-targets-label-value="' . ($GLOBALS['TL_LANG'][$this->strTable][$key] ?? $key) . '" data-action="contao--jump-targets:scrollto->contao--toggle-fieldset#open">' . $legend . "\n" . '<div class="widget-group">';
$thisId = '';

// Build rows of the current box
Expand All @@ -2129,7 +2129,7 @@ public function edit($intId=null, $ajaxId=null)

if (\count($arrAjax) > 1)
{
$current = "\n" . '<div id="' . $thisId . '" class="subpal cf">' . $arrAjax[$thisId] . '</div>';
$current = "\n" . '<div id="' . $thisId . '" class="subpal widget-group">' . $arrAjax[$thisId] . '</div>';
unset($arrAjax[$thisId]);
end($arrAjax);
$thisId = key($arrAjax);
Expand All @@ -2147,7 +2147,7 @@ public function edit($intId=null, $ajaxId=null)
$thisId = 'sub_' . substr($vv, 1, -1);
$arrAjax[$thisId] = '';
$blnAjax = ($ajaxId == $thisId && Environment::get('isAjaxRequest')) ? true : $blnAjax;
$return .= "\n" . '<div id="' . $thisId . '" class="subpal cf">';
$return .= "\n" . '<div id="' . $thisId . '" class="subpal widget-group">';

continue;
}
Expand Down Expand Up @@ -2186,7 +2186,7 @@ public function edit($intId=null, $ajaxId=null)
}

$class = 'tl_box';
$return .= "\n" . '</fieldset>';
$return .= "\n</div>\n</fieldset>";
}

$this->submit();
Expand Down Expand Up @@ -2645,7 +2645,7 @@ public function editAll($intId=null, $ajaxId=null)
$thisId = 'sub_' . substr($v, 1, -1) . '_' . $id;
$arrAjax[$thisId] = '';
$blnAjax = ($ajaxId == $thisId && Environment::get('isAjaxRequest')) ? true : $blnAjax;
$box .= "\n " . '<div id="' . $thisId . '" class="subpal cf">';
$box .= "\n " . '<div id="' . $thisId . '" class="subpal widget-group">';

continue;
}
Expand Down
2 changes: 0 additions & 2 deletions core-bundle/contao/themes/flexible/backend.51223d60.css

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions core-bundle/contao/themes/flexible/backend.56075171.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core-bundle/contao/themes/flexible/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"entrypoints": {
"backend": {
"css": [
"/system/themes/flexible/backend.51223d60.css"
"/system/themes/flexible/backend.56075171.css"
]
},
"confirm": {
Expand Down Expand Up @@ -46,4 +46,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions core-bundle/contao/themes/flexible/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"backend.css": "/system/themes/flexible/backend.51223d60.css",
"backend.css": "/system/themes/flexible/backend.56075171.css",
"confirm.css": "/system/themes/flexible/confirm.c2996dd4.css",
"conflict.css": "/system/themes/flexible/conflict.aa6b9c95.css",
"diff.css": "/system/themes/flexible/diff.171af75f.css",
Expand All @@ -8,7 +8,7 @@
"popup.css": "/system/themes/flexible/popup.4728c2fc.css",
"tinymce.css": "/system/themes/flexible/tinymce.e5009f94.css",
"tinymce-dark.css": "/system/themes/flexible/tinymce-dark.596023db.css",
"backend.51223d60.css.map": "/system/themes/flexible/backend.51223d60.css.map",
"backend.56075171.css.map": "/system/themes/flexible/backend.56075171.css.map",
"confirm.c2996dd4.css.map": "/system/themes/flexible/confirm.c2996dd4.css.map",
"conflict.aa6b9c95.css.map": "/system/themes/flexible/conflict.aa6b9c95.css.map",
"diff.171af75f.css.map": "/system/themes/flexible/diff.171af75f.css.map",
Expand Down
92 changes: 81 additions & 11 deletions core-bundle/contao/themes/flexible/styles/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,31 @@ table.with-zebra tbody tr:nth-child(even) td {
}

/* Widgets */
.widget {
margin-left: 15px;
margin-right: 15px;
position: relative;
fieldset > .widget-group {
padding: 0 15px;
}
.widget-group {
display: grid;
grid-column-gap: 30px;
grid-template-columns: repeat(12, 1fr);
}
.widget-group > * {
grid-column: 1 / 13;
}
.widget-group > .m12 {
margin: 0;
}
.widget-group > .w50 {
grid-column: auto / span 6;
}
.widget-group > .w33 {
grid-column: auto / span 4;
}
.widget-group > .w25 {
grid-column: auto / span 3;
}
.widget-group > .clr {
grid-column-start: 1 !important;
}

.widget {
Expand Down Expand Up @@ -770,7 +791,7 @@ a.tl_submit {
}

/* Floats */
.clr {
/*.clr {
clear: both;
width: calc(100% - 30px);
}
Expand All @@ -795,8 +816,8 @@ a.tl_submit {
}
.long {
width: calc(100% - 30px); /* see #6320 */
}
width: calc(100% - 30px); !* see #6320 *!
}*/

.wizard > a {
position: relative;
Expand Down Expand Up @@ -935,7 +956,7 @@ a.tl_submit {

/* Large screens */
@media (min-width: 1280px) {
.w25 {
/*.w25 {
width: calc(25% - 30px);
}
Expand All @@ -949,7 +970,7 @@ a.tl_submit {
.w75 {
width: calc(75% - 30px);
}
}*/

#sbtog {
display: none;
Expand Down Expand Up @@ -1058,12 +1079,28 @@ a.tl_submit {
}
}

/* Smaller viewports */
@media (max-width:1279.98px) {
.widget-group > .w33 {
grid-column: auto / span 6;
}
}

/* Handheld */
@media (max-width: 767px) {
.w25, .w33, .w50, .w66, .w75 {

.widget-group > .w25,
.widget-group > .w33,
.widget-group > .w50,
.widget-group > .w66,
.widget-group > .w75 {
grid-column: 1 / 13;
}

/*.w25, .w33, .w50, .w66, .w75 {
float: none;
width: calc(100% - 30px);
}
}*/

.m12 {
padding-top: 0;
Expand All @@ -1083,3 +1120,36 @@ a.tl_submit {
margin-bottom: 1px;
}
}

/* BC */
/*
*:not(.widget-group) > .clr {
clear:both;
width:calc(100% - 30px);
}
*:not(.widget-group) > .clr:not(.widget) {
width:100%;
}
*:not(.widget-group) > .clr:before {
content:"";
display:table;
}
*:not(.widget-group) > .w50 {
width:calc(50% - 30px);
float:left;
min-height:80px;
}
*:not(.widget-group) > .long {
width:calc(100% - 30px); !* see #6320 *!
}
*:not(.widget-group) > .m12 {
margin: 0 15px;
}
@media (max-width:767px) {
*:not(.widget-group) > .w50 {
float:none;
width:calc(100% - 30px);
}
}
*/

0 comments on commit df706f1

Please sign in to comment.