<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="plone">

<head>
    <metal:block fill-slot="top_slot"
                 tal:define="dummy python:request.set('disable_border',1);
                             disable_column_one python:request.set('disable_plone.leftcolumn',1);
                             disable_column_two python:request.set('disable_plone.rightcolumn',1);" />
</head>

<body>
<metal:main fill-slot="main"
     tal:define="err_type options/error_type|nothing;
                 err_message options/error_message|nothing;
                 err_tb options/error_tb|nothing;
                 err_value options/error_value|nothing;
                 err_traceback options/error_traceback|nothing;
                 err_log_url options/error_log_url|nothing;
                 err_log_id options/error_log_id|nothing;
                 isAnon context/@@plone_portal_state/anonymous;
                 toLocalizedTime nocall: context/@@plone/toLocalizedTime;">

        <metal:notfound tal:condition="python:err_type=='NotFound'">

            <tal:redirect define="redirection_view context/@@plone_redirector_view">
                
                <tal:redirect define="redirect_success redirection_view/attempt_redirect" replace="nothing">
                    If the attempt succeeds, we won't see any more of this template
                </tal:redirect>
                    
                <h1 class="documentFirstHeading"
                    i18n:translate="heading_site_there_seems_to_be_an_error">
                    This page does not seem to exist&hellip;
                </h1>

                <div id="content-core">
                    <p i18n:translate="description_site_error">
                        We apologize for the inconvenience, but the page you were trying to access is not at this address.
                        You can use the links below to help you find what you are looking for.
                    </p>

                    <ul>
                        <li i18n:translate="site_error_review">
                            Review the address to make sure it is correct:
                            <strong i18n:name="current_url"
                                    tal:content="context/@@plone_context_state/current_page_url">current URL</strong>
                        </li>
                        <li i18n:translate="site_error_search">
                            <a href="#" i18n:name="search_the_site" i18n:translate="label_search_the_site"
                               tal:attributes="href string:${context/portal_url}/search">Search the site</a> for the page
                            you were trying to access, as it may have moved
                        </li>
                        <li i18n:translate="description_site_error_mail_site_admin">
                            If you are certain you have the correct web address but are encountering an error, please
                            contact the <span i18n:name="site_admin">
                            <a href="#" 
                               i18n:translate="label_site_admin"
                               tal:attributes="href string:${context/portal_url}/contact-info">Site Administration</a></span>.
                        </li>
                        <li i18n:translate="site_error_site_map">
                            View the 
                            <a href="#" i18n:name="site_map" i18n:translate="label_site_map"
                               tal:attributes="href string:${context/portal_url}/sitemap">Site map</a>
                        </li>
                        <li i18n:translate="site_error_link_home">
                            Go to the
                            <a href="#" i18n:name="home_page" i18n:translate="label_home_page"
                               tal:attributes="href context/portal_url">home page</a>
                        </li>
                    </ul>
                    
                </div>
            </tal:redirect>

        </metal:notfound>

        <metal:othererror tal:condition="python: err_type!='NotFound'"
             tal:define="checkPermission nocall: context/portal_membership/checkPermission;
                         isManager python: checkPermission('Manage portal', here)">

            <h1 class="documentFirstHeading"
                i18n:translate="heading_site_error_sorry">
                We&#8217;re sorry, but there seems to be an error&hellip;
            </h1>

            <div id="content-core">
                <tal:hasentry condition="err_log_id">
                    <p tal:condition="not: isManager"
                       i18n:translate="description_error_has_been_logged">
                    The error has been logged as entry number 
                    <code i18n:name="entryid" tal:content="err_log_id">1174791474.310.489098092344</code>.
                    </p>
                
                    <p tal:condition="not: isManager"
                       i18n:translate="description_include_error_in_admin_message">
                    If you need to report this to the 
                    <span i18n:name="site_admin">
                    <a href="#" 
                       i18n:translate="label_site_admin"
                       tal:attributes="href string:${context/portal_url}/contact-info">Site Administration</a></span>,
                    please include this entry number in your message.
                    </p>
            
                    <div tal:condition="isManager">
                       <p i18n:translate="description_site_admin_full_error">
                       Here is the full error message:
                       </p>
                       
                       <p ><a href="" tal:attributes="href
                                      string:error_log/getLogEntryAsText?id=${err_log_id}"
                                      i18n:translate="label_traceback_as_text">Display traceback as text</a></p>

                       <div tal:replace="structure err_tb"/>
                    </div>

                </tal:hasentry>

                <tal:noentry condition="not:err_log_id">
                    <p i18n:translate="description_site_error_mail_site_admin">
                    If you are certain you have the correct web address but are encountering an error, please
                    contact the <span i18n:name="site_admin">
                    <a href="#" 
                       i18n:translate="label_site_admin"
                       tal:attributes="href string:${context/portal_url}/contact-info">Site Administration</a></span>.
                    </p>
                </tal:noentry>
            </div>
            
        </metal:othererror>
        <tal:ksserrors
                tal:define="kss_view kss_view | context/@@kss_view | nothing;
                            dummy python: kss_view and kss_view.attach_error(err_type, err_value);"/>

</metal:main>
</body>
</html>
