Skip to content

Commit

Permalink
[TASK] Cleanup and reduce partial override
Browse files Browse the repository at this point in the history
  • Loading branch information
garbast committed Nov 30, 2024
1 parent eca793c commit b229c48
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 73 deletions.
10 changes: 4 additions & 6 deletions Resources/Private/Partials/PageLayout/ActionControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
<div class="t3-page-ce-actions t3js-page-new-ce" id="colpos-{column.columnNumber}-page-{column.context.pageId}-{column.uniqueId}">
<f:if condition="{column.newContentElementWizardShouldBeSkipped}">
<f:then>
<a href="{column.newContentUrl}" title="{newContentTitle}" class="btn btn-default btn-sm">
<a class="btn btn-default btn-sm" href="{column.newContentUrl}" title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newContentElement')}">
<core:icon identifier="actions-add" />
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:createNewContent" />
</a>
</f:then>
<f:else>
<typo3-backend-new-content-element-wizard-button class="btn btn-default btn-sm" url="{column.newContentUrl}" subject="{newContentTitle}">
<button type="button" class="btn btn-default btn-sm">
<core:icon identifier="actions-add" />
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:createNewContent" />
</button>
<typo3-backend-new-content-element-wizard-button class="btn btn-default btn-sm" url="{column.newContentUrl}" subject="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newContentElement')}">
<core:icon identifier="actions-add" />
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:createNewContent" />
</typo3-backend-new-content-element-wizard-button>
</f:else>
</f:if>
Expand Down
5 changes: 4 additions & 1 deletion Resources/Private/Partials/PageLayout/Grid/Column.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{f:if(condition: column.unassigned, then: 't3-grid-cell-unassigned')}
{f:if(condition: '!{column.active} && !{column.unused}', then: 't3-grid-cell-restricted')}
{f:if(condition: '!{column.active} && {hideRestrictedColumns} && !{column.unused}', then: 't3-grid-cell-hidden')}
t3-gridCell-width{column.colSpan}
t3-gridCell-height{column.rowSpan}
{f:if(condition: column.definition.collapsed, then: 'collapsed')}
</f:variable>

Expand All @@ -18,7 +20,8 @@
<f:if condition="{column.active} || {column.unused}">
<div data-colpos="{column.columnNumber}" data-language-uid="{column.context.siteLanguage.languageId}"
data-collapse-colpos="{column.containerUid}-{column.columnNumber}"
class="t3-page-ce-wrapper {f:if(condition: column.items, else: 't3-page-ce-empty')}">
class="t3js-sortable t3js-sortable-lang t3js-sortable-lang-{column.context.siteLanguage.languageId} t3-page-ce-wrapper
{f:if(condition: column.items, else: 't3-page-ce-empty')}">
<f:for each="{column.items}" as="item">
<f:render partial="PageLayout/Record" arguments="{_all}" />
</f:for>
Expand Down
90 changes: 51 additions & 39 deletions Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,16 @@
<f:if condition="{column.active}">
<f:then>
<div class="t3-page-column-header-icons">
<f:if condition="{collapsable}">
<a href="#"
class="btn btn-sm btn-default btn-borderless t3js-toggle-container-column"
title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:expandcontent')}"
data-toggle-title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:collapsecontent')}"
data-collapse-state="collapsed">
<core:icon identifier="actions-view-list-expand" />
</a>
<a href="#"
class="btn btn-sm btn-default btn-borderless t3js-toggle-container-column"
title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:collapsecontent')}"
data-toggle-title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:expandcontent')}"
data-collapse-state="expanded">
<core:icon identifier="actions-view-list-collapse" />
</a>
</f:if>

