<div class="control-group">
  <label class="control-label">{{i18n "groups.manage.membership.access"}}</label>

  <label>
    {{input type="checkbox"
        class="group-form-public-admission"
        checked=model.public_admission
        disabled=disablePublicSetting}}

    {{i18n "groups.public_admission"}}
  </label>

  <label>
    {{input type="checkbox"
        class="group-form-public-exit"
        checked=model.public_exit}}

    {{i18n "groups.public_exit"}}
  </label>

  <label>
    {{input type="checkbox"
        class="group-form-allow-membership-requests"
        checked=model.allow_membership_requests
        disabled=disableMembershipRequestSetting}}

    {{i18n "groups.allow_membership_requests"}}
  </label>

  {{#if model.allow_membership_requests}}
    <div>
      <label for="membership-request-template">
        {{i18n "groups.membership_request_template"}}
      </label>

      {{expanding-text-area name="membership-request-template"
          class="group-form-membership-request-template input-xxlarge"
          value=model.membership_request_template}}
    </div>
  {{/if}}
</div>

{{#if model.can_admin_group}}
  <div class="control-group">
    <label class="control-label">{{i18n "admin.groups.manage.membership.automatic"}}</label>

    <label for="automatic_membership">
      {{i18n "admin.groups.manage.membership.automatic_membership_email_domains"}}
    </label>

    {{list-setting
      name="automatic_membership"
      class="group-form-automatic-membership-automatic"
      value=emailDomains
      choices=emailDomains
      settingName="name"
      nameProperty=null
      valueProperty=null
      onChange=(action "onChangeEmailDomainsSetting")
      options=(hash allowAny=true)
    }}
  </div>

  {{plugin-outlet name="groups-form-membership-below-automatic"
                  args=(hash model=model)}}

  <div class="control-group">
    <label class="control-label">{{i18n "admin.groups.manage.membership.effects"}}</label>
    <label for="grant_trust_level">{{i18n "admin.groups.manage.membership.trust_levels_title"}}</label>

    {{combo-box
      name="grant_trust_level"
      valueProperty="value"
      value=groupTrustLevel
      content=trustLevelOptions
      class="groups-form-grant-trust-level"
      onChange=(action (mut model.grant_trust_level))
    }}
    <label>
      {{input type="checkbox"
          checked=model.primary_group
          class="groups-form-primary-group"}}

      {{i18n "admin.groups.manage.membership.primary_group"}}
    </label>
  </div>

  <div class="control-group">
    <label class="control-label" for="title">
      {{i18n "admin.groups.default_title"}}
    </label>

    {{input value=model.title name="title" class="input-xxlarge"}}

    <div class="control-instructions">
      {{i18n "admin.groups.default_title_description"}}
    </div>
  </div>
{{/if}}

{{#if canEdit}}
  <div class="control-group">
    {{group-flair-inputs model=model}}
  </div>
{{/if}}
