This is an automated email from the ASF dual-hosted git repository.
holivier pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new d79d7c5 Improvement: Help link using asciidoc files via generated
html (OFBIZ-11693)
d79d7c5 is described below
commit d79d7c50b81b58beb02a22118dfe04803c7bed79
Author: holivier <[email protected]>
AuthorDate: Tue May 12 16:25:25 2020 +0200
Improvement: Help link using asciidoc files via generated html (OFBIZ-11693)
1. Add a general property: userDocUri containing uri for
ofbiz.apache.org html user-documentation generated by Buildbot
2. in each theme, add a test on helpAnchor field, if it's define help
link is now on ${userDocUri}#${helpAnchor}
* if userDocUri is not defined, the general property is used
---
framework/common/config/general.properties | 3 +++
themes/bluelight/template/Header.ftl | 12 ++++++++----
themes/flatgrey/template/Header.ftl | 12 ++++++++----
themes/rainbowstone/template/includes/TopAppBar.ftl | 8 ++++++--
themes/tomahawk/template/AppBarClose.ftl | 12 ++++++++----
5 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/framework/common/config/general.properties
b/framework/common/config/general.properties
index 38a3b03..8eee50d 100644
--- a/framework/common/config/general.properties
+++ b/framework/common/config/general.properties
@@ -133,3 +133,6 @@ saveEntitySyncRemoveInfo=false
# -- Y if you want to display the multi-tenant textbox in the login page and
install specify components which related to each tenant
multitenant=N
+
+# -- Default User Documentation website uri
+userDocUri=https://ci.apache.org/projects/ofbiz/site/ofbizdoc/html5/user-manual.html
diff --git a/themes/bluelight/template/Header.ftl
b/themes/bluelight/template/Header.ftl
index f359182..9460fed 100644
--- a/themes/bluelight/template/Header.ftl
+++ b/themes/bluelight/template/Header.ftl
@@ -195,10 +195,14 @@ under the License.
<#else>
<li><a
href="<@ofbizUrl>${checkLoginUrl}</@ofbizUrl>">${uiLabelMap.CommonLogin}</a></li>
</#if>
- <#--if webSiteId?? && requestAttributes._CURRENT_VIEW_?? &&
helpTopic??-->
- <#if parameters.componentName?? &&
requestAttributes._CURRENT_VIEW_?? && helpTopic??>
- <#include
"component://common-theme/template/includes/HelpLink.ftl" />
- <li><a class="help-link <#if pageAvail?has_content> alert</#if>"
href="javascript:lookup_popup1('<@ofbizUrl>showHelp?helpTopic=${helpTopic}&portalPageId=${(parameters.portalPageId!)?html}</@ofbizUrl>','help'
,500,500);" title="${uiLabelMap.CommonHelp}"></a></li>
+ <#if helpAnchor??>
+ <li><a class="help-link alert"
href="${userDocUri!Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("general",
"userDocUri", delegator)}#${helpAnchor}" target="help"
title="${uiLabelMap.CommonHelp}"></a></li>
+ <#else>
+ <#--if webSiteId?? && requestAttributes._CURRENT_VIEW_?? &&
helpTopic??-->
+ <#if parameters.componentName?? &&
requestAttributes._CURRENT_VIEW_?? && helpTopic??>
+ <#include
"component://common-theme/template/includes/HelpLink.ftl" />
+ <li><a class="help-link <#if pageAvail?has_content>
alert</#if>"
href="javascript:lookup_popup1('<@ofbizUrl>showHelp?helpTopic=${helpTopic}&portalPageId=${(parameters.portalPageId!)?html}</@ofbizUrl>','help'
,500,500);" title="${uiLabelMap.CommonHelp}"></a></li>
+ </#if>
</#if>
<#if userLogin??>
<#if "Y" == (userPreferences.COMPACT_HEADER)?default("N")>
diff --git a/themes/flatgrey/template/Header.ftl
b/themes/flatgrey/template/Header.ftl
index b74b46e..97e20f0 100644
--- a/themes/flatgrey/template/Header.ftl
+++ b/themes/flatgrey/template/Header.ftl
@@ -157,10 +157,14 @@ under the License.
<#else>
<li>${uiLabelMap.CommonWelcome}! <a
href="<@ofbizUrl>${checkLoginUrl}</@ofbizUrl>">${uiLabelMap.CommonLogin}</a></li>
</#if>
- <#---if webSiteId?? && requestAttributes._CURRENT_VIEW_?? &&
helpTopic??-->
- <#if parameters.componentName?? &&
requestAttributes._CURRENT_VIEW_?? && helpTopic??>
- <#include
"component://common-theme/template/includes/HelpLink.ftl" />
- <li><a <#if pageAvail?has_content>class="alert"</#if>
href="javascript:lookup_popup1('<@ofbizUrl>showHelp?helpTopic=${helpTopic}&portalPageId=${(parameters.portalPageId!)?html}</@ofbizUrl>','help'
,500,500);">${uiLabelMap.CommonHelp}</a></li>
+ <#if helpAnchor??>
+ <li><a class="alert"
href="${userDocUri!Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("general",
"userDocUri", delegator)}#${helpAnchor}"
target="help">${uiLabelMap.CommonHelp}</a></li>
+ <#else>
+ <#---if webSiteId?? && requestAttributes._CURRENT_VIEW_?? &&
helpTopic??-->
+ <#if parameters.componentName?? &&
requestAttributes._CURRENT_VIEW_?? && helpTopic??>
+ <#include
"component://common-theme/template/includes/HelpLink.ftl" />
+ <li><a <#if pageAvail?has_content>class="alert"</#if>
href="javascript:lookup_popup1('<@ofbizUrl>showHelp?helpTopic=${helpTopic}&portalPageId=${(parameters.portalPageId!)?html}</@ofbizUrl>','help'
,500,500);">${uiLabelMap.CommonHelp}</a></li>
+ </#if>
</#if>
</ul>
</li>
diff --git a/themes/rainbowstone/template/includes/TopAppBar.ftl
b/themes/rainbowstone/template/includes/TopAppBar.ftl
index 90cc979..a6936dd 100644
--- a/themes/rainbowstone/template/includes/TopAppBar.ftl
+++ b/themes/rainbowstone/template/includes/TopAppBar.ftl
@@ -237,8 +237,12 @@ under the License.
</div>
<div id="main-nav-bar-right">
<div id="company-logo"></div>
- <#if parameters.componentName?exists &&
requestAttributes._CURRENT_VIEW_?exists && helpTopic?exists>
- <a class="dark-color" title="${uiLabelMap.CommonHelp}"
href="javascript:lookup_popup1('<@ofbizUrl>showHelp?helpTopic=${helpTopic}&portalPageId=${(parameters.portalPageId!)?html}</@ofbizUrl>','help'
,500,500);"><img class="appbar-btn-img" id="help-btn"
src="/rainbowstone/images/help.svg" alt="Help"></a>
+ <#if helpAnchor??>
+ <a class="dark-color" title="${uiLabelMap.CommonHelp}"
href="${userDocUri!Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("general",
"userDocUri", delegator)}#${helpAnchor}"
target="help">${uiLabelMap.CommonHelp}<img class="appbar-btn-img" id="help-btn"
src="/rainbowstone/images/help.svg" alt="Help"></a>
+ <#else>
+ <#if parameters.componentName?exists &&
requestAttributes._CURRENT_VIEW_?exists && helpTopic?exists>
+ <a class="dark-color" title="${uiLabelMap.CommonHelp}"
href="javascript:lookup_popup1('<@ofbizUrl>showHelp?helpTopic=${helpTopic}&portalPageId=${(parameters.portalPageId!)?html}</@ofbizUrl>','help'
,500,500);"><img class="appbar-btn-img" id="help-btn"
src="/rainbowstone/images/help.svg" alt="Help"></a>
+ </#if>
</#if>
<#include "component://rainbowstone/template/includes/Avatar.ftl"/>
diff --git a/themes/tomahawk/template/AppBarClose.ftl
b/themes/tomahawk/template/AppBarClose.ftl
index 3a22bd6..0467bad 100644
--- a/themes/tomahawk/template/AppBarClose.ftl
+++ b/themes/tomahawk/template/AppBarClose.ftl
@@ -72,10 +72,14 @@ under the License.
</#if>
</#if>
<#if userLogin??>
- <#--if webSiteId?? && requestAttributes._CURRENT_VIEW_?? &&
helpTopic??-->
- <#if parameters.componentName?? && requestAttributes._CURRENT_VIEW_?? &&
helpTopic??>
- <#include "component://common-theme/template/includes/HelpLink.ftl" />
- <li><a class="help-link <#if pageAvail?has_content> alert</#if>"
href="javascript:lookup_popup1('<@ofbizUrl>showHelp?helpTopic=${helpTopic}&portalPageId=${(parameters.portalPageId!)?html}</@ofbizUrl>','help'
,500,500);" title="${uiLabelMap.CommonHelp}"></a></li>
+ <#if helpAnchor??>
+ <li><a class="help-link alert"
href="${userDocUri!Static["org.apache.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("general",
"userDocUri", delegator)}#${helpAnchor}" target="help"
title="${uiLabelMap.CommonHelp}"></a></li>
+ <#else>
+ <#--if webSiteId?? && requestAttributes._CURRENT_VIEW_?? &&
helpTopic??-->
+ <#if parameters.componentName?? && requestAttributes._CURRENT_VIEW_??
&& helpTopic??>
+ <#include "component://common-theme/template/includes/HelpLink.ftl"
/>
+ <li><a class="help-link <#if pageAvail?has_content> alert</#if>"
href="javascript:lookup_popup1('<@ofbizUrl>showHelp?helpTopic=${helpTopic}&portalPageId=${(parameters.portalPageId!)?html}</@ofbizUrl>','help'
,500,500);" title="${uiLabelMap.CommonHelp}"></a></li>
+ </#if>
</#if>
<li><a
href="<@ofbizUrl>logout</@ofbizUrl>">${uiLabelMap.CommonLogout}</a></li>
<li><a
href="<@ofbizUrl>ListVisualThemes</@ofbizUrl>">${uiLabelMap.CommonVisualThemes}</a></li>