From b79e81c5c32c83ebdc785ec1f5335b22c21c83bc Mon Sep 17 00:00:00 2001 From: gorm Date: Mon, 25 May 2015 02:19:54 +0200 Subject: Fixed contact form - Also updated API help (need translation) --- lib/views/help/api.html.erb | 162 +++++++++++++++++++++------------------- lib/views/help/contact.html.erb | 7 +- 2 files changed, 90 insertions(+), 79 deletions(-) diff --git a/lib/views/help/api.html.erb b/lib/views/help/api.html.erb index 5f27c2e..c6488f9 100644 --- a/lib/views/help/api.html.erb +++ b/lib/views/help/api.html.erb @@ -1,83 +1,89 @@ -<% @title = "Application Programming Interface - API" %> +<% @title = "About our API" %> <%= render :partial => 'sidebar' %>
-

<%=@title %>

- -

Introduction

- -

This page explains how programmers can make other websites and software -interact with <%= site_name %> via an "API". -

- -

<%= site_name %> does not have a full API yet, but we are gradually adding -lots of things that are similar in use to an API as they are requested. -

- -
- -

1. Linking to new requests

- -

To encourage your users to make requests to a particular public authority, use URLs of the form: -<%= link_to new_request_to_body_url(:url_name => "liverpool_city_council") , new_request_to_body_url(:url_name => "liverpool_city_council") %>. -These are the parameters you can add to those URLs, either in the URL or from a form. - -

- -
- -

2. RSS (actually, Atom) feeds

- -

There are Atom feeds on most pages which list FOI requests, which you can -use to get updates and links in XML format. Find the URL of the Atom feed in -one of these ways: -

- -

In particular, even complicated search queries have Atom feeds. -You can do all sorts of things with them, such as query by authority, by file -type, by date range, or by status. See the advanced search -tips for details. - -


- -

3. JSON structured data

- -

Quite a few pages have JSON versions, which let you download information about -objects in a structured form. Find them by: -

-

- -

Requests, users and authorities all have JSON versions containing basic -information about them. Every Atom feed has a JSON equivalent, containing -information about the list of events in the feed. -

- -
-

4. Spreadsheet of all authorities

- -

-A spreadsheet file listing every body in <%= site_name %> is available: -<%= link_to "all-authorities.csv", all_public_bodies_csv_url() %> -

- -
- -

Please contact us if you need an API feature that isn't there yet. It's -very much a work in progress, and we do add things when people ask us to.

- - - +

<%=@title %>

+
+
Introduction
+
+

This page explains how programmers can make other websites and software + interact with WhatDoTheyKnow via an "API". +

+ +

WhatDoTheyKnow does not have a full API yet, but we are gradually adding + lots of things that are similar in use to an API as they are requested. +

+
+ +
Linking to new requests
+
+

To encourage your users to make links to a particular public authority, use URLs of the form + <%= link_to new_request_to_body_path(:url_name => "liverpool_city_council") , new_request_to_body_path(:url_name => "liverpool_city_council") %>. + These are the parameters you can add to those URLs, either in the URL or from a form. + +

    +
  • title - default summary of the new request.
  • +
  • default_letter - default text of the body of the letter. The salutation (Dear...) and signoff (Yours...) are wrapped round this.
  • +
  • body - as an alternative to default_letter, this sets the default entire text of the request, so you can customise the salutation and signoff.
  • +
  • tags - space separated list of tags, so you can find and link up any requests made later, e.g. openlylocal spending_id:12345. The : indicates it is a machine tag. The values of machine tags may also include colons, useful for URIs. +
+
+ +
RSS (actually, Atom) feeds
+
+

There are Atom feeds on most pages which list FOI requests, which you can + use to get updates and links in XML format. Find the URL of the Atom feed in + one of these ways: +

    +
  • Look for the <%= image_tag "feed-16.png", :alt => "RSS icon" %> RSS feed links.
  • +
  • Examine the <link rel="alternate" type="application/atom+xml"> tag in the head of the HTML.
  • +
  • Add /feed to the start of another URL. +
+ +

In particular, even complicated search queries have Atom feeds. + You can do all sorts of things with them, such as query by authority, by file + type, by date range, or by status. See the advanced search + tips for details. +

+ +
JSON structured data
+
+

Quite a few pages have JSON versions, which let you download information about + objects in a structured form. Find them by: +

+
    +
  • Adding .json to the end of the URL.
  • +
  • Look for the <link rel="alternate" type="application/json"> tag in the head of the HTML.
  • +
+ +

Requests, users and authorities all have JSON versions containing basic + information about them. Every Atom feed has a JSON equivalent, containing + information about the list of events in the feed. +

+
+ +
Spreadsheet of all authorities
+
+

+ A spreadsheet file listing every body in WhatDoTheyKnow is available: + <%= link_to "all-authorities.csv", all_public_bodies_csv_path %> +

+ +
+ + +
5. Write API
+
+

+ The write API is designed to be used by authorities to create their own requests in the system. The API is currently used by mySociety's FOI Register software to support using Alaveteli as a disclosure log for all FOI activity at a particular public body. More technical information about the write API is available on the Alaveteli wiki. +

+
+
+ +

Please contact us if you need an API feature that isn't there yet. It's + very much a work in progress, and we do add things when people ask us to.

+ +
+ diff --git a/lib/views/help/contact.html.erb b/lib/views/help/contact.html.erb index ad89db9..d228aa3 100644 --- a/lib/views/help/contact.html.erb +++ b/lib/views/help/contact.html.erb @@ -65,6 +65,11 @@ <%= f.text_area :message, :rows => 10, :cols => 60 %>

+

+ <%= f.label :comment, 'Do not fill in this field' %> + <%= f.text_field :comment %> +

+ <% if !@last_request.nil? %>

@@ -88,7 +93,7 @@

<%= hidden_field_tag(:submitted_contact_form, 1) %> - <%= submit_tag "Send message to the charity" %> + <%= submit_tag "Send message to the charity", :disable_with => "Sending..." %> <-- we run this site, not the Government!
-- cgit v1.2.3