Skip to content

Commit

Permalink
Extract bullet list component
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Aug 26, 2024
1 parent 13fb853 commit 5dfaf32
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 98 deletions.
5 changes: 5 additions & 0 deletions app/components/bullet_list_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ul class="pl-6 <%= @space_css %> text-xl list-disc list-outside text-navy">
<% items.each do |item| %>
<li><%= item %></li>
<% end %>
</ul>
22 changes: 22 additions & 0 deletions app/components/bullet_list_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# typed: strict
# frozen_string_literal: true

class BulletListComponent < ViewComponent::Base
extend T::Sig

renders_many :items

sig { params(space: T.nilable(Integer)).void }
def initialize(space: nil)
super

space_css = if space == 6
"space-y-6"
elsif space.nil?
""
else
raise "Unexpected space value: #{space}"
end
@space_css = T.let(space_css, String)
end
end
37 changes: 19 additions & 18 deletions app/views/api_keys/confirm.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@
We trust you. Don’t be a dickhead. We’re giving you this and your end of the deal is this:
</p>

<%# TODO: Extract component for bullet list %>
<ul class="pl-6 mt-8 mb-12 space-y-6 text-xl list-disc list-outside text-navy">
<li>
Do NOT use this for commercial purposes. That includes any activity happening inside a commercial organisation. It doesn't matter
whether something will be free or not. You can, however, use this for evaluation purposes. Beyond that you need to
<%# TODO: Extract this special path into a helper %>
<%= pa_link_to "contact us to enter into a commercial agreement for access", api_contact_path %>.
</li>
<li>
You have to attribute the OpenAustralia Foundation and Planning Alerts on your website or application.
</li>
<li>
Don't use the service (or information obtained from the service) to market goods or services to individuals
</li>
<li>
Don't use the service (or information obtained from the service) to harass or intimidate a person.
</li>
</ul>
<div class="mt-8 mb-12">
<%= render BulletListComponent.new(space: 6) do |c| %>
<%= c.with_item do %>
Do NOT use this for commercial purposes. That includes any activity happening inside a commercial organisation. It doesn't matter
whether something will be free or not. You can, however, use this for evaluation purposes. Beyond that you need to
<%# TODO: Extract this special path into a helper %>
<%= pa_link_to "contact us to enter into a commercial agreement for access", api_contact_path %>.
<% end %>
<%= c.with_item do %>
You have to attribute the OpenAustralia Foundation and Planning Alerts on your website or application.
<% end %>
<%= c.with_item do %>
Don't use the service (or information obtained from the service) to market goods or services to individuals
<% end %>
<%= c.with_item do %>
Don't use the service (or information obtained from the service) to harass or intimidate a person.
<% end %>
<% end %>
</div>

<%= pa_button_to "I understand", api_keys_path, method: :post %>
</div>
30 changes: 16 additions & 14 deletions app/views/api_keys/requests/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@
Under certain very specific circumstances we may grant you access to the API for free. You must:
</p>

<ul class="pl-6 mt-8 text-xl list-disc list-outside text-navy">
<li>
Not be making money in any way using the API or in a related service - some more words that explain this in detail
</li>
<li>
Not be funded
</li>
<li>
Not unduly restricting access to the end result - should be available to the public
</li>
<li>
You have don't oodles lying around that you could use to pay for API access
</li>
</ul>
<div class="mt-8">
<%= render BulletListComponent.new do |c| %>
<%= c.with_item do %>
Not be making money in any way using the API or in a related service - some more words that explain this in detail
<% end %>
<%= c.with_item do %>
Not be funded
<% end %>
<%= c.with_item do %>
Not unduly restricting access to the end result - should be available to the public
<% end %>
<%= c.with_item do %>
You have don't oodles lying around that you could use to pay for API access
<% end %>
<% end %>
</div>

<%# TODO: Note that almost none of content is yet relevant to our situation. It's mostly a placeholder %>
<section class="bg-white">
Expand Down
56 changes: 28 additions & 28 deletions app/views/authorities/under_the_hood.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,36 +60,36 @@

