<div class="modal fade" tabindex="-1" role="dialog" id="newuser-dialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title"><?php echo _('Available roles'); echo '&nbsp; <span style="color:#7f8c8d">'.($this->view->getMaxAddRoles - $this->view->getTotRoles).'</span>'; ?></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
          <ul class="list-group">
            <li class="list-group-item d-flex justify-content-between align-items-center">
              Amministratori
              <span class="badge <?php echo ( ($this->view->getMaxAddAdmins-$this->view->getTotAdmins) > 0 ) ? 'badge-primary' : 'badge-danger'; ?> badge-pill"><?php echo $this->view->getMaxAddAdmins-$this->view->getTotAdmins; ?></span>
            </li>
            <li class="list-group-item d-flex justify-content-between align-items-center">
              Moderatori
              <span class="badge <?php echo ( ($this->view->getMaxAddModerators-$this->view->getTotModerators) > 0 ) ? 'badge-primary' : 'badge-danger'; ?> badge-pill"><?php echo $this->view->getMaxAddModerators-$this->view->getTotModerators; ?></span>
            </li>
            <li class="list-group-item d-flex justify-content-between align-items-center">
              Richiedenti
              <span class="badge <?php echo ( ($this->view->getMaxAddRequesters-$this->view->getTotRequesters) > 0 ) ? 'badge-primary' : 'badge-danger'; ?> badge-pill"><?php echo $this->view->getMaxAddRequesters-$this->view->getTotRequesters; ?></span>
            </li>
            <li class="list-group-item d-flex justify-content-between align-items-center">
              Refertanti
              <span class="badge <?php echo ( ($this->view->getMaxAddResponders-$this->view->getTotResponders) > 0 ) ? 'badge-primary' : 'badge-danger'; ?> badge-pill"><?php echo $this->view->getMaxAddResponders-$this->view->getTotResponders; ?></span>
            </li>
            <li class="list-group-item d-flex justify-content-between align-items-center">
              Ospiti
              <span class="badge <?php echo ( ($this->view->getMaxAddGuests-$this->view->getTotGuests) > 0 ) ? 'badge-primary' : 'badge-danger'; ?>  badge-pill"><?php echo $this->view->getMaxAddGuests-$this->view->getTotGuests; ?></span>
            </li>
          </ul>
	  </div>
      <div class="modal-footer">
      	<button type="button" class="btn btn-light" data-dismiss="modal"><?php echo _('Close'); ?></button>
        <?php if($this->view->getTotRoles >= $this->view->getMaxAddRoles){
          ?>
          <a class="btn btn-success disabled" href="#"><?php echo _('Create new user'); ?></a>
          <?php
        }else{
          ?>
          <a class="btn btn-success" data-dismiss="modal" href="<?php echo $this->helper->setHash(vsprintf($this->view->editLinkHash, [0])); ?>"><?php echo _('Create new user'); ?></a>
          <?php
        }
        ?>

      </div>
    </div>
  </div>
</div>
