Skip to content

Commit

Permalink
Fixed: Test next FreeMarker release (OFBIZ-12934)
Browse files Browse the repository at this point in the history
This fixes errors in rainbowstone theme reported only by the new release
(2.3.33). The release before (2.3.32) did not report these errors
These errors are about not checking the presence of displayApps and
displaySecondaryApps. These errors are not present in Helveticus theme from
where I found the fixes.

This should not put in any regression, again better by safe (does it exist?)
than sorry (I don't care). Though weird that it appears only now... A proof
that FreeMarker is still improving...

Also I think that we should think more about Helveticus that seems better
finished...
  • Loading branch information
JacquesLeRoux committed Mar 10, 2024
1 parent e8aa8cd commit 891dc34
Showing 1 changed file with 105 additions and 97 deletions.
202 changes: 105 additions & 97 deletions themes/rainbowstone/template/includes/TopAppBar.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,97 @@ under the License.
<ul id="app-bar-list">
<#assign appCount = 0>
<#assign firstApp = true>
<#if displayApps??>
<#list displayApps as display>
<#assign thisApp = display.getContextRoot()>
<#assign permission = true>
<#assign selected = false>
<#assign permissions = display.getBasePermission()>
<#list permissions as perm>
<#if (perm != "NONE" && !security.hasEntityPermission(perm, "_VIEW", session))>
<#-- User must have ALL permissions in the base-permission list -->
<#assign permission = false>
</#if>
</#list>
<#if permission == true>
<#if thisApp == contextPath || contextPath + "/" == thisApp>
<#assign selected = true>
</#if>
<#assign thisApp = StringUtil.wrapString(thisApp)>
<#assign thisURL = thisApp>
<#if thisApp != "/">
<#assign thisURL = thisURL + "/control/main">
</#if>
<#if layoutSettings.suppressTab?exists && display.name == layoutSettings.suppressTab>
<#-- do not display this component-->
<#else>
<#if appCount<=appMax>
<li class="app-btn<#if selected> selected</#if>">
<#if selected>
<div id="app-selected">
<#assign alreadySelected = true>
</#if>
<a href="${thisURL}${StringUtil.wrapString(externalKeyParam)}"<#if uiLabelMap?exists> title="${uiLabelMap[display.description]}">${uiLabelMap[display.title]}<#else> title="${display.description}">${display.title}</#if></a>
<#if selected>
<div id="color-add"></div>
</div>
</#if>
</li>
<#else>
<#break>
</#if>
<#assign appCount = appCount + 1>
</#if>
</#if>
</#list>
</#if>
<#if displaySecondaryApps??>
<#list displaySecondaryApps as display>
<#assign thisApp = display.getContextRoot()>
<#assign permission = true>
<#assign selected = false>
<#assign permissions = display.getBasePermission()>
<#list permissions as perm>
<#if (perm != "NONE" && !security.hasEntityPermission(perm, "_VIEW", session))>
<#-- User must have ALL permissions in the base-permission list -->
<#assign permission = false>
</#if>
</#list>
<#if permission == true>
<#if thisApp == contextPath || contextPath + "/" == thisApp>
<#assign selected = true>
</#if>
<#assign thisApp = StringUtil.wrapString(thisApp)>
<#assign thisURL = thisApp>
<#if thisApp != "/">
<#assign thisURL = thisURL + "/control/main">
</#if>
<#if appCount<=appMax>
<li class="app-btn<#if selected> selected</#if>">
<#if selected>
<div id="app-selected">
<#assign alreadySelected = true>
</#if>
<a href="${thisURL}${StringUtil.wrapString(externalKeyParam)}"<#if uiLabelMap?exists> title="${uiLabelMap[display.description]}">${uiLabelMap[display.title]}<#else> title="${display.description}">${display.title}</#if></a>
<#if selected>
<div id="color-add"></div>
</div>
</#if>
</li>
<#else>
<#break>
</#if>
<#assign appCount = appCount + 1>
</#if>
</#list>
</#if>
</ul>
<!-- If the number of applications is greater than the maximum number of applications that can be displayed, the rest is put
in a drop-down menu. The code is deliberately doubled because otherwise, reading the code during maintenance
could be complicated. Correct if ever the performance is affected -->
<#assign appCount = 0>
<#assign moreApp = false>
<#if displayApps??>
<#list displayApps as display>
<#assign thisApp = display.getContextRoot()>
<#assign permission = true>
Expand All @@ -72,25 +163,26 @@ under the License.
<#if layoutSettings.suppressTab?exists && display.name == layoutSettings.suppressTab>
<#-- do not display this component-->
<#else>
<#if appCount<=appMax>
<li class="app-btn<#if selected> selected</#if>">
<#if selected>
<div id="app-selected">
<#assign alreadySelected = true>
</#if>
<a href="${thisURL}${StringUtil.wrapString(externalKeyParam)}"<#if uiLabelMap?exists> title="${uiLabelMap[display.description]}">${uiLabelMap[display.title]}<#else> title="${display.description}">${display.title}</#if></a>
<#if appMax < appCount>
<#if !moreApp>
<div id="more-app" <#if !alreadySelected>class="selected"</#if>>
<span>+</span>
<ul id="more-app-list">
<#assign moreApp = true>
</#if>
<li class="app-btn-sup<#if selected> selected</#if>">
<a class="more-app-a" href="${thisURL}${StringUtil.wrapString(externalKeyParam)}"<#if uiLabelMap?exists> title="${uiLabelMap[display.description]}">${uiLabelMap[display.title]}<#else> title="${display.description}">${display.title}</#if></a>
<#if selected>
<div id="color-add"></div>
</div>
<#assign currentMoreApp = display>
</#if>
</li>
<#else>
<#break>
</#if>
<#assign appCount = appCount + 1>
</#if>
</#if>
</#list>
</#if>
<#if displaySecondaryApps??>
<#list displaySecondaryApps as display>
<#assign thisApp = display.getContextRoot()>
<#assign permission = true>
Expand All @@ -111,56 +203,9 @@ under the License.
<#if thisApp != "/">
<#assign thisURL = thisURL + "/control/main">
</#if>
<#if appCount<=appMax>
<li class="app-btn<#if selected> selected</#if>">
<#if selected>
<div id="app-selected">
<#assign alreadySelected = true>
</#if>
<a href="${thisURL}${StringUtil.wrapString(externalKeyParam)}"<#if uiLabelMap?exists> title="${uiLabelMap[display.description]}">${uiLabelMap[display.title]}<#else> title="${display.description}">${display.title}</#if></a>
<#if selected>
<div id="color-add"></div>
</div>
</#if>
</li>
<#else>
<#break>
</#if>
<#assign appCount = appCount + 1>
</#if>
</#list>
</ul>
<!-- If the number of applications is greater than the maximum number of applications that can be displayed, the rest is put
in a drop-down menu. The code is deliberately doubled because otherwise, reading the code during maintenance
could be complicated. Correct if ever the performance is affected -->
<#assign appCount = 0>
<#assign moreApp = false>
<#list displayApps as display>
<#assign thisApp = display.getContextRoot()>
<#assign permission = true>
<#assign selected = false>
<#assign permissions = display.getBasePermission()>
<#list permissions as perm>
<#if (perm != "NONE" && !security.hasEntityPermission(perm, "_VIEW", session))>
<#-- User must have ALL permissions in the base-permission list -->
<#assign permission = false>
</#if>
</#list>
<#if permission == true>
<#if thisApp == contextPath || contextPath + "/" == thisApp>
<#assign selected = true>
</#if>
<#assign thisApp = StringUtil.wrapString(thisApp)>
<#assign thisURL = thisApp>
<#if thisApp != "/">
<#assign thisURL = thisURL + "/control/main">
</#if>
<#if layoutSettings.suppressTab?exists && display.name == layoutSettings.suppressTab>
<#-- do not display this component-->
<#else>
<#if appMax < appCount>
<#if !moreApp>
<div id="more-app" <#if !alreadySelected>class="selected"</#if>>
<div id="more-app">
<span>+</span>
<ul id="more-app-list">
<#assign moreApp = true>
Expand All @@ -174,45 +219,8 @@ under the License.
</#if>
<#assign appCount = appCount + 1>
</#if>
</#if>
</#list>
<#list displaySecondaryApps as display>
<#assign thisApp = display.getContextRoot()>
<#assign permission = true>
<#assign selected = false>
<#assign permissions = display.getBasePermission()>
<#list permissions as perm>
<#if (perm != "NONE" && !security.hasEntityPermission(perm, "_VIEW", session))>
<#-- User must have ALL permissions in the base-permission list -->
<#assign permission = false>
</#if>
</#list>
<#if permission == true>
<#if thisApp == contextPath || contextPath + "/" == thisApp>
<#assign selected = true>
</#if>
<#assign thisApp = StringUtil.wrapString(thisApp)>
<#assign thisURL = thisApp>
<#if thisApp != "/">
<#assign thisURL = thisURL + "/control/main">
</#if>
<#if appMax < appCount>
<#if !moreApp>
<div id="more-app">
<span>+</span>
<ul id="more-app-list">
<#assign moreApp = true>
</#if>
<li class="app-btn-sup<#if selected> selected</#if>">
<a class="more-app-a" href="${thisURL}${StringUtil.wrapString(externalKeyParam)}"<#if uiLabelMap?exists> title="${uiLabelMap[display.description]}">${uiLabelMap[display.title]}<#else> title="${display.description}">${display.title}</#if></a>
<#if selected>
<#assign currentMoreApp = display>
</#if>
</li>
</#if>
<#assign appCount = appCount + 1>
</#if>
</#list>
</#if>
<#if moreApp>
</ul> <!-- more-app-list -->
</div> <!-- more-app -->
Expand Down

0 comments on commit 891dc34

Please sign in to comment.