kennethkalmer/powerdns-on-rails

View on GitHub
app/views/macros/edit.html.haml

Summary

Maintainability
Test Coverage
%h1.underline
  = @macro.new_record? ? t(:title_macro_new) : t(:title_macro_update)

%div{ :style => "display:none" }
  #macro-name= t :help_macro_name
  #macro-active= t :help_macro_active

= form_for( @macro ) do |f|
  = error_messages_for :macro

  %table
    %tr
      %td= t(:label_macro_name)
      %td  
      %td
        = f.text_field :name
        = help_icon('macro-name')
    %tr
      %td.top= t(:label_macro_description)
      %td  
      %td= f.text_area :description, :size => '35x2'
    - if current_user.admin? && !possible_owners.empty?
      %tr
        %td= t(:label_macro_owner)
        %td  
        %td= f.collection_select :user_id, possible_owners, :id, :login, :include_blank => true
    %tr
      %td= t(:label_macro_active)
      %td  
      %td
        = f.check_box :active
        = help_icon('macro-active')
    %tr
      %td.right= link_to_cancel @macro
      %td  
      %td= submit_tag t(:generic_save)