-
Notifications
You must be signed in to change notification settings - Fork 38
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
[FEATURE] gray badge #125
Open
KlickUndKlar
wants to merge
9
commits into
IchHabRecht:feature/show-maxitems-in-pagemodule
Choose a base branch
from
KlickUndKlar:feature/show-maxitems-in-pagemodule
base: feature/show-maxitems-in-pagemodule
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[FEATURE] gray badge #125
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ee36c1b
gray badge
KlickUndKlar 23dfe42
remove container condition
KlickUndKlar 276fa13
Fix styling and partial issue at TYPO3 10 and 12
Abdul-Hafiz 57d971c
Adapt fixes for TYPO3 12
Abdul-Hafiz 505273c
Adapt fixes for TYPO3 12 -
Abdul-Hafiz 3902cad
Adapt fixes for TYPO3 12
Abdul-Hafiz d1d44c8
Update GetVersionViewHelper.php
KlickUndKlar 829fb6d
Update GetVersionViewHelper.php
KlickUndKlar 2b2b142
[BUG] bad sign «`» in typoscript template
KlickUndKlar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace IchHabRecht\ContentDefender\ViewHelpers; | ||
|
||
use TYPO3\CMS\Core\Information\Typo3Version; | ||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; | ||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; | ||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; | ||
|
||
class GetVersionViewHelper extends AbstractViewHelper | ||
{ | ||
use CompileWithRenderStatic; | ||
|
||
public function initializeArguments() | ||
{ | ||
parent::initializeArguments(); | ||
} | ||
|
||
public static function renderStatic( | ||
array $arguments, | ||
\Closure $renderChildrenClosure, | ||
RenderingContextInterface $renderingContext | ||
) { | ||
return (new Typo3Version())->getMajorVersion(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
templates.typo3/cms-backend.100 = ichhabrecht/content-defender:Resources/Private/ | ||
templates.typo3/cms-backend.100 = ichhabrecht/content-defender:Resources/Private/Backend/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
module.tx_contentdefender { | ||
view { | ||
# cat=plugin.tx_contentdefender/file; type=string; label=Path to template root | ||
templateRootPath = EXT:content_defender/Resources/Private/Templates/Backend/ | ||
templateRootPath = EXT:content_defender/Resources/Private/Backend/Templates/ | ||
# cat=plugin.tx_contentdefender/file; type=string; label=Path to template partials | ||
partialRootPath = EXT:content_defender/Resources/Private/Partials/Backend/ | ||
partialRootPath = EXT:content_defender/Resources/Private/Backend/Partials/ | ||
# cat=plugin.tx_contentdefender/file; type=string; label=Path to template layouts | ||
layoutRootPath = EXT:content_defender/Resources/Private/Layouts/Backend/ | ||
layoutRootPath = EXT:content_defender/Resources/Private/Backend/Layouts/ | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Resources/Private/Backend/Partials/PageLayout/Grid/ColumnHeader.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
xmlns:cd="http://typo3.org/ns/IchHabRecht/ContentDefender/ViewHelpers" | ||
data-namespace-typo3-fluid="true"> | ||
|
||
<f:be.pageRenderer includeCssFiles="{0: 'EXT:content_defender/Resources/Public/Css/backend.css'}" /> | ||
|
||
<f:if condition="{cd:getVersion()} == 12"> | ||
<f:be.pageRenderer includeCssFiles="{1: 'EXT:content_defender/Resources/Public/Css/backend_v12.css'}" /> | ||
</f:if> | ||
|
||
|
||
<cd:extendPartial> | ||
<f:alias map="{maxitems: '{cd:maxitems(column: column)}'}"> | ||
|
||
<f:variable name="length" value="1"/> | ||
|
||
<f:if condition="{maxitems} > 9"> | ||
<f:variable name="length" value="2"/> | ||
</f:if> | ||
|
||
<f:if condition="{maxitems} > 99"> | ||
<f:variable name="length" value="3"/> | ||
</f:if> | ||
|
||
<div class="t3-cd-badge-container t3-cd-badge-container-length-{length}" data-maxitems="{maxitems}"> | ||
<f:if condition="{maxitems} >= 0"> | ||
<span class="badge t3-cd-badge"> | ||
{f:if(condition: '{maxitems} > 99', then: '+99', else: '{maxitems}')} | ||
</span> | ||
</f:if> | ||
<f:render partial="PageLayout/Grid/ColumnHeader" arguments="{_all}" /> | ||
</div> | ||
</f:alias> | ||
</cd:extendPartial> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
Resources/Private/Partials/Backend/PageLayout/Grid/ColumnHeader.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
@charset "UTF-8"; | ||
|
||
.t3-cd-badge-container { | ||
position: relative; | ||
.t3js-page-column .t3-cd-badge-container[data-maxitems="0"] .t3-page-ce .t3js-page-new-ce, | ||
.t3js-page-column .t3-cd-badge-container[data-maxitems="0"] .t3-page-ce .t3-page-ce-dropzone { | ||
display: none; | ||
} | ||
|
||
.t3-cd-badge-container[data-maxitems="0"] .t3-page-ce .t3js-page-new-ce, | ||
.t3-cd-badge-container[data-maxitems="0"] .t3-page-ce .t3-page-ce-dropzone { | ||
display: none; | ||
body[style="cursor: move;"] .t3js-page-column .t3-cd-badge-container[data-maxitems="0"] .t3-page-ce .t3js-page-new-ce, | ||
body[style="cursor: move;"].t3js-page-column .t3-cd-badge-container[data-maxitems="0"] .t3-page-ce .t3-page-ce-dropzone { | ||
display: block; | ||
visibility: hidden; | ||
} | ||
|
||
.t3-cd-badge { | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
transform: translate(-50%, 0); | ||
background-color: #ff0000; | ||
z-index: 100; | ||
.t3-cd-badge-container:not([data-maxitems="-1"]).t3-cd-badge-container-length-1 .t3-page-column-header { | ||
padding-left: 25px; | ||
} | ||
|
||
.t3-cd-badge.text-bg-success { | ||
background-color: #107c10; | ||
color: #ffffff; | ||
.t3-cd-badge-container:not([data-maxitems="-1"]).t3-cd-badge-container-length-2 .t3-page-column-header { | ||
padding-left: 30px; | ||
} | ||
|
||
.t3-cd-badge.text-bg-warning { | ||
background-color: #e8a33d; | ||
color: #ffffff; | ||
.t3-cd-badge-container:not([data-maxitems="-1"]).t3-cd-badge-container-length-3 .t3-page-column-header { | ||
padding-left: 40px; | ||
} | ||
|
||
.t3-cd-badge.text-bg-danger { | ||
background-color: #ff0000; | ||
color: #ffffff; | ||
.t3-cd-badge-container { | ||
position: relative; | ||
} | ||
|
||
.t3-cd-badge { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you tested the layout in all TYPO3 versions yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i say it in German – "verdammt – da war noch was 😳" I keep you updated after testing |
||
position: absolute; | ||
z-index: 1; | ||
left: 0; | ||
top: 21px; | ||
background-color: #eaeaea; | ||
color: #000000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.t3-cd-badge-container .t3-cd-badge{ | ||
background-color: #c6bebe; | ||
left: 1rem; | ||
top: 0; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand the CSS correctly for a full column there wouldn't be any badge anymore. But one of the main purposes is to tell the editor that there is a limit and it is reached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the Line 3-12 just removes the «new content-element» Button not the badge.
Line 8-12 is a fix, to prevent the shifting of the Drop area if the button is hidden.
The badge is always visible. We just hide it if there is no maxitems property in the backendlayout configuration.