<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:eat="http://msqr.us/xsd/ieat"
	xmlns:xweb="http://msqr.us/xsd/jaxb-web"
	exclude-result-prefixes="eat xweb">
	
    <!-- imports -->
	<xsl:import href="tmpl/default-layout.xsl"/>
	
	<!-- layout variables -->
	<xsl:variable name="layout.global.nav.page" select="'home'"/>
	
	<xsl:template match="xweb:x-data" mode="page-body">
		<p><xsl:value-of select="key('i18n','home.intro')"/></p>

		<dl class="menu">
			<xsl:if test="not($acting-user)">
				<dt>
					<a href="{$web-context}/logon.do" title="{key('i18n','link.logon.title')}">
						<xsl:value-of select="key('i18n','link.logon')"/>
					</a>
				</dt>
				<dd>
					<xsl:value-of select="key('i18n','link.logon.explain')"
						 disable-output-escaping="yes"/>
				</dd>
				
				<xsl:if test="key('appenv','feature.registration') = 'true'">
					<dt>
						<a href="{$web-context}/register.do" title="{key('i18n','link.register.title')}">
							<xsl:value-of select="key('i18n','link.register')"/>
						</a>
					</dt>
					<dd>
						<xsl:value-of select="key('i18n','link.register.explain')"
							 disable-output-escaping="yes"/>
					</dd>
				</xsl:if>
			</xsl:if>
			
			<xsl:if test="$acting-user">
				<dt>
					<a href="{$web-context}/addRecipe.do" title="{key('i18n','link.recipe.add.title')}">
						<xsl:value-of select="key('i18n','link.recipe.add')"/>
					</a>
				</dt>
				<dd>
					<xsl:value-of select="key('i18n','link.recipe.add.explain')"
						 disable-output-escaping="yes"/>
				</dd>
				
				<dt>
					<a href="{$web-context}/meals.do" title="{key('i18n','link.meals.title')}">
						<xsl:value-of select="key('i18n','link.meals')"/>
					</a>
				</dt>
				<dd>
					<xsl:value-of select="key('i18n','link.meals.explain')"
						 disable-output-escaping="yes"/>
				</dd>
			</xsl:if>

			<dt>
				<a href="{$web-context}/index.do" title="{key('i18n','link.recipe.index.title')}">
					<xsl:value-of select="key('i18n','link.recipe.index')"/>
				</a>
			</dt>
			<dd>
				<xsl:value-of select="key('i18n','link.recipe.index.explain')"
					 disable-output-escaping="yes"/>
			</dd>
			
			<dt>
				<a href="{$web-context}/search.do" title="{key('i18n','link.recipe.search.title')}">
					<xsl:value-of select="key('i18n','link.recipe.search')"/>
				</a>
			</dt>
			<dd>
				<xsl:value-of select="key('i18n','link.recipe.search.explain')"
					 disable-output-escaping="yes"/>
			</dd>
			
			<xsl:if test="$acting-user">
				<dt>
					<a href="{$web-context}/importRecipeML.do" title="{key('i18n','link.import-recipeml.title')}">
						<xsl:value-of select="key('i18n','link.import-recipeml')"/>
					</a>
				</dt>
				<dd>
					<xsl:value-of select="key('i18n','link.import-recipeml.explain')"
						 disable-output-escaping="yes"/>
				</dd>

				<dt>
					<a href="{$web-context}/settings.do" title="{key('i18n','link.settings.title')}">
						<xsl:value-of select="key('i18n','link.settings')"/>
					</a>
				</dt>
				<dd>
					<xsl:value-of select="key('i18n','link.settings.explain')"
						 disable-output-escaping="yes"/>
				</dd>
			</xsl:if>

			<xsl:if test="$acting-user/../@admin = 'true'">
				<dt>
					<a href="{$web-context}/admin.do" title="{key('i18n','link.admin.title')}">
						<xsl:value-of select="key('i18n','link.admin')"/>
					</a>
				</dt>
				<dd>
					<xsl:value-of select="key('i18n','link.admin.explain')" disable-output-escaping="yes"/>
				</dd>
			</xsl:if>
		</dl>
	</xsl:template>
	
</xsl:stylesheet>
