{% extends "newsroom/base.html" %}
{% block flag_update_stamp %}Last updated {{edition.published_on|date:"F j, Y"}}{% endblock %}

{% block content %}

{% load typogrify convert_tags markup %}
<div style="width:100%">
	<div class="main_content_left">
		<!-- Feature BEGIN -->
		{% ifequal edition.featured_story.weight 99 %}
		<h3 class="featured_headline">
		<a href="{{edition.featured_story.get_absolute_url}}">{{edition.featured_story.hed}}</a>
		</h3>					
		<div style="float:left; width:1px; margin-right:18px; display:table">
			<img src="{{edition.featured_story.lead_photo.get_lead_with_story_url}}" alt="{{edition.featured_story.lead_photo.title}}" style="border-width:0px"><br>
			<div class="newcutline_lead">
				{{edition.featured_story.lead_photo.title|typogrify|urlize|markdown|typogrify}}
			</div>
			{% if edition.featured_story.lead_photo.photographer %}
			<span class="photobyline_lead">Photo by {{edition.featured_story.lead_photo.photographer}}</span>
			{% else %}
			{% if edition.featured_story.lead_photo.courtesy %}
			<span class="photobyline_lead">Photo courtesy of {{edition.featured_story.lead_photo.courtesy}}</span>
			{% endif %}
			{% if edition.featured_story.lead_photo.file_photo %}
			<span class="photobyline_lead">Penobscot Bay Press file photo</span>
			{% endif %}
			{% endif %}
		</div>
		<div class="featuredleadbody">
			<div class="teaser_float">{{edition.featured_story.dateline}} &mdash; </div>{{edition.featured_story.summary|typogrify|urlize|markdown|truncatewords:110}}
			<div style="margin-top:-15px; padding-top:0px; text-align:left"><a href="{{edition.featured_story.get_absolute_url}}" class="return">Read full story</a></div>
		</div>
		{% else %}
		<div>
			<div style="float:left; margin-right:18px; margin-top:8px">
				<a href="{% if edition.featured_photo.story_set.all %}{% for s in edition.featured_photo.story_set.all %}{% if forloop.first %}{{s.get_absolute_url}}{% endif %}{% endfor %}{% else %}{% if edition.featured_photo.gallery_photos.all %}{% for s in edition.featured_photo.gallery_photos.all %}{% if forloop.first %}{{s.get_absolute_url}}{% endif %}{% endfor %}{% else %}{{edition.featured_photo.get_absolute_url}}{% endif %}{% endif %}">
				<img src="{{edition.featured_photo.get_lead_no_story_url}}" alt="{{edition.featured_photo.title}}" style="border-width:0px">
				</a>
			</div>
			<div style="float:left; display:block; margin-top:75px; width:180px">
				<div class="newcutline_head">
					<a href="{% if edition.featured_photo.story_set.all %}{% for s in edition.featured_photo.story_set.all %}{% if forloop.first %}{{s.get_absolute_url}}{% endif %}{% endfor %}{% else %}{% if edition.featured_photo.gallery_photos.all %}{% for s in edition.featured_photo.gallery_photos.all %}{% if forloop.first %}{{s.get_absolute_url}}{% endif %}{% endfor %}{% else %}{{edition.featured_photo.get_absolute_url}}{% endif %}{% endif %}">{{edition.featured_photo.title|typogrify}}</a>
				</div>
				<div class="newcutline">
					{{edition.featured_photo.description|typogrify|urlize|markdown|truncatewords:30}}
				</div>
				{% if edition.featured_photo.photographer %}
				<span class="photobyline">Photo by {{edition.featured_photo.photographer}}</span>
				{% else %}
				{% if edition.featured_photo.courtesy %}
				<span class="photobyline">Photo courtesy of {{edition.featured_photo.courtesy}}</span>
				{% endif %}
				{% if edition.featured_photo.file_photo %}
				<span class="photobyline">Penobscot Bay Press file photo</span>
				{% endif %}
				{% endif %}
			</div>
			<div style="clear:both"></div>
		</div>
		{% endifequal %}
		<!-- Feature END -->
	</div>
	<div class="sidebar_right">

		<!-- APP Teaser BEGIN -->
		<div style="padding:2px; text-align:center; margin:0px 0px 10px 0px">
			<a href="https://penobscotbaypress.com/apps/" class="app_teaser_link">
			<div class="app_teaser_button" style="background-size:244px">
				Get our apps
			</div>
			</a>
		</div>
		<!-- APP Teaser END -->
		<!-- Webcams BEGIN -->
		<div style="clear:both; margin-top:-10px; padding-top:0px">
			<p class="home_teaser" style="margin:0px; text-align:center">View our Webcams</p>
			{% for cam in webcams %}
			{% if forloop.first %}
			<div style="float:left; width:120px; padding:0px 10px 0px 4px; margin:0">
			{% else %}
			<div style="float:left; width:120px; padding:0; margin:0">
			{% endif %}
				<span class="webcamteaser" style="width:120px; text-align:center"><a href="{{cam.get_absolute_url}}">{{cam.title}}</a></span>
				<a href="{{cam.get_absolute_url}}">
				<img src="{{cam.thumb_file}}" alt="{{cam}}" width="120" style="border-width:0px">
				</a>
			</div>
			{% endfor %}
		</div>
		<!-- Webcams END -->
		<!-- Smugmug Teaser BEGIN -->
		<div style="padding:2px; text-align:center; margin:0px 0px 10px 0px; clear:left">
			<p class="home_teaser" style="margin:5px 0 0 0"><a href="http://penobscotbaypress.smugmug.com/">Order Photos</a></p>
			<div class="newcutline">Print your favorite newspaper photos on a mug, a t-shirt, or even poster size.</div>
			<a href="http://penobscotbaypress.smugmug.com/" class="head_link"><img src="https://penobscotbaypress.com/static/images/headers/2013/smugmug_teaser_img_2014_grey.jpg"></a>
		</div>
		<!-- Smugmug Teaser END -->
	</div>
