Skip to content

Commit

Permalink
[Open311] Include JSON links on index page.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Jan 8, 2021
1 parent 9e9245c commit cbe743e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fix non-JS form when all extra questions answered. #3248
- Improve display of disabled fields in iOS.
- Use div for inspector form wrapped extra questions. #3250
- Fix Open311 JSON services output. #3279
- Admin improvements:
- Enable per-category hint customisation.
- Move ban/unban buttons to user edit admin page.
Expand Down
21 changes: 11 additions & 10 deletions templates/web/base/open311/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ <h2 id="server">[% loc('Open311 API for the mySociety FixMyStreet server') %]</h
<ul>
<li><a rel="nofollow" href="http://www.open311.org/">[% loc('Open311 initiative web page') %]</a></li>
<li><a rel="nofollow" href="http://wiki.open311.org/GeoReport_v2">[% loc('Open311 specification') %]</a></li>
<li><a href="https://github.com/mysociety/fixmystreet/wiki/Open311-FMS---Complete-Spec">Open311 specification, with mySociety additions</a></li>
</ul>

<p>[% tprintf( loc('At most %d requests are returned in each query. The returned requests are ordered by requested_datetime, so to get all requests, do several searches with rolling start_date and end_date.'), c.config.OPEN311_LIMIT ) %]</p>
Expand All @@ -90,41 +91,41 @@ <h2 id="server">[% loc('Open311 API for the mySociety FixMyStreet server') %]</h
[% jurisdiction_id = c.cobrand.jurisdiction_id_example %]
[% examples = [
{
url = c.cobrand.base_url _ "/open311/v2/discovery.xml?jurisdiction_id=$jurisdiction_id",
url = "/open311/v2/discovery.xml?jurisdiction_id=$jurisdiction_id",
info = 'discovery information',
},
{
url = c.cobrand.base_url _ "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id",
url = "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id",
info = 'list of services provided',
},
{
url = c.cobrand.base_url _ "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id&lat=60&long=11",
url = "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id&lat=60&long=11",
info = 'list of services provided for WGS84 coordinate latitude 60 longitude 11',
},
{
url = c.cobrand.base_url _ "/open311/v2/requests/1.xml?jurisdiction_id=$jurisdiction_id",
url = "/open311/v2/requests/1.xml?jurisdiction_id=$jurisdiction_id",
info = 'Request number 1',
},
{
url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=1601&end_date=2011-03-10",
url = "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=1601&end_date=2011-03-10",
info = 'All open requests reported before 2011-03-10 to Trondheim (id 1601)',
},
{
url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=219|220",
url = "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=219|220",
info = 'All open requests in Asker (id 220) and Bærum (id 219)',
},
{
url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&service_code=Vannforsyning",
url = "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&service_code=Vannforsyning",
info = "All requests with the category 'Vannforsyning'",
},
{
url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=closed",
url = "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=closed",
info = 'All closed requests',
},
] %]
[% FOREACH examples %]
<li><a href="[% url %]">[% info %]</a>
<br>[% url | html %]</li>
<li>[% info %]: <a href="[% url %]">XML</a> or <a href="[% url.replace('xml', 'json') %]">JSON</a>
<br>[% url.replace('xml', '<i>format</i>') | safe %]</li>
[% END %]

</ul>
Expand Down

0 comments on commit cbe743e

Please sign in to comment.