<section class="py-12">
<%= render HeadingComponent.new(tag: :h2).with_content("What you can do next") %>
<p class="mt-8 text-xl text-navy">
<p class="mt-8 mb-4 text-xl text-navy">
If something isn't right with the scraper or the data coming in then you could do one or several of the following:
<ul class="pl-8 mt-4 text-xl list-disc text-navy">
<li>
<%= pa_link_to "Report or view scraper issues", github_issues_url %>
</li>
<li>
<%= pa_link_to "Fork the scraper on Github", github_url(@authority) %>
and try to fix it
</li>
<li>
If it's an issue with the council website, then contact
<%= @authority.full_name %>
</li>
<li>
Contact us for help
</li>
</ul>
</p>
<p class="mt-8 text-xl text-navy">
<%= render BulletListComponent.new do |c| %>
<%= c.with_item do %>
<%= pa_link_to "Report or view scraper issues", github_issues_url %>
<% end %>
<%= c.with_item do %>
<%= pa_link_to "Fork the scraper on Github", github_url(@authority) %>
and try to fix it
<% end %>
<%= c.with_item do %>
If it's an issue with the council website, then contact
<%= @authority.full_name %>
<% end %>
<%= c.with_item do %>
Contact us for help
<% end %>
<% end %>
<p class="mt-8 mb-4 text-xl text-navy">
If everything is working fine right now but you want to help if something goes wrong:
<ul class="pl-8 mt-4 text-xl list-disc text-navy">
<li>
<%= pa_link_to "Watch the scraper", morph_url(@authority) %>
on morph.io, so you will get an email if it errors. Press the "Watch" button in the top right while you're logged in to morph.io.
</li>
<li>
<%= pa_link_to "View any scraper issues", github_issues_url %>.
Help fix them or comment on them if they are out of date
</li>
</ul>
</p>
<%= render BulletListComponent.new do |c| %>
<%= c.with_item do %>
<%= pa_link_to "Watch the scraper", morph_url(@authority) %>
on morph.io, so you will get an email if it errors. Press the "Watch" button in the top right while you're logged in to morph.io.
<% end %>
<%= c.with_item do %>
<%= pa_link_to "View any scraper issues", github_issues_url %>.
Help fix them or comment on them if they are out of date
<% end %>
<% end %>
</section>
83 changes: 53 additions & 30 deletions app/views/documentation/api_landing.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@
AUD
<span class="block mt-1">/ month</span>
</p>
<%# TODO: Use extracted component %>
<ul class="pl-6 text-left list-disc list-outside">
<%# TODO: Calculate and format this automatically %>
<li>Return up to 100,000 applications per day</li>
</ul>
<div class="text-left">
<%= render BulletListComponent.new do |c| %>
<%= c.with_item do %>
<%# TODO: Calculate and format this automatically %>
Return up to 100,000 applications per day
<% end %>
<% end %>
</div>
</div>
<p class="my-4">
<%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %> to apply
Expand All @@ -81,13 +84,20 @@
AUD
<span class="block mt-1">+ GST / month</span>
</p>
<%# TODO: Use extracted component %>
<ul class="pl-6 text-left list-disc list-outside">
<%# TODO: Calculate and format this automatically %>
<li>Return up to 500,000 applications per day</li>
<li>1 product</li>
<li>Priority email support</li>
</ul>
<div class="text-left">
<%= render BulletListComponent.new do |c| %>
<%= c.with_item do %>
<%# TODO: Calculate and format this automatically %>
Return up to 500,000 applications per day
<% end %>
<%= c.with_item do %>
1 product
<% end %>
<%= c.with_item do %>
Priority email support
<% end %>
<% end %>
</div>
</div>
<p class="my-4">
<%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %>
Expand All @@ -106,16 +116,28 @@
<p class="mt-8 mb-4 text-left">
Potential add ons can include:
</p>
<%# TODO: Use extracted component %>
<ul class="pl-6 text-left list-disc list-outside">
<li>Access to bulk data API</li>
<li>Multiple products</li>
<%# TODO: Calculate and format this automatically %>
<li>Return more than 500,000 applications per day</li>
<li>Customised integration options</li>
<%# TODO: Should we include this? %>
<li>Resale of data</li>
</ul>
<div class="text-left">
<%= render BulletListComponent.new do |c| %>
<%= c.with_item do %>
<%# TODO: Add documentation for bulk data API %>
Access to bulk data API
<% end %>
<%= c.with_item do %>
Multiple products
<% end %>
<%= c.with_item do %>
<%# TODO: Calculate and format this automatically %>
Return more than 500,000 applications per day
<% end %>
<%= c.with_item do %>
Customised integration options
<% end %>
<%= c.with_item do %>
<%# TODO: Should we include this? %>
Resale of data
<% end %>
<% end %>
</div>
</div>
<p class="my-4">
<%= pa_link_to "Contact us", api_contact_path, extra_classes: "block" %>
Expand All @@ -131,14 +153,15 @@
<p>
In our API you can find Australia-wide data, updated daily:
</p>
<%# TODO: Extract component for bulleted list %>
<ul class="pl-6 my-6 list-disc list-outside">
<li>Single Location by longitude/latitude</li>
<li>Area by longitude/latitude</li>
<li>Planning authority</li>
<li>Postcode</li>
<li>Suburb</li>
</ul>
<div class="my-6">
<%= render BulletListComponent.new do |c| %>
<%= c.with_item.with_content("Single Location by longitude/latitude") %>
<%= c.with_item.with_content("Area by longitude/latitude") %>
<%= c.with_item.with_content("Planning authority") %>
<%= c.with_item.with_content("Postcode") %>
<%= c.with_item.with_content("Suburb") %>
<% end %>
</div>