<f:render section="collapsibleToggleIcon" arguments="{_all}"/>
<f:if condition="{allowEditContent} && {column.editUrl}">
<a href="{column.editUrl}"
class="btn btn-sm btn-default btn-borderless"
title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:editColumn')}">
<a href="{column.editUrl}" title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:editColumn')}"
class="btn btn-sm btn-default btn-borderless">
<core:icon identifier="actions-document-open" />
</a>
</f:if>
</div>
<span id="{columnIdentifier}">{column.title}</span>
<f:if condition="{column.definition.showMinItemsWarning}"><span class="fw-bold link-danger">
<f:if condition="{column.definition.countOfHiddenItems}">
<f:then>
<f:translate id="LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:minimum-item-count-not-reached-with-hidden" arguments="{1: column.definition.minitems, 2: column.definition.countOfHiddenItems}"/>
</f:then>
<f:else>
<f:translate id="LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:minimum-item-count-not-reached" arguments="{1: column.definition.minitems}"/>
</f:else>
</f:if>
</span></f:if>
<f:render section="collapsibleMinitemWarning" arguments="{_all}"/>
</f:then>
<f:else if="{column.unused}">
<span id="{columnIdentifier}"><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:unusedColPos"/></span>
Expand All @@ -57,18 +31,56 @@
<f:format.raw>{column.beforeSectionMarkup}</f:format.raw>
<f:if condition="{allowEditContent} && {column.contentEditable} && {column.context.allowNewContent} && {column.active}">
<div class="t3-page-ce t3js-page-ce" data-page="{column.context.pageId}" id="{column.uniqueId}">
<f:render partial="PageLayout/ActionControls" arguments="{column: column, newContentTitle: newContentTitle, allowEditContent: allowEditContent, url: column.newContentUrl}" />
<f:render partial="PageLayout/ActionControls" arguments="{column: column, allowEditContent: allowEditContent, url: column.newContentUrl}" />
<div class="t3-page-ce-dropzone t3js-page-ce-dropzone-available"></div>
</div>
</f:if>

<f:if condition="{collapsable}">
<div class="m-3 container-collapsed-column-marker t3js-expand-column">
<button type="button" class="btn btn-default btn-sm me-2">
<core:icon identifier="actions-view-list-expand"/>
</button>
{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:contentcollapsed')}
</div>
</f:if>
<f:render section="collapsibleExpandIcon" arguments="{_all}"/>

<f:section name="collapsibleToggleIcon">
<f:if condition="{collapsable}">
<a href="#"
class="btn btn-sm btn-default btn-borderless t3js-toggle-container-column"
title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:expandcontent')}"
data-toggle-title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:collapsecontent')}"
data-collapse-state="collapsed">
<core:icon identifier="actions-view-list-expand" />
</a>
<a href="#"
class="btn btn-sm btn-default btn-borderless t3js-toggle-container-column"
title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:collapsecontent')}"
data-toggle-title="{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:expandcontent')}"
data-collapse-state="expanded">
<core:icon identifier="actions-view-list-collapse" />
</a>
</f:if>
</f:section>

<f:section name="collapsibleMinitemWarning">
<f:if condition="{column.definition.showMinItemsWarning}">
<div class="fw-bold link-danger">
<f:if condition="{column.definition.countOfHiddenItems}">
<f:then>
<f:translate id="LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:minimum-item-count-not-reached-with-hidden" arguments="{1: column.definition.minitems, 2: column.definition.countOfHiddenItems}"/>
</f:then>
<f:else>
<f:translate id="LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:minimum-item-count-not-reached" arguments="{1: column.definition.minitems}"/>
</f:else>
</f:if>
</div>
</f:if>
</f:section>

<f:section name="collapsibleExpandIcon">
<f:if condition="{collapsable}">
<div class="m-3 container-collapsed-column-marker t3js-expand-column">
<button type="button" class="btn btn-default btn-sm me-2">
<core:icon identifier="actions-view-list-expand"/>
</button>
{f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:contentcollapsed')}
</div>
</f:if>
</f:section>

</html>
27 changes: 0 additions & 27 deletions Resources/Private/Partials/PageLayout/Record.html

This file was deleted.

0 comments on commit b229c48

Please sign in to comment.