
<ion-view>
  <ion-nav-bar class="bar-royal">
    <ion-nav-back-button>
    </ion-nav-back-button>
    <ion-nav-title>{{wallet.name}}</ion-nav-title>
  </ion-nav-bar>

  <ion-content>
    <div ng-show="!wallet.notAuthorized">
      <div class="list card text-center">
        <a class="item item-heading" ng-style="{'border-width': 0}" translate>
          Share this invitation with your copayers
        </a>
        <div ng-click="copySecret()" ng-class="{'enable_text_select': !isCordova}">
          <div class="text-center" copy-to-clipboard="secret">
            <qrcode size="220" error-correction-level="L" data="{{secret}}"></qrcode>
            <div ng-show="!secret" style="position:relative; top:-226px; height:0px">
              <div style="height:220px; width:220px; margin:auto; background: white">
                <ion-spinner class="spinner-dark" icon="lines"></ion-spinner>
              </div>
            </div>
            <div class="secret" ng-show="!isCordova">
              {{secret || ('Loading...'|translate)}}
            </div>
          </div>
        </div>
      </div>

      <div ng-show="secret">
        <div class="text-center m10t" ng-if="isCordova">
          <span class="button outline round dark-gray tiny m0"
            ng-click="shareSecret()">
            <i class="fi-share"></i>
            <span translate>Share invitation</span>
          </span>
        </div>

        <div class="m30v line-t">
          <h4 class="size-14 p10h m10t">
            <span translate>Waiting for copayers</span>
            <span class="text-gray right">
              [ <span translate>{{wallet.m}}-of-{{wallet.n}}</span> ]
            </span>
          </h4>
          <div ng-include="'views/includes/copayers.html'"></div>
          <div ng-if="!wallet.isComplete()" class="line-b p10 white size-12">
            <i class="icon ion-loop"></i>
            <span translate>Waiting...</span>
          </div>
        </div>

        <div class="m20b text-center" ng-show="wallet.notAuthorized">
          <h1 translate>Wallet incomplete and broken</h1>
          <h4 translate>Delete it and create a new one</h4>
        </div>

        <div class="text-center">
          <button class="button button-block button-assertive" ng-click="showDeletePopup()">
            <i class="fi-trash"></i> <span translate>Cancel and delete the wallet</span>
          </button>
        </div>
      </div>
    </div>
  </ion-content>
</ion-view>
