{% extends "newsroom/base.html" %}
{% load humanize %}
{% block og_title %}{{object.web_hed}}{% endblock %}
{% block og_type %}Article{% endblock %}
{% block og_url %}{{object.get_absolute_url}}{% endblock %}
{% block og_description %}{{object.summary|striptags}}{% endblock %}
{% block og_image %}{% if object.lead_photo %}{{object.lead_photo.get_facebook_og_image_url}}{% else %}{{MEDIA_URL}}images/headers/pbp_sharing_logo.jpg{% endif %}{% endblock %}

{% block meta_title %}{{object.web_hed}} | {% for s in object.sites.all %}{% if forloop.first %}{{s.name}}{% endif %}{% endfor %} | Penobscot Bay Press{% endblock %}
{% block meta_keywords %}{% for tag in object.tags.all %}{{tag}}, {%endfor %}{% endblock %}
{% block meta_description %}{{object.summary|striptags}}{% endblock %}
{% block rel-img %}{% if object.lead_photo %}{{object.lead_photo.get_square_url}}{% else %}{{MEDIA_URL}}images/headers/pbp_sharing_logo.jpg{% endif %}{% endblock %}

{% block title %}{{object.web_hed}} | {% for s in object.sites.all %}{% if forloop.first %}{{s.name}}{% endif %}{% endfor %} | Penobscot Bay Press {% endblock %}

{% block content %}
{% load markup typogrify humanize %}
<td valign="top" bgcolor="white" colspan="3" width="768px">
	<div style="padding-left:12px; padding-right:12px; padding-top:12px">
		{% if object.standing_hed %}<h2 class="sectionhead_wide">{{object.standing_hed}}</h2>
		{% else %}<h2 class="sectionhead_wide">News Feature</h2>{% endif %}
		{% for e in object.visitorsedition_set.all %}
		<div align="center">
			<a href="{% url vs-index %}" class="return">Return to the Seasonal Guide Visitor's Portal</a>
		</div>
		{% endfor %}
	</div>

	<div style="padding-left:12px; padding-right:12px; width:450px; float:left">
	<p>
	<SPAN Class="teaser">{{object.dateline}}</SPAN><br>
	{% if object.paper_editions.all %}<span class="paper">Originally published in 
	{% for e in object.paper_editions.all %}
		{% if not forloop.first %}and <em>{{e.paper}}</em>, {{e.published_on|date:"F j, Y"}}
		{% else %}<em>{{e.paper}}</em>, {{e.published_on|date:"F j, Y"}}{% endif %}
	{% endfor %}<br>
	</span>
	{% else %}<span class="paper">Web exclusive, {{object.published_on|date:"F j, Y"}}<span><br>{% endif %}
    {% if object.kicker %}<SPAN Class="kicker">{{object.kicker}}<br></SPAN>{% endif %}
    <SPAN Class="headline">{{object.web_hed|typogrify}}</SPAN>
    {% if object.subhed %}<br><SPAN Class="subhed">{{object.subhed}}</SPAN><br>{% endif %}
    </p>
	</div>



  <div style="float:right; width:250px; padding-left:25px">

    {% if object.archivesection_set.all %}
    <h4>
    {% for a in object.archivesection_set.all %}
    {% if not forloop.first %}<br><br>{% endif %}
    {% if a.lead_image %}
    <img src="{{a.lead_image.url}}" width="250px" alt="{{a}}"/><br>
    {% endif %}
    <a href="{{a.get_absolute_url}}">Click here to see the full {{a.title}}.</a>
    {% endfor %}
    </h4>
    {% endif %}
<!-- AddThis Button BEGIN -->
<hr size="1">
<p><span class="kicker"><strong>Share this page</strong></span>
<div>
<a class="addthis_button_facebook_like" fb:like:layout="standard"></a>
</div><br>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_twitter" tw:count="none"></a> &nbsp;
<a class="addthis_button_email"></a> &nbsp;
<a class="addthis_button_print"></a> &nbsp;
<a class="addthis_button_pinterest_share" style="cursor:pointer"></a> &nbsp;
</div>
<br>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_reddit"></a> &nbsp;
<a class="addthis_button_gmail"></a> &nbsp;
<a class="addthis_button_tumblr"></a> &nbsp;
<a class="addthis_button_compact"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=penbaypress"></script>
<hr size="1">
<!-- AddThis Button END -->
</p>

