{% load leaflet_tags %}
{% load cookielaw_tags %}
{% load rowerfilters %}
{% load tz_detect %}
{% tz_detect %}
{% load analytical %}
{% block filters %}
{% endblock %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
  <head>
    {% block scripts %} {% endblock %}

    <script type="text/javascript" src="/admin/jsi18n/"></script>
    <script type="text/javascript" src="/static/admin/js/core.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js">        </script>
    <script type="text/javascript" src="/static/admin/js/calendar.js"></script>
<script type="text/javascript" src="/static/admin/js/urlify.js"></script>
<script type="text/javascript" src="/static/admin/js/prepopulate.js"></script>
<script type="text/javascript" src="/static/admin/js/vendor/xregexp/xregexp.min.js"></script>
<script type="text/javascript" src="/static/admin/js/SelectBox.js"></script>
<script type="text/javascript" src="/static/admin/js/SelectFilter2.js"></script>
<script type="text/javascript" src="/static/admin/js/admin/DateTimeShortcuts.js"></script>
<script type="text/javascript" src="/static/admin/js/inlines.js"></script>
    <script src="/static/cookielaw/js/cookielaw.js"></script>
    {% analytical_head_top %}

    <link rel="stylesheet" href="/static/css/bokeh-0.12.3.min.css" type="text/css" />
    <link rel="stylesheet" href="/static/css/bokeh-widgets-0.12.3.min.css" type="text/css" />

    <link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon" />
    <link rel="icon" sizes="32x32" href="/static/img/favicon-32x32.png" type="image/png"/>
    <link rel="icon" sizes="64x64" href="/static/img/favicon-64x64.png" type="image/png"/>
    <link rel="icon" sizes="192x192" href="/static/img/favicon-192x192.png" type="image/png"/>
    <link rel="icon" sizes="16x16" href="/static/img/favicon-16x16.png" type="image/png"/>
    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=0.67">
    <title>{% block title %}Rowsandall Rowing Data Analytics{% endblock %}</title>
    <meta name="description" content="{% block description %}Free Data and Analysis. For Rowers. By Rowers. {% endblock %}"/>
    {% block image_src %}<link rel="image_src" href="static/img/logo7.png" />{% endblock %}
    <meta property="og:type" content="website">
    {% block og_image %}
    <meta property="og:image" content="https://rowsandall.com/static/img/logo_r.png" />
    <meta property="og:image:secure_url" content="https://rowsandall.com/static/img/logo_r.png" />
    {% endblock %}
    <meta property="og:url" content="https://rowsandall.com{{ request.get_full_path }}" />
    <meta property="fb:app_id" content="694685920739849" />
    <meta property="og:title" content="{% block og_title %}Rowsandall{% endblock %}" />
    <meta property="og:description" content="{% block og_description %}Rowsandall: Free Data and Analysis. For Rowers. By Rowers.{% endblock %}" />
    <link rel="stylesheet" type="text/css" href="/static/admin/css/forms.css"/>
<link rel="stylesheet" type="text/css" href="/static/admin/css/widgets.css"/>
    <link rel="stylesheet" href="/static/css/reset.css" />
    <link rel="stylesheet" href="/static/css/text.css" />
    <link rel="stylesheet" href="/static/css/960_12_col.css" />
    <link rel="stylesheet" href="/static/css/rowsandall.css" />

    {% block meta %} {% endblock %}
    {% leaflet_js %}
    {% leaflet_css %}
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.async=true;
      js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.10&appId=694685920739849";
      fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));</script>
    <link rel="stylesheet" href="https://webapiv2.navionics.com/dist/webapi/webapi.min.css" >
    <script type="text/javascript" src="https://webapiv2.navionics.com/dist/webapi/webapi.min.no-dep.js"></script>
    <script>window.twttr = (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0],
    t = window.twttr || {};
      if (d.getElementById(id)) return t;
      js = d.createElement(s);
      js.id = id;
      js.async=true; 
      js.src = "https://platform.twitter.com/widgets.js";
      fjs.parentNode.insertBefore(js, fjs);

  t._e = [];
  t.ready = function(f) {
    t._e.push(f);
  };

  return t;
}(document, "script", "twitter-wjs"));</script>
    {% analytical_head_bottom %}
  </head>
  <body data-root="https://webapiv2.navionics.com/dist/webapi/images">
    {% analytical_body_top %}
    {% block body_top %}{% endblock %}
    <div class="container_12">
      <div class="grid_12">
        &nbsp;
      </div>
      <div class="grid_12">
        <div id="logo" class="grid_6 alpha">
	  {% if user|is_promember %}
	  <p><a href="/"><img src="/static/img/logo7.png" 
		              alt="Rowsandall logo" height="80"></a></p>
	  {% else %}
	  <p><a href="/"><img src="/static/img/logo7.png" 
		              alt="Rowsandall logo" height="80"></a></p>
	  {% endif %}
        </div>
        <div class="grid_6 omega">
          <div class="grid_4 alpha">
            <div class="grid_1 alpha">
	      <p id="header">
	        <a class="button gray small" href="/rowers/videos">Videos</a></p>
	    </div>
	    <div class="grid_2">
              <p id="header">
                <a class="button gray small" href="http://analytics.rowsandall.com/">Rowing Analytics BLOG</a></p>
            </div>
            <div class="grid_1 omega">
	      <p id="header">
	      <a class="button gray small" href="/rowers/email">Contact</a>
              </p>
	    </div>
            <div class="grid_4 alpha">
	      <p>Free Data and Analysis. For Rowers. By Rowers.</p>
	    </div>
          </div>

          <div class="grid_1">
	    <div class="grid_1 tooltip">
	      {% if user.is_authenticated %}
	      <p>
                {% if user.first_name %}
	        <a class="button gray small" href="/rowers/me/edit">{{ user.first_name }}</a>
                {% else %}
                <a class="button gray small" href="/rowers/me/edit">{{ user }}</a>
                {% endif %}
	      </p>
	      <span class="tooltiptext">Edit user account, e.g. heart rate zones, power zones, email, teams</span>
              
	      {% else %}
	      <p><a class="button gray small" href="{% url 'login' %}">login</a> </p>
	      {% endif %}
	    </div>
            <div class="grid_1">
	      {% if user.is_authenticated %}
	      <p><a class="button gray small" href="{% url 'logout' %}">logout</a></p>
	      {% else %}
	      <p>&nbsp</p>
	      {% endif %}
            </div>
          </div>
          <div class="grid_1 omega">
	    {% if user.rower.rowerplan == 'pro' %}
	    <h6 class="graytext">Pro Member</h6>
            {% elif user.rower.rowerplan == 'coach' %}
	    <h6 class="graytext">Coach</h6>
            {% elif user.rower.rowerplan == 'plan' %}
	    <h6 class="graytext">Self-Coach</h6>
	    {% else %}
	    <div class="grid_1"><p><a class="button green small" href="/rowers/promembership"><b>Upgrade</b></a></p></div>
	    {% endif %}
            {% if user.rower.rowerplan == 'basic' and user.rower.protrialexpires|date_dif == 1 %}
            <div class="grid_1"><p><a class="button green small" href="/rowers/promembership">Start Free Pro trial</a></p></div>
            {% elif user.rower.rowerplan == 'basic' and user.rower.plantrialexpires|date_dif == 1 %}
            <div class="grid_1"><p><a class="button green small" href="/rowers/promembership">Start Free Plan trial</a></p></div>
            {% endif %}
          </div>
        </div>
      </div>
      
      
      <div class="grid_12">
	<div class="grid_1 alpha tooltip">
	  {% if user.is_authenticated %}
	  <p><a class="button gray small" href="/rowers/workout/upload/">Upload</a></p>
	  <span class="tooltiptext">Upload CSV, TCX, FIT data files to rowsandall.com</span>
	  {% else %}
	  <p><a class="button green small" href="/rowers/register">Register (free)</a></p>
	  {% endif %}
	</div>
	<div class="grid_1 tooltip">
	  {% if user.is_authenticated %}
	  <p>
	    <a class="button gray small" href="/rowers/imports/">Import</a>
	  </p>
	  <span class="tooltiptext">Import workouts from Strava, SportTracks, and C2 logbook</span>
	  {% else %}
	  <p>&nbsp;</p>
	  {% endif %}
	</div>
	<div class="grid_2 tooltip">
	  {% if user.is_authenticated %}
	  <p>
	    <a class="button gray small" href="/rowers/list-workouts/">Workouts</a>
	  </p>
	  <span class="tooltiptext">See your list of workouts</span>
	  {% else %}
	  <p>&nbsp;</p>
	  {% endif %}
	</div>
	<div class="grid_1 tooltip">
	  {% if user.is_authenticated %}
	  <p>
	    <a class="button gray small" href="/rowers/list-graphs/">Graphs</a>
	  </p>
	  <span class="tooltiptext">See your most recent charts</span>
	  {% else %}
	  <p>&nbsp;</p>
	  {% endif %}
	</div>
        <div class="grid_1 tooltip">
          {% if user.is_authenticated %}
          <p><a class="button gray small" href="/rowers/sessions/">Plans</a></p>
          {% else %}
          <p>&nbsp;</p>
          {% endif %}
        </div>
	<div class="grid_2 tooltip">
	  {% if user.is_authenticated %}
	  <p>
	    <a class="button gray small" href="/rowers/analysis">Analysis</a>
	  </p>
	  <span class="tooltiptext">Analysis of workouts over a period of time</span>
	  {% else %}
	  <p>&nbsp;</p>
	  {% endif %}
	</div>
        <div class="grid_1 tooltip">
          {% block challenges %}
          {% endblock %}
        </div>
        <div class="grid_1 tooltip">
          {% block teams %}
          {% endblock %}
        </div>
      </div>

	
      <div class="clear"></div>
      <div id="messaging" class="grid_12">
        {% if WARNING_MESSAGE != '' %}
        <p class="message">
          {{ WARNING_MESSAGE }}
        </p>
        {% endif %}
        {% if user.rower.protrialexpires and user.rower.protrialexpires|is_future_date %}
        {% if user.rower.plantrialexpires %}
        <p class="successmessage">
          {{ user.rower.protrialexpires|date_dif|ddays }} days left of your Self-Coach trial           - Would you like to <a href="/rowers/planmembership">upgrade now?</a>

          {% else %}
        <p class="successmessage">
          {{ user.rower.protrialexpires|date_dif|ddays }} days left of your Pro trial           - Would you like to <a href="/rowers/promembership">upgrade now?</a>
          {% endif %}
        </p>
        {% endif %}
        {% if user.rower.emailbounced %}
        <p class="message">
          Your email bounced. Please update your email address in the <a href="/rowers/me/edit/">user settings</a>
        </p>
        {% endif %}
        {% if messages %}
        {% for message in messages %}
        {% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
        <p class="message">
          {% else %}
        <p class="successmessage">
          {% endif %}
          {{ message|safe }}
        </p>
          {% endfor %}
	{% endif %}
        {% block message %}
	{% if message %}
	<p class="message">
	  <span>{{ message }}</span>
	</p>
	{% endif %}
	{% if successmessage %}
	<p class="successmessage">
	  <span>{{ successmessage }}</span>
	</p>
	{% endif %}
        <div id="extra_message">
        </div>
	{% endblock %}
      </div>
      <div class="grid_12">
	{% load tz %}
        
    	{% block content %}{% endblock %}
      </div>
      <div class="clear"></div>
      
      <div class="grid_12 omega" >	
    	{% block footer %}
    	<p id="footer">{{ versionstring }}</p>
	<div class="grid_2 alpha">
    	  <p id="footer"><a href="/rowers/email/">&copy; Rowsandall s.r.o.</a></p>
	</div>
	<div class="grid_1">
	  <p id="footer">
	    <a href="/rowers/about">About</a></p>
	</div>
	<div class="grid_1">
	  <p id="footer">
	    <a href="/rowers/brochure">Brochure</a></p>
	</div>
        <div class="grid_1">
          <p id="footer">
            <a href="/rowers/developers">Develop</a></p>
        </div>
	<div class="grid_1">
	  <p id="footer">
	    <a href="/rowers/legal">Legal</a></p>
	</div>
	<div class="grid_1">
	  <p id="footer">
	    <a href="/rowers/partners">Partners</a></p>
	</div>
	<div class="grid_1">
	  <p id="footer">
	    <a href="/rowers/physics">Physics</a></p>
	</div>
	<div class="grid_2">
          <p id="footer">
            <a href="http://analytics.rowsandall.com/">Rowing Analytics BLOG</a></p>
        </div>
	<div class="grid_2 omega">
	  <p id="footer">
	    <a href="http://www.facebook.com/groups/rowsandall/">Facebook group</a></p>
	</div>
    	{% endblock %}
      </div>
      {% cookielaw_banner %}
    </div>
    <!-- end container -->
    {% analytical_body_bottom %}
    {% block body_bottom %}{% endblock %}
  </body>
</html>
