{% extends "base.html" %}

{% block title%}Calibre Planet{% endblock %}
{% block header_text %}Planet{% endblock %}

{% block extra_header %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/styles/planet.css" /> 
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/styles/codebox.css" /> 
{% endblock %}

{% block content %}
<div id="paginate">
<ul>

{% if has_previous %}
<li><a href="?page={{ previous }}">&lt;&lt;</a></li>
{% endif %}
<li>
  Page {{ page }} of {{ pages }} ({{ hits }} posts) 
</li>
{% if has_next %}
<li><a href="?page={{ next }}">&gt;&gt;</a></li>
{% endif %}
{% if user %}
<li class="username"><a href="{{ user.feed.link }}">{{ user.name }}</a>talks about »</li>
{% endif %}
{% if tag %}
<li class="tagname">{{ tag.name }}</li>
{% endif %}
</ul>
</div> <!-- end paginate -->

<div id="buttons">
      <a href="{{ site.url }}/feed/rss/" title="RSS 2.0 feed"><img src="{{ MEDIA_URL }}/img/button-rss.png"/></a> &bull;   
      <a href="{{ site.url }}/feed/atom/" title="Atom 1.0 feed"><img src="{{ MEDIA_URL }}/img/button-atom.png"/></a> &bull; 
      <a href="{{ site.url }}/opml/" title="OPML"><img src="{{ MEDIA_URL }}/img/button-opml.png"/></a> &bull; 
      <a href="{{ site.url }}/foaf/" title="FOAF"><img src="{{ MEDIA_URL }}/img/button-foaf.png"/></a>
</div> <!-- end buttons -->

<div id="post_list">
{% for item in object_list %}

  {% ifchanged %}
  <div class="date">{{ item.date_modified|date:"F j, Y" }}</div>
  {% endifchanged %}

  <div class="post">
  {% ifchanged %}
  <!-- {{ item.date_modified|date:"F j, Y" }} -->
  <div class="avatar">
    <a href="{{ item.feed.link }}">
        <img 
        src="{{ MEDIA_URL }}/img/faces/{{ item.subscriber.shortname}}.png" alt="" />
        <div class="url">
            {{ item.feed.name|safe }}
        </div>
    </a>
  </div>
  {% endifchanged %}

  {% if item.title %}
  <div class="post-title">» {{ item.title }}</div>
  {% else %}
  <div class="post-title">» {{ item.subscriber.name }}</div>
  {% endif %}
  <div class="post-content">
    <p>{{ item.content|safe }}</p>
    <div class="post-meta">
      <a href="{{ item.link }}">
      {% if item.author %}by {{ item.author }} at{% endif %}
      {{ item.date_modified|date:"g:i A" }}</a>
      {% for tag in item.qtags %}
          {% if forloop.first %}under{% endif %}
          <a href="{{ site.url }}/tag/{{ tag.name }}">{{ tag.name }}</a>
          {% if not forloop.last %}, {% endif %}
      {% endfor %}
      {% if item.comments %}
        <a href="{{ item.comments }}">(Comments)</a>
      {% endif %}
    </div>
  </div>
  </div>
{% endfor %}
</div>


<div id="sidebar">
<h4>{{ site.name }}</h4>

<p style="text-align:left">
Planet Calibre is a window into the world, work and lives of Calibre developers and contributors.
</p>
<p style="text-align:left">
If you have a question or would like your blog added to the planet, please email 
<a href="mailto:kovid@kovidgoyal.net">Kovid Goyal</a>.
</p>

<div id="planet_donate">
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_s-xclick" />
        <input type="hidden" name="hosted_button_id" value="3028915" />
        <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Donate to support calibre development" />
        <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
        <div>Donate to support the development of calibre.</div>
    </form>
</div>


<div id="tags">
    <ul id="cloud">
    {% for tag in tagcloud %}
      <li><a
      {% if user_id %}
      href="{{ site.url }}/user/{{ user_id }}/tag/{{ tag.tagname|urlencode }}/"
      {% else %}
      href="{{ site.url }}/tag/{{ tag.tagname|urlencode }}/"
      {% endif %}
      title="{{ tag.count }} posts"
      class="cloud_{{ tag.weight }}">{{ tag.tagname }}</a></li>
    {% endfor %}
    </ul>
</div>

<div id='planet_ads' style="z-index:0">
    <script type="text/javascript"><!--
        google_ad_client = "pub-2595272032872519";
        /* Calibre Planet */
        google_ad_slot = "6940385240";
        google_ad_width = 120;
        google_ad_height = 600;
        //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    
</div>


<h4>Last update</h4>
<b>{{ last_modified }}</b>

<h4>People</h4>

<ul class="suscriptores">
{% for feed in subscribers %}
<li>
<a href="{{ feed.feed.feed_url }}"
{% if feed.feed.last_modified %}
title="feed (last modified: {{ feed.feed.last_modified }})"
{% else %}
title="feed"
{% endif %}
>
<img src="{{ MEDIA_URL }}/img/feed.png" alt="feed"></a>
<a class="nombre" href="{{ site.url }}/user/{{ feed.feed.id }}"
title="{{ feed.feed.title }}">{{ feed.name }}</a></li>
{% endfor %}
</ul>


</div>

<div id="paginate">
<ul>

{% if has_previous %}
<li><a href="?page={{ previous }}">&lt;&lt;</a></li>
{% endif %}
<li>
  Page {{ page }} of {{ pages }} (
    {{ hits }} posts
  )
</li>
{% if has_next %}
<li><a href="?page={{ next }}">&gt;&gt;</a></li>
{% endif %}
{% if user %}
<li class="username"><a href="{{ user.feed.link }}">{{ user.name }}</a></li>
{% endif %}
{% if tag %}
<li class="tagname">{{ tag.name }}</li>
{% endif %}
</ul>
</div>

<div style="height:50px">&nbsp;</div>


{% endblock %}
