<div class="row">
  <div class="page-wrapper chiller-theme toggled">
    <nav id="sidebar" class="sidebar-wrapper">
      <menu-admin name={{name}} dock={{dock}}></menu-admin>
      <link-exit></link-exit>
    </nav>

    <main class="page-content">
      <div class="container justify-content-md-center">

        <div class="row">
          <div class="col-md-7">
            <h2>Criar Promoção</h2>
          </div>
        </div>
        <p ng-show="mensagem.length" class="alert alert-info">{{mensagem}}</p>

        <form name="formPromo" ng-submit="submeter()" novalidate>
          <div class="row form-login">
            <div class="col-md-6">
              <input type="text" class="form-control" placeholder="Nome da promoção" ng-model="promo.name"  required>
            </div>
          </div>

          <div class="row form-login">
            <div class="col-md-3">
              <label><h6>Inicio</h6></label>
              <input type="date" class="form-control" ng-model="promo.beginday" required>
            </div>

            <div class="col-md-3">
              <label><h6>Fim</h6></label>
              <input type="date" class="form-control" ng-model="promo.endday" required>
            </div>

            <div class="col-md-3">
                <label><h6>Cupom</h6></label>
              <input type="text" class="form-control" placeholder="Nome do Cupom" ng-model="promo.coupon" required>
            </div>
          </div>

          <div class="row form-login">
            <div class="col-md-2">
              <h6>Qual o tipo e valor do desconto?</h6>
            </div>

            <div class="col-md-4">
              <select class="form-control promotion" ng-model="promo.type" required>
                <option value="freteGratis">Frete Grátis</option>
                <option value="percentualFrete">Percentual Frete</option>
                <option value="nominalFrete">Valor de Frete</option>
                <option value="percentualCompra">Percentual Valor Total da Compra</option>
                <option value="nominalCompra">Valor Total da Compra</option>
              </select>
              <span class="text-danger">
                *será aplicado para todos os itens de sua loja, exceto os itens da categoria Outlet
              </span>
            </div>

            <div id="percentage" class="col-md-3 invisible">
              <div class="input-group">
                <div class="input-group-prepend">
                  <div class="input-group-text">%</div>
                </div>
                <input type="text" class="form-control" placeholder="00,00" ng-model="promo.percent" money-dir>
              </div>
            </div>

            <div id="money" class="col-md-3 invisible">
              <div class="input-group">
                <div class="input-group-prepend">
                  <div class="input-group-text">R$</div>
                </div>
                <input type="text" class="form-control" placeholder="00,00" ng-model="promo.money" money-dir>
              </div>
            </div>

          </div>

          <div class="row form-login">
            <div class="col-md-2">
              <h6>Descrição da promoção</h6>
            </div>
            <div class="col-md-7">
              <textarea class="form-control" placeholder="Descrição..." ng-model="promo.text" required></textarea>
            </div>
          </div>

          <button type="submit" class="btn btn-success mt-5" ng-disabled="formPromo.$invalid">Salvar Promoção</button>
          <a href="#/promotions" role="button" class="btn btn-primary mt-5">Voltar</a>
        </form>

      </div>
    </main>

  </div>

</div>
