{% 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 %}
<div style="width:100%; margin:0; padding:0">
	<div class="main_content_left">
		<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:550px; 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>
		{% if object.archivesection_set.all %}
		<div style="float:right; width:250px; margin-left:25px">
			<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>
		</div>
		{% endif %}

		{% if object.lead_photo %}
		<div style="float:right; width:1px; margin-left:15px; display:table; clear:right">
			<a href="{{object.lead_photo.get_absolute_url}}#photo-{{lead_photo.id}}" class="photocutline"><img src="{{object.lead_photo.get_storylead_url}}" alt="{{object.lead_photo.title}}" style="border-width:0px"></a><br>
			<div class="newcutline">{{object.lead_photo.description|urlize|markdown|typogrify}}</div>
			{% if object.lead_photo.photographer %}
			<span class="photobyline">Photo by {{object.lead_photo.photographer}}
			<a href="http://penobscotbaypress.smugmug.com/" class="return" style="float:right; display:block; font-style:normal">Order prints of selected PBP photos.</a></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 %}
		</div>
		{% endif %}

		{% if object.attached_documents.all %}
		<div style="float:right; width:250px; margin-left:25px; margin-bottom:15px; clear:right">
			{% for doc in object.attached_documents.all %}
			<p style="text-align:left"><span class="teaser-alt">PDF Document</span><br>
			<b><a href="{{doc.document.get_absolute_url}}" alt="{{doc.document}}">{{doc.document}}</a></b><br>
			{{doc.document.description}}
			{% endfor %}
		</div>
		{% endif %}

		<div style="padding-left:12px; padding-right:12px; clear:left">
			{% 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 %}
		</div>
	</div>


	<div class="sidebar_right_media">
		<!-- Google AdSense BEGIN -->
		<div style="clear:both; text-align:center">
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
			<!-- Square ad for right of pages -->
			<ins class="adsbygoogle"
			style="display:inline-block;width:250px;height:250px"
			data-ad-client="ca-pub-7616595738812584"
			data-ad-slot="7790117357"></ins>
			<script>
			(adsbygoogle = window.adsbygoogle || []).push({});
			</script>
		</div>
		<!-- Google AdSense END -->
		<br>
		<!-- Google AdSense BEGIN -->
		<div style="clear:both; text-align:center">
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
			<!-- Square ad for right of pages -->
			<ins class="adsbygoogle"
			style="display:inline-block;width:250px;height:250px"
			data-ad-client="ca-pub-7616595738812584"
			data-ad-slot="7790117357"></ins>
			<script>
			(adsbygoogle = window.adsbygoogle || []).push({});
			</script>
		</div>
		<!-- Google AdSense END -->
	</div>
		<div style="padding-left:20px; padding-right:12px; padding-bottom:10px">
			<!-- AddThis Button BEGIN -->
			<div>
				<a class="addthis_button_facebook_like" fb:like:layout="standard"></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#async=1"></script>
			<!-- AddThis Button END -->
		</div>
		{% if object.attached_gallery.all %}
			{% for rel_gallery in object.attached_gallery.all %}
		{% if rel_gallery.gallery.photos.count == 4 %}
<div style="clear:both; margin-bottom:12px; border-style:solid; border-width:1px; width:100%; padding:10px">
		<div style="margin-left:10px">
			<a href="{{rel_gallery.gallery.get_absolute_url}}"><p class="gallery_link">GALLERY &#8212; {{rel_gallery}}</p></a>
			{% for photo in rel_gallery.gallery.photos.all|dictsortreversed:"weight" %}
		</div>
		<div style="float:left; width:400px; margin-left:45px; margin-right:45px; margin-bottom:10px{% if forloop.counter == 3 %}; clear:left{% endif %}">
			<a href="{{rel_gallery.gallery.get_absolute_url}}#photo-{{photo.id}}"><img src="{{photo.get_story_gallery_wide_url}}" alt="{{photo.title}}" style="border-width:0px"></a>
			<div class="newcutline">{{photo.description|urlize|markdown|typogrify}}</div>
			{% if photo.photographer != None %}
			<span class="photobyline">Photo by {{photo.photographer}}</span>
			{% endif %}
			{% if photo.courtesy %}
			<span class="photobyline">Photo courtesy of {{photo.courtesy}}</span>
			{% endif %}
			{% if photo.file_photo %}
			<span class="photobyline">Penobscot Bay Press file photo</span>
			{% endif %}
			{% endfor %}
		</div>
		{% else %}
<div style="clear:both; margin-bottom:12px; border-style:solid; border-width:1px; display:table">
		<div style="margin-left:10px">
		{% if object.attachedlink.all %}TEST
		{% endif %}
		</div>
		<div style="margin-left:10px">
			<a href="{{rel_gallery.gallery.get_absolute_url}}"><p class="gallery_link">GALLERY &#8212; {{rel_gallery}}</p></a>
			{% for photo in rel_gallery.gallery.photos.all|dictsortreversed:"weight" %}
		</div>
		<div style="float:left; width:300px; margin-left:10px; margin-right:10px; margin-bottom:10px{% if forloop.counter == 4 %}; clear:left{% endif %}">
			<a href="{{rel_gallery.gallery.get_absolute_url}}#photo-{{photo.id}}"><img src="{{photo.get_story_gallery_url}}" alt="{{photo.title}}" style="border-width:0px"></a>
			<div class="newcutline">{{photo.description|urlize|markdown|typogrify}}</div>
			{% if photo.photographer != None %}
			<span class="photobyline">Photo by {{photo.photographer}}</span>
			{% endif %}
			{% if photo.courtesy %}
			<span class="photobyline">Photo courtesy of {{photo.courtesy}}</span>
			{% endif %}
			{% if photo.file_photo %}
			<span class="photobyline">Penobscot Bay Press file photo</span>
			{% endif %}
			{% endfor %}
		</div>
		{% endif %}
		<div style="clear:both"></div>
</div>
			{% endfor %}
		<div style="padding:20px; text-align:center; margin-left:auto; margin-right:auto">
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
			<!-- Large banner for bottom of pages -->
			<ins class="adsbygoogle"
				 style="display:inline-block;width:728px;height:90px"
				 data-ad-client="ca-pub-7616595738812584"
				 data-ad-slot="1750256958"></ins>
			<script>
			(adsbygoogle = window.adsbygoogle || []).push({});
			</script>		
		</div>
		{% else %}
		<div style="padding:20px">
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
				<!-- Google links -->
				<ins class="adsbygoogle"
				style="display:inline-block;width:468px;height:15px"
				data-ad-client="ca-pub-7616595738812584"
				data-ad-slot="3791624955"></ins>
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
			</script>
		</div>
		<div style="clear:both"></div>
		{% endif %}
		
		
<!-- AddThis Smart Layers BEGIN -->
<!-- Go to http://www.addthis.com/get/smart-layers to customize -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=penbaypress#async=1"></script>
<script type="text/javascript">
  addthis.layers({
    'theme' : 'transparent',
    'share' : {
      'position' : 'right',
      'services' : 'facebook,twitter,email,print,gmail,tumblr,more',
    }, 
    'follow' : {
      'services' : [
        {'service': 'facebook', 'id': 'penobscotbaypress'},
        {'service': 'youtube', 'id': 'penobscotbaypress'},
        {'service': 'rss', 'id': 'http://https://penobscotbaypress.com/news/feed.xml'}
      ]
    }   
  });
</script>
<!-- AddThis Smart Layers END -->
{% endblock %}