</div>
<div style="width:100%">
	<div class="sidebar_right_media">

		<!-- Block Ad BEGIN -->
		<div style="clear:both; padding:1px; width:250px; margin: 0 auto">
			{% load adzone_tags %} 
			{% random_zone_ad '' 'cn-block' %}
		</div>
		<!-- Block Ad END -->

		<!-- Local Headlines BEGIN -->
		{% if latest_other_editions %}
		<p style="display:block; width:260px" class="sectionheader_blue">LOCAL HEADLINES</p>
		{% for edition in latest_other_editions %}
		{% if edition.published %}
		<p style="text-align:left"><span class="paper">{{edition.featured_story.dateline}}</span>, <span class="paper"><em>{{edition.paper}}</em>, {{edition.published_on|date:"M j, Y"}}</span><br>
		<span class="smaller_headline"><a href="http://{{edition.site.domain}}/{{edition.featured_story.get_relative_url}}">{{edition.featured_story.web_hed|typogrify}}</a></span>
		</p>
		{% endif %}
		{% endfor %}
		{% endif %}
		<!-- Local Headlines END -->

	</div>
	<div class="main_content_left">


		<!-- Editions BEGIN -->
		{% for edition in latest_editions %}
		<div style="clear:both; margin-top:16px">
			<h2 class="datehead_new">{{edition.published_on|date:"l, F j, Y"}}</h2>
		</div>
		{% if forloop.first %}
		<!-- Stories BEGIN -->
		{% load markup typogrify humanize  %}
		{% if edition.stories.published %}  
		{% for story in edition.stories.published|dictsortreversed:"weight" %}

		<!-- Breaking News BEGIN -->
		{% ifequal story.weight 100 %}
		<p style="text-align:left; margin-bottom: -10px">
		<span class="reddata">BREAKING NEWS</span><br>
		{% if story.kicker %}
		<span class="kicker">{{story.kicker|typogrify}}</span><br>
		{% endif %}
		<span class="headline"><a href="{{story.get_absolute_url}}">{{story.web_hed|typogrify}}</a></span><br>
		{% if story.subhed %}
		<span class="kicker">{{story.subhed|typogrify}}</span>
		</p>
		{% endif %}
		<div class="featuredleadbody">
			<div class="teaser_float">
				{{story.dateline}} &mdash; 
			</div>
			{{story.summary|typogrify|truncatewords:30}}
		</div>
		<div style="margin-top:-15px; padding-top:0px; text-align:left">
			<a href="{{story.get_absolute_url}}" class="return">Read full story</a>
		</div>
		<!-- Breaking News END -->

		{% else %}
		<!-- Featured Story BEGIN -->
		{% if story == edition.featured_story %}
		{% ifnotequal story.weight 99 %}
		<p style="text-align:left; margin-bottom: -10px">
		{% if story.kicker %}
		<span class="kicker">{{story.kicker|typogrify}}</span><br>
		{% endif %}
		<span class="headline"><a href="{{story.get_absolute_url}}">{{story.web_hed|typogrify}}</a><br></span>
		{% if story.subhed %}
		<span class="kicker">{{story.subhed|typogrify}}</span>
		{% endif %}
		</p>
		<div class="featuredleadbody">
			<div class="teaser_float">
			{{story.dateline}} &mdash; </div>{{story.summary|typogrify|truncatewords:30}}
		</div>
		<div style="margin-top:-15px; padding-top:0px; text-align:left">
			<a href="{{story.get_absolute_url}}" class="return">Read full story</a>
		</div>
		{% endifnotequal %}	
		<!-- Featured Story END -->

		{% else %}
		<p style="text-align:left">
		<span class="dateline">{{story.dateline}}</span><br>
		<span class="small_headline"><a href="{{story.get_absolute_url}}">{{story.web_hed|typogrify}}</a></span>
		</p>
		{% endif %}

		{% endifequal %}	

		{% endfor %}	
		{% endif %}
		<!-- Stories END -->
		
		<!-- Extras BEGIN -->
		{% if edition.pdfdocuments.all %}
		{% for doc in edition.pdfdocuments.all %}
		<p style="text-align:left"><span class="teaser-alt">PDF Document</span><br>
		<span class="small_headline"><a href="{{doc.get_absolute_url}}">{{doc.title|typogrify}}</a></span>
		</p>
		{% endfor %}
		{% endif %}

		{% if edition.movies.all %}  
		{% for movie in edition.movies.all|dictsortreversed:"weight" %}
		<p style="text-align:left"><span class="teaser-alt">MOVIE</span><br>
		<span class="small_headline"><a href="{{movie.get_absolute_url}}">{{movie.title|typogrify}}</a></span>
		</p>
		{% endfor %}	
		{% endif %}

		{% if edition.slideshows.all %}  
		{% for slideshow in edition.slideshows.all %}
		<p style="text-align:left"><span class="teaser-alt">SLIDESHOW</span><br>
		<span class="small_headline"><a href="{{slideshow.get_absolute_url}}">{{slideshow.title|typogrify}}</a></span>
		</p>
		{% endfor %}	
		{% endif %}
		<!-- Extras END -->
		<!-- Photos and Galleries BEGIN -->
		<div style="margin-top:30px">
			{% if edition.photos.published %}
			{% for photo in edition.photos.published %}
			<div style="float:left; width:220px; margin-right:7px; margin-top:10px; height:200px">
				<a href="{{photo.get_absolute_url}}">
				<div class="newcutline">
					<p>
					<img src="{{photo.get_index_photo_thumb_url}}" alt="{{photo.title}}" style="border-width:0px"><br>
					{{photo.title|typogrify}}
					</p>
				</div>
				</a>
			</div>
			{% endfor %}
			{% endif %}
			{% if edition.galleries.published %}  
			{% for gallery in edition.galleries.published %}
			<div style="float:left; width:220px; margin-right:7px; margin-top:10px; height:200px">
				{% for photo in gallery.photos.all|dictsortreversed:"weight" %}
				{% if forloop.first %}
				
				<div class="newcutline">
					<p>
					<a href="{{gallery.get_absolute_url}}"><img src="{{photo.get_index_photo_thumb_url}}" alt="{{photo.title}}" style="border-width:0px"><br>
					GALLERY &mdash; {{gallery.title|typogrify}}</a>
					</p>
				</div>
				{% endif %}
				{% endfor %}
			</div>
			{% endfor %}
			{% endif %}
			<div style="clear:both"></div>
		</div>
		<!-- Photos and Galleries END -->
		<div style="clear:left; padding:1px; margin: 0 auto">
			{% load adzone_tags %} 
			{% random_zone_ad '' 'home-leaderboard' %}
		</div>
		{% else %}
		<!-- Stories BEGIN -->
		{% load markup typogrify humanize  %}
		{% if edition.stories.published %}  
		{% if edition.featured_photo.published %}
			<div style="float:right; width:220px; margin-right:7px; margin-top:10px; margin-left:5px; height:200px">
				<a href="{{edition.featured_photo.get_absolute_url}}">
				<div class="newcutline">
					<p>
					<img src="{{edition.featured_photo.get_index_photo_thumb_url}}" alt="{{edition.featured_photo.title}}" style="border-width:0px"><br>
					{{edition.featured_photo.title|typogrify}}
					</p>
				</div>
				</a>
			</div>
		{% endif %}
		{% for story in edition.stories.published|dictsortreversed:"weight" %}

		<!-- Breaking News BEGIN -->
		{% ifequal story.weight 100 %}
		<p style="text-align:left; margin-bottom: -10px">
		<span class="reddata">BREAKING NEWS</span><br>
		{% if story.kicker %}
		<span class="kicker">{{story.kicker|typogrify}}</span><br>
		{% endif %}
		<span class="headline"><a href="{{story.get_absolute_url}}">{{story.web_hed|typogrify}}</a></span><br>
		{% if story.subhed %}
		<span class="kicker">{{story.subhed|typogrify}}</span>
		</p>
		{% endif %}
		<div class="featuredleadbody">
			<div class="teaser_float">
				{{story.dateline}} &mdash; 
			</div>
			{{story.summary|typogrify|truncatewords:30}}
		</div>
		<div style="margin-top:-15px; padding-top:0px; text-align:left">
			<a href="{{story.get_absolute_url}}" class="return">Read full story</a>
		</div>
		<!-- Breaking News END -->

		{% else %}
		<!-- Featured Story BEGIN -->
		{% if story == edition.featured_story %}
		<p style="text-align:left; margin-bottom: -10px">
		{% if story.kicker %}
		<span class="kicker">{{story.kicker|typogrify}}</span><br>
		{% endif %}
		<span class="headline"><a href="{{story.get_absolute_url}}">{{story.web_hed|typogrify}}</a><br></span>
		{% if story.subhed %}
		<span class="kicker">{{story.subhed|typogrify}}</span>
		{% endif %}
		</p>
		<div class="featuredleadbody">
			<div class="teaser_float">
			{{story.dateline}} &mdash; </div>{{story.summary|typogrify|truncatewords:30}}
		</div>
		<div style="margin-top:-15px; padding-top:0px; text-align:left">
			<a href="{{story.get_absolute_url}}" class="return">Read full story</a>
		</div>
		<!-- Featured Story END -->

		{% else %}
		<p style="text-align:left">
		<span class="dateline">{{story.dateline}}</span><br>
		<span class="small_headline"><a href="{{story.get_absolute_url}}">{{story.web_hed|typogrify}}</a></span>
		</p>
		{% endif %}

		{% endifequal %}	

		{% endfor %}	
		{% endif %}
		<!-- Stories END -->
		
		<!-- Extras BEGIN -->
		{% if edition.pdfdocuments.all %}
		{% for doc in edition.pdfdocuments.all %}
		<p style="text-align:left"><span class="teaser-alt">PDF Document</span><br>
		<span class="small_headline"><a href="{{doc.get_absolute_url}}">{{doc.title|typogrify}}</a></span>
		</p>
		{% endfor %}
		{% endif %}

		{% if edition.movies.all %}  
		{% for movie in edition.movies.all|dictsortreversed:"weight" %}
		<p style="text-align:left"><span class="teaser-alt">MOVIE</span><br>
		<span class="small_headline"><a href="{{movie.get_absolute_url}}">{{movie.title|typogrify}}</a></span>
		</p>
		{% endfor %}	
		{% endif %}

		{% if edition.slideshows.all %}  
		{% for slideshow in edition.slideshows.all %}
		<p style="text-align:left"><span class="teaser-alt">SLIDESHOW</span><br>
		<span class="small_headline"><a href="{{slideshow.get_absolute_url}}">{{slideshow.title|typogrify}}</a></span>
		</p>
		{% endfor %}	
		{% endif %}
		<!-- Extras END -->
		<!-- Photos and Galleries BEGIN -->
		<div style="margin-top:30px">
			{% if edition.photos.published %}
			{% for photo in edition.photos.published %}
			<div style="float:left; width:220px; margin-right:7px; margin-top:10px; height:200px">
				<a href="{{photo.get_absolute_url}}">
				<div class="newcutline">
					<p>
					<img src="{{photo.get_index_photo_thumb_url}}" alt="{{photo.title}}" style="border-width:0px"><br>
					{{photo.title|typogrify}}
					</p>
				</div>
				</a>
			</div>
			{% endfor %}
			{% endif %}
			{% if edition.galleries.published %}  
			{% for gallery in edition.galleries.published %}
			<div style="float:left; width:220px; margin-right:7px; margin-top:10px; height:200px">
				{% for photo in gallery.photos.all|dictsortreversed:"weight" %}
				{% if forloop.first %}
				
				<div class="newcutline">
					<p>
					<a href="{{gallery.get_absolute_url}}"><img src="{{photo.get_index_photo_thumb_url}}" alt="{{photo.title}}" style="border-width:0px"><br>
					GALLERY &mdash; {{gallery.title|typogrify}}</a>
					</p>
				</div>
				{% endif %}
				{% endfor %}
			</div>
			{% endfor %}
			{% endif %}
			<div style="clear:both"></div>
		</div>
		<!-- Photos and Galleries END -->
		{% endif %}
		{% endfor %}
		<!-- Editions END -->

	</div>
</div>


<!-- 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 %}