<ion-view>
  <ion-nav-bar class="bar-royal">
    <ion-nav-back-button>
    </ion-nav-back-button>
    <ion-nav-title>Preferences</ion-nav-title>
  </ion-nav-bar>

  <ion-content>

    <ul class="list">
      <div ng-if="account.token">
      <div class="item item-divider">
        Permissions
      </div>
      <li class="item">
      <span>Email</span>
      <span class="item-note">
        {{account.permissions.view_email_address}}
      </span>
      </li>
      <li class="item">
      <span>Personal Information</span>
      <span class="item-note">
        {{account.permissions.personal_info}}
      </span>
      </li>
      <li class="item">
      <span>Buy/Sell</span>
      <span class="item-note">
        {{account.permissions.transact}}
      </span>
      </li>
      <li class="item">
      <span>Transaction History</span>
      <span class="item-note">
        {{account.permissions.transaction_history}}
      </span>
      </li>
      </div>

      <div ng-if="account.permissions.view_email_address">
      <div class="item item-divider">
        Email
      </div>
      <li class="item">
      <span>Email</span>
      <span class="item-note">
        {{account.email.email}}
      </span>
      </li>
      <li class="item">
      <span>Active</span>
      <span class="item-note">
        {{account.email.userEmailIsSetup}}
      </span>
      </li>
      </div>

      <div ng-if="account.permissions.personal_info">
      <div class="item item-divider">
        Personal Information
      </div>

      <li class="item">
      <span>First Name</span>
      <span class="item-note">
        {{account.personalInfo.firstName}}
      </span>
      </li>
      <li class="item">
      <span>Middle Name</span>
      <span class="item-note">
        {{account.personalInfo.middleName}}
      </span>
      </li>
      <li class="item">
      <span>Last Name</span>
      <span class="item-note">
        {{account.personalInfo.lastName}}
      </span>
      </li>
      <li class="item">
      <span>Birth Date</span>
      <span class="item-note">
        {{account.personalInfo.birthDate}}
      </span>
      </li>
      <li class="item">
      <span>Address 1</span>
      <span class="item-note">
        {{account.personalInfo.address1}}
      </span>
      </li>
      <li class="item">
      <span>Address 2</span>
      <span class="item-note">
        {{account.personalInfo.address2}}
      </span>
      </li>
      <li class="item">
      <span>City</span>
      <span class="item-note">
        {{account.personalInfo.city}}
      </span>
      </li>
      <li class="item">
      <span>State</span>
      <span class="item-note">
        {{account.personalInfo.state}}
      </span>
      </li>
      <li class="item">
      <span>ZIP Code</span>
      <span class="item-note">
        {{account.personalInfo.zipCode}}
      </span>
      </li>
      <li class="item">
      <span>Country</span>
      <span class="item-note">
        {{account.personalInfo.countryCode}}
      </span>
      </li>
      <li class="item">
      <span>Occupation</span>
      <span class="item-note">
        {{account.personalInfo.occupation}}
      </span>
      </li>
      <li class="item">
      <span>Basic Information State</span>
      <span class="item-note">
        {{account.personalInfo.basicInfoState}}
      </span>
      </li>
      </div>

      <div ng-if="token">
      <div class="item item-divider">
      Status
      </div>

      <li class="item">
      <span>Buy/Sell</span>
      <span class="item-note">
        {{account.status.userCanTransact}}
      </span>
      </li>

      <li class="item">
      <span>Buy</span>
      <span class="item-note">
        {{account.status.userCanBuy}}
      </span>
      </li>
      <li class="item">
      <span>Sell</span>
      <span class="item-note">
        {{account.status.userCanSell}}
      </span>
      </li>
      <li class="item">
      <span>Email Is Setup</span>
      <span class="item-note">
        {{account.status.userEmailIsSetup}}
      </span>
      </li>
      <li class="item">
      <span>Phone Is Setup</span>
      <span class="item-note">
        {{account.status.userPhoneIsSetup}}
      </span>
      </li>
      <li class="item">
      <span>Bank Account Is Setup</span>
      <span class="item-note">
        {{account.status.userBankAccountIsSetup}}
      </span>
      </li>
      <li class="item">
      <span>Personal Information State</span>
      <span class="item-note">
        {{account.status.personalInfoState}}
      </span>
      </li>
      <li class="item">
      <span>Bank Account State</span>
      <span class="item-note">
        {{account.status.bankAccountState}}
      </span>
      </li>
      <li class="item">
      <span>Country</span>
      <span class="item-note">
        {{account.status.country}}
      </span>
      </li>
      </div>

      <div ng-if="token">
      <div class="item item-divider">
        Limits
      </div>

      <li class="item">
      <span>Daily Buy</span>
      <span class="item-note">
        {{account.limits.dailyBuy|currency:'':2}} {{limits.currency}}
      </span>
      </li>
      <li class="item">
      <span>Daily Sell</span>
      <span class="item-note">
        {{account.limits.dailySell|currency:'':2}} {{limits.currency}}
      </span>
      </li>
      <li class="item">
      <span>Monthly Buy</span>
      <span class="item-note">
        {{account.limits.monthlyBuy|currency:'':2}} {{limits.currency}}
      </span>
      </li>
      <li class="item">
      <span>Monthly Sell</span>
      <span class="item-note">
        {{account.limits.monthlySell|currency:'':2}} {{limits.currency}}
      </span>
      </li>
      <li class="item">
      <span>Daily Buy Remaining</span>
      <span class="item-note">
        {{account.limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}}
      </span>
      </li>
      <li class="item">
      <span>Daily Sell Remaining</span>
      <span class="item-note">
        {{account.limits.dailySellRemaining|currency:'':2}} {{limits.currency}}
      </span>
      </li>
      <li class="item">
      <span>Monthly Buy Remaining</span>
      <span class="item-note">
        {{account.limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}}
      </span>
      </li>
      <li class="item">
      <span>Monthly Sell Remaining</span>
      <span class="item-note">
        {{account.limits.monthlySellRemaining|currency:'':2}} {{limits.currency}}
      </span>
      </li>
      <li class="item">
      <span>Buy/Sell Disabled (pending first transaction)</span>
      <span class="item-note">
        {{account.limits.transactDisabledPendingFirstTransaction}}
      </span>
      </li>
      </div>

      <div class="item item-divider">
        Account
      </div>

      <li class="item" ng-click="revokeToken()">
        <span class="assertive">Log out</span>
      </li>

      <div class="item item-divider"></div>
    </ul>
  </ion-content>
</ion-view>
