<!DOCTYPE html >
<html lang="en">
<head>
  <title><%site_title%></title>
<%include include_common_head.html%>
</head>
<body id="home">
    <%~if ad_wallpaper%>
    <%ad_wallpaper%>
    <%~endif%>

    <div class="container">
        <%include include_header.html%>

        <div class="main">
            <div class="contentwrapper clearfix">
                <%~if $config.featured_articles%><%set featured_articles_loop = Plugins::UI::fetch_links(ids => $config.featured_articles)%><%endif%>
                <%~if featured_articles_loop.length%>
                <section class="section featured home">
                <%loop featured_articles_loop%>
                <%if row_num > 1%><%lastloop%><%endif%>
                <%~rewrite_detail_url%>
                <div class="home-featured grid">
                    <div class="col-1-2">
                        <a href="<%detailed_url%>">
                          <%~if thumbnail_url%>
                          <div class="crop-3"><img src="<%thumbnail_url.large || $thumbnail_url.medium%>" class="img-responsive"></div>
                          <%--
                          srcset="<%thumbnail_url.largest%> 620w, <%thumbnail_url.large%> 900w"
                          class="img-responsive">
                          --%>
                          <%~else%>
                          <img src="<%config.build_static_url%>/images/default_470x260.png">
                          <%~endif%>
                        </a>
                    </div>
                    <div class="col-1-2">
                        <div class="featured-hero">
                            <a href="<%URL%>" class="label label-category"><%escape_html Name%></a>
                            <h1><a href="<%detailed_url%>"><%Title%></a></h1>
                            <div class="excerpt">
                                <%shorten_it($Description, 150)%> <a href="<%detailed_url%>" class="readmore">Read &gt;</a>
                            </div>
                            <div class="post-meta light-grey">
                                <i class="icon sprite-slowtwitch"></i>
                                <span class="author">By <%Contact_Name%></span>
                                <span class="hide-on-mobile"> | </span>
                                <span class="time"><%Plugins::UI::friendly_date($Timestmp)%></span>
                            </div>
                        </div><!-- end featured-content -->
                    </div><!-- end col-6-12 -->
                    
                </div><!-- end grid grid-pad -->
                <%~endloop%>

                <!-- Latest Headlines -->
                <div class="section-has-widgets remove-sidebar clearfix">
                    <div class="sidebar-b">
                        <%~set adsize = '300x600'%>
                        <%include include_ad.html%>
                    </div><!-- end sidebar -->
                    <div class="content content-has-sidebar">
                        <div class="grid">
                            <%~set skip_first = 1%><%~set show_ad = 4%><%set show_category = 1%>
                            <%include include_featured_articles.html%>
                            <%~set show_category = 0%>
                        </div>
                    </div><!-- end content -->
                </div>
                </section><!-- end section: featured articles -->
                <div class="section-divider"></div>
                <%~endif%>

                <%~set widgets_loop = Plugins::UI::fetch_widgets('home')%>
                <section class="section section-has-widgets list clearfix latest-headlines section-reverse">
                <div class="sidebar-b">
                  <%~set widget_start = 1%><%set widget_end = 3%>
                  <%include include_widgets.html%>
                </div>
                <div class="content content-has-widgets">
                    <div class="grid">
                        <!-- latest articles -->
                        <div class="list-column col-6-12 show-3">
                            <h1>Latest Headlines</h1>
                            <%~set latest_news = Plugins::UI::fetch_links(type => 'news', max_hits => 6)%>
                            <%~set list_view   = 'latest'%>
                            <%~if latest_news.length%>
                            <%~loop latest_news%>
                            <%include link.html%>
                            <%~endloop%>
                            <%~endif%>
                        </div>

                        <!-- latest techs -->
                        <%~set latest_tech = Plugins::UI::fetch_links(type => 'editorial', max_hits => 3)%>
                        <%~set list_view   = 'latest'%>
                        <%~if latest_tech.length%>
                        <div class="list-column col-6-12">
                            <%~set adsize = '300x250_1'%>
                            <%include include_ad.html%>

                            <h1>Latest Tech</h1>
                            <%~loop latest_tech%>
                            <%include link.html%>
                            <%~endloop%>
                        </div><!-- end .list-column -->
                        <%~endif%>

                    </div><!-- end grid -->
                    <div class="section-divider mobile"></div>

                </div><!-- end content -->
                </section><!-- end section -->
                <div class="section-divider"></div>

                <%-- Featured photo & video section --%>
                <%~if $config.featured_photos%><%set featured_photo_video_loop = Plugins::UI::fetch_links(ids => $config.featured_photos)%><%endif%>
                <%~if featured_photo_video_loop.length%>
                <section class="section section-has-widgets clearfix featured-photo-video section-reverse">
                <div class="sidebar-b">
                    <%~set adsize = '300x250_1'%>
                    <%include include_ad.html%>
                </div>
                <div class="content content-has-widgets">
                    <div class="grid">

                        <%~loop featured_photo_video_loop%>
                        <%~rewrite_detail_url%>
                        <div class="featured-content col-6-12">
                            <div class="widget widget-fullwidth center">
                                <h2><%if Link_Type eq 'photo'%>Photos<%else%>Video<%endif%></h2>
                                <a href="<%URL%>" class="label label-category"><%escape_html Name%></a>
                                <br/><br/>
                                <%if Link_Type eq 'video'%>
                                <a href="<%detailed_url%>" class="video-thumb">
                                    <%~if thumbnail_url%>
                                    <div class="crop-2"><img class="img-responsive" src="<%$thumbnail_url.large || $thumbnail_url.medium || $thumbnail_url.small%>" /></div>
                                    <%~else%>
                                    <img class="img-responsive" width="300" height="166" src="<%config.build_static_url%>/images/default_300x166.png" />
                                    <%~endif%>
                                    <i class="sprite-video-play"></i>
                                    <div class="excerpt"><%Contact_Name%></div>
                                </a>
                                <%~else%>
                                <a href="<%detailed_url%>">
                                    <%~if thumbnail_url%>
                                    <div class="crop-2"><img class="img-responsive" src="<%$thumbnail_url.large || $thumbnail_url.medium || $thumbnail_url.small%>" /></div>
                                    <%~else%>
                                    <img class="img-responsive" width="300" height="166" src="<%config.build_static_url%>/images/default_300x166.png" />
                                    <%~endif%>
                                    <div class="excerpt">More <%Contact_Name%> pictures</div>
                                </a>
                                <%~endif%>
                            </div>
                        </div>
                        <%~endloop%>
                        
                    </div><!-- end grid -->
                </div><!-- end content -->
                </section><!-- end section -->
                <div class="section-divider"></div>
                <%~endif%>


                <%-- Begin Inside Track --%>
                <%~set interviews = Plugins::UI::fetch_links(category => 7, max_hits => 6)%>
                <%~if interviews.length%>
                <section class="section highlight-list section-has-widgets clearfix section-reverse">
                <div class="sidebar-b">
                    <%~set widget_start = 4%><%set widget_end = 5%>
                    <%include include_widgets.html%>
                </div>
                <div class="content content-has-widgets">
                    <div class="grid">
                        <div class="clearfix">
                            <div class="center">
                                <h1>Inside Track</h1>
                                <a href="<%interviews.0.URL%>" class="label label-category">Interviews</a>
                            </div>
                            <div class="clearfix"></div>
                            <br/>
                            <div class="grid content-has-widgets">
                                <%~loop interviews%>
                                <div class="highlight col-4-12">
                                    <a href="<%detailed_url%>">
                                    <%~if thumbnail_url%>
                                    <div class="crop"><img src="<%thumbnail_url.medium%>" class="img-responsive" /></div>
                                    <%~else%>
                                    <img src="<%config.build_static_url%>/images/default_193x144.png" class="img-responsive" width="193" height="144" />
                                    <%~endif%>
                                    </a>
                                    <div class="info">
                                        <h3><a href="<%detailed_url%>"><%escape_html Title%></a></h3>
                                        <span class="post-meta light-grey"><%Plugins::UI::friendly_date($Add_Date, $Timestmp)%></span>
                                    </div>
                                </div>
                                <%if row_num == 3%><div class="clearall"></div><%endif%>
                                <%~endloop%>

                                <div class="more col-1-1 center">
                                    <a href="<%interviews.0.URL%>" class="btn btn-more">More Interviews</a>
                                </div>
                            </div>
                        </div>
                    </div> <!-- end grid -->
                    <div class="section-divider mobile"></div>
                </div>
                </section>
                <div class="section-divider"></div>
                <%~endif%>
                <%-- End Inside Track --%>

                <%-- Begin Featured Articles --%>
                <%~set features = Plugins::UI::fetch_links(category => 9, max_hits => 12)%>
                <%~if features.length%>
                <section class="section list section-has-widgets clearfix latest-headlines section-reverse">
                <div class="sidebar-b">
                    <%~set widget_start = 6%><%set widget_end = 0%>
                    <%include include_widgets.html%>
                </div>
                <div class="content content-has-widgets">
                    <div class="grid">
                        <div class="list-column col-1-1 show-6">
                            <!-- articles -->
                            <h1>Feature Articles</h1>
                            <%~set list_view = 'column'%>
                            <%~loop features%>
                            <%include link.html%>
                            <%~endloop%>

                            <div class="more col-1-1 center">
                                <a href="<%features.0.URL%>" class="btn btn-more">More Features</a>
                            </div>
                        </div><!-- end .list-column -->

                    </div>
                    <div class="section-divider mobile"></div>
                </div>
                </section>
                <%~endif%>
                <%-- End Featured Articles --%>

                <section class="section advert-large">
                <div class="content content-has-widgets">
                    <%~set adsize = '970x250'%>
                    <%include include_ad.html%>
                </div>
                </section>

                <div class="section-divider mobile tablet"></div>

            </div><!-- End contentwrapper -->
        </div>
        <%include include_footer.html%>
    </div>
</body>
<%~include include_global_js.html%>
</html>
