= editing_alert
= simple_form_for @group do |f|
  %fieldset
    .form-group
      = f.input :name, as: :string, required: false, label: 'Team name'

    .form-group
      %label.form-label-bold{ for: :group_description } Team description
      %p.form-hint= info_text('hint_team_description')
      = f.input :description, label: false, input_html: { class: 'wider' }

    .form-group
      %label.form-label-bold{ for: :group_responsibilities } Team responsibilities (optional)
      %p.form-hint= info_text('hint_team_responsibilities')
      = f.input :responsibilities, label: false, input_html: { class: 'wider' }

    .form-group
      %label.form-label-bold Team parent
      %p.form-hint Use this to change where in the organisation this team is located.
      = f.input :parent_id, as: :hidden
      = render partial: 'home/org_browser'
      :javascript
        window.getOrgBrowserGroupId = function() {
          return parseInt($('#group_parent_id').attr('value'), 10);
        };
        window.setOrgBrowserGroupId = function(id) {
          $('#group_parent_id').attr('value', id);
        };

    .form-group
      = f.button :submit

= editing_alert
= simple_form_for @group do |f|
  %fieldset
    .form-group
      = f.input :name, as: :string, required: false, label: 'Team name'

    .form-group
      %label.form-label-bold{ for: :group_description } Team description
      %p.form-hint= info_text('hint_team_description')
      = f.input :description, label: false, input_html: { class: 'wider' }

    .form-group
      %label.form-label-bold{ for: :group_responsibilities } Team responsibilities (optional)
      %p.form-hint= info_text('hint_team_responsibilities')
      = f.input :responsibilities, label: false, input_html: { class: 'wider' }

    .form-group
      = f.input :parent_id, as: :hidden
      - unless params[:group_id]
        %label.form-label-bold Team parent
        %p.form-hint Use this to change where in the organisation this team is located.
        = render partial: 'home/org_browser'
        :javascript
          window.getOrgBrowserGroupId = function() {
            return parseInt($('#group_parent_id').attr('value'), 10);
          };
          window.setOrgBrowserGroupId = function(id) {
            $('#group_parent_id').attr('value', id);
          };

    .form-group
      = f.button :submit

Hide the org browser when creating a sub-team
Hide the org browser when creating a sub-team
