<?php foreach($gateGroups as $gateGroup) { ?>
  <?php $provider = new ServiceProvider($gateGroup->incompleteServices); ?>
  <?php $viewParams = array('gateGroup' => $gateGroup); ?>
  <?php if ($provider->isEmpty) { ?>
    <?php $this->renderPartial('service/_create', $viewParams); ?>
  <?php } else { ?>
    <?php if ($service = ($provider->service)) { ?>
      <?php $this->renderPartial('service/_'.strtolower($service->status), array_merge($viewParams, array('service' => $service))); ?>
    <?php } else { ?>
      <?php $this->renderPartial('service/_error', array_merge($viewParams, array('errors' => $provider->errors))); ?>
    <?php } ?>
  <?php } ?>
<?php } ?>
