openaustralia/planningalerts

View on GitHub
app/views/_tailwind/api_keys/non_commercials/new.html.erb

Summary

Maintainability
Test Coverage
<%= render Tailwind::Heading.new(tag: :h1).with_content("Request a non-commercial API key") %>

<section class="mt-16">
  <%= render Tailwind::Heading.new(tag: :h2).with_content("What exactly do you mean by non-commercial?") %>
</section>

<section class="mt-16">
<%= render Tailwind::Heading.new(tag: :h2).with_content("Terms of use") %>
</section>

<section class="mt-8">
  <%# TODO: Add errors on all fields in the form %>
  <%= form_with builder: FormBuilders::Tailwind do |f| %>
    <div>
      <%= f.label :organisation, "Organisation", class: "block mb-3" %>
      <%= f.text_field :organisation, class: "block w-full" %>
      <%= f.hint "Leave this blank if you are applying as an individual" %>
    </div>
    <div class="mt-8">
      <%= f.label :public_url, "Public URL", class: "block mb-3" %>
      <%= f.url_field :public_url, class: "block w-full", placeholder: "e.g. https://www.acmeconservation.org.au/mylocaltrees" %>
      <%= f.hint "A publically accessible URL for your project" %>
    </div>
    <div class="mt-8">
      <%= f.label :open_source, "Is the software that uses the API released under an open source license?", class: "block mb-3" %>
      <%# TODO: Do we want to use the word select here? %>
      <%= f.select :open_source, %w[Yes No], { prompt: "Please select" }, class: "block", required: true %>
      <%# TODO: Add link to definition of open source licenses %>
    </div>
    <div class="mt-8">
      <%= f.label :repo_url, "Repository URL", class: "block mb-3" %>
      <%= f.url_field :repo_url, class: "block w-full", placeholder: "https://github.com/acmeconservation/mylocaltrees/" %>
      <%= f.hint "Where to view the source code for your software" %>
    </div>
    <div class="mt-8">
      <%= f.label :expected_max_api_requests_per_day, "Expected maximum API requests per day", class: "block mb-3" %>
      <%= f.select :expected_max_api_requests_per_day,
                   ["0 - 100", "101 - 1000", "1001 - 10,000", "more than 10,000"],
                   { prompt: "Please select" },
                   class: "block", required: true %>
      <%= f.hint "Take your best guess. Keep in mind that each API request returns a maximum of #{Application.max_per_page} applications" %>
    </div>
    <div class="mt-8">
      <%= f.label :purpose, "Purpose", class: "block mb-3" %>
      <%= f.text_area :purpose,
                      placeholder: "e.g. \"My Local Trees\" will use the API to show all tree applications on a map. The aim is to give the members of our not-for-profit new tools to protect trees around our city.",
                      class: "block w-full", required: true, rows: 7 %>
    </div>
    <div class="mt-8">
      <%= f.label :why_non_commercial, "How is it non-commercial?", class: "block mb-3" %>
      <%= f.text_area :why_non_commercial,
                      placeholder: "e.g. We are a not-for-profit. The project is unfunded and created by unpaid volunteers. The result will be freely accessible to our members as well as the general public.",
                      class: "block w-full", required: true, rows: 7 %>
      <%= f.hint "Explain in detail why your particular use is non-commercial. Please bear in mind our guidelines above on what constitutes non-commercial." %>
    </div>
    <div class="mt-12">
      <%= f.button "Submit request" %>
    </div>

  <% end %>
</section>

<section class="mt-24">
  <%= render Tailwind::Heading.new(tag: :h2).with_content("What happens next?"), class: "mb" %>
  <p class="mt-6 text-xl text-navy">
    Your request will be reviewed by one of the human Planning Alerts administrators.
    We will try to do this quickly. You will then be notified via email.
  </p>
</section>