{% if object.attached_gallery.all %}
  	{% for rel_gallery in object.attached_gallery.all %}
  		<a href="{{rel_gallery.gallery.get_absolute_url}}" alt="{{rel_gallery}}"><p class="gallery_link">{{rel_gallery}}</p></a>
  		{% for photo in rel_gallery.gallery.photos.all|dictsortreversed:"weight" %}
      		<a class="photocutline" href="{{rel_gallery.gallery.get_absolute_url}}#photo-{{photo.id}}" alt="{{photo.title}}" class="photocutline"><img src="{{photo.get_square_url}}" alt="{{photo.title}}" width="250" border="0"><br>
          	{{photo.description|urlize|markdown|typogrify}}</a>
			{% if photo.photographer != None %}
				<span class="photobyline">Photo by {{photo.photographer}}</span>
			{% endif %}
			{% if photo.courtesy %}
				<span class="photobyline">Photo courtesy {{photo.courtesy}}</span>
			{% endif %}
			{% if photo.file_photo %}
				<span class="photobyline">Penobscot Bay Press file photo</span>
			{% endif %}
  		{% endfor %}
 	{% endfor %}
{% else %}
	{% if object.lead_photo %}
		<img src="{{object.lead_photo.get_square_url}}" alt="{{object.lead_photo.title}}" width="250" border="0"><br>
		<a class="photocutline" href="{{object.lead_photo.get_absolute_url}}#photo-{{photo.id}}" alt="{{photo.title}}" class="photocutline">{{object.lead_photo.description|urlize|markdown|typogrify}}</a>
		{% if object.lead_photo.photographer %}
			<span class="photobyline">Photo by {{object.lead_photo.photographer}}</span>
		{% else %}
			{% if object.lead_photo.courtesy %}
				<span class="photobyline">Photo courtesy of {{object.lead_photo.courtesy}}</span>
			{% endif %}
			{% if object.lead_photo.file_photo %}
				<span class="photobyline">Penobscot Bay Press file photo</span>
			{% endif %}
	{% endif %}
{% endif %}
{% endif %}

  {% if object.attached_documents.all %}
  <h3>Documents</h3>
  {% for doc in object.attached_documents.all %}
  <a href="{{doc.document.get_absolute_url}}" alt="{{doc.document}}">{{doc.document}}
  {% if doc.document.preview %}<img src="{{doc.document.preview.url}}" alt="{{doc.document}}" width="250"></a>{% endif %}
  {{doc.document.description}}
  {% endfor %}
  {% endif %}

  </div>



    <div style="padding-left:12px; padding-right:12px; width:450px">
    {% if object.authors.all %}<p>by 
    	{% for e in object.authors.all %}
    		{% if not forloop.first %}and {{e.name}}{% if e.title %}, {{e.title }}{% endif %}
    		{% else %}{{e.name}}{% if e.title %}, {{e.title }}{% endif %} {% endif %}
    	{% endfor %}
    	</p>
    {% endif %}
    {% for p in object.paragraphs %}
	{{p|typogrify|urlize|markdown}}
    {% endfor %}

    
    
    
    </p></div>
<div style="padding-left:12px; padding-right:12px; clear:both">
	{% for s in object.sites.all|dictsortreversed:"id"%}
    {% if s.url == 'http://penobscotbaypress.com' %}
    <p><a class="return" href="http://penobscotbaypress.com">Return to the Penobscot Bay Press home page.</a></p>
    {% else %}
    <p><a class="return" href="http://{{s}}">Return to the {{s.name}} home page</a></p>
    {% endif %}
    {% endfor %}
    <hr size="1">
  </div>
</td>
{% endblock %}
