<form name="$ctrl.redeployGitForm">
  <div class="col-sm-12 form-section-title">
    Redeploy from git repository
  </div>
  <div class="form-group text-muted">
    <div class="col-sm-12">
      <p>
        Pull the latest manifest from git and redeploy the application.
      </p>
    </div>
  </div>

  <div class="form-group">
    <div class="col-sm-12">
      <p>
        <a class="small interactive" ng-click="$ctrl.state.showConfig = !$ctrl.state.showConfig">
          <i ng-class="['fa space-right', { 'fa-minus': $ctrl.state.showConfig, 'fa-plus': !$ctrl.state.showConfig }]" aria-hidden="true"></i>
          {{ $ctrl.state.showConfig ? 'Hide' : 'Advanced' }} configuration
        </a>
      </p>
    </div>
  </div>
  <git-form-ref-field ng-if="$ctrl.state.showConfig" value="$ctrl.formValues.RefName" on-change="($ctrl.onChangeRef)"></git-form-ref-field>
  <git-form-auth-fieldset
    ng-if="$ctrl.state.showConfig"
    model="$ctrl.formValues"
    is-edit="$ctrl.state.isEdit"
    on-change="($ctrl.onChange)"
    show-auth-explanation="true"
  ></git-form-auth-fieldset>

  <div class="col-sm-12 form-section-title">
    Actions
  </div>
  <!-- #Git buttons -->
  <button
    class="btn btn-sm btn-primary"
    ng-click="$ctrl.pullAndRedeployApplication()"
    ng-disabled="$ctrl.isSubmitButtonDisabled() || !$ctrl.redeployGitForm.$valid"
    style="margin-top: 7px; margin-left: 0;"
    button-spinner="ctrl.state.redeployInProgress"
    analytics-category="kubernetes"
    analytics-event="kubernetes-application-edit-git-pull"
  >
    <span ng-show="!$ctrl.state.redeployInProgress"> <i class="fa fa-sync space-right" aria-hidden="true"></i> Pull and update application </span>
    <span ng-show="$ctrl.state.redeployInProgress">In progress...</span>
  </button>
  <button
    class="btn btn-sm btn-primary"
    ng-click="$ctrl.saveGitSettings()"
    ng-disabled="$ctrl.isSubmitButtonDisabled() || !$ctrl.redeployGitForm.$valid"
    style="margin-top: 7px; margin-left: 0;"
    button-spinner="$ctrl.state.saveGitSettingsInProgress"
  >
    <span ng-show="!$ctrl.state.saveGitSettingsInProgress"> Save settings </span>
    <span ng-show="$ctrl.state.saveGitSettingsInProgress">In progress...</span>
  </button>
</form>
