Skip to content

Commit

Permalink
[BUGFIX] Disable the function bar if publishing is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
vertexvaar committed Oct 31, 2023
1 parent c326783 commit 31d2fe9
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 115 deletions.
158 changes: 80 additions & 78 deletions Resources/Private/Partials/File/FunctionBar.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,84 +3,86 @@
xmlns:publish="http://typo3.org/ns/In2code/In2publishCore/ViewHelpers"
data-namespace-typo3-fluid="true"
>
<div class="hstack gap-3 my-2">
<div class="input-group w-25">
<span class="input-group-text" id="search-input-addon">
<core:icon identifier="actions-search"/>
</span>
<div class="form-control-clearable">
<input type="text" class="t3js-clearable form-control js-form-search" placeholder="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enterSearchString')}" aria-label="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enterSearchString')}" aria-describedby="search-input-addon">
<f:if condition="{publishingAvailable}">
<div class="hstack gap-3 my-2">
<div class="input-group w-25">
<span class="input-group-text" id="search-input-addon">
<core:icon identifier="actions-search"/>
</span>
<div class="form-control-clearable">
<input type="text" class="t3js-clearable form-control js-form-search" placeholder="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enterSearchString')}" aria-label="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.enterSearchString')}" aria-describedby="search-input-addon">
</div>
</div>
<f:if condition="{config.view.records.filterButtons}">
<p class="m-0">
<f:translate key="record.filter"/>
</p>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusAdded"
value="added"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'added' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'added\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusAdded">
<f:translate key="record.state.added.short"/>
</label>
</div>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusChanged"
value="changed"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'changed' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'changed\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusChanged">
<f:translate key="record.state.changed.short"/>
</label>
</div>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusDeleted"
value="deleted"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'deleted' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'deleted\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusDeleted">
<f:translate key="record.state.deleted.short"/>
</label>
</div>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusMoved"
value="moved"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'moved' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'moved\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusMoved">
<f:translate key="record.state.moved.short"/>
</label>
</div>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusUnchanged"
value="unchanged"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'unchanged' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'unchanged\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusUnchanged">
<f:translate key="record.state.unchanged.short"/>
</label>
</div>
</f:if>
</div>
<f:if condition="{config.view.records.filterButtons}">
<p class="m-0">
<f:translate key="record.filter"/>
</p>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusAdded"
value="added"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'added' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'added\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusAdded">
<f:translate key="record.state.added.short"/>
</label>
</div>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusChanged"
value="changed"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'changed' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'changed\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusChanged">
<f:translate key="record.state.changed.short"/>
</label>
</div>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusDeleted"
value="deleted"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'deleted' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'deleted\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusDeleted">
<f:translate key="record.state.deleted.short"/>
</label>
</div>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusMoved"
value="moved"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'moved' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'moved\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusMoved">
<f:translate key="record.state.moved.short"/>
</label>
</div>
<div class="form-check form-switch">
<input
class="form-check-input js-in2publish-filter"
type="checkbox"
role="switch"
id="toggleStatusUnchanged"
value="unchanged"
data-href="{f:uri.action(action: 'toggleFilterStatus', arguments: { filter: 'unchanged' })}"
{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'unchanged\',key:\'files\')}',then:' checked')}>
<label class="form-check-label m-0" for="toggleStatusUnchanged">
<f:translate key="record.state.unchanged.short"/>
</label>
</div>
</f:if>
</div>
</f:if>
</html>
76 changes: 39 additions & 37 deletions Resources/Private/Partials/Record/FunctionBar.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,43 @@
>
<f:comment><![CDATA[This comment prevents that the <publish:/> ns is removed on reformat code.]]></f:comment>

<div class="in2publish-functions-bar">
<f:comment>
Filter buttons
</f:comment>
<f:if condition="{config.view.records.filterButtons}">
<div class="in2publish-functions-bar__filter">
<f:link.action
action="toggleFilterStatus"
class="in2publish-icon-status-changed in2publish-functions-bar__filter__link{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'changed\')}',then:' in2publish-functions-bar--active')}"
additionalAttributes="{data-action-toggle-filter-status:1}"
arguments="{filter:'changed'}">
<i class="in2publish-icon-folder-open" title="Show only changed pages"></i>
</f:link.action>
<f:link.action
action="toggleFilterStatus"
class="in2publish-icon-status-added in2publish-functions-bar__filter__link{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'added\')}',then:' in2publish-functions-bar--active')}"
additionalAttributes="{data-action-toggle-filter-status:1}"
arguments="{filter:'added'}">
<i class="in2publish-icon-folder-plus" title="Show only added pages"></i>
</f:link.action>
<f:link.action
action="toggleFilterStatus"
class="in2publish-icon-status-deleted in2publish-functions-bar__filter__link{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'deleted\')}',then:' in2publish-functions-bar--active')}"
additionalAttributes="{data-action-toggle-filter-status:1}"
arguments="{filter:'deleted'}">
<i class="in2publish-icon-folder-minus" title="Show only deleted pages"></i>
</f:link.action>
<f:link.action
action="toggleFilterStatus"
class="in2publish-icon-status-moved in2publish-functions-bar__filter__link{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'moved\')}',then:' in2publish-functions-bar--active')}"
additionalAttributes="{data-action-toggle-filter-status:1}"
arguments="{filter:'moved'}">
<i class="in2publish-icon-folder-download" title="Show only moved pages"></i>
</f:link.action>
</div>
</f:if>
</div>
<f:if condition="{publishingAvailable}">
<div class="in2publish-functions-bar">
<f:comment>
Filter buttons
</f:comment>
<f:if condition="{config.view.records.filterButtons}">
<div class="in2publish-functions-bar__filter">
<f:link.action
action="toggleFilterStatus"
class="in2publish-icon-status-changed in2publish-functions-bar__filter__link{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'changed\')}',then:' in2publish-functions-bar--active')}"
additionalAttributes="{data-action-toggle-filter-status:1}"
arguments="{filter:'changed'}">
<i class="in2publish-icon-folder-open" title="Show only changed pages"></i>
</f:link.action>
<f:link.action
action="toggleFilterStatus"
class="in2publish-icon-status-added in2publish-functions-bar__filter__link{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'added\')}',then:' in2publish-functions-bar--active')}"
additionalAttributes="{data-action-toggle-filter-status:1}"
arguments="{filter:'added'}">
<i class="in2publish-icon-folder-plus" title="Show only added pages"></i>
</f:link.action>
<f:link.action
action="toggleFilterStatus"
class="in2publish-icon-status-deleted in2publish-functions-bar__filter__link{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'deleted\')}',then:' in2publish-functions-bar--active')}"
additionalAttributes="{data-action-toggle-filter-status:1}"
arguments="{filter:'deleted'}">
<i class="in2publish-icon-folder-minus" title="Show only deleted pages"></i>
</f:link.action>
<f:link.action
action="toggleFilterStatus"
class="in2publish-icon-status-moved in2publish-functions-bar__filter__link{f:if(condition:'{publish:Miscellaneous.GetFilterStatus(filter:\'moved\')}',then:' in2publish-functions-bar--active')}"
additionalAttributes="{data-action-toggle-filter-status:1}"
arguments="{filter:'moved'}">
<i class="in2publish-icon-folder-download" title="Show only moved pages"></i>
</f:link.action>
</div>
</f:if>
</div>
</f:if>
</html>

0 comments on commit 31d2fe9

Please sign in to comment.