{#
 # Homepage template
 # ---------------
 #
 # When this template gets loaded, it will be because someone has accessed
 # http://yoursite.com/ (without any URI). Craft checks to see if you have
 # a Single section set to be the Homepage (as you do, by default), and
 # loads the section’s Template (this file). A special ‘entry’ variable
 # will already be set for you, assigned to the Homepage entry.
 #
 # It's worth noting that even if you didn't have a Homepage Single section,
 # as long as this template remains at craft/templates/index.html, it
 # would still be the one to get loaded when accessing http://yoursite.com/,
 # albeit without an ‘entry’ variable already set for you.
 #
 # See this page for more details on how Craft routes requests:
 # http://craftcms.com/docs/routing
 #}
{% set metaTitle = "Contact Hammer & Nail - Chris Divyak" %}


{% set metaDescription = "Hammer and Nail home repair offers free estimates and service Whatcom County, WA. Fill out our form today to get an estimate or call us at 360-305-3862." %}

{% extends "_layout" %}

{% block content %}

{% set homepage = craft.entries.section('homepage').all() %}
{% for entry in homepage %}
{% if entry.alertTitle|length %}
<div class="modal fade" tabindex="-1" id="homepageAlert">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">{{entry.alertTitle}}</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body">
        {{entry.alertContent}}
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
{% endif %}
{% endfor %}

<!-- Feature Start -->
    <div class="container-fluid  overflow-hidden  px-lg-0">
        <div class="container feature px-lg-0">
            <div class="row g-0 mx-lg-0">
                <div class="col-lg-612 feature-text py-5 wow fadeIn" data-wow-delay="0.5s">
                    <div class="p-lg-5 ps-lg-0">
                      
                        <div class="row">
	                        <div class="col-md-12">
	                          <div class="section-title text-start">
	                          
	                          {% if currentUser %}
	                          
	                           <h2>Welcome, {{ currentUser.friendlyName }}!</h2>
	                            <h1 class="display-5 mb-4">Stats for Hammer & Nail</h1>
	                            
	                            
	                             
	                             {%for page in entry.bidsWon %}
	                             	{%set bw = page.bidsWon|number_format %}
	                             	{%set tb = page.totalBids|number_format %}
	                             	
	                             	<h3 class="text-center bg-grey p-4">{{bw}} bids won out of {{tb}} as of 8/6/2026<br/><br>
	                             	
	                             	Landed <span id="bids"></span>% of bids
	                             	</h3>
	                             	
	                             	
	                             	  <script>
								  var tb = '{{tb}}';
								  var bw = '{{bw}}';
								  console.log(tb);
								  
								  var a = (bw/tb)*100;
								  document.getElementById('bids').textContent = a;
								  console.log(a);
								  </script>
								  {% endfor %}
								  
								  
								  
								  
								  
								
								 {% else %}
	                          <h1 class="display-5 mb-4">You are not authorized to view this page</h1>
{% endif %}
	                            
	                            
	                        </div>
                        </div>
                         
                </div>
                
            </div>
        </div>
    </div>
    <!-- Feature End -->
{% endblock %}