- @header_with_form = @form if @form.present?
.view.full-page-intro{ style: "background-image: url('#{block.background.url}'); background-repeat: no-repeat; background-size: cover;" }
  .mask.rgba-black-light.d-flex.justify-content-center.align-items-center
    .container
      .row.wow.fadeIn
        .col-md-6.mb-4.white-text.text-center.text-md-left
          %h1.display-4.font-weight-bold
            = @page&.title || @application.public_name
          %hr.hr-light
            %p
              - unless @page.present?
                %strong
                  = @application.tagline
            %p.mb-4.d-none.d-md-block
              %strong
                = @page&.body || @application.short_description
        - forms = actual_forms(block.forms)
        - if forms.any?
          .col-md-6.col-xl-5.mb-4
            - if params[:flash] == 'success_user_sign_up'
              = render 'tramway/landing/templates/alert', alert_type: :success do
                = t('.sign_up_successful')
            - if params[:flash] == 'success_user_sign_in'
              = render 'tramway/landing/templates/alert', alert_type: :success do
                = t('.sign_in_successful')
            - if params[:flash] == 'error_user_sign_up'
              = render 'tramway/landing/templates/alert', alert_type: :danger do
                = t('.there_is_some_errors')
            - if params[:flash] == 'error_user_sign_in'
              = render 'tramway/landing/templates/alert', alert_type: :danger do
                = t('.invalid_email_or_password')
            .card
              .card-body
                - raise 'Initialize @header_with_form in a controller with something like that `@header_with_form = UserSignUpForm.new User.new`. `User` is your model which you want to Sign Up' unless defined?(@header_with_form)
                %h3.dark-grey-text.text-center
                  - forms.each_with_index do |form, index|
                    - unless index == 0
                      |
                    = link_to '#', class: :form_activation_link, id: form.id do
                      %strong
                        = form.title
                %hr
                - forms.each do |form|
                  - current_form = @header_with_form[form.form_name]
                  = simple_form_for current_form, url: form.url, method: :post, input_html: { class: "form-vertical form_#{form.id} header_with_form" }, html: { class: "form_#{form.id} header_with_form" } do |f|
                    = hidden_field_tag :model, @header_with_form[form.form_name].model.class.to_s
                    = hidden_field_tag :success_redirect, request.path
                    = hidden_field_tag :error_redirect, request.path
                    - current_form.properties.each do |property|
                      = render 'tramway/core/shared/input', property: property[0], object: :user, type: property[1], form: f, destination: :landing, record: current_form, value: (params[:record].present? ? params[:record][property[0]] : '')
                    = f.button :submit, current_form.submit_message
:javascript
  $(document).ready(function() {
    $("form.header_with_form").each(function(index) {
      if (index != 0) {
        $(this).hide();
      }
    });
    $('a.form_activation_link').click(function() {
      $("form.header_with_form").each(function() {
        $(this).hide();
      });
      $(`form.form_${$(this).first()[0].id}`).show();
    });
  });