<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{{ r.name }}</title>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic' rel='stylesheet' type='text/css'>
    <style>
    {{ cssInfo.data }}
    </style>
  </head>
  <body>
    <main>
      <header>
        <h1>{{ r.name }}</h1>
        <div id="contact">
          {% if (r.contact.email) { %}<div class="email">{{ r.contact.email }}</div>{% } %}
          {% if (r.contact.phone) { %}<div class="phone">{{ r.contact.phone }}</div>{% } %}
          {% if (r.contact.website) { %}<div class="website"><a href="{{ r.contact.website }}">{{ r.contact.website }}</a></div>{% } %}
        </div>
      </header>


{% if ( r.info.brief && r.info.brief.length ) { %}
      <section id="summary">
        {{ r.info.brief|md }}
      </section>
{% } %}


{% if ( r.skills && r.skills.length ) { %}
      <section id="skills">
        <header>
        <h2>Skills</h2><hr>
        </header>
        <table>
          <thead>
            <tr>
              <th>Skill</th>
              <th>Keywords</th>
            </tr>
          </thead>
          <tbody>
            {% r.skills.forEach( function( skill, idx, ar) { %}
            <tr>
              <td style="width: 25%;">{{ skill.name }}</td>
              <td class="keywords">{{ skill.level }}</td>
            </tr>
            {% }); %}
          </tbody>
        </table>
      </section>
{% } %}



{% if ( r.employment && r.employment.history ) { %}
      <section id="employment">
        <header>
        <h2>Employment</h2><hr>
        </header>



        {% r.employment.history.forEach( function( proj, idx, ar) { %}
          {% if( idx < 4 ) { %}
            <h3><em>{{ proj.position }}</em>, {{ proj.employer }} <span class="tenure">{{ proj.safe.start.format('YYYY-MM') }} &mdash; {{ proj.safe.end.format('YYYY-MM') }}<span></h3>
            <p style="clear: both;">{{ proj.summary|md }}</p>
            {% if( proj.highlights ) { %}
              <ul>
              {% proj.highlights.forEach( function( high, idx, ar) { %}
                <li>{{ high|mdin }}</li>
              {% }); %}
              </ul>
            {% } %}
          {% } else { %}

            {% if( idx === 4 ) { %}
            <h3>Previously... <span class="tenure">{{ r.employment.history[ r.employment.history.length - 1 ].safe.start.format('YYYY') }} &mdash; {{ proj.safe.end.format('YYYY') }}<span></h3>
            <p style="clear: both;">Prior to {{ r.employment.history[ 3 ].employer }}, I worked on a range of projects for companies large and small.</p>
            <ul>
            {% } %}


            <li>{{ proj.position }}, {{ proj.employer }}</li>


            {% if( idx === ar.length - 1 ) { %}
            </ul>
            {% } %}

          {% } %}
        {% }); %}



      </section>
{% } %}



{% if ( r.education && r.education.history ) { %}
      <section id="education">
        <header>
        <h2>Education</h2><hr>
        </header>
        {% r.education.history.forEach( function( edu, idx, ar) { %}
          <h3>{{ edu.institution }} <span class="tenure">{{ edu.safe.start.format('YYYY') }} &mdash; {{ edu.safe.end.format('YYYY') }}<span></h3>
          {% if(edu.summary) { %}<p style="clear: both;">{{ edu.summary|md }}</p>{% } %}
        {% }); %}

      </section>
{% } %}

{% if ( r.service && r.service.history && r.service.history.length ) { %}
      <section id="volunteer">
        <header>
        <h2>Volunteer</h2><hr>
        </header>
        {% r.service.history.forEach( function( vol, idx, ar ) { %}
          <h3>{{ vol.organization }} <span class="tenure">{{ vol.safe.start.format('YYYY') }} &mdash; {{ vol.safe.end.format('YYYY') }}<span></h3>
          <p style="clear: both;">{{ vol.summary|md }}</p>
          {% if( vol.highlights ) { %}
            <ul>
            {% vol.highlights.forEach( function( high, idx, ar) { %}
              <li>{{ high|md }}</li>
            {% }); %}
            </ul>
          {% } %}
        {% }); %}

      </section>
{% } %}

{% if( r.publications && r.publications.length ) { %}
      <section id="publications">
        <header>
        <h2>Publications</h2><hr>
        </header>
        <span class="fa fa-lg fa-trophy"></span>
        {% r.publications.forEach( function( pub, idx, ar) { %}
          <h4>
            {% if( pub.link ) { %}
              <span class="res-label"><a href="{{ pub.link[0].url }}" ></span>{{ pub.title }}</a>,&nbsp;{{ pub.publisher }}
            {% } else { %}
              <span class="res-label">{{ pub.title }}</span>,&nbsp;{{ pub.publisher }}
            {% } %}
            <span class="tenure">{{ pub.safe.date.format('YYYY') }}</span>
          </h4>

        {% if (pub.summary) { %}{{ pub.summary|md }}{% } %}

        {% }); %}
      </section>
{% } %}

{% if( r.awards && r.awards.length ) { %}
      <section id="awards">
        <header>
        <h2>Awards</h2><hr>
        </header>
        <span class="fa fa-lg fa-trophy"></span>
        {% r.awards.forEach( function( award, idx, ar) { %}
          <h4><span class="res-label">{{ award.title }}</span>, {{ award.awarder }} <span class="tenure">{{ award.safeDate.format('YYYY') }}</span></h4>
          {{ award.summary|md }}
        {% }); %}
      </section>
{% } %}

    </main>
  </body>
</html>