New feature - Page Layout Best Practices demonstration and visual theme test jig.

Based on a recent dev mailing list discussion, I added a page to the Example component that demonstrates some basic layout concepts. The idea is to display the page, then look at the screen widget definition and the HTML markup to see how the page is constructed.

The page can also be used for visual theme development - because most of the common UI elements are all on one page.

This could be improved - it needs a multi-column layout example, a tree widget example, and a form widget field group example.

Internationalization note: This commit contains new UI labels.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1059429 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian Crum
2011-01-16 01:14:21 +00:00
parent 78682e55ee
commit 805555b0f1
5 changed files with 231 additions and 0 deletions
@@ -462,4 +462,160 @@ under the License.
</widgets>
</section>
</screen>
<screen name="ExampleLayoutDemo">
<!-- Demonstrates UI layout best practices and serves as a visual theme test jig.
For more information:
https://cwiki.apache.org/OFBADMIN/user-interface-layout-best-practices.html
https://cwiki.apache.org/OFBADMIN/html-and-css-best-practices.html
https://cwiki.apache.org/OFBIZ/ofbiz-maincsscss-html-element-collection-styles.html
-->
<section>
<actions>
<property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
<set field="titleProperty" value="ExampleLayoutDemo"/>
<set field="headerItem" value="LayoutDemo"/>
<set field="tabButtonItem" value="Selected"/>
<set field="demoText" value="${uiLabelMap.ExampleLayoutDemoText}" global="true"/>
<set field="errorMessage" from-field="demoText" global="true"/>
<set field="eventMessage" from-field="demoText" global="true"/>
<set field="demoTargetUrl" value="ExampleLayoutDemo"/>
<set field="demoMap.name" value="${uiLabelMap.ExampleLayoutDemo}"/>
<set field="demoMap.description" value="${uiLabelMap.ExampleLayoutDemoText}"/>
<set field="demoMap.dropDown" value="Y"/>
<set field="demoMap.checkBox" value="Y"/>
<set field="demoMap.radioButton" value="Y"/>
<set field="demoList[]" from-field="demoMap"/>
<set field="demoList[]" from-field="demoMap"/>
<set field="demoList[]" from-field="demoMap"/>
<set field="altRowStyle" value=""/>
<set field="headerStyle" value="header-row-1"/>
<set field="tableStyle" value="basic-table light-grid"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="pre-body">
<section>
<condition>
<and>
<if-has-permission permission="EXAMPLE" action="_VIEW"/>
</and>
</condition>
<widgets>
<include-menu name="LayoutDemo" location="component://example/widget/example/ExampleMenus.xml"/>
</widgets>
</section>
</decorator-section>
<decorator-section name="body">
<section>
<condition>
<if-has-permission permission="EXAMPLE" action="_VIEW"/>
</condition>
<widgets>
<section name="Standard Page Start">
<widgets>
<container style="page-title">
<label text="${uiLabelMap.ExampleLayoutDemo}"/>
</container>
<container style="button-bar button-style-1">
<!-- Typically used for intra-app links -->
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonNew}" style="create"/>
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonSelected}" style="selected"/>
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonEnabled}"/>
<link text="${uiLabelMap.CommonDisabled}" style="disabled"/>
</container>
<container style="button-bar button-style-2">
<!-- Typically used for inter-app links -->
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonNew}" style="create"/>
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonSelected}" style="selected"/>
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonEnabled}"/>
<link text="${uiLabelMap.CommonDisabled}" style="disabled"/>
</container>
</widgets>
</section>
<section name="h1-h6 Styles">
<widgets>
<horizontal-separator/>
<label style="h1" text="${demoText}"/>
<label style="h2" text="${demoText}"/>
<label style="h3" text="${demoText}"/>
<label style="h4" text="${demoText}"/>
<label style="h5" text="${demoText}"/>
<label style="h6" text="${demoText}"/>
</widgets>
</section>
<section name="Form/List Styles">
<widgets>
<horizontal-separator/>
<include-form name="LayoutDemoForm" location="component://example/widget/example/ExampleForms.xml"/>
<include-form name="LayoutDemoList" location="component://example/widget/example/ExampleForms.xml"/>
<section>
<actions>
<set field="tableStyle" value="basic-table dark-grid"/>
</actions>
<widgets/>
</section>
<include-form name="LayoutDemoList" location="component://example/widget/example/ExampleForms.xml"/>
<section>
<actions>
<set field="altRowStyle" value="alternate-row"/>
<set field="headerStyle" value="header-row-2"/>
<set field="tableStyle" value="basic-table hover-bar"/>
</actions>
<widgets/>
</section>
<include-form name="LayoutDemoList" location="component://example/widget/example/ExampleForms.xml"/>
</widgets>
</section>
<section name="Screenlet Styles">
<widgets>
<horizontal-separator/>
<screenlet>
<label text="${demoText}"/>
</screenlet>
<screenlet title="${uiLabelMap.ExampleLayoutDemo}" id="screenlet-demo" collapsible="true">
<include-form name="LayoutDemoForm" location="component://example/widget/example/ExampleForms.xml"/>
</screenlet>
<screenlet title="${uiLabelMap.ExampleLayoutDemo}" padded="false">
<section>
<actions>
<set field="altRowStyle" value="alternate-row"/>
<set field="headerStyle" value="header-row-1"/>
<set field="tableStyle" value="basic-table light-grid hover-bar"/>
</actions>
<widgets/>
</section>
<include-form name="LayoutDemoList" location="component://example/widget/example/ExampleForms.xml"/>
</screenlet>
<screenlet title="${uiLabelMap.ExampleLayoutDemo}" padded="false">
<section>
<actions>
<set field="altRowStyle" value="alternate-row"/>
<set field="headerStyle" value="header-row-2"/>
<set field="tableStyle" value="basic-table hover-bar"/>
<set field="viewSize" value="1" type="Integer"/>
</actions>
<widgets/>
</section>
<container style="button-bar button-style-1">
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonNew}" style="create"/>
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonSelected}" style="selected"/>
<link target="${demoTargetUrl}" text="${uiLabelMap.CommonEnabled}"/>
<link text="${uiLabelMap.CommonDisabled}" style="disabled"/>
</container>
<include-form name="LayoutDemoList" location="component://example/widget/example/ExampleForms.xml"/>
</screenlet>
</widgets>
</section>
</widgets>
<fail-widgets>
<label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
</fail-widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
</screens>