_fields.html.haml 2 KB
= errors_for @app

%div.required
  = f.label :name
  = f.text_field :name

%div
  = f.label :github_repo
  = f.text_field :github_repo, :placeholder => "errbit/errbit from https://github.com/errbit/errbit"
%div
  = f.label :bitbucket_repo
  = f.text_field :bitbucket_repo, :placeholder => "errbit/errbit from https://bitbucket.org/errbit/errbit"

%fieldset
  %legend Notifications
  %div.checkbox
    = f.check_box :notify_on_errs, 'data-show-when-checked' => '.email_at_notices_nested'
    = f.label :notify_on_errs, 'Notify on errors'
  - if Errbit::Config.per_app_email_at_notices
    %div.email_at_notices_nested{:style => f.object.notify_on_errs ? '' : 'display: none;'}
      .field-helpertext Send a notification every
      = f.text_field :email_at_notices, :value => f.object.email_at_notices.join(", ")
      .field-helpertext times an error occurs (comma separated).
  %div.checkbox
    = f.check_box :notify_on_deploys
    = f.label :notify_on_deploys, 'Notify on deploys'

%div.checkbox
  = f.check_box :notify_all_users
  = f.label :notify_all_users, 'Send notifications to all users'


%fieldset.watchers.nested-wrapper{:style => f.object.notify_all_users ? 'display: none;' : ''}
  %legend Watchers
  = f.fields_for :watchers do |w|
    %div.watcher.nested
      %div.choose
        = w.radio_button :watcher_type, :user
        = label_tag :watcher_type_user, 'User', :for => label_for_attr(w, 'watcher_type_user')
        = w.radio_button :watcher_type, :email
        = label_tag :watcher_type_email, 'Email Address', :for => label_for_attr(w, 'watcher_type_email')
      %div.watcher_params.user{:class => w.object.email.blank? ? 'chosen' : nil}
        = w.select :user_id, User.all.map{|u| [u.name,u.id.to_s]}, :include_blank => '-- Select a User --'
      %div.watcher_params.email{:class => w.object.email.present? ? 'chosen' : nil}
        = w.text_field :email

%div.checkbox
  = f.check_box :resolve_errs_on_deploy
  = f.label :resolve_errs_on_deploy, 'Resolve errs on deploy'

= render "issue_tracker_fields", :f => f