diff options
-rw-r--r-- | conf/general.yml-example | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Open311.pm | 7 | ||||
-rw-r--r-- | templates/web/base/admin/config_page.html | 1 | ||||
-rw-r--r-- | templates/web/base/open311/index.html | 2 | ||||
-rw-r--r-- | templates/web/fixamingata/open311/index.html | 2 |
5 files changed, 9 insertions, 6 deletions
diff --git a/conf/general.yml-example b/conf/general.yml-example index aa8d431be..4c89cfba2 100644 --- a/conf/general.yml-example +++ b/conf/general.yml-example @@ -159,8 +159,9 @@ ALLOWED_COBRANDS: # the admin interface. Defaults to BASE_URL with "/admin" on the end. ADMIN_BASE_URL: '' -# How many items are returned in the GeoRSS feeds by default +# How many items are returned in the GeoRSS and Open311 feeds by default RSS_LIMIT: '20' +OPEN311_LIMIT: 1000 # How many reports to show per page on the All Reports pages ALL_REPORTS_PER_PAGE: 100 diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm index 4f1727b1a..98e5f42b2 100644 --- a/perllib/FixMyStreet/App/Controller/Open311.pm +++ b/perllib/FixMyStreet/App/Controller/Open311.pm @@ -112,7 +112,7 @@ sub get_discovery : Private { 'changeset' => [$prod_changeset], # XXX rewrite to match 'key_service' => ["Read access is open to all according to our \u003Ca href='/open_data' target='_blank'\u003Eopen data license\u003C/a\u003E. For write access either: 1. return the 'guid' cookie on each call (unique to each client) or 2. use an api key from a user account which can be generated here: http://seeclickfix.com/register The unversioned url will always point to the latest supported version."], - 'max_requests' => [ $c->config->{RSS_LIMIT} ], + 'max_requests' => [ $c->config->{OPEN311_LIMIT} || 1000 ], 'endpoints' => [ { 'endpoint' => [ @@ -205,8 +205,9 @@ sub get_services : Private { sub output_requests : Private { my ( $self, $c, $criteria, $limit ) = @_; - $limit = $c->config->{RSS_LIMIT} - unless $limit && $limit <= $c->config->{RSS_LIMIT}; + my $default_limit = $c->config->{OPEN311_LIMIT} || 1000; + $limit = $default_limit + unless $limit && $limit <= $default_limit; my $attr = { order_by => { -desc => 'confirmed' }, diff --git a/templates/web/base/admin/config_page.html b/templates/web/base/admin/config_page.html index 71c524fb3..67661c597 100644 --- a/templates/web/base/admin/config_page.html +++ b/templates/web/base/admin/config_page.html @@ -68,6 +68,7 @@ running version <strong>[% git_version || 'unknown' %]</strong>. </tr> [% INCLUDE with_cobrand value="ALL_REPORTS_PER_PAGE" cob=c.cobrand.reports_per_page %] [% INCLUDE just_value value="RSS_LIMIT" %] +[% INCLUDE just_value value="OPEN311_LIMIT" conf_default = '<em>1000</em>' %] [% INCLUDE just_value value="AREA_LINKS_FROM_PROBLEMS" %] [% INCLUDE subsection heading="Geocoder" %] diff --git a/templates/web/base/open311/index.html b/templates/web/base/open311/index.html index 196cf0db6..99c0fbec0 100644 --- a/templates/web/base/open311/index.html +++ b/templates/web/base/open311/index.html @@ -73,7 +73,7 @@ for council problem-reporting systems.</p> <li><a rel="nofollow" href="http://wiki.open311.org/GeoReport_v2">[% loc('Open311 specification') %]</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.RSS_LIMIT ) %]</p> +<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> <p>[% loc('The following Open311 v2 attributes are returned for each request: service_request_id, description, lat, long, media_url, status, requested_datetime, updated_datetime, service_code and service_name.') %]</p> diff --git a/templates/web/fixamingata/open311/index.html b/templates/web/fixamingata/open311/index.html index 995069ed2..47b270512 100644 --- a/templates/web/fixamingata/open311/index.html +++ b/templates/web/fixamingata/open311/index.html @@ -14,7 +14,7 @@ <li><a rel="nofollow" href="http://wiki.open311.org/GeoReport_v2">[% loc('Open311 specification') %]</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.RSS_LIMIT ) %]</p> +<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> <p>[% loc('The following Open311 v2 attributes are returned for each request: service_request_id, description, lat, long, media_url, status, requested_datetime, updated_datetime, service_code and service_name.') %]</p> |