af83/chouette-core

View on GitHub
app/views/organisations/_form.html.slim

Summary

Maintainability
Test Coverage
= simple_form_for @organisation, url: organisation_path, html: { class: 'form-horizontal', id: 'organisation_form' }, wrapper: :horizontal_form do |f|
  h2.my-16
    = t("organisations.form.sections.information")
  = f.input :name
  = f.input :code, disabled: true
  = f.simple_fields_for(:authentication, @organisation.authentication || Authentication::Saml.new) do |sub_f|
    div[x-data = "{type: '#{@organisation.authentication&.type}'}"]
      .separator.section_separator
      h2.my-16
        = t("organisations.form.sections.identity_provider")
      = sub_f.input :type, as: :select, selected: sub_f.object.organisation_id ? sub_f.object.type : '', include_blank: true, input_html: { 'x-on:change': 'type = $event.target.value' }
      .identity_provider x-show="type === 'Authentication::Saml'"
        = sub_f.input :subtype, as: :select
        = sub_f.input :name
        = sub_f.input :saml_idp_entity_id
        = sub_f.input :saml_idp_sso_service_url
        = sub_f.input :saml_idp_slo_service_url
        = sub_f.input :saml_idp_cert, as: :text
        = sub_f.input :saml_idp_cert_fingerprint
        = sub_f.input :saml_idp_cert_fingerprint_algorithm
        = sub_f.input :saml_authn_context
        = sub_f.input :saml_email_attribute
  = cancel_button
  = f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'organisation_form'