<moya xmlns="http://moyaproject.com"
    xmlns:w="http://moyaproject.com/widgets"
    xmlns:html="http://moyaproject.com/html">

    <content libname="content.base" template="/base.html" />


    <content libname="content.signup" extends="#content.base">
        <title>Signup!</title>
        <section name="body">
            <w:info if="fail">Unable to create account, please try again later.</w:info>
            <if test="success">
                <if test="validate_email">
                    <w:info>
                        <markdown>
We have sent an email to **${validate_email.user.email}** with a link. Please click this link to validate your email.

If you don't receive this email within a few minutes, please check your spam folder.
                        </markdown>
                    </w:info>
                </if>
                <else>
                    <w:success>Your new account was created!</w:success>
                    <w:button-link name="login" from="moya.auth">Log in here</w:button-link>
                </else>
                <done />
            </if>
            <render src="form"/>
        </section>
    </content>


    <content libname="content.validate" extends="#content.base">
        <title>Validate Email</title>
        <section name="body">
            <get-url name="login" from="moya.auth" dst="login_url" />

            <w:success if="success">
                <markdown>
**Thank you!**

Your email was validated successfully. You may now [log in](${login_url}) here.
                </markdown>
            </w:success>


            <w:error if="not success">
                <markdown>
**Unable to validate your email address.**

You may have already used this link. Try to [log in](${login_url}) here.
                </markdown>

            </w:error>

        </section>

    </content>


</moya>