Author: adrianc
Date: Sat Aug 16 08:52:47 2008 New Revision: 686515 URL: http://svn.apache.org/viewvc?rev=686515&view=rev Log: Collapsible masthead, based upon a patch provided by Bruno Busco - https://issues.apache.org/jira/browse/OFBIZ-1919. Modified: ofbiz/trunk/framework/common/webcommon/includes/header.ftl ofbiz/trunk/framework/common/widget/CommonScreens.xml ofbiz/trunk/framework/images/webapp/images/maincss.css Modified: ofbiz/trunk/framework/common/webcommon/includes/header.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/header.ftl?rev=686515&r1=686514&r2=686515&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/includes/header.ftl (original) +++ ofbiz/trunk/framework/common/webcommon/includes/header.ftl Sat Aug 16 08:52:47 2008 @@ -60,7 +60,11 @@ </#if> ${layoutSettings.extraHead?if_exists} </head> - +<#if layoutSettings.headerImageLinkUrl?exists> + <#assign logoLinkURL = "${layoutSettings.headerImageLinkUrl}"> +<#else> + <#assign logoLinkURL = "${layoutSettings.commonHeaderImageLinkUrl}"> +</#if> <body> <div class="hidden"> <a href="#column-container" title="${uiLabelMap.CommonSkipNavigation}" accesskey="2"> @@ -69,30 +73,49 @@ </div> <div id="masthead"> <ul> - <#if layoutSettings.headerImageLinkUrl?exists> - <#assign logoLinkURL = "${layoutSettings.headerImageLinkUrl}"> + <#if (userPreferences.COMPACT_HEADER)?default("N") == "Y"> + <li class="logo-area"> + <#if layoutSettings.shortcutIcon?has_content> + <a href="<@ofbizUrl>${logoLinkURL}</@ofbizUrl>"><img src="<@ofbizContentUrl>${layoutSettings.shortcutIcon}</@ofbizContentUrl>"/></a> + </#if> + </li> + <li> + <#if person?has_content> + ${uiLabelMap.CommonWelcome} ${person.firstName?if_exists} ${person.lastName?if_exists} [${userLogin.userLoginId}] + <#elseif partyGroup?has_content> + ${uiLabelMap.CommonWelcome} ${partyGroup.groupName?if_exists} [${userLogin.userLoginId}] + <#else> + ${uiLabelMap.CommonWelcome}! + </#if> + </li> + <li>${nowTimestamp?datetime?string.short}</li> + <li class="control-area"> + <p class="collapsed"><a href="setUserPreference?userPrefGroupId=GLOBAL_PREFERENCES&userPrefTypeId=COMPACT_HEADER&userPrefValue=N"> </a></p> + </li> <#else> - <#assign logoLinkURL = "${layoutSettings.commonHeaderImageLinkUrl}"> - </#if> - <#if layoutSettings.headerImageUrl?exists> - <li class="logo-area"><a href="<@ofbizUrl>${logoLinkURL}</@ofbizUrl>"><img alt="${layoutSettings.companyName}" src="<@ofbizContentUrl>${layoutSettings.headerImageUrl}</@ofbizContentUrl>"/></a></li> - <#else> - <li class="logo-area"><a href="<@ofbizUrl>${logoLinkURL}</@ofbizUrl>"><img alt="${layoutSettings.companyName}" src="<@ofbizContentUrl>${layoutSettings.commonHeaderImageUrl}</@ofbizContentUrl>"/></a></li> - </#if> - <li class="control-area"<#if layoutSettings.headerRightBackgroundUrl?has_content> background="${layoutSettings.headerRightBackgroundUrl}"</#if>> - <p> - <#if person?has_content> - ${uiLabelMap.CommonWelcome} ${person.firstName?if_exists} ${person.lastName?if_exists} [${userLogin.userLoginId}] - <#elseif partyGroup?has_content> - ${uiLabelMap.CommonWelcome} ${partyGroup.groupName?if_exists} [${userLogin.userLoginId}] + <#if layoutSettings.headerImageUrl?exists> + <li class="logo-area"><a href="<@ofbizUrl>${logoLinkURL}</@ofbizUrl>"><img alt="${layoutSettings.companyName}" src="<@ofbizContentUrl>${layoutSettings.headerImageUrl}</@ofbizContentUrl>"/></a></li> <#else> - ${uiLabelMap.CommonWelcome}! + <li class="logo-area"><a href="<@ofbizUrl>${logoLinkURL}</@ofbizUrl>"><img alt="${layoutSettings.companyName}" src="<@ofbizContentUrl>${layoutSettings.commonHeaderImageUrl}</@ofbizContentUrl>"/></a></li> </#if> - </p> - <p>${nowTimestamp?datetime?string.short}</p> - <p>${uiLabelMap.CommonLanguageTitle} : ${locale.getDisplayName(locale)} <a href="<@ofbizUrl>LookupLocales</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonChange}</a></p> - <p>${timeZone.getDisplayName(timeZone.useDaylightTime(), Static["java.util.TimeZone"].LONG, locale)} <a href="<@ofbizUrl>LookupTimezones</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonChange}</a></p> - </li> + <li class="control-area"<#if layoutSettings.headerRightBackgroundUrl?has_content> background="${layoutSettings.headerRightBackgroundUrl}"</#if>> + <#if userLogin?exists> + <p class="expanded"><a href="setUserPreference?userPrefGroupId=GLOBAL_PREFERENCES&userPrefTypeId=COMPACT_HEADER&userPrefValue=Y"> </a></p> + </#if> + <p> + <#if person?has_content> + ${uiLabelMap.CommonWelcome} ${person.firstName?if_exists} ${person.lastName?if_exists} [${userLogin.userLoginId}] + <#elseif partyGroup?has_content> + ${uiLabelMap.CommonWelcome} ${partyGroup.groupName?if_exists} [${userLogin.userLoginId}] + <#else> + ${uiLabelMap.CommonWelcome}! + </#if> + </p> + <p>${nowTimestamp?datetime?string.short}</p> + <p>${uiLabelMap.CommonLanguageTitle} : ${locale.getDisplayName(locale)} <a href="<@ofbizUrl>LookupLocales</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonChange}</a></p> + <p>${timeZone.getDisplayName(timeZone.useDaylightTime(), Static["java.util.TimeZone"].LONG, locale)} <a href="<@ofbizUrl>LookupTimezones</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonChange}</a></p> + </li> + </#if> </ul> <br class="clear" /> </div> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=686515&r1=686514&r2=686515&view=diff ============================================================================== --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Sat Aug 16 08:52:47 2008 @@ -128,6 +128,10 @@ <!-- The default (global) logo --> <set field="layoutSettings.commonHeaderImageUrl" value="/images/ofbiz_logo.jpg" global="true"/> <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" default-value="main" global="true"/> + <service service-name="getUserPreferenceGroup"> + <field-map field-name="userPrefGroupId" value="GLOBAL_PREFERENCES"/> + </service> + <set field="userPreferences" from-field="userPrefMap" global="true"/> </actions> <widgets> <!-- render header --> Modified: ofbiz/trunk/framework/images/webapp/images/maincss.css URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/maincss.css?rev=686515&r1=686514&r2=686515&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/maincss.css (original) +++ ofbiz/trunk/framework/images/webapp/images/maincss.css Sat Aug 16 08:52:47 2008 @@ -876,11 +876,11 @@ color: #000000; font-weight: bold; height: 1%; /* IE fix */ -padding: 0.4em; } #masthead ul li { float: left; +padding: 0.4em; } #masthead ul .logo-area { @@ -893,6 +893,18 @@ text-align: right; } +#masthead ul .control-area .expanded { +background: url(/images/collapse.gif) no-repeat right; +min-height: 10px; +min-width: 10px; +} + +#masthead ul .control-area .collapsed { +background: url(/images/expand.gif) no-repeat right; +min-height: 10px; +min-width: 10px; +} + /* ========================================= */ /* ===== Footer Styles ===================== */ /* ========================================= */ |
Free forum by Nabble | Edit this page |