ManageIQ/manageiq-ui-classic

View on GitHub
app/views/layouts/angular/_x_edit_buttons_angular.html.haml

Summary

Maintainability
Test Coverage
.clearfix
.pull-right.button-group.edit_buttons{"ng-controller" => "buttonGroupController"}
  %miq-button{:name      => t = _("Add"),
              :title     => t,
              :alt       => t,
              'ng-if'    => 'newRecord',
              :enabled   => "saveable(angularForm)",
              'on-click' => "addClicked({target: '.edit_buttons'}, true)",
              :primary   => 'true'}
  %miq-button{:name      => t = _("Save"),
              :title     => t,
              :alt       => t,
              'ng-if'    => '!newRecord',
              :enabled   => "saveable(angularForm) || reactFormDirty",
              'on-click' => "saveClicked({target: '.edit_buttons'}, true)",
              :primary   => 'true'}
  %miq-button{:name      => t = _("Reset"),
              :title     => t,
              :alt       => t,
              'ng-if'    => '!newRecord',
              :enabled   => "!angularForm.$pristine",
              'on-click' => "resetClicked()"}
  %miq-button{:name      => t = _("Cancel"),
              :title     => t,
              :alt       => t,
              :enabled   => "true",
              'on-click' => "cancelClicked({target: '.edit_buttons'})"}