<!DOCTYPE html>
<html lang="en">
<head>
  <title><%cat_full_name%>: Edit a Personal Race</title>
  <%include include_common_head.html%>
</head>
<body class="page-<%page_id%>">
  <div class="container-b">
    <%include include_header.html%>

    <div class="main">
      <div class="contentwrapper clearfix">
        <div class="sidebar">
            <%include include_sidebar.html%>
        </div>

        <%~set content_header_title = 'Edit A Personal Race'%>
        <%~init array breadcrumbs%><%init hash breadcrumbs.0%><%init hash breadcrumbs.1%>
        <%~set breadcrumbs.0.name = 'User Profile'%>
        <%~set breadcrumbs.0.url  = GForum::SEO::url(type => "profile", id => $current_user_username)%>
        <%~set breadcrumbs.1.name = $content_header_title%>

        <%include include_breadcrumb.html%>

        <div class="content"><%-- start content--%>
          <%include include_content_header.html%>

          <form action="<%GForum::SEO::url()%>" method="post">
            <input type="hidden" name="do" value="personal_race_edit" />
            <input type="hidden" name="pr_id" value="<%pr_id%>" />
            <input type="hidden" name="username" value="<%current_user_username%>" />
            <%hidden_form%>

            <div class="dtable form">
              <div class="drow">
                <div class="dcell name">Name</div>
                <div class="dcell divider"></div>
                <div class="dcell value">
                  <input type="text" name="pr_name" value="<%if pr_name%><%pr_name%><%endif%>" class="txt midtext" />
                </div>
              </div>
              <div class="drow">
                <div class="dcell name">URL</div>
                <div class="dcell divider"></div>
                <div class="dcell value">
                  <input type="text" name="pr_url" value="<%if pr_url%><%pr_url%><%endif%>" class="txt midtext" placeholder="http://" />
                </div>
              </div>
              <div class="drow">
                <div class="dcell name">City</div>
                <div class="dcell divider"></div>
                <div class="dcell value">
                  <input type="text" name="pr_city" value="<%if pr_city%><%pr_city%><%endif%>" class="txt shotext" />
                </div>
              </div>
              <div class="drow">
                <div class="dcell name">State</div>
                <div class="dcell divider"></div>
                <div class="dcell value">
                  <input type="text" name="pr_state" value="<%if pr_state%><%pr_state%><%endif%>" class="txt shotext" />
                </div>
              </div>
              <div class="drow">
                <div class="dcell name">Country</div>
                <div class="dcell divider"></div>
                <div class="dcell value">
                    <input type="text" name="pr_country" value="<%if pr_country%><%pr_country%><%endif%>" class="txt shotext" />
                </div>
              </div>
              <div class="drow">
                <div class="dcell name">Date</div>
                <div class="dcell divider"></div>
                <div class="dcell value">
                  <div id="inlinePicker"></div>
                  <input type="hidden" name="pr_date" id="pr_date" />
                </div>
              </div>
              <div class="drow">
                <div class="dcell name"></div>
                <div class="dcell divider"></div>
                <div class="dcell value">
                  <input type="checkbox" id="delete" name="delete" /><label for="delete">Delete this race</label>
                </div>
              </div>
              <div class="drow actions">
                <div class="dcell name"></div>
                <div class="dcell divider"></div>
                <div class="dcell value">
                    <input type="submit" name="add" value="Submit Race" class="btn default">
                </div>
              </div>
            </div>

          </form>

        </div><%-- end content --%>

      </div>

      <%include include_footer.html%>
    </div>
  </body>
  <%~include include_global_js.html%>
  <script type="text/javascript">
      $(document).ready(function() {
          $('#inlinePicker').datepicker({
              dateFormat: 'yy-mm-dd',
              onSelect: selectDate,
              defaultDate: new Date(<%year%>, <%month%>, <%day%>)
          });
      });

      function selectDate(date) {
          $('#pr_date').val(date);
      }
  </script>
</html>
