Ignore:
Timestamp:
2017-01-24T04:36:48+13:00 (7 years ago)
Author:
Georgiy Litvinov
Message:

Modified query page for group select menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl

    r31286 r31346  
    194194                    <xsl:variable name="ns">s1.</xsl:variable>
    195195                    <xsl:choose>
    196                         <xsl:when test="/page/pageResponse/hierarchy">
     196                        <xsl:when test="/page/pageResponse/hierarchy and paramList/param[@name ='collection']">
    197197                            <xsl:call-template name="hierarchy">
    198198                                <xsl:with-param name="ns" select="$ns" />
     
    234234        </div>
    235235        <div class="paramValue">
    236             <select multiple="" name="s1.collection" size='10'>
     236            <select multiple="" size='10'>
     237                <xsl:attribute name="name">
     238                        <xsl:value-of select="$ns"></xsl:value-of>
     239                        <xsl:text>collection</xsl:text>
     240                    </xsl:attribute>
    237241                <xsl:for-each select="/page/pageResponse/hierarchy/*">
    238242                    <xsl:call-template name="hierarchy-display">
     
    240244                            0
    241245                        </xsl:with-param>
     246                        <xsl:with-param name="path">
     247                            <xsl:text>/</xsl:text>
     248                        </xsl:with-param>
    242249                    </xsl:call-template>
    243250                </xsl:for-each>
    244251            </select>
    245             <script type="text/javascript">
    246                 <xsl:text disable-output-escaping="yes">
    247                 function selectChildren(group) {
    248                 var value = $(group).attr("value");
    249                 var name = value.substring(5);
    250                 $("option[class^='"+name+"']").prop({selected: true});
    251                 }
    252             </xsl:text>
    253             </script>
    254252        </div>
    255253        <br class="clear" />
    256         <xsl:for-each select="paramList/param[@type='integer']">
    257             <xsl:call-template name="param-display">
    258                 <xsl:with-param name="ns" select="$ns" />
    259             </xsl:call-template>
    260         </xsl:for-each>
    261         <xsl:for-each select="paramList/param[@type='string']">
    262             <xsl:call-template name="param-display">
    263                 <xsl:with-param name="ns" select="$ns" />
    264             </xsl:call-template>
     254        <xsl:for-each select="paramList/param[@name !='collection']">
     255            <xsl:choose>
     256                <xsl:when test="@type='multi'">
     257                    <xsl:apply-templates select=".">
     258                        <xsl:with-param name="ns" select="$ns"/>
     259                    </xsl:apply-templates>
     260                </xsl:when>
     261                <xsl:otherwise>
     262                    <xsl:call-template name="param-display">
     263                        <xsl:with-param name="ns" select="$ns"/>
     264                    </xsl:call-template>
     265                </xsl:otherwise>
     266            </xsl:choose>
    265267        </xsl:for-each>
    266268    </xsl:template>
     
    273275                <option>
    274276                    <xsl:attribute name="style">
    275                             <xsl:text>padding-left: </xsl:text>
    276                             <xsl:value-of select="concat($padding,'px')" />
    277                         </xsl:attribute>
    278                     <xsl:attribute name="disabled">
    279                             <xsl:text>disabled</xsl:text>
    280                         </xsl:attribute>
     277                        <xsl:text>padding-left: </xsl:text>
     278                        <xsl:value-of select="concat($padding,'px')" />
     279                    </xsl:attribute>
    281280                    <xsl:attribute name="value">
    282                             <xsl:text>group</xsl:text>
    283                             <xsl:value-of select="$path" />
    284                             <xsl:text>_</xsl:text>
    285                             <xsl:value-of select="@name" />
    286                         </xsl:attribute>
    287                     <xsl:attribute name="onclick">
    288                             <xsl:text>selectChildren(this)</xsl:text>
    289                         </xsl:attribute>
     281                        <xsl:text>group</xsl:text>
     282                        <xsl:value-of select="$path" />
     283                        <xsl:value-of select="@name" />
     284                    </xsl:attribute>
    290285                    <xsl:value-of select="@title"></xsl:value-of>
    291286                    <xsl:for-each select="./*">
     
    296291                            <xsl:with-param name="path">
    297292                                <xsl:value-of select="$path" />
    298                                 <xsl:text>_</xsl:text>
     293                                <xsl:text>/</xsl:text>
    299294                                <xsl:value-of select="../@name" />
    300295                            </xsl:with-param>
     
    310305                            <xsl:text>px</xsl:text>
    311306                        </xsl:attribute>
    312                     <xsl:attribute name="class">
     307                    <!-- <xsl:attribute name="class">
    313308                            <xsl:value-of select="$path" />
    314                         </xsl:attribute>
     309                        </xsl:attribute> -->
    315310                    <xsl:attribute name="value">
    316311                        <xsl:value-of select="current()/@name"></xsl:value-of>
Note: See TracChangeset for help on using the changeset viewer.