<div id=“adminToolbar” class=“toolbar robots-nocontent<%= ' hidden' unless auth_key_valid? %>”>

<% if auth_key_valid? %>
  <ul class="edit">
    <li>
      <a href="<%= Thoth::PostController.r(:new) %>"
          title="Create a new blog post">
        <span class="adminicon post-new"></span>
      </a>
    </li>

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

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

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

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

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

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

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

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

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

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

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

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

<% else %>
  <form id="login" action="<%= Thoth::AdminController.r(: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>