summary: Group params on entry form by package
* src/current/include/entry-form.xsl: Group entry form params.master
parent
dc5e5b74dc
commit
c98ece9d68
|
@ -23,6 +23,7 @@
|
||||||
<xsl:stylesheet version="1.0"
|
<xsl:stylesheet version="1.0"
|
||||||
xmlns="http://www.w3.org/1999/xhtml"
|
xmlns="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
xmlns:lv="http://www.lovullo.com/rater"
|
xmlns:lv="http://www.lovullo.com/rater"
|
||||||
xmlns:c="http://www.lovullo.com/calc"
|
xmlns:c="http://www.lovullo.com/calc"
|
||||||
xmlns:l="http://www.lovullo.com/rater/linker"
|
xmlns:l="http://www.lovullo.com/rater/linker"
|
||||||
|
@ -92,22 +93,52 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<dl>
|
<!-- generate form fields for each param -->
|
||||||
<!-- generate HTML elements for each *global* parameter, *but only if it
|
<xsl:for-each-group select="/lv:package/l:dep/preproc:sym[ @type='param' ]"
|
||||||
is used in the rater* -->
|
group-by="@src">
|
||||||
<xsl:apply-templates
|
<xsl:variable name="pkg-name"
|
||||||
select="/lv:package/l:dep/preproc:sym[ @type='param' ]"
|
select="preproc:package-name(
|
||||||
mode="entry-form">
|
current-grouping-key(),
|
||||||
|
$root-pkg )" />
|
||||||
|
|
||||||
|
<fieldset class="param-set">
|
||||||
|
<legend data-pkg-name="{$pkg-name}">
|
||||||
|
<a href="#pkg-{$pkg-name}" class="sym-ref sym-pkg sym-large">
|
||||||
|
<xsl:value-of select="$pkg-name" />
|
||||||
|
</a>
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
<xsl:variable name="syms" as="element( preproc:sym )*">
|
||||||
|
<xsl:perform-sort select="current-group()">
|
||||||
|
<xsl:sort select="@desc"></xsl:sort>
|
||||||
|
</xsl:perform-sort>
|
||||||
|
</xsl:variable>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
<xsl:apply-templates mode="entry-form" select="$syms">
|
||||||
<xsl:with-param name="root-pkg" select="$root-pkg" />
|
<xsl:with-param name="root-pkg" select="$root-pkg" />
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</dl>
|
</dl>
|
||||||
|
</fieldset>
|
||||||
|
</xsl:for-each-group>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script type="text/javascript" src="{$fw-path}/rater/scripts/entry-form.js"></script>
|
<script type="text/javascript" src="{$fw-path}/rater/scripts/entry-form.js"></script>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
|
||||||
|
<xsl:function name="preproc:package-name" as="xs:string">
|
||||||
|
<xsl:param name="src" as="xs:string" />
|
||||||
|
<xsl:param name="root-pkg" as="element( lv:package )"/>
|
||||||
|
|
||||||
|
<xsl:sequence select="
|
||||||
|
if ( not( $src = '' ) ) then
|
||||||
|
document( concat( $src, '.xmlo' ), $root-pkg )/lv:*/@name
|
||||||
|
else
|
||||||
|
''" />
|
||||||
|
</xsl:function>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Generate text and input for a global parameter
|
Generate text and input for a global parameter
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue