{% extends "base.html" %}
<!-- start main content -->
{% block content %}
{% if gallery %}
<div id="story-name-{{ gallery.id }}" class="span-6 first">
  <p class="story_name"><h2>{{ gallery.title }}</h2></p>
  <hr>
</div>
<div id="story-body-{{ gallery.id }}" class="span-18 last">
  {{ gallery.body|safe }}
  <hr>
    <!-- The following courtesy of http://slideshow.triptracker.net/ -->
    <script type="text/javascript">
    <!--
      var viewer = new PhotoViewer();
      {% for photo in gallery.photo_set.all %}
      viewer.add('/media/{{ photo.image }}');
      {% endfor %}
      // -->
    </script>
       {% for photo in gallery.photo_set.all %}
       
       <a href="{{ MEDIA_URL }}{{ photo.image }}" onclick="return viewer.show({{ forloop.counter0 }})"> <img width="100" height="100" src="{{ photo.image.thumb_url }}" alt="" /> </a>
       
       {% if forloop.last %}
        </p>
       {% endif %}
     {% endfor %}
  <hr>
  <p class="small">Created {{ gallery.created|date:"m/d/y @ h:iA T" }} by {{ gallery.owner }}</p>
  <p class="story_cat"><u>Categories</u>:
   {% for x in gallery.category.all %}<a href="{{ x.get_absolute_url }}">{{ x }}</a> {% endfor %}
  </p>
  <!-- start tags -->
  <p><u>Tags</u>: {% for tag in gallery.get_tags %}
   <a href="/tags/{{ tag }}">{{ tag }}</a>
  {% endfor %}</p>
  <!-- end tags -->
  <hr>
  <!-- start social media -->
  <p>
    <a href="http://reddit.com/submit?url={{ ROOT_URL }}{{ gallery.get_absolute_url }}&name={{ gallery.title }}"><img src="{{ MEDIA_URL }}images/reddit.gif" alt="Reddit"></a>
    <a href="http://digg.com/submit?phase=2&url={{ ROOT_URL }}{{ gallery.get_absolute_url }}"><img src="{{ MEDIA_URL }}images/digg.gif" alt="Digg it!"></a>
    <a href="http://www.stumbleupon.com/submit?url={{ ROOT_URL }}{{ gallery.get_absolute_url }}&name={{ gallery.title }}"><img src="{{ MEDIA_URL }}images/stumble-upon.jpg" alt="StumbleUpon"></a>
    <a href="http://del.icio.us/post?url={{ ROOT_URL }}{{ gallery.get_absolute_url }}&name={{ gallery.title }}"><img src="{{ MEDIA_URL }}images/delicious.gif" alt="Delicious!"></a>
  </p>
  <!-- stop social media -->
  <hr>
  <!-- start comments -->
{% load disqus_tags %}
{% disqus_show_comments %}
  <!-- end comments -->
</div>
{% endif %}
{% endblock %}
<!-- end main content -->

