Changeset 4948 for cats


Ignore:
Timestamp:
04/11/14 10:02:05 (10 years ago)
Author:
Menzo Windhouwer
Message:

M mod-ISOcat-interface-rest/representations/html/datacategory.xsl
M mod-ISOcat-interface-gi/interface/JSXAPPS/ISOcat/js/org/isocat/gui/DCViewer.js

  • tweaking the DC HTML view, i.e., admin. info is now collapsed
Location:
cats/ISOcat/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cats/ISOcat/trunk/mod-ISOcat-interface-gi/interface/JSXAPPS/ISOcat/js/org/isocat/gui/DCViewer.js

    r2322 r4948  
    353353       
    354354        // close some sections
     355        $('.dc-' + this.dc.id + '-adminrec').toggle();
    355356        $('.dc-' + this.dc.id + '-langsec').toggle();
    356357        $('.dc-' + this.dc.id + '-langsec-en').addClass('dc-' + this.dc.id + '-langsec');
  • cats/ISOcat/trunk/mod-ISOcat-interface-rest/representations/html/datacategory.xsl

    r2632 r4948  
    8181       
    8282        <xsl:template match="isocat:administrationStatus" priority="10">
    83                 <tr class="DC-data">
     83            <xsl:param name="class" select="''" tunnel="yes"/>
     84            <tr class="DC-data{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
    8485                        <td class="DC-data-label">
    8586                                <xsl:value-of select="isocat:name(.)"/>
     
    282283        </xsl:template>
    283284       
    284         <xsl:template match="*[empty(child::dcif:*)]">
     285    <xsl:template match="dcif:administrationRecord" priority="1">
     286        <xsl:param name="class" select="''" tunnel="yes"/>
     287        <xsl:variable name="dc" select="ancestor::dcif:dataCategory[last()]/@isocat:id"/>
     288        <xsl:variable name="c" select="concat('dc-',$dc,'-adminrec')"/>
     289        <xsl:variable name="classes" select="string-join(($c,$class),' ')"/>
     290        <xsl:variable name="level" select="isocat:level(.)"/>
     291        <tr class="DC-header{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
     292            <th colspan="2">
     293                <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
     294                    <xsl:attribute name="style" select="'color:gray;'"/>
     295                </xsl:if>
     296                <xsl:choose>
     297                    <xsl:when test="$level &lt; 1">
     298                        <xsl:attribute name="class" select="concat('DC-header-level-',$level + 1)"/>
     299                    </xsl:when>
     300                    <xsl:when test="$level &lt; 2">
     301                        <xsl:attribute name="class" select="concat('DC-header-level-',$level + 1)"/>
     302                    </xsl:when>
     303                    <xsl:otherwise>
     304                        <xsl:attribute name="class" select="'DC-header-level-x'"/>
     305                    </xsl:otherwise>
     306                </xsl:choose>
     307                <pre style="display:inline;cursor:pointer;cursor:hand;" onclick="var span = this;$('.{$c}').toggle(1000);span.innerHTML = '['+(span.innerHTML=='[+] '?'-':'+')+'] ';">
     308                                    <xsl:text>[+] </xsl:text>
     309                        </pre>
     310                <xsl:value-of select="isocat:section(.)"/>
     311                <xsl:text>. </xsl:text>
     312                <xsl:value-of select="isocat:name(.)"/>
     313            </th>
     314        </tr>
     315        <xsl:apply-templates select="child::*[empty(child::*)] except dcif:note">
     316            <xsl:with-param name="class" select="$classes" tunnel="yes"/>
     317        </xsl:apply-templates>
     318        <xsl:apply-templates select="child::*[exists(child::*)]">
     319            <xsl:with-param name="class" select="$classes" tunnel="yes"/>
     320        </xsl:apply-templates>
     321        <xsl:if test="exists(dcif:note[normalize-space(.)!=''])">
     322            <tr class="DC-header">
     323                <th colspan="2" class="DC-header-level-x">
     324                    <xsl:value-of select="isocat:section(.)"/>
     325                    <xsl:text>.</xsl:text>
     326                    <xsl:value-of select="count(child::*[exists(child::*)]) + 1"/>
     327                    <xsl:text> Note Section</xsl:text>
     328                </th>
     329            </tr>
     330            <xsl:apply-templates select="dcif:note[normalize-space(.)!='']"/>
     331        </xsl:if>
     332    </xsl:template>
     333   
     334    <xsl:template match="*[empty(child::dcif:*)]">
    285335                <xsl:param name="class" select="''" tunnel="yes"/>
    286336                <tr class="DC-data{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
     
    320370                </tr>
    321371        </xsl:template>
    322        
     372   
    323373        <xsl:template match="*[exists(child::dcif:*)]">
    324374                <xsl:param name="class" select="''" tunnel="yes"/>
     
    433483                                                </xsl:otherwise>
    434484                                        </xsl:choose>
    435                                         <tr class="DC-data">
     485                                        <!--<tr class="DC-data">
    436486                                                <td class="DC-data-label">Key</td>
    437487                                                <td class="DC-data-value">
    438488                                                        <xsl:value-of select="@isocat:id"/>
    439489                                                </td>
    440                                         </tr>
     490                                        </tr>-->
    441491                                        <tr class="DC-data">
    442492                                                <td class="DC-data-label">PID</td>
     
    514564                                        <xsl:for-each select=".//dcif:dataCategory">
    515565                                                <xsl:variable name="dc" select="@isocat:id"/>
    516                                                 $('.dc-<xsl:value-of select="$dc"/>-langsec').toggle();
     566                                            $('.dc-<xsl:value-of select="$dc"/>-adminrec').toggle();
     567                                            $('.dc-<xsl:value-of select="$dc"/>-langsec').toggle();
    517568                                                $('.dc-<xsl:value-of select="$dc"/>-langsec-en').addClass('dc-<xsl:value-of select="$dc"/>-langsec');
    518569                                        </xsl:for-each>
Note: See TracChangeset for help on using the changeset viewer.