<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <!-- =============================================================== -->
  <!--  person-edit.xsl (v003) for HF                                  -->
  <!--  26.10.05 - kristian.syversen@usit.uio.no                       -->
  <!-- =============================================================== -->

  <!-- =============================================================== -->
  <!--  Dokumenttypens hovedelement blir matchet i system-edit.xsl     -->
  <!-- =============================================================== -->

  <!-- prefixes (text element definitions) -->
  <xsl:import href="hf-person-translations.xsl" />

  <!-- =============================================================== -->
  <!--  Importing 'person-edit.xsl' to transform elements              -->
  <!-- =============================================================== -->

  <xsl:import href="../../../uio/person/v004/person-edit.xsl" />
  

  <!-- =============================================================== -->
  <!--  Overridde templates from person-edit.xsl here:                 -->
  <!-- =============================================================== -->

  <xsl:template match="institute" mode="edit">
     <table border="0" cellspacing="1" cellpadding="5">
      <tr>
        <td>
          <b>
            <xsl:call-template name="hf-person-document-phrase">
              <xsl:with-param name="identifier" select="'person.edit_institute_from_dropdown'"/>
            </xsl:call-template>
          </b>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <xsl:variable name="list-string">
            <xsl:call-template name="hf-person-document-phrase">
              <xsl:with-param name="identifier" select="'hf_person.institute_dropdown_list'"/>
            </xsl:call-template>
          </xsl:variable>
          <xsl:call-template name="insert-dropdown">
            <xsl:with-param name="separator" select="';'" />
            <xsl:with-param name="name-value-list" select="normalize-space($list-string)" />
          </xsl:call-template>
        </td>
      </tr>
    </table>
  </xsl:template>
  
  
  <xsl:template match="other" mode="edit">
    <table border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td>
          <b>
            <xsl:call-template name="person-document-phrase">
              <xsl:with-param name="identifier" select="'person.edit_other'"/>
            </xsl:call-template>
          </b>
        </td>
      </tr>
      <xsl:for-each select="./*">
        <tr>
          <td>
            <xsl:choose>
              <xsl:when test="position() = 1">
                <xsl:apply-templates select="." mode="edit"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:apply-templates select="." mode="edit-without-helptext"/>
              </xsl:otherwise>
            </xsl:choose> 
          </td>
        </tr>
      </xsl:for-each>
      <tr>
        <td valign="bottom">
          <xsl:call-template name="insert-button">
            <xsl:with-param name="elementname" select="'structuredtext-item'"/>
            <xsl:with-param name="buttonname" select="'Ny fritekst'"/>
          </xsl:call-template>
        </td>
      </tr>
    </table>
  </xsl:template>
  
</xsl:stylesheet>

