agile-alliance-brazil/event_registrations

View on GitHub
app/views/events/_form.html.erb

Summary

Maintainability
Test Coverage
<%= form_for event do |f| %>
  <div class="row">
    <div class="col-xl-3 form-group">
      <% if @event.event_image_valid? %>
        <%= image_tag @event.event_image.url, size: '300x300', class: 'card-img-top' %>
      <% else %>
        <%= image_tag 'https://res.cloudinary.com/agile-alliance-brazil/image/upload/v1623597789/img-empty_b8hdek.png', size: '300x300' %>
      <% end %>
    </div>
    <div class="col-xl-9 form-group">
      <%= f.file_field :event_image, class: 'form-control' %>
    </div>
  </div>

  <div class="row">
    <div class="col-xl-4 form-group">
      <%= f.label :name, class: 'control-label' %>
      <%= f.text_field :name, class: 'form-control', autofocus: true %>
      <span class="help-block"><%= event.errors[:name].join(', ') %></span>
    </div>
    <div class="col-xl-4 form-group">
      <%= f.label :event_nickname, class: 'control-label' %>
      <%= f.text_field :event_nickname, class: 'form-control' %>
    </div>
    <div class="col-xl-4 form-group">
      <%= f.label :attendance_limit, class: 'control-label' %>
      <%= f.text_field :attendance_limit, class: 'form-control' %>
      <span class="help-block"><%= event.errors[:attendance_limit].join(', ') %></span>
    </div>
  </div>

  <div class="row">
    <div class="col-xl-6 form-group">
      <%= f.label :main_email_contact, class: 'control-label' %>
      <%= f.text_field :main_email_contact, class: 'form-control' %>
      <span class="help-block"><%= event.errors[:main_email_contact].join(', ') %></span>
    </div>
    <div class="col-xl-6 form-group">
      <%= f.label :days_to_charge, class: 'control-label' %>
      <%= f.text_field :days_to_charge, class: 'form-control' %>
      <span class="help-block"><%= event.errors[:days_to_charge].join(', ') %></span>
    </div>
  </div>

  <div class="row">
    <div class="col-xl-6 form-group">
      <%= f.label :city, class: 'control-label' %>
      <%= f.text_field :city, class: 'form-control' %>
      <span class="help-block"><%= event.errors[:city].join(', ') %></span>
    </div>
    <div class="col-xl-4 form-group">
      <%= f.label :state, class: 'control-label' %>
      <%= f.text_field :state, class: 'form-control' %>
    </div>
    <div class="col-xl-2 form-group">
      <%= f.label :country, class: 'control-label' %>
      <%= f.country_select :country, priority_countries = ["Brazil"], options = {}, html_options = { class: 'form-control' } %>
    </div>
  </div>

  <div class="row">
    <div class="col-xl-6 form-group">
      <%= f.label :start_date, class: 'control-label' %>
      <%= f.datetime_field :start_date, class: 'form-control' %>
      <span class="help-block"><%= event.errors[:start_date].join(', ') %></span>
    </div>
    <div class="col-xl-6 form-group">
      <%= f.label :end_date, class: 'control-label' %>
      <%= f.datetime_field :end_date, class: 'form-control' %>
      <span class="help-block"><%= event.errors[:end_date].join(', ') %></span>
    </div>
  </div>

  <div class="row">
    <div class="col-xl-3 form-group">
      <%= f.label :full_price, class: 'control-label' %>
      <%= f.text_field :full_price, class: 'form-control' %>
      <span class="help-block"><%= event.errors[:full_price].join(', ') %></span>
    </div>
    <div class="col-xl-3 form-group">
      <%= f.label :link, class: 'control-label' %>
      <%= f.text_field :link, class: 'form-control' %>
    </div>
    <div class="col-xl-3 form-group">
      <%= f.label :event_schedule_link, class: 'control-label' %>
      <%= f.text_field :event_schedule_link, class: 'form-control' %>
    </div>
    <div class="col-xl-3 form-group">
      <%= f.label :privacy_policy, class: 'control-label' %>
      <%= f.text_field :privacy_policy, class: 'form-control' %>
    </div>
  </div>

  <div class="row">
    <div class="col-xl-3 form-group">
      <%= f.check_box :event_remote %>
      <%= f.label :event_remote, class: 'form-check-label' %>
    </div>
    <div class="col-xl-3 form-group">
      <%= f.label :event_remote_platform_name, class: 'control-label' %>
      <%= f.text_field :event_remote_platform_name, class: 'form-control' %>
    </div>
    <div class="col-xl-3 form-group">
      <%= f.label :event_remote_platform_mail, class: 'control-label' %>
      <%= f.text_field :event_remote_platform_mail, class: 'form-control' %>
    </div>
    <div class="col-xl-3 form-group">
      <%= f.label :event_remote_manual_link, class: 'control-label' %>
      <%= f.text_field :event_remote_manual_link, class: 'form-control' %>
    </div>
  </div>

  <div class="row">
    <div class="col-xl-12 form-group">
      <%= f.submit class: 'btn btn-success text-label button-spacing' %>
    </div>
  </div>
<% end %>