<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      lang="en"
      metal:use-macro="context/main_template/macros/master"
      i18n:domain="xmldirector.facebook">
<body>

<metal:main fill-slot="content-core">
    <metal:content-core define-macro="content-core"
        tal:define="token view/get_oauth_token">

        <style type="text/css">
            .label {
                width: 100px;
                text-align: right;
            }
        </style>

        <h2 i18n:translate="">Facebook Authentication/Authorization</h2>
        <div tal:condition="not: token" i18n:translate="" class="info">
            Your application is not authorized for Facebook access.
        </div>
        <a tal:condition="not: token" 
            tal:attributes="href view/get_oauth_url" 
            i18n:translate="">Authorize Facebook access</a>

        <div tal:condition="token" i18n:translate="" class="info">
            Your application is authorized for Facebook access.
        </div>
        <a tal:condition="token" 
            tal:attributes="href string:${context/absolute_url}/deauthorize-facebook" 
            i18n:translate="">Deauthorize Facebook access</a>

        <div id="facebook-info" tal:condition="token" style="margin-top: 1em">
            <form method="post" tal:attributes="action string:${context/absolute_url}/facebook-post" style="margin-top: 1em">
                <textarea 
                    name="text" 
                    rows="3" 
                    cols="60" 
                    tal:content="request/form/text | string:${context/Title} - ${context/absolute_url}"></textarea>
                <input type="submit" i18n:attributes="value" value="Post to Facebook"/>
            </form>
        </div>

  </metal:content-core>
</metal:main>

</body>
</html>

