<div id="adminToolbar" class="toolbar robots-nocontent<%= ' hidden' unless auth_key_valid? %>">
  <% if auth_key_valid? %>
    <ul class="edit">
      <li>
        <a href="<%= R(Thoth::PostController, :new) %>"
            title="Create a new blog post">
          <span class="adminicon post-new"></span>
        </a>
      </li>

      <% if @show_post_edit && @post %>
        <li>
          <a href="<%= R(Thoth::PostController, :edit, @post.id) %>#post-form"
              title="Edit this blog post">
            <span class="adminicon post-edit"></span>
          </a>
        </li>

        <li>
          <a href="<%= R(Thoth::PostController, :delete, @post.id) %>"
              title="Delete this blog post">
            <span class="adminicon post-delete"></span>
          </a>
        </li>
      <% end %>

      <li>
        <a href="<%= R(Thoth::PageController, :new) %>"
            title="Create a new page">
          <span class="adminicon page-new"></span>
        </a>
      </li>

      <% if @show_page_edit && @page %>
        <li>
          <a href="<%= R(Thoth::PageController, :edit, @page.id) %>#page-form"
              title="Edit this page">
            <span class="adminicon page-edit"></span>
          </a>
        </li>

        <li>
          <a href="<%= R(Thoth::PageController, :delete, @page.id) %>"
              title="Delete this page">
            <span class="adminicon page-delete"></span>
          </a>
        </li>
      <% end %>

      <li>
        <a href="<%= R(Thoth::MediaController, :new) %>" title="Upload media">
          <span class="adminicon media-new"></span>
        </a>
      </li>

      <% if @show_file_edit && @file %>
        <li>
          <a href="<%= R(Thoth::MediaController, :delete, @file.id) %>"
              title="Delete this file">
            <span class="adminicon media-delete"></span>
          </a>
        </li>
      <% end %>
    </ul>

    <ul class="tools">
      <li>
        <a href="<%= R(Thoth::PostController, :list) %>" title="List all blog posts">
          <span class="adminicon post-list"></span>
        </a>
      </li>

      <li>
        <a href="<%= R(Thoth::PageController, :list) %>" title="List all pages">
          <span class="adminicon page-list"></span>
        </a>
      </li>

      <% if Thoth::Config.site.enable_comments %>
        <li>
          <a href="<%= R(Thoth::CommentController, :list) %>" title="List all comments">
            <span class="adminicon comment-list"></span>
          </a>
        </li>
      <% end %>

      <li>
        <a href="<%= R(Thoth::MediaController, :list) %>" title="List all media">
          <span class="adminicon media-list"></span>
        </a>
      </li>
    </ul>

    <ul class="tools">
      <li>
        <a href="<%= R(Thoth::AdminController, :logout) %>" title="Log out">
          <span class="adminicon logout"></span>
        </a>
      </li>
    </ul>

  <% else %>
    <form id="login" action="<%= R(Thoth::AdminController, :login) %>" method="post">
      <div>
        <label for="username">Username:</label>
        <input type="text" id="username" name="username" maxlength="64"
            title="Enter your username" />

        <label for="password">Password:</label>
        <input type="password" id="password" name="password" maxlength="64"
            title="Enter your password" />

        <input type="submit" value="Login" />
      </div>
    </form>
  <% end %>
</div>
