<div class="header-Outro with-site-image">
  <div class="row content site-info-row">
    <div class="col col-50 signup-Area site-display-preview-wrapper large">
      <div class="signup-Form site-display-preview">
  	  <fieldset class="content">
        <a href="<%= site.uri %>" class="screenshot" style="background-image:url(<%= site.screenshot_url('index.html', '540x405') %>);"></a>
	    </fieldset>
      </div>
    </div>
    <div class="col col-50 profile-info">
      <h2 class="eps title-with-badge"><span><%= site.title %></span> <% if site.supporter? %><a href="/supporter" class="supporter-badge" title="Epic"></a> <% end %></h2>
      <p class="site-url"><a href="<%= site.uri %>"><%= site.host %></a></p>
      <% follow_count = site.follows_dataset.count %>
      <div class="stats">
        <div class="stat"><strong><%= site.views.format_large_number %></strong> <span>view<%= site.views == 1 ? '' : 's' %></span></div>
        <div class="stat"><strong><%= follow_count.format_large_number %></strong> <span>follower<%= follow_count == 1 ? '' : 's' %></span></div>
        <div class="stat"><strong><%= site.changed_count.format_large_number %></strong> <span>update<%= site.changed_count == 1 ? '' : 's' %></span></div>
        <div class="stat tips"><strong><%= site.tips_dataset.count %></strong> <span>tips</span></div>
      </div>
      <div class="actions">
        <% if current_site == site && !current_site.tutorial_required %>
          <a href="/dashboard" class="btn-Action edit"><i class="fa fa-edit" title="Edit"></i> Edit Site</a>
        <% end %>

        <% if current_site && current_site != site %>
          <% is_following = current_site.is_following?(site) %>

          <a id="followLink" href="#" onclick="Site.toggleFollow(<%= site.id %>, '<%= csrf_token %>'); return false" class="btn-Action <%= is_following ? 'is-following' : '' %>">
            <span class="unfollow"><i class="fa fa-times"></i>Unfollow</span>
            <span class="following"><i class="fa fa-check"></i>Following</span>
            <span class="follow"><i class="fa fa-plus"></i>Follow</span>
          </a>
        <% end %>

        <a href="#" id="shareButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'_share', layout: false, locals: {site: site} %>'><i class="fa fa-share-alt"></i> <span>Share</span></a>

        <% if site.tipping_enabled? %>
          <a href="#" id="tipButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'site/_tip', layout: false, locals: {site: site} %>'><i class="fa fa-usd"></i> <span>Send a Tip</span></a>
        <% end %>
      </div>
    </div>
  </div>
</div>

<div class="container site-profile">
<div class="content misc-page columns right-col"><div class="col-left">
  <div class="col col-66">
    <%== erb :'site/_profile_comments', locals: {site: site} %>
    <div class="site-profile-padding"><%== erb :'_news', layout: false, locals: {site: site, events: @latest_events} %></div>
  </div>

  <div class="col col-33">
    <h3>Website Stats</h3>
    <div class="stats">
      <div class="stat">
        <% unless site.updated_at.nil? %>
          <span>Last updated</span>
          <strong class="local-date-title" data-timestamp="<%= site.site_updated_at.to_i %>"><%= site.site_updated_at.ago.downcase %></strong>
        <% end %>
      </div>
      <div class="stat"><span>Created</span><strong><%= site.created_at.strftime('%b %-d, %Y') %></strong></div>
      <a href="/site/<%= site.username %>/stats">Site Traffic Stats</a>
    </div>

    <%== erb :'_follows', layout: false, locals: {site: site, is_current_site: site == current_site} %>

    <%== erb :'_tags', layout: false, locals: {site: site, is_current_site: site == current_site} %>

    <% if site != current_site %>
      <div class="report">
        <% if signed_in? %>
          <% if current_site && current_site.is_blocking?(site) %>
            <a href="/site/<%= site.username %>/unblock">Unblock</a>
          <% else %>
            <a href="#block" data-toggle="modal">Block Site</a>
          <% end %>
        <% end %>
      </div>
    <% end %>
  </div>
</div></div>
</div>

<% if current_site %>
  <div class="modal hide" id="block" tabindex="-1" role="dialog" aria-labelledby="blockLabel" aria-hidden="true">
    <form method="POST" action="/site/<%= site.username %>/block">
      <input type="hidden" value="<%= csrf_token %>" name="csrf_token">
      <div class="modal-header">
        <button class="close" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
        <h3 id="blockLabel">Block Site</h3>
      </div>
      <div class="modal-body">
        <p>You are going to block this site. This will do the following:</p>

        <ul>
          <li>You will no longer see this site in searches.</li>
          <li>Site will no longer see your site in searches.</li>
          <li>Site will not be able to comment on your site profile.</li>
          <li>Any comments this site has posted to your profile will not be displayed.</li>
        </ul>

        <p>Are you sure you want to do this?</p>
      </div>
      <div class="modal-footer">
        <button class="btn cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
        <button type="submit" class="btn-Action">Block Site</button>
      </div>
    </form>
  </div>
<% end %>
