sudara/alonetone

View on GitHub
app/views/account_requests/new.html.erb

Summary

Maintainability
Test Coverage
<div class="page_container page_container_with_blank_slate_overlapping_content big_form">
  <%= render layout: 'shared/blank_slate', locals: { name: 'alec', role: 'illustrator' } do %>
      <p>
        “Alonetone is open to everyone making music. However, we are invite-only to keep spammers out.
      </p>
      <p>
        Get on the list below! It might take us a day or two to approve your account, but it’s worth it, promise.”
      </p>
  <% end %>

  <div class="box">
    <h2>Get an Account</h2>
    <%= render partial: 'shared/errors', locals: { errors: @account_request.errors } %>

    <%= form_with model: @account_request, data: { turbo: false }  do |f| %>
      <h3 class="form_heading">
        Give us an email and pick your username:
      </h3>
      <div class="form_row">
        <div>
          <%= f.label :email, "Email" %>
          <%= f.text_field :email %>
          <%= inline_form_error(@account_request.errors[:email]) %>
        </div>
        <div class="field_with_hint_before">
          <%= f.label :login, "Pick a username (no spaces allowed)" %>
          <span>alonetone.com/</span><%= f.text_field :login %>
          <%= inline_form_error(@account_request.errors[:login]) %>
        </div>
      </div>
      <div>
        <h3 class="form_heading">
          Which best describes you?
        </h3>
        <div class="form_radio_group">
          <div class="columns">
            <div class="left">
              <div class="form_radio_pair">
                <%= f.radio_button(:entity_type, "band") %>
                <%= f.label(:entity_type_band, "Band") %>
              </div>
              <div class="form_radio_pair">
                <%= f.radio_button(:entity_type, "musician") %>
                <%= f.label(:entity_type_musician, "Musician") %>
              </div>
              <div class="form_radio_pair">
                <%= f.radio_button(:entity_type, "label") %>
                <%= f.label(:entity_type_label, "Label") %>
              </div>
            </div>
            <div class="right">
              <div class="form_radio_pair">
                <%= f.radio_button(:entity_type, "blogger") %>
                <%= f.label(:entity_type_blogger, "Blogger / Website owner") %>
              </div>
              <div class="form_radio_pair">
                <%= f.radio_button(:entity_type, "podcaster") %>
                <%= f.label(:entity_type_podcaster, "Podcaster / Spoken Word") %>
              </div>
            </div>
          </div>
          <%= inline_form_error(@account_request.errors[:entity_type]) %>
        </div>
      </div>

      <div>
        <h3 class="form_heading">
          Do you currently support us on <a href="https://patreon.com/alonetone">Patreon</a>?
        </h3>
        <div class="form_radio_group">
          <div class="single_col">
            <div class="form_radio_pair">
              <%= f.radio_button(:patreon, "maybe") %>
              <%= f.label(:patreon_maybe, "Oooh, not yet but maybe someday!") %>
            </div>
            <div class="form_radio_pair">
              <%= f.radio_button(:patreon, "yes") %>
              <%= f.label(:patreon_yes, "Yes!") %>
            </div>
            <div class="form_radio_pair">
              <%= f.radio_button(:patreon, "no") %>
              <%= f.label(:patreon_no, "Not interested right now.") %>
            </div>
          </div>
        </div>
      </div>
      <div>
        <h3 class="form_heading">
          Tell us something about your music — or better, link to it:
        </h3>
        <%= f.label :details, "Don't worry, we don't care about genre or recording quality, etc. We just care that you are a music maker, not a spammer :)" %>
        <%= f.text_area :details %>
        <%= inline_form_error(@account_request.errors[:details]) %>
      </div>
      <div>
        <%= f.submit "Get On The List" %>
      </div>
    <% end %>
  </div>
</div>