Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Fischer committed May 22, 2024
2 parents 5419cef + 87ca6ba commit 3a9a393
Show file tree
Hide file tree
Showing 18 changed files with 194 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
github: [garbast]
issuehunt: # Replace with a single IssueHunt username
ko_fi: # Replace with a single Ko-fi username
liberapay: # Replace with a single Liberapay username
open_collective: # Replace with a single Open Collective username
otechie: # Replace with a single Otechie username
patreon: # Replace with a single Patreon username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: ['https://www.paypal.me/garbast']
36 changes: 36 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Commit Github-Page

on:
workflow_dispatch:

push:
branches: [ develop, main ]

permissions:
contents: write

jobs:
build-and-commit-github-page:
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Build documentation
run: |
docker run \
--rm --user $(id -u) \
-v ${PWD}:/project \
ghcr.io/typo3-documentation/render-guides:latest render Documentation
echo '<html><head><meta http-equiv="refresh" content="0; url=./Index.html" /></head></html>' > Documentation-GENERATED-temp/index.html
touch Documentation-GENERATED-temp/.nojekyll
- name: Deploy to GitHub Pages 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: Documentation-GENERATED-temp
target-folder: /
clean: true
9 changes: 8 additions & 1 deletion Classes/Xclass/ContainerGridColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function __construct(
Container $container,
int $newContentElementAtTopTarget,
bool $allowNewContentElements = true,
protected bool $collapsed = false
protected bool $collapsed = false,
protected int $minitems = 0
) {
parent::__construct(
$context,
Expand Down Expand Up @@ -96,7 +97,13 @@ public function getNewContentUrl(): string
}
}

