aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml13
-rwxr-xr-xVagrantfile2
-rwxr-xr-xbin/comment-backfill21
-rwxr-xr-xbin/cron-wrapper6
-rwxr-xr-xbin/emptyhomes/canonicalise-eha (renamed from bin/canonicalise-eha)0
-rwxr-xr-xbin/emptyhomes/make_welsh_po (renamed from bin/make_emptyhomes_welsh_po)12
-rwxr-xr-xbin/fetch-comments7
-rwxr-xr-xbin/fetch-comments-24hs10
-rw-r--r--bin/fiksgatami/export-norwegian-contacts (renamed from bin/export-norwegian-contacts)0
-rwxr-xr-xbin/fiksgatami/load-norwegian-contacts (renamed from bin/load-norwegian-contacts)0
-rwxr-xr-xbin/fixmystreet.com/canonicalise-csv (renamed from bin/canonicalise-csv)0
-rwxr-xr-xbin/fixmystreet.com/generate_council_location (renamed from bin/generate_council_location)0
-rwxr-xr-xbin/fixmystreet.com/import-categories (renamed from bin/import-categories)0
-rwxr-xr-xbin/fixmystreet.com/load-contacts (renamed from bin/load-contacts)0
-rwxr-xr-xbin/fixmystreet.com/populate_bing_cache (renamed from bin/populate_bing_cache)0
-rwxr-xr-xbin/fixmystreet.com/rotate-photos (renamed from bin/rotate-photos)0
-rwxr-xr-xbin/fixmystreet.com/showcouncilrates (renamed from bin/showcouncilrates)0
-rwxr-xr-xbin/fixmystreet.com/update-areas (renamed from bin/update-areas)0
-rwxr-xr-xbin/fixmystreet.com/update-send-questionnaire (renamed from bin/update-send-questionnaire)0
-rwxr-xr-xbin/geocode11
-rwxr-xr-xbin/gettext-nget-patch2
-rwxr-xr-xbin/handlemail3
-rwxr-xr-xbin/install-as-user8
-rwxr-xr-xbin/kasabi234
-rwxr-xr-xbin/make_css5
-rwxr-xr-xbin/make_css_watch9
-rwxr-xr-xbin/make_po4
-rwxr-xr-xbin/open311-populate-service-list8
-rwxr-xr-xbin/open311-update-reports10
-rwxr-xr-xbin/problem-creation-graph11
-rwxr-xr-xbin/problems-filed-graph11
-rwxr-xr-xbin/run-tests37
-rwxr-xr-xbin/send-alerts7
-rwxr-xr-xbin/send-comments7
-rwxr-xr-xbin/send-questionnaires7
-rwxr-xr-xbin/send-reports7
-rw-r--r--bin/site-specific-install.sh2
-rwxr-xr-xbin/test-wrapper35
-rwxr-xr-xbin/update-all-reports7
-rwxr-xr-xbin/update-schema18
-rwxr-xr-xbin/zerotb/import_clinic_list.pl (renamed from bin/zerotb_import_clinic_list.pl)0
-rwxr-xr-xbin/zurich/geocode45
-rwxr-xr-xbin/zurich/overdue-alert (renamed from bin/zurich-overdue-alert)9
-rw-r--r--conf/crontab-example24
-rwxr-xr-xconf/sysvinit.example2
-rw-r--r--cpanfile2
-rw-r--r--data/kasabi-requirements.txt2
-rwxr-xr-xperllib/CronFns.pm9
-rw-r--r--perllib/CrossSell.pm2
-rw-r--r--perllib/FixMyStreet/App.pm8
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm8
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMindelo.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/FixaMinGata.pm5
-rw-r--r--perllib/FixMyStreet/Cobrand/MakeMyIsland.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/SeeSomething.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/ZeroTB.pm2
-rw-r--r--perllib/FixMyStreet/DB/Result/Token.pm5
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm2
-rw-r--r--perllib/FixMyStreet/Geocode.pm2
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm2
-rw-r--r--perllib/FixMyStreet/Geocode/FixaMinGata.pm2
-rw-r--r--perllib/FixMyStreet/Geocode/Google.pm4
-rw-r--r--perllib/FixMyStreet/Geocode/OSM.pm2
-rw-r--r--perllib/FixMyStreet/Geocode/Zurich.pm2
-rw-r--r--perllib/FixMyStreet/Map.pm2
-rw-r--r--perllib/FixMyStreet/Map/Bing.pm2
-rw-r--r--perllib/FixMyStreet/Map/Bromley.pm2
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm2
-rw-r--r--perllib/FixMyStreet/Map/Google.pm2
-rw-r--r--perllib/FixMyStreet/Map/GoogleOL.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM/CycleMap.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM/MapQuest.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM/StreetView.pm2
-rw-r--r--perllib/FixMyStreet/Map/Zurich.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/London.pm1
-rw-r--r--perllib/FixMyStreet/TestAppProve.pm2
-rw-r--r--perllib/Geo/Coordinates/CH1903.pm2
-rw-r--r--perllib/PoChange.pm1
-rw-r--r--perllib/Utils.pm3
-rwxr-xr-xscript/fixmystreet_app_create.pl7
-rwxr-xr-xscript/fixmystreet_app_server.pl4
-rwxr-xr-xscript/fixmystreet_app_test.pl7
-rwxr-xr-xsetenv.pl13
-rw-r--r--t/app/controller/reports.t2
-rw-r--r--t/open311.t4
-rw-r--r--t/open311/getservicerequestupdates.t4
-rw-r--r--t/open311/populate-service-list.t4
-rw-r--r--t/utils.t4
-rw-r--r--templates/email/default/submit.txt15
-rw-r--r--templates/email/fixmystreet/submit-brent.txt (renamed from templates/email/default/submit-brent.txt)0
-rw-r--r--templates/email/fixmystreet/submit.txt43
-rw-r--r--templates/web/barnet/header.html2
-rw-r--r--templates/web/barnet/site-name.html1
-rw-r--r--templates/web/base/admin/config_page.html5
-rw-r--r--templates/web/base/admin/index.html2
-rw-r--r--templates/web/base/common_header_tags.html2
-rwxr-xr-xtemplates/web/base/faq/faq-en-gb.html26
-rw-r--r--templates/web/base/site-name.html1
-rwxr-xr-xtemplates/web/base/static/privacy.html2
-rw-r--r--templates/web/bromley/header.html2
-rw-r--r--templates/web/bromley/site-name.html1
-rw-r--r--templates/web/eastsussex/header.html.template2
-rw-r--r--templates/web/emptyhomes/header.html2
-rw-r--r--templates/web/emptyhomes/site-name.html1
-rw-r--r--templates/web/fiksgatami/header.html2
-rw-r--r--templates/web/fiksgatami/site-name.html1
-rw-r--r--templates/web/fixamingata/site-name.html1
-rw-r--r--templates/web/fixmindelo/site-name.html1
-rw-r--r--templates/web/fixmybarangay/header.html2
-rw-r--r--templates/web/fixmybarangay/site-name.html1
-rw-r--r--templates/web/fixmystreet/header.html2
-rw-r--r--templates/web/fixmystreet/header_logo.html2
-rw-r--r--templates/web/fixmystreet/header_opengraph.html2
-rw-r--r--templates/web/harrogate/header.html2
-rwxr-xr-xtemplates/web/harrogate/static/privacy.html2
-rw-r--r--templates/web/hart/header.html12
-rw-r--r--templates/web/makemyisland/header_logo.html2
-rw-r--r--templates/web/makemyisland/site-name.html1
-rw-r--r--templates/web/oxfordshire/header.html2
-rw-r--r--templates/web/seesomething/site-name.html1
-rw-r--r--templates/web/stevenage/header.html2
-rw-r--r--templates/web/stevenage/site-name.html1
-rw-r--r--templates/web/warwickshire/header.html2
-rw-r--r--templates/web/zerotb/site-name.html1
-rw-r--r--templates/web/zurich/header.html2
-rw-r--r--templates/web/zurich/site-name.html1
129 files changed, 333 insertions, 563 deletions
diff --git a/.travis.yml b/.travis.yml
index bad676933..2c80b3534 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,16 +25,9 @@ before_install:
install:
- .travis/install
before_script:
- - psql -c 'create database fms;' -U postgres
- - psql fms postgres < db/schema.sql
- - psql fms postgres < db/alert_types.sql
- - psql fms postgres < db/generate_secret.sql
- - >
- sed -r -e "s,(FMS_DB_USER:) 'fms',\\1 'postgres',"
- conf/general.yml-example > conf/general.yml
- - ./bin/cron-wrapper ./bin/make_po FixMyStreet-EmptyHomes
- - ./bin/cron-wrapper ./bin/make_emptyhomes_welsh_po
+ - ./bin/make_po FixMyStreet-EmptyHomes
+ - ./bin/emptyhomes/make_welsh_po
- commonlib/bin/gettext-makemo FixMyStreet
-script: "bin/cron-wrapper perl /usr/bin/prove -rl t"
+script: "bin/run-tests t"
after_script:
- .travis/after_script
diff --git a/Vagrantfile b/Vagrantfile
index 7cebebbf9..cc6832f9a 100755
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -38,7 +38,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
echo "****************"
echo "You can now ssh into your vagrant box: vagrant ssh"
echo "The website code is found in: ~/fixmystreet"
- echo "You can run the dev server with: bin/cron-wrapper script/fixmystreet_app_server.pl [-d] [-r] [--fork]"
+ echo "You can run the dev server with: script/fixmystreet_app_server.pl [-d] [-r] [--fork]"
EOS
# Create a private network, which allows host-only access to the machine
diff --git a/bin/comment-backfill b/bin/comment-backfill
deleted file mode 100755
index e296d7756..000000000
--- a/bin/comment-backfill
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env perl
-
-use strict;
-use warnings;
-require 5.8.0;
-use DateTime;
-
-use FixMyStreet::App;
-
-use Open311;
-use Open311::GetServiceRequestUpdates;
-
-my $start_time = DateTime->now->subtract( days => 1, hours => 1 );
-my $end_time = DateTime->now;
-
-my $updates = Open311::GetServiceRequestUpdates->new(
- start_date => $start_time,
- end_date => $end_time,
-);
-
-$updates->fetch;
diff --git a/bin/cron-wrapper b/bin/cron-wrapper
index 127fd8d8a..c75f0289b 100755
--- a/bin/cron-wrapper
+++ b/bin/cron-wrapper
@@ -1,8 +1,10 @@
#!/usr/bin/env perl
BEGIN { # set all the paths to the perl code
- use FindBin;
- require "$FindBin::Bin/../setenv.pl";
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
}
exec { $ARGV[0] } @ARGV or die $!;
diff --git a/bin/canonicalise-eha b/bin/emptyhomes/canonicalise-eha
index 1030982fa..1030982fa 100755
--- a/bin/canonicalise-eha
+++ b/bin/emptyhomes/canonicalise-eha
diff --git a/bin/make_emptyhomes_welsh_po b/bin/emptyhomes/make_welsh_po
index f4f6850d6..568ccdcde 100755
--- a/bin/make_emptyhomes_welsh_po
+++ b/bin/emptyhomes/make_welsh_po
@@ -1,15 +1,17 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+
use strict;
+use warnings;
# Given a translation of the Empty Homes version of the FixMyStreet .po file,
# fix it all up to go direct from FixMyStreet -> EH translation.
use POSIX;
use FindBin;
-use lib "$FindBin::Bin/../perllib";
+use lib "$FindBin::Bin/../../perllib";
use PoChange;
-chdir("$FindBin::Bin/../locale");
+chdir("$FindBin::Bin/../../locale");
# First read in translation and match up.
open(INPO, 'cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po') or die $!;
@@ -51,7 +53,7 @@ mkdir("cy_GB.UTF-8/LC_MESSAGES");
open(MAINPO, 'FixMyStreet.po') or die;
open(OUTPO, ">cy_GB.UTF-8/LC_MESSAGES/FixMyStreet-EmptyHomes.po") or die;
-print OUTPO "# AUTOMATICALLY GENERATED by make_emptyhomes_welsh_po, do not edit\n\n";
+print OUTPO "# AUTOMATICALLY GENERATED by make_welsh_po, do not edit\n\n";
my $buffer = "";
my $start = 0;
@@ -60,7 +62,7 @@ while(<MAINPO>) {
s/#, fuzzy/#/;
}
if (m/"Last-Translator: FULL NAME/) {
- $_ = '"Last-Translator: mysociety/bin/make_emptyhomes_po\\n"'."\n";
+ $_ = '"Last-Translator: mysociety/bin/emptyhomes/make_welsh_po\\n"'."\n";
}
if (m/"PO-Revision-Date: YEAR-MO-DA/) {
my $time = POSIX::strftime("%Y-%m-%d %H:%M%z", localtime(time()));
diff --git a/bin/fetch-comments b/bin/fetch-comments
index a276433e4..4eb9def14 100755
--- a/bin/fetch-comments
+++ b/bin/fetch-comments
@@ -8,6 +8,13 @@ use strict;
use warnings;
require 5.8.0;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use FixMyStreet::App;
use CronFns;
my ($verbose, $nomail) = CronFns::options();
diff --git a/bin/fetch-comments-24hs b/bin/fetch-comments-24hs
index 602383d40..27853bcc1 100755
--- a/bin/fetch-comments-24hs
+++ b/bin/fetch-comments-24hs
@@ -7,9 +7,17 @@
use strict;
use warnings;
+require 5.8.0;
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use DateTime;
use DateTime::Format::W3CDTF;
-require 5.8.0;
use FixMyStreet::App;
use CronFns;
diff --git a/bin/export-norwegian-contacts b/bin/fiksgatami/export-norwegian-contacts
index 0209c6512..0209c6512 100644
--- a/bin/export-norwegian-contacts
+++ b/bin/fiksgatami/export-norwegian-contacts
diff --git a/bin/load-norwegian-contacts b/bin/fiksgatami/load-norwegian-contacts
index b73778848..b73778848 100755
--- a/bin/load-norwegian-contacts
+++ b/bin/fiksgatami/load-norwegian-contacts
diff --git a/bin/canonicalise-csv b/bin/fixmystreet.com/canonicalise-csv
index c0a7fc60b..c0a7fc60b 100755
--- a/bin/canonicalise-csv
+++ b/bin/fixmystreet.com/canonicalise-csv
diff --git a/bin/generate_council_location b/bin/fixmystreet.com/generate_council_location
index c7aea8074..c7aea8074 100755
--- a/bin/generate_council_location
+++ b/bin/fixmystreet.com/generate_council_location
diff --git a/bin/import-categories b/bin/fixmystreet.com/import-categories
index e9008b93f..e9008b93f 100755
--- a/bin/import-categories
+++ b/bin/fixmystreet.com/import-categories
diff --git a/bin/load-contacts b/bin/fixmystreet.com/load-contacts
index b18699db1..b18699db1 100755
--- a/bin/load-contacts
+++ b/bin/fixmystreet.com/load-contacts
diff --git a/bin/populate_bing_cache b/bin/fixmystreet.com/populate_bing_cache
index 17c8911d0..17c8911d0 100755
--- a/bin/populate_bing_cache
+++ b/bin/fixmystreet.com/populate_bing_cache
diff --git a/bin/rotate-photos b/bin/fixmystreet.com/rotate-photos
index 7b8109d65..7b8109d65 100755
--- a/bin/rotate-photos
+++ b/bin/fixmystreet.com/rotate-photos
diff --git a/bin/showcouncilrates b/bin/fixmystreet.com/showcouncilrates
index 1dacae597..1dacae597 100755
--- a/bin/showcouncilrates
+++ b/bin/fixmystreet.com/showcouncilrates
diff --git a/bin/update-areas b/bin/fixmystreet.com/update-areas
index a8cc01769..a8cc01769 100755
--- a/bin/update-areas
+++ b/bin/fixmystreet.com/update-areas
diff --git a/bin/update-send-questionnaire b/bin/fixmystreet.com/update-send-questionnaire
index 7a231b919..7a231b919 100755
--- a/bin/update-send-questionnaire
+++ b/bin/fixmystreet.com/update-send-questionnaire
diff --git a/bin/geocode b/bin/geocode
index 254cf1578..2559f7a3c 100755
--- a/bin/geocode
+++ b/bin/geocode
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
=head1 NAME
@@ -6,8 +6,6 @@ geocode - commandline tool to test geocoders
=head1 SYNOPSIS
- $ eval `perl setenv.pl`, or call with bin/cron-wrapper
-
$ bin/geocode --geocoder=Bing --cobrand=bromley "Glebe Rd"
# ... if your conf/general.yml supplies GEOCODER:
@@ -24,6 +22,13 @@ use strict;
use warnings;
require 5.8.0;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use Data::Dumper;
use Pod::Usage;
use feature 'say';
diff --git a/bin/gettext-nget-patch b/bin/gettext-nget-patch
index 5ebd8bbcb..92b687552 100755
--- a/bin/gettext-nget-patch
+++ b/bin/gettext-nget-patch
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
# xgettext doesn't deal with TT files, but xgettext.pl doesn't find nget()s, sigh.
# This will find the nget()s and output a .po file excerpt.
diff --git a/bin/handlemail b/bin/handlemail
index 8bc016241..5d4ac753c 100755
--- a/bin/handlemail
+++ b/bin/handlemail
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
#
# handlemail:
# Handle an individual incoming mail message.
@@ -14,6 +14,7 @@
my $rcsid = ''; $rcsid .= '$Id: handlemail,v 1.2 2009-02-11 11:04:48 matthew Exp $';
use strict;
+use warnings;
require 5.8.0;
# Horrible boilerplate to set up appropriate library paths.
diff --git a/bin/install-as-user b/bin/install-as-user
index ef97a41b3..0e1c151fb 100755
--- a/bin/install-as-user
+++ b/bin/install-as-user
@@ -127,15 +127,15 @@ then
psql -U "$UNIX_USER" "$DB_NAME" < "$REPOSITORY"/db/alert_types.sql
psql -U "$UNIX_USER" "$DB_NAME" < "$REPOSITORY"/db/generate_secret.sql
else
- bin/cron-wrapper update-schema --commit
+ bin/update-schema --commit
fi
echo $DONE_MSG
# Generate po and mo files (these invocations taken from Kagee's script):
echo "Creating locale .mo files"
-bin/cron-wrapper bin/make_po FixMyStreet-EmptyHomes
-bin/cron-wrapper bin/make_emptyhomes_welsh_po
+bin/make_po FixMyStreet-EmptyHomes
+bin/emptyhomes/make_welsh_po
commonlib/bin/gettext-makemo FixMyStreet
echo $DONE_MSG
-bin/cron-wrapper update-all-reports
+bin/update-all-reports
diff --git a/bin/kasabi b/bin/kasabi
deleted file mode 100755
index 456b2f4d1..000000000
--- a/bin/kasabi
+++ /dev/null
@@ -1,234 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import datetime
-import json
-import os.path
-import re
-import urllib
-import yaml
-
-import pytassium
-import psycopg2
-import psycopg2.extras
-from rdfchangesets import BatchChangeSet
-from rdflib.namespace import XSD
-
-# Set up data access
-config = yaml.load(open(os.path.abspath(os.path.join(os.path.dirname(__file__), '../conf/general.yml'))))
-dataset = pytassium.Dataset('fixmystreet', config['KASABI_API_KEY'])
-db = psycopg2.connect( "host='{host}' dbname='{name}' user='{user}' password='{password}'".format(
- host=config['FMS_DB_HOST'],
- name=config['FMS_DB_NAME'],
- user=config['FMS_DB_USER'],
- password=config['FMS_DB_PASS']
-))
-cursor = db.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
-report_cursor = db.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
-
-def main():
-
- # Check the status of our dataset
- response, status = dataset.status()
- if response.status not in range(200, 300) or status['storageMode'] == 'read-only':
- # We can't import anything, so let's not bother
- sys.exit()
-
- # Fetch reports that have changed since last update in dataset
- response, data = dataset.select('select (max(?lastupdate) as ?max) where { ?report <http://data.kasabi.com/dataset/fixmystreet/def/lastUpdate> ?lastupdate }')
- max_lastUpdate = data[1][0]['max']
- query = """
- SELECT id, latitude, longitude, used_map, council,
- category, title, detail, (photo IS NOT NULL) as photo,
- confirmed, lastupdate, whensent, state
- FROM problem
- WHERE state not in ('unconfirmed', 'partial')
- """
- if len(sys.argv) > 1 and sys.argv[1].isdigit():
- cursor.execute("%s AND id=%%s" % query, (sys.argv[1],))
- else:
- cursor.execute("%s AND lastupdate > %%s ORDER BY lastupdate" % query, (str(max_lastUpdate),))
-
- for report in cursor:
- changeset = FixMyStreetChangeSet(dataset)
- if report['state'] == 'hidden':
- # If the report has been hidden, just remove it
- changeset.remove_report(report)
- else:
-
- # Canonicalise some values
- report['latitude'] = round(report['latitude'], 6) # <10cm
- report['longitude'] = round(report['longitude'], 6)
- report['title'] = tidy_string(report['title'])
- report['detail'] = tidy_string(report['detail'])
- report['confirmed'] = report['confirmed'].replace(microsecond=0).isoformat() # Don't want microseconds
- report['lastupdate'] = report['lastupdate'].replace(microsecond=0).isoformat()
- report['council'] = sorted(re.sub('\|.*', '', report['council'] or '').split(',')) # Remove missing councils
-
- # Fetch updates to note state changes
- states = [ { 'state': 'confirmed', 'time': report['confirmed'] } ]
- report_cursor.execute("""
- SELECT id, mark_fixed, mark_open, problem_state, confirmed
- FROM comment
- WHERE problem_id=%s AND state='confirmed'
- ORDER BY created
- """, (report['id'], ))
- for update in report_cursor:
- t = update['confirmed'].replace(microsecond=0).isoformat()
- if update['problem_state']:
- states.append( { 'state': update['problem_state'], 'time': t } )
- elif update['mark_fixed']:
- states.append( { 'state': 'fixed - user', 'time': t } )
- elif update['mark_open']:
- states.append( { 'state': 'confirmed', 'time': t } )
-
- # Remove and then re-add the report
- changeset.remove_report(report)
- changeset.add_report(report, states)
- changeset.apply()
-
-# Escape double quotes and backslashes, remove carriage returns
-def tidy_string(s):
- return s.replace('\r', '').replace('\\', '\\\\').replace('"', r'\"')
-
-class FixMyStreetChangeSet(object):
- """Something that hosts either or both of a BatchChangeSet and a Turtle
- string for sending to Kasabi. Changes are done by removing all triples
- and then readding the report."""
- _changeset = None
- data = ''
-
- def __init__(self, dataset):
- self.dataset = dataset
-
- def __str__(self):
- return unicode(self).encode('utf-8')
-
- def __unicode__(self):
- g = self.changeset.getGraph()
- data = g.serialize(format='xml')
- return "Changeset:\n" + data + "\nNew data:\n" + self.data
-
- @property
- def changeset(self):
- if not self._changeset:
- self._changeset = BatchChangeSet()
- self._changeset.setChangeReason("Report updates")
- self._changeset.setCreatorName("FixMyStreet")
- return self._changeset
-
- def apply(self):
- if len(self.changeset.changesets):
- #response, data = self.dataset.apply_changeset(self.changeset)
- # XXX Do everything the above call does, but additionally escape carriage returns to prevent 409 error
- api = self.dataset.get_api('update')
- g = self.changeset.getGraph()
- data = g.serialize(format='xml')
- data = data.replace('\r', '&#13;')
- response, data = api.client.request(api.uri, "POST", body=data, headers={"accept" : "*/*", 'content-type':'application/vnd.talis.changeset+xml', 'X_KASABI_APIKEY':api.apikey})
- if response.status not in range(200, 300):
- print 'Error:', response.status, response.reason, data
- if self.data:
- response, data = self.dataset.store_data(self.data, media_type='text/turtle')
- if response.status not in range(200, 300):
- print 'Error:', response.status, response.reason, data
-
- def remove_report(self, report):
- uri = 'http://data.kasabi.com/dataset/fixmystreet/report/{id}'.format(**report)
- response, data = self.dataset.select('select ?p ?o where {{ <{0}> ?p ?o }}'.format(uri))
- for row in data[1]:
- # Need to set the datatype correctly for the lastUpdate
- if str(row['p']) == 'http://data.kasabi.com/dataset/fixmystreet/def/lastUpdate':
- row['o'].datatype = XSD.dateTime
- # Delete the referenced statuses
- if re.match('http://data.kasabi.com/dataset/fixmystreet/report/\d+/status/\d+$', unicode(row['o'])):
- uri2 = unicode(row['o'])
- response2, data2 = self.dataset.select('select ?p ?o where {{ <{0}> ?p ?o }}'.format(uri2))
- for row2 in data2[1]:
- self.changeset.remove(uri2, row2['p'], row2['o'])
- self.changeset.remove(uri, row['p'], row['o'])
-
- def add_report(self, report, states):
- # Work out the update states
- c = 0
- state_data = { 'refs': '', 'objs': '' }
- for state in states:
- state_data['refs'] += ' ; fixmystreet:status <http://data.kasabi.com/dataset/fixmystreet/report/{id}/status/{c}>\n'.format(id=report['id'], c=c)
- obj = re.sub('[ -]', '', ' '.join(x.capitalize() for x in state['state'].split()))
- if obj == 'Confirmed': obj = 'Open'
- state_data['objs'] += """<http://data.kasabi.com/dataset/fixmystreet/report/{id}/status/{c}> a fixmystreet:{state}Status
- ; event:time <http://reference.data.gov.uk/id/gregorian-instant/{time}>
- .
-""".format( id=report['id'], c=c, state=obj, time=state['time'] )
- # ; rdfs:label
- c += 1
-
- # Get info for the councils
- council_data = { 'sentTo': '', 'areaNames': [] }
- for council in report['council']:
- if not council: continue
- js = json.load(urllib.urlopen('http://mapit.mysociety.org/area/{0}'.format(council)))
- os_id = int(js['codes']['unit_id']) + 7000000000000000
- if report['whensent']:
- council_data['sentTo'] += ' ; fixmystreet:sentTo <http://data.ordnancesurvey.co.uk/id/{os_id}>\n'.format(os_id=os_id)
- council_data['areaNames'].append(js['name'])
- council_data.setdefault('firstCouncil', council)
- council_data['areaNames'] = ' / '.join(council_data['areaNames'])
- council_data.setdefault('firstCouncil', '0')
-
-# easting/northing
-
- self.data += '''
-@prefix fixmystreet: <http://data.kasabi.com/dataset/fixmystreet/def/> .
-@prefix dct: <http://purl.org/dc/terms/> .
-@prefix event: <http://purl.org/NET/c4dm/event.owl#> .
-@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix georss: <http://www.georss.org/georss/> .
-@prefix owl: <http://www.w3.org/2002/07/owl#> .
-
-<http://data.kasabi.com/dataset/fixmystreet/report/{id}> a fixmystreet:Report
- ; fixmystreet:location <http://data.kasabi.com/dataset/fixmystreet/location/geo/point/{latitude}/{longitude}>
- ; dct:description """{detail}"""
- ; dct:title "{title}"
-{photo_url}
-{state_data[refs]}
-{council_data[sentTo]}
- ; fixmystreet:category <http://data.kasabi.com/dataset/fixmystreet/category/{council_data[firstCouncil]}/{category_uri}>
- ; fixmystreet:lastUpdate "{lastupdate}"^^xsd:dateTime
- ; foaf:page <http://www.fixmystreet.com/report/{id}>
- .
-
-<http://data.kasabi.com/dataset/fixmystreet/location/geo/point/{latitude}/{longitude}> a fixmystreet:Location
- ; geo:lat "{latitude}"
- ; geo:long "{longitude}"
- ; georss:point "{latitude} {longitude}"
- .
-
-<http://data.kasabi.com/dataset/fixmystreet/location/geo/point/{latitude}/{longitude}>
- owl:sameAs <http://rdfize.com/geo/point/{latitude}/{longitude}>
- .
-{state_data[objs]}
-<http://data.kasabi.com/dataset/fixmystreet/category/{council_data[firstCouncil]}/{category_uri}> a skos:Concept
- ; skos:prefLabel "{category}"
- ; skos:altLabel "{category} in {council_data[areaNames]}"
- .
- '''.format(
- photo_url = ' ; foaf:depiction <http://www.fixmystreet.com/photo/{id}.jpeg>'.format(**report) if report['photo'] else '',
- state_data = state_data,
- council_data = council_data,
- category_uri = report['category'].lower().replace(' ', '-'),
- **report
- )
-
-# ; skos:broader <http://data.kasabi.com/dataset/fixmystreet/category/street-lights>
-
-# this category is the broadest highlevel street light category
-#<http://data.kasabi.com/dataset/fixmystreet/category/street-lights> a skos:Concept
-# ; skos:prefLabel "Street lights"
-# .
-
-main()
-
diff --git a/bin/make_css b/bin/make_css
index a8afafb27..3a1fca1a7 100755
--- a/bin/make_css
+++ b/bin/make_css
@@ -11,13 +11,14 @@
COMPASS=compass
SASS=sass
-PARENT=$(cd `dirname $0`/../.. && pwd)
+DIR=$(cd "$(dirname "$0")" && pwd -P)
+PARENT=$(cd "$DIR"/../.. && pwd)
if [ -f "$PARENT/gem-bin/compass" ]; then
COMPASS=$PARENT/gem-bin/compass
SASS=$PARENT/gem-bin/sass
fi
-DIRECTORY=$(cd `dirname $0`/../web && pwd)
+DIRECTORY=$(cd "$DIR"/../web && pwd)
DIRS=${@:-`find $DIRECTORY -name "*.scss" -exec dirname {} \; | uniq`}
diff --git a/bin/make_css_watch b/bin/make_css_watch
index 63a27a35e..2ae287429 100755
--- a/bin/make_css_watch
+++ b/bin/make_css_watch
@@ -1,7 +1,16 @@
#!/usr/bin/env perl
+
use strict;
use warnings;
use feature 'say';
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use Cwd qw(abs_path);
use File::ChangeNotify;
use File::Find::Rule;
diff --git a/bin/make_po b/bin/make_po
index ad1fc1a89..a5b145ecb 100755
--- a/bin/make_po
+++ b/bin/make_po
@@ -1,5 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+
use strict;
+use warnings;
# Generates a version of .po file, which is a translation
# into a language the same as English, with replacement as specified in PoChange
diff --git a/bin/open311-populate-service-list b/bin/open311-populate-service-list
index be1ace3b9..11f9005a5 100755
--- a/bin/open311-populate-service-list
+++ b/bin/open311-populate-service-list
@@ -2,6 +2,14 @@
use strict;
use warnings;
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use FixMyStreet::App;
use Open311::PopulateServiceList;
use Getopt::Long::Descriptive;
diff --git a/bin/open311-update-reports b/bin/open311-update-reports
index 3b77fef89..6a1c894d7 100755
--- a/bin/open311-update-reports
+++ b/bin/open311-update-reports
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
# This script utilises the standard Open311 way of getting updates on reports
# (by fetching all reports for a body and looking for updates). If possible,
@@ -8,6 +8,14 @@
use strict;
use warnings;
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use Open311::GetUpdates;
use FixMyStreet::App;
diff --git a/bin/problem-creation-graph b/bin/problem-creation-graph
index e1b6f2cc4..c3d10f934 100755
--- a/bin/problem-creation-graph
+++ b/bin/problem-creation-graph
@@ -10,13 +10,18 @@ use strict;
use warnings;
require 5.8.0;
-use FindBin;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ chdir "$d/..";
+ require "$d/../setenv.pl";
+}
+
use File::Temp qw(tempfile);
use FixMyStreet::App;
-chdir("$FindBin::Bin/../");
-
my %config = (
gplot_output => "set terminal png font 'Vera.ttf' 9 size 1200,400",
extension => '.png',
diff --git a/bin/problems-filed-graph b/bin/problems-filed-graph
index d3e132f8e..abfe0cf1a 100755
--- a/bin/problems-filed-graph
+++ b/bin/problems-filed-graph
@@ -10,13 +10,18 @@ use strict;
use warnings;
require 5.8.0;
-use FindBin;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ chdir "$d/..";
+ require "$d/../setenv.pl";
+}
+
use File::Temp qw(tempfile);
use FixMyStreet::App;
-chdir("$FindBin::Bin/../");
-
my %config = (
gplot_output => "set terminal png font 'Vera.ttf' 9 size 1200,600",
extension => '.png',
diff --git a/bin/run-tests b/bin/run-tests
new file mode 100755
index 000000000..612a13628
--- /dev/null
+++ b/bin/run-tests
@@ -0,0 +1,37 @@
+#!/usr/bin/env perl
+use strict; use warnings;
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
+use FixMyStreet::TestAppProve;
+
+=head1 NAME
+
+bin/run-tests - spin up a clean database and configuration for tests
+
+=head1 USAGE
+
+ bin/run-tests t/ # runs prove -r t/ (recursively, saving state)
+ bin/run-tests --state=failed # runs just failing tests
+ # delete .prove to reset
+
+ bin/run-tests t/foo.t # runs with prove -v (single test)
+
+By default we use conf/general.yml-example as the template, and spin up a fresh
+Postgres cluster and database. We can override this by doing:
+
+ bin/run-tests --config=general.mycobrand.yml
+ bin/run-tests --db-config=general.yml # e.g. use your current DB settings
+ bin/run-tests --all-config=general.yml # e.g. use your current DB settings
+
+(NB: passing --state=save automagically is experimental, and will be removed if
+it turns out to be annoying.)
+
+=cut
+
+FixMyStreet::TestAppProve->run(@ARGV);
diff --git a/bin/send-alerts b/bin/send-alerts
index 00c5426bc..94f7d5509 100755
--- a/bin/send-alerts
+++ b/bin/send-alerts
@@ -10,6 +10,13 @@ use strict;
use warnings;
require 5.8.0;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use CGI; # XXX
use CronFns;
diff --git a/bin/send-comments b/bin/send-comments
index 2192f674c..2d6b525b5 100755
--- a/bin/send-comments
+++ b/bin/send-comments
@@ -13,6 +13,13 @@ use strict;
use warnings;
require 5.8.0;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use Digest::MD5;
use Encode;
use CronFns;
diff --git a/bin/send-questionnaires b/bin/send-questionnaires
index 7ed3c87c2..93d58ed77 100755
--- a/bin/send-questionnaires
+++ b/bin/send-questionnaires
@@ -10,6 +10,13 @@ use strict;
use warnings;
require 5.8.0;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use CGI; # XXX Awkward kludge
use Encode;
use CronFns;
diff --git a/bin/send-reports b/bin/send-reports
index 16296dc5b..3c6f26cdb 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -10,6 +10,13 @@ use strict;
use warnings;
require 5.8.0;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use CGI; # XXX
use CronFns;
diff --git a/bin/site-specific-install.sh b/bin/site-specific-install.sh
index 3d01be469..de75d45ae 100644
--- a/bin/site-specific-install.sh
+++ b/bin/site-specific-install.sh
@@ -66,4 +66,4 @@ fi
echo Installation complete - you should now be able to view the site at:
echo http://$HOST/
echo Or you can run the tests by switching to the "'$UNIX_USER'" user and
-echo running: $REPOSITORY/bin/cron-wrapper prove -r t
+echo running: $REPOSITORY/bin/run-tests t
diff --git a/bin/test-wrapper b/bin/test-wrapper
deleted file mode 100755
index 9cb1791a1..000000000
--- a/bin/test-wrapper
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env perl
-use strict; use warnings;
-
-BEGIN {
- use FindBin;
- require "$FindBin::Bin/../setenv.pl";
-}
-
-use FixMyStreet::TestAppProve;
-
-=head1 NAME
-
-bin/test-wrapper - spin up a clean database and configuration for tests
-
-=head1 USAGE
-
- bin/test-wrapper t/ # runs prove -r t/ (recursively, saving state)
- bin/test-wrapper --state=failed # runs just failing tests
- # delete .prove to reset
-
- bin/test-wrapper t/foo.t # runs with prove -v (single test)
-
-By default we use conf/general.yml-example as the template, and spin up a fresh
-Postgres cluster and database. We can override this by doing:
-
- bin/test-wrapper --config=general.mycobrand.yml
- bin/test-wrapper --db-config=general.yml # e.g. use your current DB settings
- bin/test-wrapper --all-config=general.yml # e.g. use your current DB settings
-
-(NB: passing --state=save automagically is experimental, and will be removed if
-it turns out to be annoying.)
-
-=cut
-
-FixMyStreet::TestAppProve->run(@ARGV);
diff --git a/bin/update-all-reports b/bin/update-all-reports
index f4d6113cb..f6cd34210 100755
--- a/bin/update-all-reports
+++ b/bin/update-all-reports
@@ -10,6 +10,13 @@ use strict;
use warnings;
require 5.8.0;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use FixMyStreet::App;
use File::Path ();
use File::Slurp;
diff --git a/bin/update-schema b/bin/update-schema
index 30fc1396b..ce193f29c 100755
--- a/bin/update-schema
+++ b/bin/update-schema
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
=head1 NAME
@@ -31,9 +31,13 @@ backup of your database before running.
use strict;
use warnings;
-# Horrible boilerplate to set up appropriate library paths.
-use FindBin;
-use lib "$FindBin::Bin/../commonlib/perllib";
+my $bin_dir;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ $bin_dir = dirname(File::Spec->rel2abs($0));
+ require "$bin_dir/../setenv.pl";
+}
use mySociety::Config;
use mySociety::DBHandle qw(dbh);
@@ -41,7 +45,7 @@ use mySociety::MaPit;
use Getopt::Long;
use Pod::Usage;
-mySociety::Config::set_file("$FindBin::Bin/../conf/general");
+mySociety::Config::set_file("$bin_dir/../conf/general");
my %args = (
Name => mySociety::Config::get('FMS_DB_NAME'),
User => mySociety::Config::get('FMS_DB_USER'),
@@ -115,7 +119,7 @@ if ($upgrade) {
if ($version) {
die "Not currently implemented";
}
- for my $path (glob("$FindBin::Bin/../db/schema_*")) {
+ for my $path (glob("$bin_dir/../db/schema_*")) {
my ($name) = $path =~ /schema_(.*)\.sql$/;
next if $name le $current_version;
next if $name =~ /$current_version-/; # For number only match
@@ -146,7 +150,7 @@ if ($upgrade) {
if ($downgrade) {
my %downgrades;
- for my $path (glob("$FindBin::Bin/../db/downgrade_*")) {
+ for my $path (glob("$bin_dir/../db/downgrade_*")) {
my ($from, $to) = $path =~ /downgrade_(.*)---(.*)\.sql$/;
next unless $from eq $current_version;
$downgrades{$to} = $path;
diff --git a/bin/zerotb_import_clinic_list.pl b/bin/zerotb/import_clinic_list.pl
index 359a63925..359a63925 100755
--- a/bin/zerotb_import_clinic_list.pl
+++ b/bin/zerotb/import_clinic_list.pl
diff --git a/bin/zurich/geocode b/bin/zurich/geocode
deleted file mode 100755
index 9482b27e6..000000000
--- a/bin/zurich/geocode
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl
-
-=head1 NAME
-
-zurich/geocode - commandline tool to test the Zurich geocoder
-
-=head1 SYNOPSIS
-
- # Firstly:
- ## copy the GEOCODER config from a current Zurich conf to your conf/general.yml
- $ eval `perl setenv.pl`
-
- $ bin/zurich/geocode Magnus
-
- # ... output from geocoder
-
-This can be used to test the results of, e.g.
-
- https://www.zueriwieneu.ch/ajax/geocode?term=Magnus
-
-but without the caching which FixMyStreet applies, and passing on any 500
-errors from the server.
-
-=cut
-
-use strict;
-use warnings;
-require 5.8.0;
-
-
-use Data::Dumper;
-use feature 'say';
-
-use FixMyStreet;
-use FixMyStreet::App;
-use FixMyStreet::Geocode::Zurich;
-
-# TODO use FixMyStreet::override_config to get data from conf/general.yml.zurich if available
-my $geocoder = FixMyStreet->config('GEOCODER')
- or die "No GEOCODER config -- please copy appropriate Zurich conf to conf/general.yml";
-
-my $c = FixMyStreet::App->new();
-my $s = join ' ', @ARGV;
-
-say Dumper( FixMyStreet::Geocode::Zurich::string( $s, $c ) );
diff --git a/bin/zurich-overdue-alert b/bin/zurich/overdue-alert
index c09aef1e2..4a8fea830 100755
--- a/bin/zurich-overdue-alert
+++ b/bin/zurich/overdue-alert
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
-# zurich-overdue-alert:
+# zurich/overdue-alert:
# Send email alerts to administrators for overdue admin activities.
#
# Copyright (c) 2012 UK Citizens Online Democracy. All rights reserved.
@@ -10,6 +10,13 @@ use strict;
use warnings;
require 5.8.0;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use DateTime;
use CronFns;
use FixMyStreet::App;
diff --git a/conf/crontab-example b/conf/crontab-example
index a29a0de53..68197d7b1 100644
--- a/conf/crontab-example
+++ b/conf/crontab-example
@@ -11,24 +11,24 @@
PATH=/usr/local/bin:/usr/bin:/bin
# send-reports has three rows so that its 8am entry can be run with --verbose to send a morning summary of anything that's gone wrong
-5,10,15,20,25,30,35,40,45,50,55 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$FMS/send-reports.lock" "$FMS/bin/cron-wrapper send-reports" || echo "stalled?"
-0 0-7,9-23 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-reports.lock" "$FMS/bin/cron-wrapper send-reports" || echo "stalled?"
-0 8 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-reports.lock" "$FMS/bin/cron-wrapper send-reports --verbose" || echo "stalled?"
+5,10,15,20,25,30,35,40,45,50,55 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$FMS/send-reports.lock" "$FMS/bin/send-reports" || echo "stalled?"
+0 0-7,9-23 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-reports.lock" "$FMS/bin/send-reports" || echo "stalled?"
+0 8 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-reports.lock" "$FMS/bin/send-reports --verbose" || echo "stalled?"
-2 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-alerts.lock" "$FMS/bin/cron-wrapper send-alerts" || echo "stalled?"
-22,52 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-questionnaires.lock" "$FMS/bin/cron-wrapper send-questionnaires" || echo "stalled?"
+2 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-alerts.lock" "$FMS/bin/send-alerts" || echo "stalled?"
+22,52 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-questionnaires.lock" "$FMS/bin/send-questionnaires" || echo "stalled?"
# If you utilise Open311 and the updates extension, you will need to run these scripts
-#*/5 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-comments.lock" "$FMS/bin/cron-wrapper send-comments" || echo "stalled?"
-#*/5 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/fetch-comments.lock" "$FMS/bin/cron-wrapper fetch-comments" || echo "stalled?"
+#*/5 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/send-comments.lock" "$FMS/bin/send-comments" || echo "stalled?"
+#*/5 * * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/fetch-comments.lock" "$FMS/bin/fetch-comments" || echo "stalled?"
-47 0-7,9-23 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/open311-populate-service-list.lock" "$FMS/bin/cron-wrapper open311-populate-service-list" || echo "stalled?"
-47 8 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/open311-populate-service-list.lock" "$FMS/bin/cron-wrapper open311-populate-service-list --warn" || echo "stalled?"
+47 0-7,9-23 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/open311-populate-service-list.lock" "$FMS/bin/open311-populate-service-list" || echo "stalled?"
+47 8 * * * "$FMS/commonlib/bin/run-with-lockfile.sh" -n "$LOCK_DIR/open311-populate-service-list.lock" "$FMS/bin/open311-populate-service-list --warn" || echo "stalled?"
# Once an hour, update the all reports stats
-13 * * * * "$FMS/bin/cron-wrapper" update-all-reports
+13 * * * * "$FMS/bin/update-all-reports"
# Once a day on all servers
-39 2 * * * "$FMS/bin/cron-wrapper" problems-filed-graph
-43 2 * * * "$FMS/bin/cron-wrapper" problem-creation-graph
+39 2 * * * "$FMS/bin/problems-filed-graph"
+43 2 * * * "$FMS/bin/problem-creation-graph"
00 8 * * * "$FMS/bin/check-for-zombies" $UNIX_USER
diff --git a/conf/sysvinit.example b/conf/sysvinit.example
index 44424281b..9ad97e6ab 100755
--- a/conf/sysvinit.example
+++ b/conf/sysvinit.example
@@ -24,7 +24,7 @@ test -f $DAEMON || exit 0
set -e
start_daemon() {
- su -l -c "cd $SITE_HOME/fixmystreet && bin/cron-wrapper web/fixmystreet_app_fastcgi.cgi -d -l :9000 -n 2" $USER
+ su -l -c "cd $SITE_HOME/fixmystreet && web/fixmystreet_app_fastcgi.cgi -d -l :9000 -n 2" $USER
}
stop_daemon() {
diff --git a/cpanfile b/cpanfile
index cda6cc131..e6cb1d83d 100644
--- a/cpanfile
+++ b/cpanfile
@@ -110,7 +110,7 @@ requires 'File::ChangeNotify';
requires 'Path::Tiny';
requires 'File::Find::Rule';
-feature 'test-wrapper', 'Spin up a test database and config to run tests' => sub {
+feature 'run-tests', 'Spin up a test database and config to run tests' => sub {
requires 'Test::PostgreSQL';
};
diff --git a/data/kasabi-requirements.txt b/data/kasabi-requirements.txt
deleted file mode 100644
index 9b4397f00..000000000
--- a/data/kasabi-requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-psycopg2
-pytassium
diff --git a/perllib/CronFns.pm b/perllib/CronFns.pm
index ac7f85596..545526c8e 100755
--- a/perllib/CronFns.pm
+++ b/perllib/CronFns.pm
@@ -1,23 +1,14 @@
-#!/usr/bin/perl -w
-
# CronFns.pm:
# Shared functions for cron-run scripts
#
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
-#
-# $Id: CronFns.pm,v 1.1 2009-07-10 15:17:29 matthew Exp $
package CronFns;
use strict;
require 5.8.0;
-# Horrible boilerplate to set up appropriate library paths.
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
use mySociety::Locale;
sub options {
diff --git a/perllib/CrossSell.pm b/perllib/CrossSell.pm
index 0c621e9d0..9567c2b38 100644
--- a/perllib/CrossSell.pm
+++ b/perllib/CrossSell.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl -w
-#
# CrossSell.pm:
# Adverts from FixMyStreet to another site.
#
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index fd70ffda8..769a6bb8f 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -12,6 +12,7 @@ use Memcached;
use mySociety::Email;
use mySociety::Random qw(random_bytes);
use FixMyStreet::Map;
+use Utils;
use Path::Class;
use URI;
@@ -388,10 +389,9 @@ sub send_email_cron {
$sig = Encode::decode('utf8', $sig);
$params->{_parameters_}->{signature} = $sig;
- $tt->process( 'site_name.txt', $params, \$site_name );
- $site_name = Encode::decode('utf8', $site_name);
- my $site_title = $cobrand ? $cobrand->site_title : '';
- $params->{_parameters_}->{site_name} = $site_name || $site_title;
+ $tt->process( 'site-name.txt', $params, \$site_name );
+ $site_name = Utils::trim_text(Encode::decode('utf8', $site_name));
+ $params->{_parameters_}->{site_name} = $site_name;
$params->{_line_indent} = '';
my $email = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email($params) };
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index c20a6754a..88a49f6c9 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -112,9 +112,10 @@ sub load_problem_or_display_error : Private {
);
} elsif ( $problem->non_public ) {
if ( !$c->user || $c->user->id != $problem->user->id ) {
+ my $site_name = Utils::trim_text($c->render_fragment('site-name.html'));
$c->detach(
'/page_error_403_access_denied',
- [ sprintf(_('That report cannot be viewed on %s.'), $c->cobrand->site_title) ] #
+ [ sprintf(_('That report cannot be viewed on %s.'), $site_name) ] #
);
}
}
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 10ef30c90..352c47da8 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -74,7 +74,7 @@ sub index : Path : Args(0) {
if ($@) {
$c->stash->{message} = _("There was a problem showing the All Reports page. Please try again later.");
if ($c->config->{STAGING_SITE}) {
- $c->stash->{message} .= '</p><p>Perhaps the bin/update-all-reports script needs running. Use: bin/cron-wrapper bin/update-all-reports</p><p>'
+ $c->stash->{message} .= '</p><p>Perhaps the bin/update-all-reports script needs running. Use: bin/update-all-reports</p><p>'
. sprintf(_('The error was: %s'), $@);
}
$c->stash->{template} = 'errors/generic.html';
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index ec7a8a81d..7f1fba67a 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -146,14 +146,6 @@ Can be specified in template.
sub enter_postcode_text { }
-=head2 site_title
-
-The name of the site
-
-=cut
-
-sub site_title { return 'FixMyStreet'; }
-
=head2 set_lang_and_domain
my $set_lang = $cobrand->set_lang_and_domain( $lang, $unicode, $dir )
diff --git a/perllib/FixMyStreet/Cobrand/FixMindelo.pm b/perllib/FixMyStreet/Cobrand/FixMindelo.pm
index fd3a55c6c..59debf157 100644
--- a/perllib/FixMyStreet/Cobrand/FixMindelo.pm
+++ b/perllib/FixMyStreet/Cobrand/FixMindelo.pm
@@ -4,8 +4,6 @@ use base 'FixMyStreet::Cobrand::Default';
use strict;
use warnings;
-sub site_title { return 'FixMindelo'; }
-
sub country {
return 'CV';
}
diff --git a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
index 98c157aef..60f98dd47 100644
--- a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
+++ b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
@@ -9,11 +9,6 @@ use mySociety::MaPit;
use FixMyStreet::Geocode::FixaMinGata;
use DateTime;
-sub site_title {
- my ($self) = @_;
- return 'FixaMinGata';
-}
-
sub country {
return 'SE';
}
diff --git a/perllib/FixMyStreet/Cobrand/MakeMyIsland.pm b/perllib/FixMyStreet/Cobrand/MakeMyIsland.pm
index ebeb15fbb..f263df4cc 100644
--- a/perllib/FixMyStreet/Cobrand/MakeMyIsland.pm
+++ b/perllib/FixMyStreet/Cobrand/MakeMyIsland.pm
@@ -4,8 +4,6 @@ use base 'FixMyStreet::Cobrand::Default';
use strict;
use warnings;
-sub site_title { return 'MakeMyIsland'; }
-
sub country {
return 'MV';
}
diff --git a/perllib/FixMyStreet/Cobrand/SeeSomething.pm b/perllib/FixMyStreet/Cobrand/SeeSomething.pm
index 5e6d3a8cd..775ba770b 100644
--- a/perllib/FixMyStreet/Cobrand/SeeSomething.pm
+++ b/perllib/FixMyStreet/Cobrand/SeeSomething.pm
@@ -9,8 +9,6 @@ sub council_area { return 'West Midlands'; }
sub council_name { return 'See Something Say Something'; }
sub council_url { return 'seesomething'; }
sub area_types { [ 'MTD' ] }
-sub site_title { return 'See Something, Say Something'; }
-
sub site_restriction {
my $self = shift;
diff --git a/perllib/FixMyStreet/Cobrand/ZeroTB.pm b/perllib/FixMyStreet/Cobrand/ZeroTB.pm
index 087bf0912..cdf4e5ad4 100644
--- a/perllib/FixMyStreet/Cobrand/ZeroTB.pm
+++ b/perllib/FixMyStreet/Cobrand/ZeroTB.pm
@@ -4,8 +4,6 @@ use base 'FixMyStreet::Cobrand::Default';
use strict;
use warnings;
-sub site_title { return 'ZeroTB'; }
-
sub enter_postcode_text { return _ ('Enter a nearby street name and area, postal code or district in Delhi'); }
sub country {
diff --git a/perllib/FixMyStreet/DB/Result/Token.pm b/perllib/FixMyStreet/DB/Result/Token.pm
index 5525fe7a5..0156af137 100644
--- a/perllib/FixMyStreet/DB/Result/Token.pm
+++ b/perllib/FixMyStreet/DB/Result/Token.pm
@@ -30,9 +30,6 @@ __PACKAGE__->set_primary_key("scope", "token");
# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+LLZ8P5GXqPetuGyrra2vw
-# Trying not to use this
-# use mySociety::DBHandle qw(dbh);
-
use mySociety::AuthToken;
=head1 NAME
@@ -43,8 +40,6 @@ FixMyStreet::DB::Result::Token
Representation of mySociety::AuthToken in the DBIx::Class world.
-Mostly done so that we don't need to use mySociety::DBHandle.
-
The 'data' value is automatically inflated and deflated in the same way that the
AuthToken would do it. 'token' is set to a new random value by default and the
'created' timestamp is achieved using the database function
diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
index 646967bfc..63a91697d 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
@@ -92,8 +92,6 @@ sub send_questionnaires_period {
. $row->user->email . "\n"
if $params->{verbose};
- $h{site_name} = $cobrand->site_title();
-
my $result = FixMyStreet::App->send_email_cron(
{
_template_ => $template,
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm
index 2a318ea5a..b5be152a8 100644
--- a/perllib/FixMyStreet/Geocode.pm
+++ b/perllib/FixMyStreet/Geocode.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet::Geocode
# The geocoding functions for FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index 85eef3d0f..702e19814 100644
--- a/perllib/FixMyStreet/Geocode/Bing.pm
+++ b/perllib/FixMyStreet/Geocode/Bing.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet::Geocode::Bing
# Geocoding with Bing for FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Geocode/FixaMinGata.pm b/perllib/FixMyStreet/Geocode/FixaMinGata.pm
index 2db25f504..2ea92c422 100644
--- a/perllib/FixMyStreet/Geocode/FixaMinGata.pm
+++ b/perllib/FixMyStreet/Geocode/FixaMinGata.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Geocode::FixaMinGata
# OpenStreetmap forward and reverse geocoding for FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm
index fd65b89b1..11ff8ef80 100644
--- a/perllib/FixMyStreet/Geocode/Google.pm
+++ b/perllib/FixMyStreet/Geocode/Google.pm
@@ -1,6 +1,4 @@
-#!/usr/bin/perl
-#
-# FixMyStreet::Geocode
+# FixMyStreet::Geocode::Google
# The geocoding functions for FixMyStreet.
#
# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm
index fd14b0acc..919940f78 100644
--- a/perllib/FixMyStreet/Geocode/OSM.pm
+++ b/perllib/FixMyStreet/Geocode/OSM.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Geocode::OSM
# OpenStreetmap forward and reverse geocoding for FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm
index 84fd83fc7..1f0b4fc16 100644
--- a/perllib/FixMyStreet/Geocode/Zurich.pm
+++ b/perllib/FixMyStreet/Geocode/Zurich.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet::Geocode::Zurich
# Geocoding with Zurich web service.
#
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index f2dd0da6d..7d490fde3 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map
# Adding the ability to have different maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/Bing.pm b/perllib/FixMyStreet/Map/Bing.pm
index 676e70bf6..09c951a5f 100644
--- a/perllib/FixMyStreet/Map/Bing.pm
+++ b/perllib/FixMyStreet/Map/Bing.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::Bing
# Bing maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm
index 20821236f..fc8726b34 100644
--- a/perllib/FixMyStreet/Map/Bromley.pm
+++ b/perllib/FixMyStreet/Map/Bromley.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::Bromley
# Bromley have slightly different tiles, with trees etc.
#
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index 62849a157..96e265a4d 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::FMS
# Bing and OS StreetView maps on FixMyStreet, using OpenLayers.
#
diff --git a/perllib/FixMyStreet/Map/Google.pm b/perllib/FixMyStreet/Map/Google.pm
index 9deefc033..172d2d60e 100644
--- a/perllib/FixMyStreet/Map/Google.pm
+++ b/perllib/FixMyStreet/Map/Google.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::Google
# Google maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/GoogleOL.pm b/perllib/FixMyStreet/Map/GoogleOL.pm
index 64baf8d36..2dfb697e5 100644
--- a/perllib/FixMyStreet/Map/GoogleOL.pm
+++ b/perllib/FixMyStreet/Map/GoogleOL.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::GoogleOL
# Google maps on FixMyStreet, using OpenLayers.
#
diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm
index 82ddd293b..df2d16b82 100644
--- a/perllib/FixMyStreet/Map/OSM.pm
+++ b/perllib/FixMyStreet/Map/OSM.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::OSM
# OSM maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/OSM/CycleMap.pm b/perllib/FixMyStreet/Map/OSM/CycleMap.pm
index 71b86de8f..8f1de39d2 100644
--- a/perllib/FixMyStreet/Map/OSM/CycleMap.pm
+++ b/perllib/FixMyStreet/Map/OSM/CycleMap.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::OSM::CycleMap
# OSM CycleMap maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/OSM/MapQuest.pm b/perllib/FixMyStreet/Map/OSM/MapQuest.pm
index a7f1b334e..2c3cbaf00 100644
--- a/perllib/FixMyStreet/Map/OSM/MapQuest.pm
+++ b/perllib/FixMyStreet/Map/OSM/MapQuest.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::OSM::CycleMap
# OSM CycleMap maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/OSM/StreetView.pm b/perllib/FixMyStreet/Map/OSM/StreetView.pm
index 8fe4744a4..c70dd93aa 100644
--- a/perllib/FixMyStreet/Map/OSM/StreetView.pm
+++ b/perllib/FixMyStreet/Map/OSM/StreetView.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::OSM::StreetView
# OSM StreetView maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/Zurich.pm b/perllib/FixMyStreet/Map/Zurich.pm
index e09f8c90f..d667a4701 100644
--- a/perllib/FixMyStreet/Map/Zurich.pm
+++ b/perllib/FixMyStreet/Map/Zurich.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::Zurich
# Zurich have their own tileserver.
#
diff --git a/perllib/FixMyStreet/SendReport/London.pm b/perllib/FixMyStreet/SendReport/London.pm
index 2c48a091c..2a1ebc1c3 100644
--- a/perllib/FixMyStreet/SendReport/London.pm
+++ b/perllib/FixMyStreet/SendReport/London.pm
@@ -5,6 +5,7 @@ use Moose;
BEGIN { extends 'FixMyStreet::SendReport'; }
use Digest::MD5;
+use FindBin;
use LWP::UserAgent;
use LWP::Simple;
diff --git a/perllib/FixMyStreet/TestAppProve.pm b/perllib/FixMyStreet/TestAppProve.pm
index 4d8cdaccb..75e9fe0a4 100644
--- a/perllib/FixMyStreet/TestAppProve.pm
+++ b/perllib/FixMyStreet/TestAppProve.pm
@@ -14,7 +14,7 @@ FixMyStreet::TestAppProve - spin up a clean database and configuration for tests
=head1 USAGE
-see bin/test-wrapper for usage
+see bin/run-tests for usage
=cut
diff --git a/perllib/Geo/Coordinates/CH1903.pm b/perllib/Geo/Coordinates/CH1903.pm
index 612182152..6611af9f2 100644
--- a/perllib/Geo/Coordinates/CH1903.pm
+++ b/perllib/Geo/Coordinates/CH1903.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# Geo::Coordinates::CH1903
# Conversion between WGS84 and Swiss CH1903.
#
diff --git a/perllib/PoChange.pm b/perllib/PoChange.pm
index f26161889..1e00c1426 100644
--- a/perllib/PoChange.pm
+++ b/perllib/PoChange.pm
@@ -1,4 +1,3 @@
-#!/usr/bin/perl -w
use strict;
package PoChange;
diff --git a/perllib/Utils.pm b/perllib/Utils.pm
index 8f0ac1820..7f95d1f5a 100644
--- a/perllib/Utils.pm
+++ b/perllib/Utils.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# Utils.pm:
# Various generic utilities for FixMyStreet.
#
@@ -15,7 +13,6 @@ use strict;
use DateTime;
use Encode;
use File::Slurp qw();
-use mySociety::DBHandle qw(dbh);
use mySociety::GeoUtil;
use mySociety::Locale;
diff --git a/script/fixmystreet_app_create.pl b/script/fixmystreet_app_create.pl
index c0ec0c898..f43c4ab82 100755
--- a/script/fixmystreet_app_create.pl
+++ b/script/fixmystreet_app_create.pl
@@ -3,6 +3,13 @@
use strict;
use warnings;
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('FixMyStreet::App', 'Create');
diff --git a/script/fixmystreet_app_server.pl b/script/fixmystreet_app_server.pl
index 3778cf27d..aeb57f0d2 100755
--- a/script/fixmystreet_app_server.pl
+++ b/script/fixmystreet_app_server.pl
@@ -2,6 +2,10 @@
BEGIN {
$ENV{CATALYST_SCRIPT_GEN} = 40;
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
}
use Catalyst::ScriptRunner;
diff --git a/script/fixmystreet_app_test.pl b/script/fixmystreet_app_test.pl
index 4eefd06a4..6f2770730 100755
--- a/script/fixmystreet_app_test.pl
+++ b/script/fixmystreet_app_test.pl
@@ -1,5 +1,12 @@
#!/usr/bin/env perl
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('FixMyStreet::App', 'Test');
diff --git a/setenv.pl b/setenv.pl
index b0cf94a78..39dcc04b0 100755
--- a/setenv.pl
+++ b/setenv.pl
@@ -5,19 +5,18 @@ use warnings;
my $root;
-BEGIN { # add the local perllibs too
-
- # Can't use Path::Class here as we'd load the old debian one.
- $root = __FILE__ =~ m{^(.*)/(web|bin)/\.\..*$} ? $1 : `pwd`;
- chomp($root);
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ $root = dirname(File::Spec->rel2abs(__FILE__));
}
# Set the environment for the FixMyStreet project
-# Add the lib/perl5 in perl-external so that we can load local::lib from there
+# Add the lib/perl5 in local so that we can load local::lib from there
use lib "$root/local/lib/perl5";
-# Add the perl-external dirs properly using local::lib
+# Now add the local dir properly using local::lib
use local::lib "$root/local";
use lib "$root/commonlib/perllib";
diff --git a/t/app/controller/reports.t b/t/app/controller/reports.t
index 1b4fc3526..ecb43f447 100644
--- a/t/app/controller/reports.t
+++ b/t/app/controller/reports.t
@@ -85,7 +85,7 @@ $fife_problems[10]->update( {
});
# Run the cron script that makes the data for /reports so we don't get an error.
-system( "bin/cron-wrapper update-all-reports" );
+system( "bin/update-all-reports" );
# check that we can get the page
$mech->get_ok('/reports');
diff --git a/t/open311.t b/t/open311.t
index 0caacbffc..15bebe2fc 100644
--- a/t/open311.t
+++ b/t/open311.t
@@ -11,10 +11,6 @@ use HTTP::Response;
use DateTime;
use DateTime::Format::W3CDTF;
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
use_ok( 'Open311' );
my $o = Open311->new();
diff --git a/t/open311/getservicerequestupdates.t b/t/open311/getservicerequestupdates.t
index 00c25a83e..dac10d69b 100644
--- a/t/open311/getservicerequestupdates.t
+++ b/t/open311/getservicerequestupdates.t
@@ -5,10 +5,6 @@ use warnings;
use Test::More;
use CGI::Simple;
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
use_ok( 'Open311' );
use_ok( 'Open311::GetServiceRequestUpdates' );
diff --git a/t/open311/populate-service-list.t b/t/open311/populate-service-list.t
index d9d65945b..b343b206d 100644
--- a/t/open311/populate-service-list.t
+++ b/t/open311/populate-service-list.t
@@ -6,10 +6,6 @@ use Test::More;
use FixMyStreet::App;
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
use_ok( 'Open311::PopulateServiceList' );
use_ok( 'Open311' );
diff --git a/t/utils.t b/t/utils.t
index 8ff9266fd..29759cddc 100644
--- a/t/utils.t
+++ b/t/utils.t
@@ -4,10 +4,6 @@ use strict;
use warnings;
use Test::More;
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
use Utils;
my @truncate_tests = (
diff --git a/templates/email/default/submit.txt b/templates/email/default/submit.txt
index 315411fb4..0ab29e412 100644
--- a/templates/email/default/submit.txt
+++ b/templates/email/default/submit.txt
@@ -3,7 +3,7 @@ Subject: Problem Report: <?=$values['title']?>
Dear <?=$values['bodies_name']?>,
<?=$values['missing']?><?=$values['multiple']?>A user of
-FixMyStreet has submitted the following report
+<?=$values['site_name']?> has submitted the following report
of a local problem that they believe might require your attention.
<?=$values['fuzzy']?>, or to provide an update on the problem,
@@ -31,13 +31,6 @@ Replies to this email will go to the user who submitted the problem.
<?=$values['signature']?>
-This message was sent via FixMyStreet, a project of UKCOD, registered charity
-number 1076346. If there is a more appropriate email address for messages about
-<?=$values['category_footer']?>, please let us know by visiting <https://www.fixmystreet.com/contact>.
-This will help improve the service for local people. We
-also welcome any other feedback you may have.
-
-FixMyStreet is now available for full integration into council
-websites, making life easier for both you and your residents.
-Read more here: https://www.fixmystreet.com/council
-
+If there is a more appropriate email address for messages about
+<?=$values['category_footer']?>, please let us know. This will help improve the
+service for local people. We also welcome any other feedback you may have.
diff --git a/templates/email/default/submit-brent.txt b/templates/email/fixmystreet/submit-brent.txt
index 37adde4df..37adde4df 100644
--- a/templates/email/default/submit-brent.txt
+++ b/templates/email/fixmystreet/submit-brent.txt
diff --git a/templates/email/fixmystreet/submit.txt b/templates/email/fixmystreet/submit.txt
new file mode 100644
index 000000000..315411fb4
--- /dev/null
+++ b/templates/email/fixmystreet/submit.txt
@@ -0,0 +1,43 @@
+Subject: Problem Report: <?=$values['title']?>
+
+Dear <?=$values['bodies_name']?>,
+
+<?=$values['missing']?><?=$values['multiple']?>A user of
+FixMyStreet has submitted the following report
+of a local problem that they believe might require your attention.
+
+<?=$values['fuzzy']?>, or to provide an update on the problem,
+please visit the following link:
+
+ <?=$values['url']?>
+
+<?=$values['has_photo']?>----------
+
+Name: <?=$values['name']?>
+
+Email: <?=$values['email']?>
+
+<?=$values['phone_line']?><?=$values['category_line']?>Subject: <?=$values['title']?>
+
+Details: <?=$values['detail']?>
+
+<?=$values['easting_northing']?>Latitude: <?=$values['latitude']?>
+
+Longitude: <?=$values['longitude']?>
+
+<?=$values['closest_address']?>----------
+
+Replies to this email will go to the user who submitted the problem.
+
+<?=$values['signature']?>
+
+This message was sent via FixMyStreet, a project of UKCOD, registered charity
+number 1076346. If there is a more appropriate email address for messages about
+<?=$values['category_footer']?>, please let us know by visiting <https://www.fixmystreet.com/contact>.
+This will help improve the service for local people. We
+also welcome any other feedback you may have.
+
+FixMyStreet is now available for full integration into council
+websites, making life easier for both you and your residents.
+Read more here: https://www.fixmystreet.com/council
+
diff --git a/templates/web/barnet/header.html b/templates/web/barnet/header.html
index 7b296c208..0e9bbfa42 100644
--- a/templates/web/barnet/header.html
+++ b/templates/web/barnet/header.html
@@ -30,7 +30,7 @@
<script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% version('/cobrands/barnet/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = 'Barnet Council FixMyStreet' %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
<script src="[% version('/js/fancybox/jquery.fancybox-1.3.4.pack.js') %]" charset="utf-8"></script>
</head>
diff --git a/templates/web/barnet/site-name.html b/templates/web/barnet/site-name.html
new file mode 100644
index 000000000..78563bdf3
--- /dev/null
+++ b/templates/web/barnet/site-name.html
@@ -0,0 +1 @@
+Barnet Council FixMyStreet
diff --git a/templates/web/base/admin/config_page.html b/templates/web/base/admin/config_page.html
index 0b29590e4..211d41f31 100644
--- a/templates/web/base/admin/config_page.html
+++ b/templates/web/base/admin/config_page.html
@@ -39,7 +39,10 @@ running version <strong>[% git_version || 'unknown' %]</strong>.
[% INCLUDE with_cobrand value="ADMIN_BASE_URL" cob=c.cobrand.admin_base_url %]
[% INCLUDE subsection heading="Display" %]
-[% INCLUDE just_value value="Site title" conf = c.cobrand.site_title %]
+<tr>
+ <td>Site title</td>
+ <td colspan=2>[% PROCESS 'site-name.html' -%]</td>
+</tr>
[% allowed_conf = FOR k IN c.config.ALLOWED_COBRANDS %]
[% IF k.keys %][% k.items.join(':') %][% ELSE %][% k %][% END %]
[%- ',' IF NOT loop.last %]
diff --git a/templates/web/base/admin/index.html b/templates/web/base/admin/index.html
index 17f7bd22a..c9d2b8deb 100644
--- a/templates/web/base/admin/index.html
+++ b/templates/web/base/admin/index.html
@@ -1,7 +1,7 @@
[% INCLUDE 'admin/header.html' title=loc('Summary') -%]
<div class="fms-admin-info fms-admin-floated">
-This is the administration interface for [% c.cobrand.site_title %]. If you
+This is the administration interface for [% PROCESS 'site-name.html' -%]. If you
need any help or guidance, there is <a href="http://fixmystreet.org/">plenty of
online documentation</a>. The FixMyStreet Platform is
<a href="https://github.com/mysociety/fixmystreet">actively supported</a> by
diff --git a/templates/web/base/common_header_tags.html b/templates/web/base/common_header_tags.html
index 49b649eca..16098b7f5 100644
--- a/templates/web/base/common_header_tags.html
+++ b/templates/web/base/common_header_tags.html
@@ -42,5 +42,5 @@
<title>
[% "$title :: " | html IF title %]
- [% site_title || 'FixMyStreet' %]
+ [% PROCESS 'site-name.html' -%]
</title>
diff --git a/templates/web/base/faq/faq-en-gb.html b/templates/web/base/faq/faq-en-gb.html
index 55046ce4a..e1e07a8d7 100755
--- a/templates/web/base/faq/faq-en-gb.html
+++ b/templates/web/base/faq/faq-en-gb.html
@@ -5,7 +5,7 @@
<ul class="plain-list">
<li><strong>Frequently Asked Questions</strong></li>
<li><a href="/privacy">Privacy and cookies</a></li>
- <li><a href="/contact">Contact [% c.cobrand.site_title %]</a></li>
+ <li><a href="/contact">Contact [% PROCESS 'site-name.html' -%]</a></li>
</ul>
</aside>
</div>
@@ -15,15 +15,15 @@
<dl>
<dt>What is this site?</dt>
- <dd>[% c.cobrand.site_title %] is a site to help people report to their
+ <dd>[% PROCESS 'site-name.html' -%] is a site to help people report to their
local authority, view, or discuss local issues they&rsquo;ve found, by
simply locating them on a map.</dd>
- <dt>How do I get in touch with [% c.cobrand.site_title %]?</dt>
+ <dt>How do I get in touch with [% PROCESS 'site-name.html' -%]?</dt>
<dd>Here&rsquo;s our <a href="/contact">contact page</a>.</dd>
- <dt>What sort of problems should I report with [% c.cobrand.site_title %]?</dt>
- <dd>This depends upon the precise purpose of [% c.cobrand.site_title %];
+ <dt>What sort of problems should I report with [% PROCESS 'site-name.html' -%]?</dt>
+ <dd>This depends upon the precise purpose of [% PROCESS 'site-name.html' -%];
in the UK, FixMyStreet is primarily for reporting things which are
<strong>broken or dirty or damaged or dumped, and need fixing, cleaning
or clearing</strong>, such as:
@@ -38,8 +38,8 @@
</ul>
</dd>
- <dt>What isn&rsquo;t [% c.cobrand.site_title %] for?</dt>
- <dd>[% c.cobrand.site_title %] is not a way of getting in touch with your
+ <dt>What isn&rsquo;t [% PROCESS 'site-name.html' -%] for?</dt>
+ <dd>[% PROCESS 'site-name.html' -%] is not a way of getting in touch with your
authority for all issues &ndash; please use this site only for problems
such as the above. We often route problem reports via cleansing services or
highways and so using this site for other matters may result in a delay in
@@ -75,9 +75,9 @@
a registered charity, so if you want to make a contribution,
<a href="https://www.mysociety.org/donate/">please do</a>.</dd>
- <dt>Can I use [% c.cobrand.site_title %] on my mobile?</dt>
+ <dt>Can I use [% PROCESS 'site-name.html' -%] on my mobile?</dt>
<dd>
- <p>The [% c.cobrand.site_title %] website will already work on your mobile
+ <p>The [% PROCESS 'site-name.html' -%] website will already work on your mobile
phone, adapting to the size of your screen automatically.</p>
</dd>
</dl>
@@ -90,18 +90,18 @@
to find out where reports go at the moment. Also <a href="/contact">contact us</a>
to update the address or addresses we use.</dd>
- <dt>I&rsquo;m from an authority, can we have [% c.cobrand.site_title %]
+ <dt>I&rsquo;m from an authority, can we have [% PROCESS 'site-name.html' -%]
on our website?</dt>
<dd>Quite possibly &ndash; contact the people who run this site.</dd>
<dt>Do you remove silly or illegal content?</dt>
- <dd>[% c.cobrand.site_title %] is not responsible for the content and
+ <dd>[% PROCESS 'site-name.html' -%] is not responsible for the content and
accuracy of material submitted by its users. We reserve the right to
edit or remove any problems or updates which we consider to be
inappropriate upon being informed by a user of the site.</dd>
<dt>Why can&rsquo;t I zoom out more on the reporting map?</dt>
- <dd>We want to keep [% c.cobrand.site_title %] locally focused, so restrict
+ <dd>We want to keep [% PROCESS 'site-name.html' -%] locally focused, so restrict
the ability to move radically between areas. The map on Your Reports will
let you see all the reports you&rsquo;ve made, wherever they are. If
you&rsquo;re from the authority then the emailed version of the problem
@@ -111,7 +111,7 @@ to update the address or addresses we use.</dd>
<h2><a name="organisation"></a>Organisation Questions</h2>
<dl>
- <dt>Who built [% c.cobrand.site_title %]?</dt>
+ <dt>Who built [% PROCESS 'site-name.html' -%]?</dt>
<dd>This will depend upon the installation of the FixMyStreet Platform,
who should create their own <code>faq/</code> template in their cobrand
directory to replace this default one. The FixMyStreet Platform was
diff --git a/templates/web/base/site-name.html b/templates/web/base/site-name.html
new file mode 100644
index 000000000..4e9a24bb9
--- /dev/null
+++ b/templates/web/base/site-name.html
@@ -0,0 +1 @@
+FixMyStreet
diff --git a/templates/web/base/static/privacy.html b/templates/web/base/static/privacy.html
index 55d8531f4..36720207b 100755
--- a/templates/web/base/static/privacy.html
+++ b/templates/web/base/static/privacy.html
@@ -7,7 +7,7 @@
<ul class="plain-list">
<li><a href="/faq">Frequently Asked Questions</a></li>
<li><strong>Privacy and cookies</strong></li>
- <li><a href="/contact">Contact [% c.cobrand.site_title %]</a></li>
+ <li><a href="/contact">Contact [% PROCESS 'site-name.html' -%]</a></li>
</ul>
</aside>
</div>
diff --git a/templates/web/bromley/header.html b/templates/web/bromley/header.html
index 7d7e21a39..4f885f513 100644
--- a/templates/web/bromley/header.html
+++ b/templates/web/bromley/header.html
@@ -20,7 +20,7 @@
<script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% version('/cobrands/bromley/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = "London Borough of Bromley - Report a problem in Bromley&rsquo;s streets or parks" %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
<script type="text/javascript">
  var _gaq = _gaq || [];
diff --git a/templates/web/bromley/site-name.html b/templates/web/bromley/site-name.html
new file mode 100644
index 000000000..2ae8d10d4
--- /dev/null
+++ b/templates/web/bromley/site-name.html
@@ -0,0 +1 @@
+London Borough of Bromley - Report a problem in Bromley&rsquo;s streets or park
diff --git a/templates/web/eastsussex/header.html.template b/templates/web/eastsussex/header.html.template
index 04aedc188..1ca60f4b7 100644
--- a/templates/web/eastsussex/header.html.template
+++ b/templates/web/eastsussex/header.html.template
@@ -11,7 +11,7 @@
<![endif]-->
<script src="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = c.cobrand.site_title %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
<script src="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/report-form.js') %]"></script>
diff --git a/templates/web/emptyhomes/header.html b/templates/web/emptyhomes/header.html
index fea973468..de1ecec7b 100644
--- a/templates/web/emptyhomes/header.html
+++ b/templates/web/emptyhomes/header.html
@@ -9,7 +9,7 @@
<link rel="stylesheet" type="text/css" href="[% start %][% version('/css/core.css') %]">
<link rel="stylesheet" type="text/css" href="[% start %][% version('/cobrands/emptyhomes/css/css.css') %]">
- [% INCLUDE 'common_header_tags.html', site_title = loc('Report Empty Homes') %]
+ [% INCLUDE 'common_header_tags.html' %]
</head>
<body>
diff --git a/templates/web/emptyhomes/site-name.html b/templates/web/emptyhomes/site-name.html
new file mode 100644
index 000000000..7fd286328
--- /dev/null
+++ b/templates/web/emptyhomes/site-name.html
@@ -0,0 +1 @@
+[% loc('Report Empty Homes') %]
diff --git a/templates/web/fiksgatami/header.html b/templates/web/fiksgatami/header.html
index db3ba546e..3cdc093cb 100644
--- a/templates/web/fiksgatami/header.html
+++ b/templates/web/fiksgatami/header.html
@@ -24,7 +24,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/fixmystreet/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = 'FiksGataMi' %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
[% TRY %][% PROCESS 'header_extra.html' %][% CATCH file %][% END %]
diff --git a/templates/web/fiksgatami/site-name.html b/templates/web/fiksgatami/site-name.html
new file mode 100644
index 000000000..c6f8b5562
--- /dev/null
+++ b/templates/web/fiksgatami/site-name.html
@@ -0,0 +1 @@
+FiksGataMi
diff --git a/templates/web/fixamingata/site-name.html b/templates/web/fixamingata/site-name.html
new file mode 100644
index 000000000..022606e78
--- /dev/null
+++ b/templates/web/fixamingata/site-name.html
@@ -0,0 +1 @@
+FixaMinGata
diff --git a/templates/web/fixmindelo/site-name.html b/templates/web/fixmindelo/site-name.html
new file mode 100644
index 000000000..da8217a7b
--- /dev/null
+++ b/templates/web/fixmindelo/site-name.html
@@ -0,0 +1 @@
+FixMindelo
diff --git a/templates/web/fixmybarangay/header.html b/templates/web/fixmybarangay/header.html
index 06a8b71a1..18388649b 100644
--- a/templates/web/fixmybarangay/header.html
+++ b/templates/web/fixmybarangay/header.html
@@ -22,7 +22,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/fixmybarangay/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', site_title = 'FixMyBarangay', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
+ [% INCLUDE 'common_header_tags.html' js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
[% allow_creation = !c.cobrand.only_authed_can_create || (c.user && c.user.from_body); %]
diff --git a/templates/web/fixmybarangay/site-name.html b/templates/web/fixmybarangay/site-name.html
new file mode 100644
index 000000000..075d881b5
--- /dev/null
+++ b/templates/web/fixmybarangay/site-name.html
@@ -0,0 +1 @@
+FixMyBarangay
diff --git a/templates/web/fixmystreet/header.html b/templates/web/fixmystreet/header.html
index 3d69fbac6..a1c0ba38a 100644
--- a/templates/web/fixmystreet/header.html
+++ b/templates/web/fixmystreet/header.html
@@ -24,7 +24,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/fixmystreet/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = c.cobrand.site_title %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
[% IF c.req.uri.host == 'osm.fixmystreet.com' %]
diff --git a/templates/web/fixmystreet/header_logo.html b/templates/web/fixmystreet/header_logo.html
index e5e4aae60..6e4ad9e21 100644
--- a/templates/web/fixmystreet/header_logo.html
+++ b/templates/web/fixmystreet/header_logo.html
@@ -1 +1 @@
- <a href="/" id="site-logo">[% c.cobrand.site_title | html %]</a>
+ <a href="/" id="site-logo">[%- PROCESS 'site-name.html' -%]</a>
diff --git a/templates/web/fixmystreet/header_opengraph.html b/templates/web/fixmystreet/header_opengraph.html
index 45e7c246c..d0cd31261 100644
--- a/templates/web/fixmystreet/header_opengraph.html
+++ b/templates/web/fixmystreet/header_opengraph.html
@@ -1,6 +1,6 @@
<meta property="og:url" content="[% c.cobrand.base_url %][% c.req.uri.path %]">
<meta property="og:title" content="[% title || 'FixMyStreet' %]">
- <meta property="og:site_name" content="[% c.cobrand.site_title %]">
+ <meta property="og:site_name" content="[%- PROCESS 'site-name.html' -%]">
[% IF c.req.uri.path == '/' %]<meta property="og:description" content="Report, view, and discuss local street-related problems.">[% END %]
<meta property="og:type" content="website">
<meta property="og:image" content="[% c.cobrand.base_url %]/cobrands/fixmystreet/fms-og_image.png">
diff --git a/templates/web/harrogate/header.html b/templates/web/harrogate/header.html
index 3d69fbac6..a1c0ba38a 100644
--- a/templates/web/harrogate/header.html
+++ b/templates/web/harrogate/header.html
@@ -24,7 +24,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/fixmystreet/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = c.cobrand.site_title %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
[% IF c.req.uri.host == 'osm.fixmystreet.com' %]
diff --git a/templates/web/harrogate/static/privacy.html b/templates/web/harrogate/static/privacy.html
index 0107d0873..7f0f090e4 100755
--- a/templates/web/harrogate/static/privacy.html
+++ b/templates/web/harrogate/static/privacy.html
@@ -7,7 +7,7 @@
<ul class="plain-list">
<li><a href="/faq">Frequently Asked Questions</a></li>
<li><strong>Privacy and cookies</strong></li>
- <li><a href="/contact">Contact [% c.cobrand.site_title %]</a></li>
+ <li><a href="/contact">Contact [%- PROCESS 'site-name.html' -%]</a></li>
</ul>
</aside>
</div>
diff --git a/templates/web/hart/header.html b/templates/web/hart/header.html
index 882d382dd..dcc202b5a 100644
--- a/templates/web/hart/header.html
+++ b/templates/web/hart/header.html
@@ -11,15 +11,7 @@
<meta name="HandHeldFriendly" content="true">
<meta name="mobileoptimized" content="0">
- <meta property="og:url" content="[% c.cobrand.base_url %][% c.req.uri.path %]">
- <meta property="og:title" content="[% title || 'FixMyStreet' %]">
- <meta property="og:site_name" content="[% c.cobrand.site_title %]">
- [% IF c.req.uri.path == '/' %]<meta property="og:description" content="Report, view, and discuss local street-related problems.">[% END %]
- <meta property="og:type" content="website">
- <meta property="og:image" content="[% c.cobrand.base_url %]/cobrands/fixmystreet/fms-og_image.png">
- <meta property="og:image:type" content="image/png">
- <meta property="og:image:width" content="500">
- <meta property="og:image:height" content="500">
+ [% INCLUDE 'header_opengraph.html' %]
[% SET start = c.config.ADMIN_BASE_URL IF admin %]
@@ -33,7 +25,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/fixmystreet/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = c.cobrand.site_title %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
<script type="text/javascript">
$(function(){
diff --git a/templates/web/makemyisland/header_logo.html b/templates/web/makemyisland/header_logo.html
index cbe5c13fc..5d8b285dc 100644
--- a/templates/web/makemyisland/header_logo.html
+++ b/templates/web/makemyisland/header_logo.html
@@ -1,2 +1,2 @@
<a href="http://www.undp.org/" id="united-nations-dp-logo">UNDP</a>
- <a href="[% c.config.BASE_URL %]/" id="site-logo">[% c.cobrand.site_title | html %]</a>
+ <a href="[% c.config.BASE_URL %]/" id="site-logo">[% PROCESS 'site-name.html -%]</a>
diff --git a/templates/web/makemyisland/site-name.html b/templates/web/makemyisland/site-name.html
new file mode 100644
index 000000000..3eb903cd1
--- /dev/null
+++ b/templates/web/makemyisland/site-name.html
@@ -0,0 +1 @@
+MakeMyIsland
diff --git a/templates/web/oxfordshire/header.html b/templates/web/oxfordshire/header.html
index e287b0ec8..19bb23374 100644
--- a/templates/web/oxfordshire/header.html
+++ b/templates/web/oxfordshire/header.html
@@ -22,7 +22,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/oxfordshire/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = 'FixMyStreet' %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
[% INCLUDE 'tracking_code.html' %]
diff --git a/templates/web/seesomething/site-name.html b/templates/web/seesomething/site-name.html
new file mode 100644
index 000000000..7a3ceec89
--- /dev/null
+++ b/templates/web/seesomething/site-name.html
@@ -0,0 +1 @@
+See Something, Say Something
diff --git a/templates/web/stevenage/header.html b/templates/web/stevenage/header.html
index f53e12c6c..dbcc37866 100644
--- a/templates/web/stevenage/header.html
+++ b/templates/web/stevenage/header.html
@@ -20,7 +20,7 @@
<script src="[% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% version('/cobrands/fixmystreet/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = 'Stevenage: FixMyStreet' %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
</head>
diff --git a/templates/web/stevenage/site-name.html b/templates/web/stevenage/site-name.html
new file mode 100644
index 000000000..49b12501a
--- /dev/null
+++ b/templates/web/stevenage/site-name.html
@@ -0,0 +1 @@
+Stevenage: FixMyStreet
diff --git a/templates/web/warwickshire/header.html b/templates/web/warwickshire/header.html
index 00cb76799..1d52b5546 100644
--- a/templates/web/warwickshire/header.html
+++ b/templates/web/warwickshire/header.html
@@ -29,7 +29,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/' _ c.cobrand.moniker _ '/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = c.cobrand.site_title %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
</head>
diff --git a/templates/web/zerotb/site-name.html b/templates/web/zerotb/site-name.html
new file mode 100644
index 000000000..b2c01ff85
--- /dev/null
+++ b/templates/web/zerotb/site-name.html
@@ -0,0 +1 @@
+ZeroTB
diff --git a/templates/web/zurich/header.html b/templates/web/zurich/header.html
index 891c6f1d3..ae1b47712 100644
--- a/templates/web/zurich/header.html
+++ b/templates/web/zurich/header.html
@@ -24,7 +24,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/fixmystreet/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = 'Züri wie neu' %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
[% extra_js %]
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" charset="utf-8"></script>
diff --git a/templates/web/zurich/site-name.html b/templates/web/zurich/site-name.html
new file mode 100644
index 000000000..d8932b521
--- /dev/null
+++ b/templates/web/zurich/site-name.html
@@ -0,0 +1 @@
+Züri wie neu