<%# # TODO: Explain the general shape of the returned data. So far we've only explained how we can search for it. %>

Expand Down
28 changes: 20 additions & 8 deletions app/views/documentation/get_involved.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,26 @@
</p>
<p>
These include:
<ul class="list-disc list-inside">
<li><%= pa_link_to "Aten Systems", "https://www.atensystems.com/councillink" %></li>
<li><%= pa_link_to "Civica", "https://www.civica.com/en-au/container---product-pages/authority-enterprise-suite/" %></li>
<li><%= pa_link_to "Internetrix", "https://www.internetrix.com.au/" %></li>
<li><%= pa_link_to "ITVision", "https://www.itvision.com.au/our-solutions/synergyonline-product-suite.aspx" %></li>
<li><%= pa_link_to "SolOrient", "http://www.solorient.com.au/" %></li>
<li><%= pa_link_to "Technology One", "https://www.technologyonecorp.com/products/planningxchange" %></li>
</ul>
<%= render BulletListComponent.new do |c| %>
<%= c.with_item do %>
<%= pa_link_to "Aten Systems", "https://www.atensystems.com/councillink" %>
<% end %>
<%= c.with_item do %>
<%= pa_link_to "Civica", "https://www.civica.com/en-au/container---product-pages/authority-enterprise-suite/" %>
<% end %>
<%= c.with_item do %>
<%= pa_link_to "Internetrix", "https://www.internetrix.com.au/" %>
<% end %>
<%= c.with_item do %>
<%= pa_link_to "ITVision", "https://www.itvision.com.au/our-solutions/synergyonline-product-suite.aspx" %>
<% end %>
<%= c.with_item do %>
<%= pa_link_to "SolOrient", "http://www.solorient.com.au/" %>
<% end %>
<%= c.with_item do %>
<%= pa_link_to "Technology One", "https://www.technologyonecorp.com/products/planningxchange" %>
<% end %>
<% end %>
</p>
<p>
Please
Expand Down

0 comments on commit 5dfaf32

Please sign in to comment.