aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm44
-rw-r--r--templates/web/base/admin/list_updates.html3
-rw-r--r--templates/web/base/admin/reports.html2
-rw-r--r--templates/web/fixmystreet.com/static/council.html14
-rw-r--r--templates/web/zurich/admin/reports.html2
-rw-r--r--web/cobrands/fixmystreet/images/fms-for-councils/east-sussex-logo.pngbin0 -> 4012 bytes
-rw-r--r--web/cobrands/fixmystreet/images/fms-for-councils/zurich-logo.pngbin0 -> 6901 bytes
7 files changed, 35 insertions, 30 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index c1df8622f..b2e0bdc2e 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -541,6 +541,9 @@ sub reports : Path('reports') {
$c->stash->{dir} = $dir;
$order .= ' desc' if $dir;
+ my $p_page = $c->req->params->{p} || 1;
+ my $u_page = $c->req->params->{u} || 1;
+
if (my $search = $c->req->param('search')) {
$c->stash->{searched} = $search;
@@ -553,15 +556,15 @@ sub reports : Path('reports') {
# when DBIC creates the join it does 'JOIN users user' in the
# SQL which makes PostgreSQL unhappy as user is a reserved
- # word, hence we need to quote this SQL. However, the quoting
- # makes PostgreSQL unhappy elsewhere so we only want to do
- # it for this query and then switch it off afterwards.
- $c->model('DB')->schema->storage->sql_maker->quote_char( '"' );
- $c->model('DB')->schema->storage->sql_maker->name_sep( '.' );
+ # word. So look up user ID for email separately.
+ my @user_ids = $c->model('DB::User')->search({
+ email => { ilike => $like_search },
+ }, { columns => [ 'id' ] } )->all;
+ @user_ids = map { $_->id } @user_ids;
if (is_valid_email($search)) {
$query->{'-or'} = [
- 'user.email' => { ilike => $like_search },
+ 'me.user_id' => { -in => \@user_ids },
];
} elsif ($search =~ /^id:(\d+)$/) {
$query->{'-or'} = [
@@ -578,7 +581,7 @@ sub reports : Path('reports') {
} else {
$query->{'-or'} = [
'me.id' => $search_n,
- 'user.email' => { ilike => $like_search },
+ 'me.user_id' => { -in => \@user_ids },
'me.external_id' => { ilike => $like_search },
'me.name' => { ilike => $like_search },
'me.title' => { ilike => $like_search },
@@ -591,19 +594,17 @@ sub reports : Path('reports') {
my $problems = $c->cobrand->problems->search(
$query,
{
- prefetch => 'user',
+ rows => 50,
order_by => [ \"(state='hidden')", \$order ]
}
- );
+ )->page( $p_page );
- # we need to pass this in as an array as we can't
- # query the object in the template as the quoting
- # will have been turned off
$c->stash->{problems} = [ $problems->all ];
+ $c->stash->{problems_pager} = $problems->pager;
if (is_valid_email($search)) {
$query = [
- 'user.email' => { ilike => $like_search },
+ 'me.user_id' => { -in => \@user_ids },
];
} elsif ($search =~ /^id:(\d+)$/) {
$query = [
@@ -616,7 +617,7 @@ sub reports : Path('reports') {
$query = [
'me.id' => $search_n,
'problem.id' => $search_n,
- 'user.email' => { ilike => $like_search },
+ 'me.user_id' => { -in => \@user_ids },
'me.name' => { ilike => $like_search },
text => { ilike => $like_search },
'me.cobrand_data' => { ilike => $like_search },
@@ -631,24 +632,23 @@ sub reports : Path('reports') {
},
{
-select => [ 'me.*', qw/problem.bodies_str problem.state/ ],
- prefetch => [qw/user problem/],
+ prefetch => [qw/problem/],
+ rows => 50,
order_by => [ \"(me.state='hidden')", \"(problem.state='hidden')", 'me.created' ]
}
- );
+ )->page( $u_page );
$c->stash->{updates} = [ $updates->all ];
+ $c->stash->{updates_pager} = $updates->pager;
}
- # Switch quoting back off. See above for explanation of this.
- $c->model('DB')->schema->storage->sql_maker->quote_char( '' );
} else {
- my $page = $c->req->params->{p} || 1;
my $problems = $c->cobrand->problems->search(
$query,
- { order_by => $order }
- )->page( $page );
+ { order_by => $order, rows => 50 }
+ )->page( $p_page );
$c->stash->{problems} = [ $problems->all ];
- $c->stash->{pager} = $problems->pager;
+ $c->stash->{problems_pager} = $problems->pager;
}
$c->stash->{edit_body_contacts} = 1
diff --git a/templates/web/base/admin/list_updates.html b/templates/web/base/admin/list_updates.html
index 02845b0ee..b26db07c3 100644
--- a/templates/web/base/admin/list_updates.html
+++ b/templates/web/base/admin/list_updates.html
@@ -43,4 +43,7 @@
</tr>
[% END -%]
</table>
+
+[% INCLUDE 'pagination.html', admin = 1, param = 'u', pager = updates_pager %]
+
[% END %]
diff --git a/templates/web/base/admin/reports.html b/templates/web/base/admin/reports.html
index 7267dd11d..071c5f5a5 100644
--- a/templates/web/base/admin/reports.html
+++ b/templates/web/base/admin/reports.html
@@ -18,7 +18,7 @@
[% INCLUDE 'admin/problem_row.html' %]
</table>
-[% INCLUDE 'pagination.html', admin = 1, param = 'p' IF pager %]
+[% INCLUDE 'pagination.html', admin = 1, param = 'p', pager = problems_pager %]
[% ELSIF searched %]
diff --git a/templates/web/fixmystreet.com/static/council.html b/templates/web/fixmystreet.com/static/council.html
index 9609392f5..510d4bb20 100644
--- a/templates/web/fixmystreet.com/static/council.html
+++ b/templates/web/fixmystreet.com/static/council.html
@@ -96,8 +96,8 @@
<div class="fixed-container">
<div class="section-content">
<h2>Who's using FixMyStreet for councils?</h2>
- <p>Our UK client councils include <a href="http://fixmystreet.stevenage.gov.uk/">Stevenage</a>, <a href="http://fix.bromley.gov.uk/">Bromley</a>, <a href="http://barnet.fixmystreet.com/">Barnet</a>, <a href="http://fixmystreet.oxfordshire.gov.uk/">Oxfordshire</a>, <a href="http://hart.fixmystreet.com/">Hart</a>, and (soon to launch) East Sussex County Council and Warwickshire County Council.</p>
- <p>FixMyStreet for Councils is also in use outside the UK, in the city of Zurich, Switzerland.</p>
+ <p>Our UK client councils include <a href="http://fixmystreet.stevenage.gov.uk/">Stevenage</a>, <a href="http://fix.bromley.gov.uk/">Bromley</a>, <a href="http://barnet.fixmystreet.com/">Barnet</a>, <a href="http://fixmystreet.oxfordshire.gov.uk/">Oxfordshire</a>, <a href="http://hart.fixmystreet.com/">Hart</a>, <a href="http://eastsussex.fixmystreet.com/">East Sussex County Council</a>, and (soon to launch) Warwickshire County Council.</p>
+ <p>FixMyStreet for Councils is also in use outside the UK, in the city of <a href="https://www.zueriwieneu.ch/">Zurich</a>, Switzerland.</p>
<h3>Case studies</h3>
<p>For the insider view, and to understand the integration process, read these councils’ stories.</p>
<a href="https://www.mysociety.org/files/2014/03/FixMyStreet-for-Councils-Zurich-case-study.pdf" class="case-study-button">
@@ -116,7 +116,9 @@
--><a href="http://fixmystreet.stevenage.gov.uk/"><img src="[% start %][% version('/cobrands/fixmystreet/images/fms-for-councils/stevenage-logo.png') %]" alt="" /></a><!--
--><a href="http://hart.fixmystreet.com/"><img src="[% start %][% version('/cobrands/fixmystreet/images/fms-for-councils/hart-logo.png') %]" alt="" /></a><!--
--><a href="http://barnet.fixmystreet.com/"><img src="[% start %][% version('/cobrands/fixmystreet/images/fms-for-councils/barnet-logo.png') %]" alt="" /></a><!--
- --><a href="http://fixmystreet.oxfordshire.gov.uk/"><img src="[% start %][% version('/cobrands/fixmystreet/images/fms-for-councils/oxfordshire-logo.png') %]" alt="" /></a>
+ --><a href="http://fixmystreet.oxfordshire.gov.uk/"><img src="[% start %][% version('/cobrands/fixmystreet/images/fms-for-councils/oxfordshire-logo.png') %]" alt="" /></a><!--
+ --><a href="https://www.zueriwieneu.ch/"><img src="[% start %][% version('/cobrands/fixmystreet/images/fms-for-councils/zurich-logo.png') %]" alt="" /></a><!--
+ --><a href="http://eastsussex.fixmystreet.com/"><img src="[% start %][% version('/cobrands/fixmystreet/images/fms-for-councils/east-sussex-logo.png') %]" alt="" /></a>
</div>
</div>
@@ -129,8 +131,8 @@
<div class="section-content">
<h2>Beyond councils</h2>
<p>FixMyStreet is flexible software: it can be adapted for any use that relies on people pinpointing a location on a map. That might include crime reporting, bird spotting, or any other type of crowdsourced, map-based project.</p>
- <p>For example, Report Empty Homes (an award-winning website and iPhone app for Channel 4 and the Empty Homes Agency), or anti-social behaviour (<a href="http://www.safertravel.info/">See Something Say Something</a>, an iPhone and Android app for the West Midlands Safer Travel Partnership).
-</p>
+ <p>For example, <a href="http://collideosco.pe/">Collideoscope</a>, a project for collecting research data around cycling accidents, or <a href="http://www.safertravel.info/">See Something Say Something</a>, an iPhone and Android app for reporting anti-social behaviour, developed for the West Midlands Safer Travel Partnership.
+ </p>
<p>Tell us a new use for FixMyStreet for Councils, and we bet we can make it happen.</p>
</div>
</div>
@@ -226,7 +228,7 @@
<div class="pricing-extras-column--secondary">
<div class="pricing-extras-price">
<span class="pricing-label">One-off</span>
- <span class="pricing-price">£15,500<span class="asterisk">*</span></span>
+ <span class="pricing-price">from £2,250*</span>
</div>
</div>
</div>
diff --git a/templates/web/zurich/admin/reports.html b/templates/web/zurich/admin/reports.html
index 68f98c44a..7e425c8ec 100644
--- a/templates/web/zurich/admin/reports.html
+++ b/templates/web/zurich/admin/reports.html
@@ -19,7 +19,7 @@
[% INCLUDE 'admin/problem_row.html' %]
</table>
-[% INCLUDE 'pagination.html', admin = 1, param = 'p' IF pager %]
+[% INCLUDE 'pagination.html', admin = 1, param = 'p', pager = problems_pager %]
[% END %]
diff --git a/web/cobrands/fixmystreet/images/fms-for-councils/east-sussex-logo.png b/web/cobrands/fixmystreet/images/fms-for-councils/east-sussex-logo.png
new file mode 100644
index 000000000..e87c89668
--- /dev/null
+++ b/web/cobrands/fixmystreet/images/fms-for-councils/east-sussex-logo.png
Binary files differ
diff --git a/web/cobrands/fixmystreet/images/fms-for-councils/zurich-logo.png b/web/cobrands/fixmystreet/images/fms-for-councils/zurich-logo.png
new file mode 100644
index 000000000..2748caec3
--- /dev/null
+++ b/web/cobrands/fixmystreet/images/fms-for-councils/zurich-logo.png
Binary files differ