{% extends "admin/layout.html" %}
{% block title %}{{ _("Dashboard") }}{% endblock %}
{% block contents %}
  <div class="dashboard">
    <h1>{{ _("Dashboard") }}</h1>
    <div class="panel">
      <div class="text">
        <p>{% trans user=request.user.display_name|e -%}
          Howdy.  Welcome to the Zine administration interface {{ user }}.
        {%- endtrans %}
        {% trans -%}
          You have written <strong>{{ your_posts }}</strong> post so far.
        {%- pluralize -%}
          You have written <strong>{{ your_posts }}</strong> posts so far.
        {%- endtrans %}
      </div>
      <h2>{{ _('Quickstart') }}</h2>
      <ul>
        <li><a href="{{ url_for('admin/new_entry')|e }}">{{ _("New Entry") }}</a>
        <li><a href="{{ url_for('admin/manage_comments')|e }}">{{ _("Moderate Comments") }}</a>
        <li><a href="{{ url_for('admin/manage_entries')|e }}">{{ _("Manage Entries") }}</a>
        <li><a href="{{ url_for('admin/options')|e }}">{{ _("Configure Zine") }}</a>
        <li><a href="{{ url_for('admin/plugins')|e }}">{{ _("Manage Plugins") }}</a>
        <li><a href="{{ url_for('admin/manage_users')|e }}">{{ _("Manage Users") }}</a>
        <li><a href="{{ url_for('admin/help')|e }}">{{ _("Get Help") }}</a>
      </ul>
      <p>{% trans help=url_for('admin/help'), support='http://zine.pocoo.org/support/',
            website='http://zine.pocoo.org/' %}
        If you need help, have a look at the <a href="{{ help
          }}">documentation</a>.  If that doesn't solve your problems you might
        find answers in the <a href="{{ support }}">support section</a> of the
        <a href="{{ website }}">Zine website</a>.
      {% endtrans %}
    </div>
    <div class="links">
      {% if drafts %}
      <h2>{{ _("Drafts") }}</h2>
      <ul class="drafts">
      {%- for draft in drafts %}
        <li><a href="{{ url_for('admin/edit_post',
          post_id=draft.id) }}">{{ draft.title|e }}</a>
      {%- endfor %}
      </ul>
      {% endif %}
      {% if unmoderated_comments %}
      <h2>{{ _('Comments Awaiting Approval') }}</h2>
      <ul class="comments">
      {%- for comment in unmoderated_comments %}
        <li><p class="comment">
          by <a href="mailto:{{ comment.email|e }}">{{
          comment.author|e }}</a>,
          {{ comment.pub_date|datetimeformat('short') }}
          on <a href="{{ url_for(comment.post) }}">{{ comment.post.title|e }}</a>
          <p class="actions">
            <a href="{{ url_for('admin/edit_comment', comment_id=comment.id)|e
             }}">{{ _("Edit") }}</a> |
            <a href="{{ url_for('admin/delete_comment', comment_id=comment.id)|e
             }}">{{ _("Delete") }}</a> |
             <a href="{{ url_for('admin/approve_comment',
               comment_id=comment.id)|e }}">{{ _("Approve") }}</a>
      {%- endfor %}
      </ul>
      {% endif %}
      {% if last_posts %}
      <h2>{{ _("Last Posts") }}</h2>
      <ul class="last_posts">
      {%- for post in last_posts %}
        <li><a href="{{ url_for('admin/edit_post', post_id=post.id)
          }}">{{ post.title|e }}</a>, {{ post.pub_date|datetimeformat('short') }}
      {%- endfor %}
      </ul>
      {% endif %}
    </div>
    {% if show_reddit %}
    <div class="reddit">
      <h2>{{ _('Zine at Reddit') }}</h2>
      <p>{% trans reddit='<a href="http://www.reddit.com/r/zine/">reddit</a>' %}
        Zine is present at {{ reddit }}.  The latest popular items in the Zine
        subreddit are listed below:
        {% endtrans %}</p>
      <script type="text/javascript">
	$('<div>').load('?load=reddit').appendTo('div.reddit');
      </script>
    </div>
    {% endif %}
    <div class="clear"></div>
  </div>
{% endblock %}