/** @var UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
return (string)$uriBuilder->buildUriFromRoute($routeName, $urlParameters);
}

public function getMinitems(): int
{
return $this->minitems;
}
}
1 change: 1 addition & 0 deletions Classes/Xclass/ContainerGridColumnItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function getNewContentAfterUrl(): string
}
}

/** @var UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
return (string)$uriBuilder->buildUriFromRoute($routeName, $urlParameters);
}
Expand Down
7 changes: 4 additions & 3 deletions Classes/Xclass/ContainerPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
$grid = GeneralUtility::makeInstance(Grid::class, $context);
try {
$container = $this->containerFactory->buildContainer((int)$record['uid']);
} catch (Exception $e) {
} catch (Exception) {
// not a container
return $content;
}
$containerGrid = $this->tcaRegistry->getGrid($record['CType']);
foreach ($containerGrid as $row => $cols) {
foreach ($containerGrid as $cols) {
$rowObject = GeneralUtility::makeInstance(GridRow::class, $context);
foreach ($cols as $col) {
$newContentElementAtTopTarget = $this->containerService->getNewContentElementAtTopTargetInColumn($container, $col['colPos']);
Expand All @@ -52,7 +52,8 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
$container,
$newContentElementAtTopTarget,
$allowNewContentElements,
$collapsed
$collapsed,
$col['minitems'] ?? 0
);
$rowObject->addColumn($columnObject);
if (isset($col['colPos'])) {
Expand Down
57 changes: 57 additions & 0 deletions Documentation/Index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. include:: /Includes.rst.txt

============================================================
ew_collapsible_container: Container with collapsible columns
============================================================

:Extension key:
ew_collapsible_container

:Package name:
evoweb/ew-collapsible-container

:Version:
|release|

:Language:
en

:Description:
Adds collapsibility to container columns and directly link
into record form, if only one child type is allowed

:Copyright:
2024-2024

:Author:
Sebastian Fischer

:License:
This document is published under the
`Open Publication <https://www.opencontent.org/openpub/>`__.
license.

:Rendered:
|today|

----

The content of this document is related to TYPO3,
a GNU/GPL CMS/Framework available from http://typo3.org

----

**Table of Contents**

.. toctree::
:maxdepth: 2
:titlesonly:

Installation/Index

.. Meta Menu
.. toctree::
:hidden:

Sitemap
18 changes: 18 additions & 0 deletions Documentation/Installation/Index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. include:: /Includes.rst.txt

.. _installation:

============
Installation
============


Download via Composer
=====================

Add evoweb/ew-collapsible-container to the require in your composer.json.

.. code-block:: bash
:caption: Enter on shell
composer require evoweb/ew-collapsible-container
9 changes: 9 additions & 0 deletions Documentation/Sitemap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:template: sitemap.html

.. include:: /Includes.rst.txt

=======
Sitemap
=======

.. The sitemap.html template will insert here the page tree automatically.
24 changes: 24 additions & 0 deletions Documentation/guides.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<guides xmlns="https://www.phpdoc.org/guides" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.phpdoc.org/guides ../vendor/phpdocumentor/guides-cli/resources/schema/guides.xsd"
links-are-relative="true"
max-menu-depth="2"
>
<extension class="\T3Docs\Typo3DocsTheme\DependencyInjection\Typo3DocsThemeExtension"
project-home="https://github.com/evoweb/ew_collapsible_container"
project-contact="[email protected]"
project-repository="https://github.com/evoweb/ew_collapsible_container"
project-issues="https://github.com/evoweb/ew_collapsible_container/issues"
edit-on-github-branch="develop"
edit-on-github="evoWeb/ew_collapsible_container"
edit-on-github-directory="Documentation/"
typo3-core-preferred="stable"
interlink-shortcode="evoweb/sf-books"
/>
<project title="ew_collapsible_container"
release="1.4.0"
version="1.4.0"
copyright="since 2024 by evoWeb"
/>
<inventory id="t3tsref" url="https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/"/>
</guides>
4 changes: 4 additions & 0 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<source>This column is collapsed!</source>
<target>Diese Spalte ist zugeklappt</target>
</trans-unit>
<trans-unit id="minimum-item-count-not-reached">
<source>The minimum amount of %1$d child elements is not reached!</source>
<target>Die mindest Anzahl von %1$d Kindelementen ist noch nicht erreicht!</target>
</trans-unit>
</body>
</file>
</xliff>
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<trans-unit id="contentcollapsed">
<source>This column is collapsed!</source>
</trans-unit>
<trans-unit id="minimum-item-count-not-reached">
<source>The minimum amount of %1$d children is not reached!</source>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</f:if>
</div>
{column.title}
<f:if condition="{column.items -> f:count()} > 0 && {column.items -> f:count()} < {column.minitems}"><span class="fw-bold link-danger"><f:translate id="LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:minimum-item-count-not-reached" arguments="{1: column.minitems}"/></span></f:if>
</f:then>
<f:else if="{column.unused}">
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:unusedColPos"/>
Expand Down
4 changes: 3 additions & 1 deletion Resources/Private/Partials/PageLayout/Record.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
</f:render>
<f:spaceless>
<div class="t3-page-ce-body">
<f:render partial="PageLayout/RecordDefault/Preview" arguments="{_all}" />
<div class="t3-page-ce-body-inner">
<f:render partial="PageLayout/RecordDefault/Preview" arguments="{_all}" />
</div>
</div>
</f:spaceless>
<f:render partial="PageLayout/Record/{item.record.CType}/Footer" arguments="{_all}" optional="1">
Expand Down
9 changes: 5 additions & 4 deletions Resources/Private/PartialsPre12/PageLayout/Grid/Column.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<f:if condition="{collapsable}">
<a href="#"
class="btn 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')}"
title="{f:translate(id: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:expandcontent')}"
data-toggle-title="{f:translate(id: '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-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')}"
title="{f:translate(id: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:collapsecontent')}"
data-toggle-title="{f:translate(id: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:expandcontent')}"
data-collapse-state="expanded">
<core:icon identifier="actions-view-list-collapse" />
</a>
Expand All @@ -35,6 +35,7 @@
</f:if>
</div>
{column.title}
<f:if condition="{column.items -> f:count()} > 0 && {column.items -> f:count()} < {column.minitems}"><span class="fw-bold link-danger"><f:translate id="LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:minimum-item-count-not-reached" arguments="{1: column.minitems}"/></span></f:if>
</f:then>
<f:else if="{column.unassigned}">
{column.title} (<f:format.raw>{column.titleUnassigned}</f:format.raw>)
Expand Down
4 changes: 3 additions & 1 deletion Resources/Private/PartialsPre12/PageLayout/Record.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
</f:render>
<f:spaceless>
<div class="t3-page-ce-body">
<f:render partial="PageLayout/RecordDefault/Preview" arguments="{_all}" />
<div class="t3-page-ce-body-inner">
<f:render partial="PageLayout/RecordDefault/Preview" arguments="{_all}" />
</div>
</div>
</f:spaceless>
<f:render partial="PageLayout/Record/{item.record.CType}/Footer" arguments="{_all}" optional="1">
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/Container/Grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<f:for each="{grid}" as="row">
<tr>
<f:for each="{row}" as="column">
<td class="t3-grid-cell" valign="top"{f:if(condition:"{column.colspan}", then: ' colspan="{column.colspan}"')}{f:if(condition:"{column.rowspan}", then: ' rowspan="{column.rowspan}"')}>
<td class="t3-grid-cell" valign="top"{f:if(condition: column.colspan, then: ' colspan=\"{column.colspan}\"')}{f:if(condition: column.rowspan , then: ' rowspan=\"{column.rowspan}\"')}>
<container:drawChildren uid="{uid}" colPos="{column.colPos}" />
</td>
</f:for>
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"license": [
"GPL-2.0-or-later"
],
"require": {
"typo3/cms-backend": "^11.5 || ^12.4 || ^13.0"
},
"autoload": {
"psr-4": {
"Evoweb\\EwCollapsibleContainer\\": "Classes/"
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
'author_email' => '[email protected]',
'author_company' => 'evoWeb',
'state' => 'stable',
'version' => '1.3.1',
'version' => '1.4.0',
'constraints' => [
'depends' => [
'typo3' => '11.5.0-12.4.99',
'typo3' => '11.5.0-13.4.99',
],
],
];

0 comments on commit 3a9a393

Please sign in to comment.