<div id="service-container-image" authorization="DockerServiceUpdate">
  <rd-widget>
    <rd-widget-header icon="list" title-text="Change container image"> </rd-widget-header>
    <rd-widget-body ng-if="!isUpdating">
      <form class="form-horizontal">
        <por-image-registry
          model="formValues.RegistryModel"
          auto-complete="true"
          label-class="col-sm-1"
          input-class="col-sm-11"
          endpoint="endpoint"
          is-admin="isAdmin"
          check-rate-limits="true"
          set-validity="setPullImageValidity"
        >
        </por-image-registry>
      </form>
    </rd-widget-body>
    <rd-widget-body ng-if="isUpdating">
      <p>Image modification is disabled while service is updating.</p>
    </rd-widget-body>
    <rd-widget-footer authorization="DockerServiceUpdate">
      <div class="btn-toolbar" role="toolbar">
        <div class="btn-group" role="group">
          <button type="button" class="btn btn-primary btn-sm" ng-disabled="!hasChanges(service, ['Image'])" ng-click="updateService(service)">Apply changes</button>
          <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <pr-icon icon="'chevron-down'"></pr-icon>
          </button>
          <ul class="dropdown-menu">
            <li><a ng-click="cancelChanges(service, ['Image'])">Reset changes</a></li>
            <li><a ng-click="cancelChanges(service)">Reset all changes</a></li>
          </ul>
        </div>
      </div>
    </rd-widget-footer>
  </rd-widget>
</div>
