/! Account affiliates Dialog
#account-affiliate-partner.screen.secondary layout='screen' layout-id='account/affiliatePartner'
  .content-head
    .content-icon
      = image_tag "content/icon_account.png", :width => 27, :height => 20
    h1 my account
    = render "screen_navigation"

  /! affiliates scrolling area
  .content-body
    .content-body-scroller.account-content-scroller#account-affiliate-partner-content-scroller
      .content-wrapper.account-affiliates
        .affiliates-header
          .left.affiliates-caption
            h2 affiliate:
          .clearall
        .affiliate-partner-nav
          a#affiliate-partner-agreement-link agreement
          a#affiliate-partner-earnings-link earnings
          a#affiliate-partner-signups-link signups
          a#affiliate-partner-links-link links
          a#affiliate-partner-account-link.active account
        .clearall

        .affiliate-partner-account
          .clearall
        .affiliate-partner-links
          .clearall
        .affiliate-partner-agreement
          .clearall
        .affiliate-partner-signups
          .clearall
        .affiliate-partner-earnings
          .clearall
        #affiliate-partner-tab-content

        .clearall

script type="text/template" id="template-affiliate-partner-account"
  .tab-account
    .right-col
      | We must have a complete mailing address and a valid tax ID in order to process and mail payments due to all affiliates.&nbsp;&nbsp;Per the terms of the affiliate agreement, if this information is not available within 90 days of the end of a calendar quarter, then any payment obligation due to the affiliate for such calendar quarter shall be considered fully and permanently discharged, and no further payment for such calendar quarter shall be due or payable to affiliate.
      br
      br
      span
        | For fastest receipt of payment, please specify a PayPal.Me account (ex:
        b
          | &nbsp; paypal.me/YourName
        | &nbsp; )
      br
      br
      | So please provide this data, and be sure to keep it current!
    
    .left-col
      .affiliate-label Affiliate:
      .w80= "{{ data.partner_name }} ({{data.entity_type}})"
      br
      br

      .affiliate-label Street Address 1: 
      = text_field_tag('affiliate_partner_address1', "{{ data.address.address1 }}", {class: 'w60'})
      br
      .affiliate-label Street Address 2: 
      = text_field_tag('affiliate_partner_address2', "{{ data.address.address2 }}", {class: 'w60'})
      br
      .affiliate-label City: 
      = text_field_tag('affiliate_partner_city', "{{ data.address.city }}", {class: 'w60'})
      br
      .affiliate-label State/Region: 
      = text_field_tag('affiliate_partner_state', "{{ data.address.state }}", {class: 'w60'})
      br
      .affiliate-label Zip/Postal Code: 
      = text_field_tag('affiliate_partner_postal_code', "{{ data.address.postal_code }}", {class: 'w60'})
      br
      .affiliate-label Country: 
      = text_field_tag('affiliate_partner_country', "{{ data.address.country }}", {class: 'w60'})
      br
      br
      .affiliate-label Tax ID: 
      = text_field_tag('affiliate_partner_tax_identifier', "{{ data.tax_identifier }}", {class: 'w60'})
      br
      br
      .affiliate-label PayPal.Me:
      = text_field_tag('affiliate_partner_paypal_id', "{{ data.paypal_id }}", { class: 'w60' })
      br
      br
      .spacer
      .input-buttons
        .right
          a.button-grey href="javascript:history.go(-1)"  CANCEL
          a.button-orange id="affiliate-profile-account-submit" href="#" UPDATE
    .clearall
  .clearall

script type="text/template" id="template-affiliate-partner-agreement"
  .agreement
    label.partner-agreement You are viewing:
    select.easydropdown name='agreement'
      option value="Current agreement in effect" Current agreement in effect
    br
    h2 JamKazam Affiliate Agreement
    .execution-date
      | (you executed this Agreement on {{ window.JK.formatDate(data.signed_at) }})

    = render "legal/partner_agreement_v1"

    .input-buttons
      .right
        a.button-orange href='/client#/account' BACK TO ACCOUNT

script type="text/template" id="template-affiliate-partner-signups"
  table.traffic-table.jamtable
    thead
      tr
        th.day MONTH
        th.signups SIGNUPS
        th.visits VISITS
    tbody

script type="text/template" id="template-affiliate-partner-links"
  .links
    p.prompt
      | This page provides you with a list of ready-to-use links you can share with your followers to let them know about JamKazam. These links include your unique affiliate ID, and users who follow these links to JamKazam and sign up for a JamKazam account will be tagged with your affiliate ID, so that when they purchase a subscription and/or JamTracks, you will be paid a revenue share on their purchase payments per the terms of the affiliate agreement.
    p.prompt
      | Click “select link” next to the link you want to use, then copy the link to the clipboard and paste it wherever you want to share it.

    table.links-table
      thead
        tr
          th.target TARGET PAGE
          th.copy-link
          th.url URL
      tbody

script type="text/template" id="template-affiliate-partner-signups-row"
  tr
    td.month
      | {{data.month}}
    td.signups
      | {{data.signups}}
    td.visits
      | {{data.visits}}

script type="text/template" id="template-affiliate-partner-earnings"
  table.payment-table.jamtable
    thead
      tr
        th.month MONTH
        th.sales JAMTRACKS
        th.subscriptions SUBSCRIPTIONS
        th.earnings AFFILIATE EARNINGS
    tbody

script type="text/template" id="template-affiliate-partner-earnings-row"
  tr data-type="{{data.payment_type}}"
    td.month
      | {{data.time}}
    td.sales
      | {{data.sold}}
    td.subscriptions
      | {{ data.subscriptions }}
    td.earnings
      | {{data.earnings}}


script type="text/template" id="template-affiliate-link-entry"
  tr
    td.target
      | {{data.target}}
    td.copy-link
      a href='#' select link
    td.url
      input type="text" value="{{data.url}}"
