diff options
46 files changed, 492 insertions, 285 deletions
@@ -13,12 +13,23 @@ already been reported and leave updates. Users can also subscribe to email or RSS alerts of problems in their area. It was created in 2007 by [mySociety](http://www.mysociety.org/) for reporting -problems to UK councils and has been copied around the world. The FixMyStreet -Platform is now at version 1.0. +problems to UK councils and has been copied around the world. The FixMyStreet +Platform is now at version 1.1.1. ## Releases -* v1.0 (24th October 2012) - Official launch of the FixMyStreet platform +* v1.1.1 (22nd February 2013) + - Hotfix to fix missed iPhone width bug +* v1.1 (22nd February 2013) + - Addition of bodies so that the organisations that reports are sent to can + cover multiple MapIt administrative areas, or multiple bodies can cover + one area, and other related scenarios + - Admin display improvements + - Internationalisation improvements, especially with text in JavaScript + - Various minor updates and fixes (e.g. a --debug option on send-reports, + and coping if MapIt has its debug switched on) +* v1.0 (24th October 2012) + - Official launch of the FixMyStreet platform ## Installation diff --git a/bin/install-as-user b/bin/install-as-user index 2e0816966..b9dfa3973 100755 --- a/bin/install-as-user +++ b/bin/install-as-user @@ -101,7 +101,7 @@ fi # Install the required Perl modules - this may take a very long time: -cd "$FMS_REPOSITORY" +cd "$REPOSITORY" bin/install_perl_modules # Generate po and mo files (these invocations taken from Kagee's script): diff --git a/bin/site-specific-install.sh b/bin/site-specific-install.sh index 6ebac7970..d0b3738f3 100644 --- a/bin/site-specific-install.sh +++ b/bin/site-specific-install.sh @@ -1,5 +1,8 @@ #!/bin/sh +# Set this to the version we want to check out +VERSION=v1.1.1 + PARENT_SCRIPT_URL=https://github.com/mysociety/commonlib/blob/master/bin/install-site.sh misuse() { @@ -25,6 +28,9 @@ misuse() { install_nginx +# Check out the current released version +su -l -c "cd '$REPOSITORY' && git checkout '$VERSION'" "$UNIX_USER" + install_website_packages su -l -c "touch '$DIRECTORY/admin-htpasswd'" "$UNIX_USER" diff --git a/bin/update-schema b/bin/update-schema new file mode 100644 index 000000000..f728f8c56 --- /dev/null +++ b/bin/update-schema @@ -0,0 +1,134 @@ +#!/usr/bin/perl +# +# This script should hopefully work out at what state the database is and, if +# the commit argument is provided, run the right schema files to bring it up to +# date. Let us know if it doesn't work; as with any upgrade script, do take a +# backup of your database before running. +# +# update-schema [--commit] + +use strict; +use warnings; + +# Horrible boilerplate to set up appropriate library paths. +use FindBin; +use lib "$FindBin::Bin/../commonlib/perllib"; + +use mySociety::Config; +use mySociety::DBHandle qw(dbh); +use mySociety::MaPit; + +mySociety::Config::set_file("$FindBin::Bin/../conf/general"); +mySociety::DBHandle::configure( + Name => mySociety::Config::get('FMS_DB_NAME'), + User => mySociety::Config::get('FMS_DB_USER'), + Password => mySociety::Config::get('FMS_DB_PASS'), + Host => mySociety::Config::get('FMS_DB_HOST', undef), + Port => mySociety::Config::get('FMS_DB_PORT', undef) +); + +my $commit = 0; +$commit = 1 if @ARGV && $ARGV[0] eq '--commit'; + +my $nothing = 1; +my $current_version = get_db_version(); +print "Current database version = $current_version\n"; +print "= Dry run =\n" unless $commit; + +for my $path (glob("$FindBin::Bin/../db/schema_*")) { + my ($name) = $path =~ /schema_(.*)\.sql$/; + next if $name le $current_version; + next if $name =~ /$current_version-/; # For number only match + print "* $name\n"; + $nothing = 0; + next unless $commit; + + open(FP, $path) or die $!; + my @statements; + my $s = ''; + my $in_function = 0; + while(<FP>) { + next if /^--/; # Ignore comments + $s .= $_; + # Functions may have semicolons within them + $in_function = 1 if /create function/i; + $in_function = 0 if /language 'plpgsql'/i; + if ($s =~ /;/ && !$in_function) { + push @statements, $s; + $s = ''; + } + } + close FP; + + foreach my $st (@statements) { + dbh()->do($st); + } +} + +if ( $commit && $current_version lt '0028' ) { + print "Bodies created, fetching names from mapit\n"; + my $area_ids = dbh()->selectcol_arrayref('SELECT area_id FROM body_areas'); + if ( @$area_ids ) { + my $areas = mySociety::MaPit::call('areas', $area_ids); + foreach (values %$areas) { + dbh()->do('UPDATE body SET name=? WHERE id=?', {}, $_->{name}, $_->{id}); + } + dbh()->do('COMMIT'); + } +} + +print "Nothing to do\n" if $nothing; + +# --- + +# By querying the database schema, we can see where we're currently at +# (assuming schema change files are never half-applied, which should be the case) +sub get_db_version { + return '0028' if table_exists('body'); + return '0027' if column_exists('problem', 'subcategory'); + return '0026' if column_exists('open311conf', 'send_extended_statuses'); + return '0025' if column_like('alert_type', "ref='new_problems'", 'item_where', 'duplicate'); + return '0024' if column_exists('contacts', 'non_public'); + return '0023' if column_exists('open311conf', 'can_be_devolved'); + return '0022' if column_exists('problem', 'interest_count'); + return '0021' if column_exists('problem', 'external_source'); + return '0020' if column_exists('open311conf', 'suppress_alerts'); + return '0019' if column_exists('users', 'title'); + return '0018' if column_exists('open311conf', 'comment_user_id'); + return '0017' if column_exists('open311conf', 'send_comments'); + return '0016' if column_exists('comment', 'send_fail_count'); + return '0015-add_send_method_used_column_to_problem' if column_exists('problem', 'send_method_used'); + return '0015-add_extra_to_comment' if column_exists('comment', 'extra'); + return '0014' if column_exists('problem', 'send_fail_count'); + return '0013-add_send_method_column_to_open311conf' if column_exists('open311conf', 'send_method'); + return '0013-add_external_id_to_comment' if column_exists('comment', 'external_id'); + return '0012' if column_exists('problem', 'geocode'); + return '0011' if column_exists('contacts', 'extra'); + return '0010' if table_exists('open311conf'); + return '0009-update_alerts_problem_state_queries' if column_like('alert_type', "ref='new_problems'", 'item_where', 'investigating'); + return '0009-add_extra_to_problem' if column_exists('problem', 'extra'); + return '0008' if 0; + return '0007' if column_exists('comment', 'problem_state'); + return '0006' if 0; + return '0005-add_council_user_flag' if column_exists('users', 'from_council'); + return '0005-add_abuse_flags_to_users_and_reports' if column_exists('problem', 'flagged'); + return '0000'; +} + +# Returns true if a table exists +sub table_exists { + my $table = shift; + return dbh()->selectrow_array('select count(*) from pg_tables where tablename = ?', {}, $table); +} + +# Returns true if a column of table exists +sub column_exists { + my ( $table, $column ) = @_; + return dbh()->selectrow_array('select count(*) from pg_class, pg_attribute WHERE pg_class.relname=? AND pg_attribute.attname=? AND pg_class.oid=pg_attribute.attrelid AND pg_attribute.attnum > 0', {}, $table, $column); +} + +# Returns true if a column of a row in a table contains some text +sub column_like { + my ( $table, $where, $column, $contents ) = @_; + return dbh()->selectrow_array("select count(*) from $table WHERE $where AND $column LIKE ?", {}, "%$contents%"); +} diff --git a/db/schema_0022-add_interest_count_to_problems.sql b/db/schema_0022-add_interest_count_to_problems.sql index 62092aa0a..4a4703ae1 100644 --- a/db/schema_0022-add_interest_count_to_problems.sql +++ b/db/schema_0022-add_interest_count_to_problems.sql @@ -1,6 +1,6 @@ begin; ALTER table problem - ADD COLUMN interest_count integer; + ADD COLUMN interest_count integer DEFAULT 0; commit; diff --git a/db/schema_0026-change_interest_count_default.sql b/db/schema_0026-change_interest_count_default.sql deleted file mode 100644 index 7c78f6fe8..000000000 --- a/db/schema_0026-change_interest_count_default.sql +++ /dev/null @@ -1,9 +0,0 @@ -BEGIN; - - ALTER TABLE problem - ALTER COLUMN interest_count SET DEFAULT 0; - - UPDATE problem SET interest_count = 0 - WHERE interest_count IS NULL; - -COMMIT; diff --git a/db/schema_0027-rename_open311conf.sql b/db/schema_0027-rename_open311conf.sql deleted file mode 100644 index cef020648..000000000 --- a/db/schema_0027-rename_open311conf.sql +++ /dev/null @@ -1,12 +0,0 @@ -begin; - -ALTER TABLE open311conf RENAME TO body; -ALTER INDEX open311conf_pkey RENAME TO body_pkey; -ALTER INDEX open311conf_area_id_key RENAME TO body_area_id_key; -ALTER TABLE body ALTER COLUMN endpoint DROP NOT NULL; -ALTER TABLE body DROP CONSTRAINT open311conf_comment_user_id_fkey; -ALTER TABLE body ADD CONSTRAINT body_comment_user_id_fkey - FOREIGN KEY (comment_user_id) REFERENCES users(id); -ALTER SEQUENCE open311conf_id_seq RENAME TO body_id_seq; - -commit; diff --git a/db/schema_0028-add-bodies.sql b/db/schema_0028-add-bodies.sql new file mode 100644 index 000000000..b56738cf3 --- /dev/null +++ b/db/schema_0028-add-bodies.sql @@ -0,0 +1,87 @@ +BEGIN; + +-- Remove unused function +drop function ms_current_date(); + +-- Rename open311conf to create the new body table +ALTER TABLE open311conf RENAME TO body; +ALTER INDEX open311conf_pkey RENAME TO body_pkey; +ALTER INDEX open311conf_area_id_key RENAME TO body_area_id_key; +ALTER TABLE body ALTER COLUMN endpoint DROP NOT NULL; +ALTER TABLE body DROP CONSTRAINT open311conf_comment_user_id_fkey; +ALTER TABLE body ADD CONSTRAINT body_comment_user_id_fkey + FOREIGN KEY (comment_user_id) REFERENCES users(id); +ALTER SEQUENCE open311conf_id_seq RENAME TO body_id_seq; + +-- Update contacts column to be better named +ALTER TABLE contacts RENAME area_id TO body_id; +ALTER TABLE contacts_history RENAME area_id TO body_id; +ALTER INDEX contacts_area_id_category_idx RENAME TO contacts_body_id_category_idx; + +-- Data migration from contacts +UPDATE body SET id = area_id; +INSERT INTO body (id, area_id) + SELECT DISTINCT body_id, body_id FROM contacts WHERE body_id not in (SELECT id FROM body); +SELECT setval('body_id_seq', (SELECT MAX(id) FROM body) ); + +ALTER TABLE contacts ADD CONSTRAINT contacts_body_id_fkey + FOREIGN KEY (body_id) REFERENCES body(id); + +DROP TRIGGER contacts_update_trigger ON contacts; +DROP TRIGGER contacts_insert_trigger ON contacts; +DROP FUNCTION contacts_updated(); +create function contacts_updated() + returns trigger as ' + begin + insert into contacts_history (contact_id, body_id, category, email, editor, whenedited, note, confirmed, deleted) values (new.id, new.body_id, new.category, new.email, new.editor, new.whenedited, new.note, new.confirmed, new.deleted); + return new; + end; +' language 'plpgsql'; +create trigger contacts_update_trigger after update on contacts + for each row execute procedure contacts_updated(); +create trigger contacts_insert_trigger after insert on contacts + for each row execute procedure contacts_updated(); + +-- Give bodies a name +ALTER TABLE body ADD name text; +UPDATE body SET name=''; +ALTER table body ALTER COLUMN name SET NOT NULL; + +-- Update users column to be better named +ALTER TABLE users RENAME COLUMN from_council TO from_body; +ALTER TABLE users ADD CONSTRAINT users_from_body_fkey + FOREIGN KEY (from_body) REFERENCES body(id); + +-- Rename problem's council column +ALTER TABLE problem RENAME COLUMN council TO bodies_str; + +-- Update alert types that used 'council' column +UPDATE alert_type set item_where = 'problem.non_public = ''f'' and problem.state in +(''confirmed'', ''investigating'', ''planned'', ''in progress'', + ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', + ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', + ''internal referral'' ) AND +(bodies_str like ''%''||?||''%'' or bodies_str is null) and +areas like ''%,''||?||'',%''' WHERE ref = 'council_problems'; +UPDATE alert_type set item_where = 'problem.non_public = ''f'' and problem.state in +(''confirmed'', ''investigating'', ''planned'', ''in progress'', + ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', + ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', + ''internal referral'' ) AND +(bodies_str like ''%''||?||''%'' or bodies_str is null) and +areas like ''%,''||?||'',%''' WHERE ref = 'ward_problems'; + +-- Move to many-many relationship between bodies and areas +create table body_areas ( + body_id integer not null references body(id), + area_id integer not null +); +create unique index body_areas_body_id_area_id_idx on body_areas(body_id, area_id); +INSERT INTO body_areas (body_id, area_id) + SELECT id, area_id FROM body; +ALTER TABLE body DROP COLUMN area_id; + +-- Allow bodies to have a hierarchy +ALTER TABLE body ADD parent INTEGER REFERENCES body(id); + +COMMIT; diff --git a/db/schema_0028-rename_from_council.sql b/db/schema_0028-rename_from_council.sql deleted file mode 100644 index 027a257a4..000000000 --- a/db/schema_0028-rename_from_council.sql +++ /dev/null @@ -1,5 +0,0 @@ -begin; - -ALTER TABLE users RENAME COLUMN from_council TO from_body; - -commit; diff --git a/db/schema_0029-rename_contacts_area_id.sql b/db/schema_0029-rename_contacts_area_id.sql deleted file mode 100644 index 861ace5c5..000000000 --- a/db/schema_0029-rename_contacts_area_id.sql +++ /dev/null @@ -1,31 +0,0 @@ -begin; - -ALTER TABLE contacts RENAME area_id TO body_id; -ALTER TABLE contacts_history RENAME area_id TO body_id; -ALTER INDEX contacts_area_id_category_idx RENAME TO contacts_body_id_category_idx; - --- Data migration -UPDATE body SET id = area_id; -INSERT INTO body (id, area_id) - SELECT DISTINCT body_id, body_id FROM contacts WHERE body_id not in (SELECT id FROM body); -SELECT setval('body_id_seq', (SELECT MAX(id) FROM body) ); - -ALTER TABLE contacts ADD CONSTRAINT contacts_body_id_fkey - FOREIGN KEY (body_id) REFERENCES body(id); - -DROP TRIGGER contacts_update_trigger ON contacts; -DROP TRIGGER contacts_insert_trigger ON contacts; -DROP FUNCTION contacts_updated(); -create function contacts_updated() - returns trigger as ' - begin - insert into contacts_history (contact_id, body_id, category, email, editor, whenedited, note, confirmed, deleted) values (new.id, new.body_id, new.category, new.email, new.editor, new.whenedited, new.note, new.confirmed, new.deleted); - return new; - end; -' language 'plpgsql'; -create trigger contacts_update_trigger after update on contacts - for each row execute procedure contacts_updated(); -create trigger contacts_insert_trigger after insert on contacts - for each row execute procedure contacts_updated(); - -commit; diff --git a/db/schema_0030-add-body-name.sql b/db/schema_0030-add-body-name.sql deleted file mode 100644 index 30ac26e98..000000000 --- a/db/schema_0030-add-body-name.sql +++ /dev/null @@ -1,7 +0,0 @@ -begin; - -ALTER TABLE body ADD name text; -UPDATE body SET name=''; -ALTER table body ALTER COLUMN name SET NOT NULL; - -commit; diff --git a/db/schema_0031-rename-problem-council-column.sql b/db/schema_0031-rename-problem-council-column.sql deleted file mode 100644 index 87542a192..000000000 --- a/db/schema_0031-rename-problem-council-column.sql +++ /dev/null @@ -1,5 +0,0 @@ -begin; - -ALTER TABLE problem RENAME COLUMN council TO bodies_str; - -commit; diff --git a/db/schema_0032-add-from_body-reference.sql b/db/schema_0032-add-from_body-reference.sql deleted file mode 100644 index 4fa526963..000000000 --- a/db/schema_0032-add-from_body-reference.sql +++ /dev/null @@ -1,6 +0,0 @@ -begin; - -ALTER TABLE users ADD CONSTRAINT users_from_body_fkey - FOREIGN KEY (from_body) REFERENCES body(id); - -commit; diff --git a/db/schema_0033-body-areas-many-many.sql b/db/schema_0033-body-areas-many-many.sql deleted file mode 100644 index e03f3fa44..000000000 --- a/db/schema_0033-body-areas-many-many.sql +++ /dev/null @@ -1,15 +0,0 @@ -begin; - -create table body_areas ( - body_id integer not null references body(id), - area_id integer not null -); -create unique index body_areas_body_id_area_id_idx on body_areas(body_id, area_id); - -INSERT INTO body_areas (body_id, area_id) - SELECT id, area_id FROM body; - -ALTER TABLE body DROP COLUMN area_id; - -commit; - diff --git a/db/schema_0034-add-body-parent.sql b/db/schema_0034-add-body-parent.sql deleted file mode 100644 index 9360fbcb3..000000000 --- a/db/schema_0034-add-body-parent.sql +++ /dev/null @@ -1,5 +0,0 @@ -begin; - -ALTER TABLE body ADD parent INTEGER REFERENCES body(id); - -commit; diff --git a/db/schema_0035-update_alert_types_for_bodies.sql b/db/schema_0035-update_alert_types_for_bodies.sql deleted file mode 100644 index d7f1be475..000000000 --- a/db/schema_0035-update_alert_types_for_bodies.sql +++ /dev/null @@ -1,19 +0,0 @@ -BEGIN; - - UPDATE alert_type set item_where = 'problem.non_public = ''f'' and problem.state in - (''confirmed'', ''investigating'', ''planned'', ''in progress'', - ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', - ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', - ''internal referral'' ) AND - (bodies_str like ''%''||?||''%'' or bodies_str is null) and - areas like ''%,''||?||'',%''' WHERE ref = 'council_problems'; - - UPDATE alert_type set item_where = 'problem.non_public = ''f'' and problem.state in - (''confirmed'', ''investigating'', ''planned'', ''in progress'', - ''fixed'', ''fixed - council'', ''fixed - user'', ''closed'', - ''action scheduled'', ''not responsible'', ''duplicate'', ''unable to fix'', - ''internal referral'' ) AND - (bodies_str like ''%''||?||''%'' or bodies_str is null) and - areas like ''%,''||?||'',%''' WHERE ref = 'ward_problems'; - -COMMIT; diff --git a/locale/FixMyStreet.po b/locale/FixMyStreet.po index 420314244..495564477 100644 --- a/locale/FixMyStreet.po +++ b/locale/FixMyStreet.po @@ -53,10 +53,6 @@ msgstr "" msgid "%d questionnaires sent – %d answered (%s%%)" msgstr "" -#: templates/web/default/report/_support.html:3 -msgid "%d supporters" -msgstr "" - #: templates/web/default/pagination.html:10 msgid "%d to %d of %d" msgstr "" @@ -145,10 +141,6 @@ msgstr "" msgid "-- Pick a property type --" msgstr "" -#: templates/web/default/report/_support.html:3 -msgid "1 supporter" -msgstr "" - #: templates/web/default/questionnaire/completed.html:20 msgid "<p style=\"font-size:150%\">Thank you very much for filling in our questionnaire; glad to hear it’s been fixed.</p>" msgstr "" @@ -1291,7 +1283,7 @@ msgstr "" msgid "No result returned" msgstr "" -#: templates/web/default/report/_support.html:3 +#: templates/web/default/report/_support.html:2 templates/web/default/report/_support.html:4 msgid "No supporters" msgstr "" @@ -3109,6 +3101,13 @@ msgid_plural "%d hours" msgstr[0] "" msgstr[1] "" +#: templates/web/default/report/_support.html:6 +#, perl-format +msgid "%d supporter" +msgid_plural "%d supporters" +msgstr[0] "" +msgstr[1] "" + #: perllib/Utils.pm:284 #, perl-format msgid "%d minute" diff --git a/locale/cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po b/locale/cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po index 3b1f3b8d5..1f4b4ab5d 100644 --- a/locale/cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po +++ b/locale/cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po @@ -70,10 +70,6 @@ msgstr "Anfonwch ddiweddariadau ataf i drwy'r e-bost" msgid "%d questionnaires sent – %d answered (%s%%)" msgstr "" -#: templates/web/default/report/_support.html:3 -msgid "%d supporters" -msgstr "" - #: templates/web/default/pagination.html:10 msgid "%d to %d of %d" msgstr "" @@ -197,10 +193,6 @@ msgstr "-- Dewiswch fath o eiddo --" msgid "-- Pick a property type --" msgstr "-- Dewiswch fath o eiddo --" -#: templates/web/default/report/_support.html:3 -msgid "1 supporter" -msgstr "" - #: templates/web/default/questionnaire/completed.html:20 #, fuzzy msgid "" @@ -2087,7 +2079,8 @@ msgstr "Ni roddwyd gwybod eto am unrhyw eiddo gwag." msgid "No result returned" msgstr "" -#: templates/web/default/report/_support.html:3 +#: templates/web/default/report/_support.html:2 +#: templates/web/default/report/_support.html:4 msgid "No supporters" msgstr "" @@ -5033,6 +5026,13 @@ msgid_plural "%d hours" msgstr[0] "awr" msgstr[1] "awr" +#: templates/web/default/report/_support.html:6 +#, perl-format +msgid "%d supporter" +msgid_plural "%d supporters" +msgstr[0] "" +msgstr[1] "" + #: perllib/Utils.pm:284 #, fuzzy, perl-format msgid "%d minute" diff --git a/locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po b/locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po index 55b388c69..4528607f8 100644 --- a/locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po +++ b/locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po @@ -63,10 +63,6 @@ msgstr "" msgid "%d questionnaires sent – %d answered (%s%%)" msgstr "" -#: templates/web/default/report/_support.html:3 -msgid "%d supporters" -msgstr "" - #: templates/web/default/pagination.html:10 msgid "%d to %d of %d" msgstr "%d bis %d von %d" @@ -179,10 +175,6 @@ msgstr "-- Wählen Sie eine Kategorie --" msgid "-- Pick a property type --" msgstr "" -#: templates/web/default/report/_support.html:3 -msgid "1 supporter" -msgstr "" - #: templates/web/default/questionnaire/completed.html:20 msgid "" "<p style=\"font-size:150%\">Thank you very much for filling in our " @@ -1843,7 +1835,8 @@ msgstr "Bisher wurden noch keine Meldungen erfasst." msgid "No result returned" msgstr "" -#: templates/web/default/report/_support.html:3 +#: templates/web/default/report/_support.html:2 +#: templates/web/default/report/_support.html:4 msgid "No supporters" msgstr "" @@ -4540,6 +4533,13 @@ msgid_plural "%d hours" msgstr[0] "%d Stunde" msgstr[1] "%d Stunden" +#: templates/web/default/report/_support.html:6 +#, perl-format +msgid "%d supporter" +msgid_plural "%d supporters" +msgstr[0] "" +msgstr[1] "" + #: perllib/Utils.pm:284 #, perl-format msgid "%d minute" diff --git a/locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po b/locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po index 982d6e192..98c925008 100644 --- a/locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po +++ b/locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po @@ -69,10 +69,6 @@ msgstr "%d aktive oppdateringer" msgid "%d questionnaires sent – %d answered (%s%%)" msgstr "%d spørreskjema sendt – %d besvart (%s%%)" -#: templates/web/default/report/_support.html:3 -msgid "%d supporters" -msgstr "" - #: templates/web/default/pagination.html:10 msgid "%d to %d of %d" msgstr "" @@ -190,10 +186,6 @@ msgstr "-- Velg en kategori --" msgid "-- Pick a property type --" msgstr "-- Velg en eiendomsstype --" -#: templates/web/default/report/_support.html:3 -msgid "1 supporter" -msgstr "" - #: templates/web/default/questionnaire/completed.html:20 msgid "" "<p style=\"font-size:150%\">Thank you very much for filling in our " @@ -1957,7 +1949,8 @@ msgstr "Ingen problemer er rapportert" msgid "No result returned" msgstr "" -#: templates/web/default/report/_support.html:3 +#: templates/web/default/report/_support.html:2 +#: templates/web/default/report/_support.html:4 msgid "No supporters" msgstr "" @@ -4823,6 +4816,13 @@ msgid_plural "%d hours" msgstr[0] "%d time" msgstr[1] "%d timer" +#: templates/web/default/report/_support.html:6 +#, perl-format +msgid "%d supporter" +msgid_plural "%d supporters" +msgstr[0] "" +msgstr[1] "" + #: perllib/Utils.pm:284 #, perl-format msgid "%d minute" diff --git a/locale/nn_NO.UTF-8/LC_MESSAGES/FixMyStreet.po b/locale/nn_NO.UTF-8/LC_MESSAGES/FixMyStreet.po index 183acbd20..bc9dec3a6 100644 --- a/locale/nn_NO.UTF-8/LC_MESSAGES/FixMyStreet.po +++ b/locale/nn_NO.UTF-8/LC_MESSAGES/FixMyStreet.po @@ -68,10 +68,6 @@ msgstr "%d aktive oppdateringar" msgid "%d questionnaires sent – %d answered (%s%%)" msgstr "%d spørjeskjema sendt – %d svart (%s%%)" -#: templates/web/default/report/_support.html:3 -msgid "%d supporters" -msgstr "" - #: templates/web/default/pagination.html:10 msgid "%d to %d of %d" msgstr "" @@ -189,10 +185,6 @@ msgstr "-- Vel ein kategori --" msgid "-- Pick a property type --" msgstr "-- Vel ein eigedomstype --" -#: templates/web/default/report/_support.html:3 -msgid "1 supporter" -msgstr "" - #: templates/web/default/questionnaire/completed.html:20 msgid "" "<p style=\"font-size:150%\">Thank you very much for filling in our " @@ -1978,7 +1970,8 @@ msgstr "Ingen problem er rapporterte" msgid "No result returned" msgstr "" -#: templates/web/default/report/_support.html:3 +#: templates/web/default/report/_support.html:2 +#: templates/web/default/report/_support.html:4 msgid "No supporters" msgstr "" @@ -4891,6 +4884,13 @@ msgid_plural "%d hours" msgstr[0] "%d time" msgstr[1] "%d timar" +#: templates/web/default/report/_support.html:6 +#, perl-format +msgid "%d supporter" +msgid_plural "%d supporters" +msgstr[0] "" +msgstr[1] "" + #: perllib/Utils.pm:284 #, perl-format msgid "%d minute" diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index bb7ec2381..f69e9ea23 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -559,9 +559,6 @@ sub reports : Path('reports') { # will have been turned off $c->stash->{problems} = [ $problems->all ]; - $c->stash->{edit_body_contacts} = 1 - if ( grep {$_ eq 'body'} keys %{$c->stash->{allowed_pages}}); - if (is_valid_email($search)) { $query = [ 'user.email' => { ilike => $like_search }, @@ -611,6 +608,10 @@ sub reports : Path('reports') { $c->stash->{problems} = [ $problems->all ]; $c->stash->{pager} = $problems->pager; } + + $c->stash->{edit_body_contacts} = 1 + if ( grep {$_ eq 'body'} keys %{$c->stash->{allowed_pages}}); + } sub report_edit : Path('report_edit') : Args(1) { diff --git a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm index ef27d2c4e..99aec5ac1 100644 --- a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm +++ b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm @@ -119,6 +119,22 @@ sub process_extras { $extra->{address} = $value; } +sub front_stats_data { + my ( $self ) = @_; + my $key = "recent_new"; + my $result = Memcached::get($key); + unless ($result) { + $result = $self->problems->search( + { state => [ FixMyStreet::DB::Result::Problem->visible_states() ] } + )->count; + foreach my $v (values %{$self->old_site_stats}) { + $result += $v; + } + Memcached::set($key, $result, 3600); + } + return $result; +} + # A record of the number of reports from the Channel 4 site and other old data sub old_site_stats { return { diff --git a/perllib/FixMyStreet/Cobrand/Southampton.pm b/perllib/FixMyStreet/Cobrand/Southampton.pm index b7374149a..4e068a8c3 100644 --- a/perllib/FixMyStreet/Cobrand/Southampton.pm +++ b/perllib/FixMyStreet/Cobrand/Southampton.pm @@ -20,5 +20,7 @@ sub disambiguate_location { }; } +sub send_questionnaires { return 0; } + 1; diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm index b92aa8cfd..1ad7f5b05 100644 --- a/perllib/FixMyStreet/SendReport/Open311.pm +++ b/perllib/FixMyStreet/SendReport/Open311.pm @@ -43,7 +43,7 @@ sub send { my $revert = 0; # Extra bromley fields - if ( $row->bodies_str == 2482 ) { + if ( $row->bodies_str eq '2482' ) { $revert = 1; diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 8963e417d..65e252954 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -1050,7 +1050,7 @@ subtest 'report search' => sub { $report->update; $mech->get_ok('/admin/reports?search=' . $report->user->email); - $mech->content_like( qr{<tr [^>]*hidden[^>]*> \s* <td> \s* $r_id \s* </td>}xs ); + $mech->content_like( qr{<tr [^>]*hidden[^>]*> \s* <td[^>]*> \s* $r_id \s* </td>}xs ); $report->state('fixed - user'); $report->update; diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index cdebee35d..aa34b1a2c 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -807,7 +807,7 @@ subtest 'check meta correct for second comment marking as reopened' => sub { user => $user, problem_id => $report->id, text => 'update text', - confirmed => DateTime->now, + confirmed => DateTime->now + DateTime::Duration->new( minutes => 1 ), problem_state => 'confirmed', anonymous => 0, mark_open => 0, diff --git a/templates/web/default/admin/flagged.html b/templates/web/default/admin/flagged.html index 5af92a23c..fc8b1fae1 100644 --- a/templates/web/default/admin/flagged.html +++ b/templates/web/default/admin/flagged.html @@ -9,14 +9,8 @@ <th>[% loc('ID') %]</th> <th>[% loc('Title') %]</th> <th>[% loc('Name') %]</th> - <th>[% loc('Email') %]</th> - <th>[% loc('Council') %]</th> - <th>[% loc('Category') %]</th> - <th>[% loc('Anonymous') %]</th> - <th>[% loc('Cobrand') %]</th> - <th>[% loc('Created') %]</th> + <th>[% loc('Body') %]</th> <th>[% loc('State') %]</th> - <th>[% loc('When sent') %]</th> <th>*</th> </tr> [% INCLUDE 'admin/problem_row.html' %] diff --git a/templates/web/default/admin/header.html b/templates/web/default/admin/header.html index 93254f5e3..6282bf383 100644 --- a/templates/web/default/admin/header.html +++ b/templates/web/default/admin/header.html @@ -1,4 +1,4 @@ -[% INCLUDE 'header.html' admin = 1, bodyclass = 'fullwidthpage' %] +[% INCLUDE 'header.html' admin = 1, bodyclass = 'fullwidthpage admin' %] <style type="text/css"> dt { clear: left; float: left; font-weight: bold; } dd { margin-left: 8em; } diff --git a/templates/web/default/admin/problem_row.html b/templates/web/default/admin/problem_row.html index 1533f8dd2..ec8fda6c5 100644 --- a/templates/web/default/admin/problem_row.html +++ b/templates/web/default/admin/problem_row.html @@ -1,6 +1,6 @@ [%- FOR problem IN problems %] <tr[% ' class="adminhidden"' IF problem.state == 'hidden' %]> - <td>[%- IF problem.is_visible -%] + <td class="record-id">[%- IF problem.is_visible -%] [%- cobrand_data = problem.cobrand_data %] [%- cobrand_data = c.data_for_generic_problem IF !problem.cobrand %] <a href="[% c.uri_for_email( '/report', problem.id, cobrand_data ) %]">[% problem.id %]</a> @@ -8,26 +8,30 @@ [%- problem.id %] [%- END -%]</td> <td>[% PROCESS value_or_nbsp value=problem.title %]</td> - <td>[% PROCESS value_or_nbsp value=problem.name %]</td> - <td>[% PROCESS value_or_nbsp value=problem.user.email %]</td> - <td>[%- IF edit_body_contacts -%] - [% FOR body IN problem.bodies.values %] - <a href="[% c.uri_for('body', body.id ) %]">[% PROCESS value_or_nbsp value=body.name %]</a> - [% END %] - [%- ELSE -%] - [%- PROCESS value_or_nbsp value=problem.bodies_str -%] - [%- END -%]</td> - <td>[% PROCESS value_or_nbsp value=problem.category %]</td> - <td>[% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> - <td>[% problem.cobrand %]<br>[% problem.cobrand_data | html %]</td> - <td>[% PROCESS format_time time=problem.created %]</td> - <td>[% problem.state %]<small> - [%- IF problem.is_visible %]<br>[% loc('Confirmed:' ) %] [% PROCESS format_time time=problem.confirmed %][% END -%] - [%- IF problem.is_fixed %]<br>[% loc('Fixed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] - [%- IF problem.is_closed %]<br>[% loc('Closed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] - [%- IF problem.is_open %]<br>[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]</small> - </td> - <td>[% PROCESS format_time time=problem.whensent %]</td> + <td> + [% PROCESS value_or_nbsp value=problem.name %] + <br>[% PROCESS value_or_nbsp value=problem.user.email %] + <br>[% loc('Anonymous') %]: [% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] + </td> + <td> + [% PROCESS value_or_nbsp value=problem.category %] + <br>[%- IF edit_body_contacts -%] + [% FOR body IN problem.bodies.values %] + <a href="[% c.uri_for('body', body.id ) %]">[% PROCESS value_or_nbsp value=body.name %]</a> + [% END %] + [%- ELSE -%] + [%- PROCESS value_or_nbsp value=problem.bodies_str -%] + [%- END -%] + <br>[% problem.cobrand %]<br>[% problem.cobrand_data | html %] + </td> + <td>[% problem.state %]<br><small> + [% loc('Created') %]: [% PROCESS format_time time=problem.created %] + <br>[% loc('When sent') %]: [% PROCESS format_time time=problem.whensent %] + [%- IF problem.is_visible %]<br>[% loc('Confirmed:' ) %] [% PROCESS format_time time=problem.confirmed %][% END -%] + [%- IF problem.is_fixed %]<br>[% loc('Fixed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] + [%- IF problem.is_closed %]<br>[% loc('Closed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] + [%- IF problem.is_open %]<br>[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] + </small></td> <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td> </tr> [%- END -%] diff --git a/templates/web/default/admin/reports.html b/templates/web/default/admin/reports.html index fab12cfce..d57b2f53e 100644 --- a/templates/web/default/admin/reports.html +++ b/templates/web/default/admin/reports.html @@ -11,14 +11,8 @@ <th>[% loc('ID') %]</th> <th>[% loc('Title') %]</th> <th>[% loc('Name') %]</th> - <th>[% loc('Email') %]</th> <th>[% loc('Body') %]</th> - <th>[% loc('Category') %]</th> - <th>[% loc('Anonymous') %]</th> - <th>[% loc('Cobrand') %]</th> - <th>[% loc('Created') %]</th> <th>[% loc('State') %]</th> - <th>[% loc('When sent') %]</th> <th>*</th> </tr> [% INCLUDE 'admin/problem_row.html' %] diff --git a/templates/web/default/front/stats.html b/templates/web/default/front/stats.html index eae66018b..5367f1118 100644 --- a/templates/web/default/front/stats.html +++ b/templates/web/default/front/stats.html @@ -36,10 +36,8 @@ <div id="front_stats"> <div>[% tprintf( new_text, stats.new ) | comma %]</div> - [% IF c.cobrand.moniker != 'emptyhomes' %] <div>[% tprintf( fixed_text, stats.fixed ) | comma %]</div> [% IF c.cobrand.moniker != 'zurich' %] <div>[% tprintf( updates_text, stats.updates ) | comma %]</div> [% END %] - [% END %] </div> diff --git a/templates/web/default/report/_support.html b/templates/web/default/report/_support.html index f4bdb8c20..3e372ba69 100644 --- a/templates/web/default/report/_support.html +++ b/templates/web/default/report/_support.html @@ -1,11 +1,17 @@ [% IF c.cobrand.can_support_problems %] -<p id="supporter"><small> - [% IF !problem.interest_count %][% text=loc('No supporters') %][% ELSIF problem.interest_count == 1 %][% text = loc('1 supporter') %][% ELSE %][% text = tprintf( loc('%d supporters' ), problem.interest_count ) %][% END %] - [% IF c.user && c.user.from_body %]<form action="[% c.uri_for( '/report/support' ) %]"> - [% text %] <input type="hidden" name="id" value="[% problem.id %]"><input type="submit" class="green-btn" value="Add support"> +[% + IF !problem.interest_count; + SET text = loc('No supporters'); + ELSE; + SET text = tprintf( nget( "%d supporter", "%d supporters", problem.interest_count ), problem.interest_count ); + END; +%] + + [% IF c.user AND c.user.from_body %] + <form action="[% c.uri_for( '/report/support' ) %]"> + <p id="supporter"><small>[% text %] <input type="hidden" name="id" value="[% problem.id %]"><input type="submit" class="green-btn" value="Add support"></small></p> </form> [% ELSE %] - [% text %] + <p id="supporter"><small>[% text %]</small></p> [% END %] -</small></p> [% END %] diff --git a/templates/web/emptyhomes/around/extra_text.html b/templates/web/emptyhomes/around/extra_text.html new file mode 100644 index 000000000..bb9d18d8e --- /dev/null +++ b/templates/web/emptyhomes/around/extra_text.html @@ -0,0 +1,9 @@ +[% +# Need to ignore any county council +FOR c IN all_areas.values; + SET council = c IF c.type != 'CTY'; +END; +%] +<a href="/local/[% c.cobrand.short_name(council) | lower %]"> + Find out local news and stats for [% council.name %] +</a> diff --git a/templates/web/emptyhomes/front/stats.html b/templates/web/emptyhomes/front/stats.html new file mode 100644 index 000000000..f6aacf859 --- /dev/null +++ b/templates/web/emptyhomes/front/stats.html @@ -0,0 +1,7 @@ +[% USE Comma %] +[% stats = c.cobrand.front_stats_data %] + +<div id="front_stats"> + <div>[% tprintf( loc("<big>%s</big> reports"), stats ) | comma %]</div> + <div><a href="/local/">[% loc('Find latest local and national news') %]</a></div> +</div> diff --git a/templates/web/oxfordshire/around/intro.html b/templates/web/oxfordshire/around/intro.html index 81b2569f6..3b96ec82f 100644 --- a/templates/web/oxfordshire/around/intro.html +++ b/templates/web/oxfordshire/around/intro.html @@ -1 +1 @@ - <h1 class="main">Reporting a problem in Oxfordshire</h1> + <h1 class="main">Report a street or road problem</h1> diff --git a/templates/web/oxfordshire/faq/faq-en-gb.html b/templates/web/oxfordshire/faq/faq-en-gb.html index 5aafa0bc4..a85c8b96b 100755 --- a/templates/web/oxfordshire/faq/faq-en-gb.html +++ b/templates/web/oxfordshire/faq/faq-en-gb.html @@ -25,6 +25,10 @@ to make it easier for our customers to report highways faults directly to us by using their computer or mobile phone. </p> + <p> + Here is a <a href="http://vimeo.com/61275718">short video</a> + about FixMyStreet and how you can use it to report road and street problems. + </p> </dd> <dt>What sort of problems should I report with FixMyStreet?</dt> @@ -107,6 +111,32 @@ The map shows all faults submitted online through FixMyStreet. You can view the exact location of each fault and see its current status. </dd> + + <dt>What updates will I receive?</dt> + <dd> + <p> + When you record a fault you can sign up to receive updates and you will receive an + initial email to acknowledge the report. + </p> + <p> + You will then receive an email every time that fault is updated. This could be when + a member of the public posts an update onto the fault or when we post a status update. + </p> + <p> + Road problems that are the responsibility of our Highways department, such as potholes, + will receive automatic updates at different stages. You will receive an email when the + problem has been inspected and another one when the fault is fixed. + </p> + <p> + Some faults may be marked as referred when they are not the responsibility of Oxfordshire + County Council, for example problems such as graffiti or rubbish which are the + responsibility of the District Council for that area. + </p> + <p> + All of these updates will also be posted on the mapped fault so that anyone can see the + status of any fault recorded via FixMyStreet by clicking on it on the map. + </p> + </dd> <dt>How can I get an update on a fault?</dt> <dd> @@ -148,12 +178,12 @@ <h2><a name="practical"></a>Practical Questions</h2> <dl> - <dt>Do you remove silly or illegal content?</dt> + <dt>Inappropriate use</dt> <dd> Oxfordshire County Council and FixMyStreet are 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. + accuracy of material submitted by its users. Oxfordshire County Council will monitor + this website for instances of inappropriate use, and reserves the right to moderate + comments if such instances occur. </dd> <dt>Why does the site use kilometres for measurements?</dt> diff --git a/templates/web/oxfordshire/header.html b/templates/web/oxfordshire/header.html index e9a592fd4..67afb2334 100644 --- a/templates/web/oxfordshire/header.html +++ b/templates/web/oxfordshire/header.html @@ -37,10 +37,10 @@ <div id="oxford-header" class="desk-only oxford-left"> <a href="http://www.oxfordshire.gov.uk/" title="Home" class="logo">Oxfordshire County Council<span></span></a> <span id="oxford-links"> - <a href="http://www.oxfordshire.gov.uk/" title="">Oxfordshire County Council home</a>|<a href="/" title="">FixMyStreet</a> + <a href="http://www.oxfordshire.gov.uk/" title="">Oxfordshire County Council home</a> </span> <div style="clear:both"></div> - <span class="header"><a href="/">FixMyStreet</a></span> + <span class="header"><a href="/">Report a road or street problem</a></span> <div class="oxford-user"> <p> [% IF c.user_exists %] diff --git a/web/cobrands/emptyhomes/css.css b/web/cobrands/emptyhomes/css.css index 97d0e1192..da9afd104 100644 --- a/web/cobrands/emptyhomes/css.css +++ b/web/cobrands/emptyhomes/css.css @@ -168,8 +168,8 @@ a:hover, a:active { clear: both; font-size: 83%; border-top: solid 2em #ffffff; - background-color: #80AE7D; - color: #FFFFFF; + background-color: #fe6500; + color: #000; margin: 2em 0 1em 0; padding: 20px; overflow: auto; @@ -185,20 +185,24 @@ a:hover, a:active { } #emptyhomes-footer a { - color: #FFFFFF; + color: #000; } #mysociety #postcodeForm { - background-color: #80AE7D; + background-color: #B1BECF; color: #000000; font-size: 130%; } #mysociety #front_stats div { - background-color: #80AE7D; + vertical-align: middle; + background-color: #B1BECF; + color: #000000; + padding: 0.5em; + width: 7em; +} +#mysociety #front_stats div a { color: #000000; - /*padding: 0.5em 0; */ - width: 9em; } #mysociety #problem_form { diff --git a/web/cobrands/fixmystreet/_layout.scss b/web/cobrands/fixmystreet/_layout.scss index 80ac35edc..07f944ffa 100644 --- a/web/cobrands/fixmystreet/_layout.scss +++ b/web/cobrands/fixmystreet/_layout.scss @@ -981,6 +981,59 @@ body.frontpage { } } +// Admin tables + +$table_border_color: #ccc; +$table_heading_bg_col: #595959; +$table_heading_border_col: #7a7a7a; +$table_heading_col: #fff; +$table_heading_underline_col: #393939; +$button_col: #fff; +$button_bg_col: #a1a1a1; // also search bar (tables) + +.admin { + table { + width: 100%; + font-size: 0.9em; + border: 1px solid $table_border_color; + border-collapse: collapse; + margin-bottom: 1em; + th, td { + padding: 0.666em 0.5em; + border: 1px solid $table_border_color; + } + th { + color: white; + background-color: $table_heading_bg_col; + border-bottom: 2px solid $table_heading_underline_col; + border-left: 1px solid $table_heading_border_col; + border-right: 1px solid $table_heading_border_col; + a:link, a:visited { + color: white; + } + } + td.record-id { + text-align: center; + font-weight: bold; + } + tr.filter-row td { + display: none; /* TODO: reveal when filtering is implemented */ + padding: 4px 4px 4px 40px; + background-color: $button_bg_col; + background-image: url('search-icon-white.png'); + background-position: 14px center; + background-repeat: no-repeat; + border-bottom: 2px solid $table_border_color; + } + tr.filter-row td input[type=text] { + background-color: #e1e1e1; + width: 16em; + @include border-radius(4px); + border: none; + padding: 3px 0.5em; + } + } +} diff --git a/web/cobrands/stevenage/layout.scss b/web/cobrands/stevenage/layout.scss index 542cffd96..a46c15875 100644 --- a/web/cobrands/stevenage/layout.scss +++ b/web/cobrands/stevenage/layout.scss @@ -1,5 +1,5 @@ @import "colours"; -@import "../fixmystreet/layout"; +@import "../fixmystreet/_layout"; // d523b431 - "Stevenage Home page styles" // 2a23e09f - Moved menu on map page and reverted to full header. diff --git a/web/cobrands/zurich/_colours.scss b/web/cobrands/zurich/_colours.scss index 73fb36577..e2a2587f0 100644 --- a/web/cobrands/zurich/_colours.scss +++ b/web/cobrands/zurich/_colours.scss @@ -16,12 +16,3 @@ $col_fixed_label_dark: #4B8304; $mobile_menu_tab_bg_col: #FFFFFF; // the white border and tab on mobile site $mobile_header_blue: #366AB6; // close match to Zurich logo_portal.jpg -// Zurich admin tables: - -$table_border_color: #ccc; -$table_heading_bg_col: #595959; -$table_heading_border_col: #7a7a7a; -$table_heading_col: #fff; -$table_heading_underline_col: #393939; -$button_col: #fff; -$button_bg_col: #a1a1a1; // also search bar (tables) diff --git a/web/cobrands/zurich/layout.scss b/web/cobrands/zurich/layout.scss index 46ea45856..2b16636b9 100644 --- a/web/cobrands/zurich/layout.scss +++ b/web/cobrands/zurich/layout.scss @@ -1,5 +1,5 @@ @import "colours"; -@import "../fixmystreet/layout"; +@import "../fixmystreet/_layout"; @import "zurich"; // Things to override from parent stylesheet @@ -286,48 +286,6 @@ body.mappage.admin .content { #zurich-footer { margin: 2em auto 3em auto; } - - table { - width: 100%; - font-size: 0.9em; - border: 1px solid $table_border_color; - border-collapse: collapse; - margin-bottom: 1em; - th, td { - padding: 0.666em 0.5em; - border: 1px solid $table_border_color; - } - th { - color: white; - background-color: $table_heading_bg_col; - border-bottom: 2px solid $table_heading_underline_col; - border-left: 1px solid $table_heading_border_col; - border-right: 1px solid $table_heading_border_col; - a:link, a:visited { - color: white; - } - } - td.record-id { - text-align: center; - font-weight: bold; - } - tr.filter-row td { - display: none; /* TODO: reveal when filtering is implemented */ - padding: 4px 4px 4px 40px; - background-color: $button_bg_col; - background-image: url('search-icon-white.png'); - background-position: 14px center; - background-repeat: no-repeat; - border-bottom: 2px solid $table_border_color; - } - tr.filter-row td input[type=text] { - background-color: #e1e1e1; - width: 16em; - @include border-radius(4px); - border: none; - padding: 3px 0.5em; - } - } } .admin-nav-wrapper { diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index e28a4d982..62e94ed29 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -411,7 +411,7 @@ OpenLayers.Control.PanZoomFMS = OpenLayers.Class(OpenLayers.Control.PanZoom, { /* Overriding Permalink so that it can pass the correct zoom to OSM */ OpenLayers.Control.PermalinkFMS = OpenLayers.Class(OpenLayers.Control.Permalink, { - updateLink: function() { + _updateLink: function(alter_zoom) { var separator = this.anchor ? '#' : '?'; var href = this.base; if (href.indexOf(separator) != -1) { @@ -430,7 +430,11 @@ OpenLayers.Control.PermalinkFMS = OpenLayers.Class(OpenLayers.Control.Permalink, center = this.map.getLonLatFromViewPortPx(p); } - href += separator + OpenLayers.Util.getParameterString(this.createParams(center, this.map.getZoom()+fixmystreet.zoomOffset)); + var zoom = this.map.getZoom(); + if ( alter_zoom ) { + zoom += fixmystreet.zoomOffset; + } + href += separator + OpenLayers.Util.getParameterString(this.createParams(center, zoom)); // Could use mlat/mlon here as well if we are on a page with a marker if (this.anchor && !this.element) { window.location.href = href; @@ -438,6 +442,14 @@ OpenLayers.Control.PermalinkFMS = OpenLayers.Class(OpenLayers.Control.Permalink, else { this.element.href = href; } + }, + updateLink: function() { + this._updateLink(0); + } +}); +OpenLayers.Control.PermalinkFMSz = OpenLayers.Class(OpenLayers.Control.PermalinkFMS, { + updateLink: function() { + this._updateLink(1); } }); diff --git a/web/js/map-OpenStreetMap.js b/web/js/map-OpenStreetMap.js index 54bf95964..9b8916946 100644 --- a/web/js/map-OpenStreetMap.js +++ b/web/js/map-OpenStreetMap.js @@ -7,8 +7,8 @@ function set_map_config(perm) { new OpenLayers.Control.ArgParser(), //new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.Navigation(), - new OpenLayers.Control.Permalink(permalink_id), - new OpenLayers.Control.PermalinkFMS('osm_link', 'http://www.openstreetmap.org/'), + new OpenLayers.Control.PermalinkFMS(permalink_id), + new OpenLayers.Control.PermalinkFMSz('osm_link', 'http://www.openstreetmap.org/'), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; } diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 6d86663f0..34ea255e8 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -16,9 +16,14 @@ function set_map_config(perm) { new OpenLayers.Control.Attribution(), new OpenLayers.Control.ArgParser(), fixmystreet.nav_control, - new OpenLayers.Control.Permalink(permalink_id), + new OpenLayers.Control.PermalinkFMS(permalink_id), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; + /* Linking back to around from report page, keeping track of map moves */ + if ( fixmystreet.page == 'report' ) { + fixmystreet.controls.push( new OpenLayers.Control.PermalinkFMS('key-tool-problems-nearby', '/around') ); + } + if (fixmystreet.map_type) { tile_base = fixmystreet.map_type; } |