<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <link href="/css/index.css" rel="stylesheet" type="text/css">
    <title>FFF - {% if fic.completed %} Finished {% else %} {% if fic.failure %} Failed {% else %} Working... {% endif %} {% endif %}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    {% if not fic.completed and not fic.failure %}
    <meta http-equiv="refresh" content="10">
    {% endif %}
  </head>
  <body>
    <div id='main'>
      <h1>
        <a href="/" style="text-decoration: none; color: black;">FanFicFare</a>
      </h1>

      <div id='urlbox'>
        {% if fic.url %}
        <div id='greeting'>
        <p>
          {% if fic.completed %}
              <p>Your fic has finished processing and you can download it now.</p>
              <span class="recent"><a href="/file?id={{ fic.key }}">Download <i>{{ fic.title }}</i></a></span>
              by {{ fic.author }} ({{ fic.format }})
          {% endif %}
          {% if fic.failure %}
          <span id='error'>{{ fic.failure }}</span>
          {% endif %}
          {% if  not fic.completed and not fic.failure %}
              <p>Not done yet.  This page will periodically poll to see if your story has finished.</p>
              <span class="recent">Processing <i>{{ fic.title }}</i></span>
              by {{ fic.author }} ({{ fic.format }})
          {% endif %}
          <a href="{{ fic.url }}" title="Link to original story">Source</a>
          {% if fic.completed and escaped_url %}
              <a href="http://www.convertfiles.com/index.php?url={{ escaped_url }}" title="Convert to other formats using Convertfiles.com">Convert</a>
          {% endif %}
        </p>
        </div>
        {% endif %}
          <p>See your personal list of <a href="/recent">previously downloaded fanfics</a>.</p>
      </div>

      <div style='text-align: center'>
        <img src="http://code.google.com/appengine/images/appengine-silver-120x30.gif"
             alt="Powered by Google App Engine" />
        <br/><br/>
        This is a web front-end to <a href="https://github.com/JimmXinu/FanFicFare/">FanFicFare</a><br/>
        Copyright &copy; FanFicFare team
      </div>

    </div>
  </body>
</html>
