diff options
28 files changed, 1692 insertions, 3 deletions
@@ -14,3 +14,4 @@ iPhone/FixMyStreet.xcodeproj/xcuserdata iPhone/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcuserdata iPhone/CordovaLib/CordovaLib.xcodeproj/xcuserdata Android/gen/ +compiled diff --git a/bin/gettext-extract b/bin/gettext-extract new file mode 100755 index 0000000..75b95f1 --- /dev/null +++ b/bin/gettext-extract @@ -0,0 +1,53 @@ +#!/bin/bash +# +# fixmystreet/bin/gettext-extract +# Generate English language .po files from the source code and email templates, +# for FixMyStreet. Writes the output to appropriate .po files in locale/. +# +# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved. +# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ + +if [ -e ../../locale ] +then + cd ../../ +else if [ -e ../locale ] +then + cd ../ +else if [ -e locale ] +then + cd . +else + echo "Please run with current directory fixmystreet/bin" + exit 1 +fi +fi +fi + +# File to write to, clear it to start with +PO=locale/FixMyStreetMobileApp.po +rm -f $PO + +# Extract from Perl +xgettext.pl --gnu-gettext --verbose --output $PO --plugin perl=* --plugin tt2 --directory templates + +# Fix headers +# no such thing as tempfile on OS X +TEMP=`tempfile 2>/dev/null || mktemp /tmp/gettext-extract.XXXXXX` +NOW=`date +"%Y-%m-%d %H:%M%z"` +# strictly POSIX sed on e.g. OS X doesn't let you used \n in replacements so we do this +nl=$'\n'; +cat $PO | sed " + s/SOME DESCRIPTIVE TITLE/FixMyStreet mobile app original .po file, autogenerated by gettext-extract/; + s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2013 UK Citizens Online Democracy/; + s/PACKAGE package/main FixMyStreet code/; + s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Struan Donald <struan@mysociety.org>, 2013./; + + s/PACKAGE VERSION/1.0\\\n\"\\$nl\"Report-Msgid-Bugs-To: struan@mysociety.org/; + s/POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE/POT-Creation-Date: $NOW/; + s/LL@li.org/team@fixmystreet.com/; + s/charset=CHARSET/charset=UTF-8/; + s/8bit/8bit\\\n\"\\$nl\"Plural-Forms: nplurals=2; plural=n != 1;/; +" >> $TEMP +mv $TEMP $PO + +echo "$( bin/gettext-nget-patch )" >> $PO diff --git a/bin/gettext-merge b/bin/gettext-merge new file mode 100755 index 0000000..9137698 --- /dev/null +++ b/bin/gettext-merge @@ -0,0 +1,40 @@ +#!/bin/bash +# +# bin/gettext-merge +# Update all .po files from new .pot +# +# Copyright (c) 2013 UK Citizens Online Democracy. All rights reserved. +# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ + +# Yuck +if [ -e ../../locale ] +then + cd ../../ +else if [ -e ../locale ] +then + cd ../ +else if [ -e locale ] +then + cd . +else + echo "Please run with current directory fixmystreet" + exit 1 +fi +fi +fi + +for X in locale/*.UTF-8 +do + if [ -d $X ] + then + cd $X/LC_MESSAGES + echo $X + if [ -e FixMyStreetMobileApp.po ] + then + msgmerge -o New.po FixMyStreetMobileApp.po ../../FixMyStreetMobileApp.po + mv New.po FixMyStreetMobileApp.po + fi + cd - >/dev/null + fi +done + diff --git a/bin/gettext-nget-patch b/bin/gettext-nget-patch new file mode 100755 index 0000000..5ebd8bb --- /dev/null +++ b/bin/gettext-nget-patch @@ -0,0 +1,44 @@ +#!/usr/bin/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. + +use File::Find qw/find/; + +my %out; + +find( sub { + next unless -f; + next if $File::Find::name =~ /ttc$/; + open (FP, $_) or die $!; + while (<FP>) { + next unless /nget/; + my $line = $.; + my $text = $_; + do { + $text .= <FP>; + } until $text =~ /\)/; + if ($text =~ /nget\(\s*"(.*?)"\s*,\s*"(.*?)"\s*,\s*(.*?)\s*\)/s) { + $out{$1} = { + file => $File::Find::name, + line => $line, + s => $1, + p => $2, + }; + } + } + close FP; +}, 'templates', 'perllib'); + +foreach (values %out) { + print <<EOF; + +#: $_->{file}:$_->{line} +#, perl-format +msgid "$_->{s}" +msgid_plural "$_->{p}" +msgstr[0] "" +msgstr[1] "" +EOF +} + diff --git a/bin/localise_templates b/bin/localise_templates new file mode 100644 index 0000000..372535b --- /dev/null +++ b/bin/localise_templates @@ -0,0 +1,36 @@ +#!/bin/env perl + +use strict; +use warnings; +use Template; +use mySociety::Locale; + +mySociety::Locale::negotiate_language('de-ch,German,de_CH'); +mySociety::Locale::gettext_domain('ZurichMobileApp'); +mySociety::Locale::change('de-ch'); + +sub loc { + my @args = @_; + return _(@args); +} + +sub tprintf { + my ( $format, @args ) = @_; + @args = @{$args[0]} if ref $args[0] eq 'ARRAY'; + return sprintf $format, @args; +} + +my $t = Template->new({ + INCLUDE_PATH => 'templates', + OUTPUT_PATH => 'compiled' +}); + +my $vars = { + loc => \&loc, + tprintf => \&tprintf, +}; + +for my $file ( glob('templates/*') ) { + $file =~ s%templates/%%; + $t->process( $file, $vars, $file ) or warn $t->error; +} diff --git a/locale/FixMyStreetMobileApp.po b/locale/FixMyStreetMobileApp.po new file mode 100644 index 0000000..442948c --- /dev/null +++ b/locale/FixMyStreetMobileApp.po @@ -0,0 +1,429 @@ +# FixMyStreet mobile app original .po file, autogenerated by gettext-extract. +# Copyright (C) 2013 UK Citizens Online Democracy +# This file is distributed under the same license as the main FixMyStreet code. +# Struan Donald <struan@mysociety.org>, 2013. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.0\n" +"Report-Msgid-Bugs-To: struan@mysociety.org\n" +"POT-Creation-Date: 2013-07-30 16:37+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <team@fixmystreet.com>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#: templates/offline.html:46 templates/photo.html:10 +msgid "(optional)" +msgstr "" + +#: templates/existing.html:12 templates/strings.js:39 +msgid "-- Pick a category --" +msgstr "" + +#: templates/around.html:7 +msgid "Account" +msgstr "" + +#: templates/photo.html:2 +msgid "Add Photo" +msgstr "" + +#: templates/photo.html:10 +msgid "Add a Photo" +msgstr "" + +#: templates/offline.html:46 +msgid "Add a Photo " +msgstr "" + +#: templates/offline.html:48 templates/photo.html:19 +msgid "Add an existing photo" +msgstr "" + +#: templates/strings.js:30 +msgid "An error was encountered when submitting your report: " +msgstr "" + +#: templates/around.html:23 templates/around.html:5 templates/offline.html:14 +msgid "Cancel" +msgstr "" + +#: templates/existing.html:31 +msgid "Complete report now" +msgstr "" + +#: templates/around.html:43 +msgid "Confirm Location" +msgstr "" + +#: templates/submit_password.html:38 +msgid "Confirm name" +msgstr "" + +#: templates/sent.html:7 +msgid "Confirmation email sent" +msgstr "" + +#: templates/submit_set_password.html:15 +msgid "Continue" +msgstr "" + +#: templates/strings.js:38 +msgid "Could not access location services. Please check permissions." +msgstr "" + +#: templates/strings.js:37 +msgid "Could not determine your location, please search for a street name and area, or postcode instead." +msgstr "" + +#: templates/reports.html:22 +msgid "Delete" +msgstr "" + +#: templates/details.html:17 templates/details.html:2 +msgid "Details" +msgstr "" + +#: templates/existing.html:33 +msgid "Discard" +msgstr "" + +#: templates/reports.html:3 +msgid "Draft Reports" +msgstr "" + +#: templates/around.html:3 +msgid "Drafts" +msgstr "" + +#: templates/around.html:19 +msgid "Finding your location" +msgstr "" + +#: templates/details_extra.html:2 +msgid "Further Details" +msgstr "" + +#: templates/login.html:2 templates/reports.html:2 templates/sent.html:2 +msgid "Home" +msgstr "" + +#: templates/submit_email.html:21 +msgid "I don't want to set a password" +msgstr "" + +#: templates/submit_email.html:22 +msgid "I'd like to set a password" +msgstr "" + +#: templates/submit_email.html:23 +msgid "I've already got one - login" +msgstr "" + +#: templates/reports.html:6 +msgid "If you start compiling a report, but don't finish and send it, it'll appear in this menu so you can finish it later" +msgstr "" + +#: templates/strings.js:41 +msgid "Invalid email" +msgstr "" + +#: templates/strings.js:42 +msgid "Invalid report" +msgstr "" + +#: templates/offline.html:27 +msgid "Locate" +msgstr "" + +#: templates/strings.js:27 +msgid "Location error" +msgstr "" + +#: templates/login.html:3 +msgid "Login" +msgstr "" + +#: templates/strings.js:45 +msgid "More details" +msgstr "" + +#: templates/strings.js:29 +msgid "More than one location matched that name. Select one below or try entering street name and area, or a postcode." +msgstr "" + +#: templates/around.html:37 +msgid "New Report Here" +msgstr "" + +#: templates/around.html:8 templates/details.html:3 templates/details_extra.html:3 templates/photo.html:6 +msgid "Next" +msgstr "" + +#: templates/strings.js:44 +msgid "No network connection available for submitting your report. Please try again later" +msgstr "" + +#: templates/submit_name.html:9 +msgid "No problem - we don't like faffing with passwords either." +msgstr "" + +#: templates/offline.html:3 templates/save_offline.html:2 +msgid "Offline" +msgstr "" + +#: templates/offline.html:20 +msgid "Oh dear - we can't detect an internet connection. However you can still start a report now and complete it later, by going to 'drafts' when you're back online." +msgstr "" + +#: templates/submit_confirm.html:21 templates/submit_name.html:26 +msgid "Optionally enter your phone number" +msgstr "" + +#: templates/strings.js:11 +msgid "Please choose a category" +msgstr "" + +#: templates/submit_confirm.html:11 templates/submit_password.html:21 +msgid "Please confirm your name, if you want it to be public and optionally your phone number." +msgstr "" + +#: templates/strings.js:33 +msgid "Please enter a location" +msgstr "" + +#: templates/strings.js:4 +msgid "Please enter a message" +msgstr "" + +#: templates/strings.js:20 +msgid "Please enter a password" +msgstr "" + +#: templates/strings.js:5 +msgid "Please enter a subject" +msgstr "" + +#: templates/strings.js:14 templates/strings.js:18 +msgid "Please enter a valid email" +msgstr "" + +#: templates/strings.js:6 +msgid "Please enter some details" +msgstr "" + +#: templates/strings.js:13 templates/strings.js:17 +msgid "Please enter your email" +msgstr "" + +#: templates/submit_email.html:8 +msgid "Please enter your email address" +msgstr "" + +#: templates/strings.js:9 +msgid "Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box below" +msgstr "" + +#: templates/strings.js:8 templates/submit_confirm.html:18 templates/submit_name.html:23 +msgid "Please enter your name" +msgstr "" + +#: templates/submit_password.html:28 +msgid "Please enter your phone number (optional)" +msgstr "" + +#: templates/details.html:18 +msgid "Please fill in details of the problem." +msgstr "" + +#: templates/submit_name.html:11 +msgid "Please give us some basic details, and you're nearly done." +msgstr "" + +#: templates/strings.js:36 +msgid "Please search for a street name and area, or postcode." +msgstr "" + +#: templates/details.html:9 templates/offline.html:33 +msgid "Provide a title" +msgstr "" + +#: templates/offline.html:60 templates/photo.html:21 +msgid "Remove Photo" +msgstr "" + +#: templates/submit_confirm.html:29 templates/submit_password.html:15 +msgid "Report" +msgstr "" + +#: templates/sent.html:3 +msgid "Report Created" +msgstr "" + +#: templates/around.html:40 +msgid "Reposition Report Here" +msgstr "" + +#: templates/existing.html:32 +msgid "Save for later" +msgstr "" + +#: templates/around.html:29 +msgid "Search or scroll the map" +msgstr "" + +#: templates/submit_name.html:36 +msgid "Send confirmation email" +msgstr "" + +#: templates/submit_confirm.html:25 templates/submit_name.html:31 templates/submit_password.html:33 +msgid "Show my name publicly" +msgstr "" + +#: templates/login.html:12 templates/login.html:40 +msgid "Sign Out" +msgstr "" + +#: templates/login.html:36 +msgid "Signed in!" +msgstr "" + +#: templates/login.html:17 +msgid "Signed out!" +msgstr "" + +#: templates/offline.html:4 templates/photo.html:4 +msgid "Skip" +msgstr "" + +#: templates/details.html:8 +msgid "Subject" +msgstr "" + +#: templates/offline.html:47 templates/photo.html:20 +msgid "Take a new photo" +msgstr "" + +#: templates/sent.html:13 +msgid "Thanks. Your report will be sent to the authorities immediately." +msgstr "" + +#: templates/save_offline.html:5 +msgid "There is no internet connection" +msgstr "" + +#: templates/save_offline.html:8 +msgid "There isn't an internet connection, do you want to save the current report for later?" +msgstr "" + +#: templates/strings.js:35 +msgid "There was a problem checking if we have all the details we need. Please try again later" +msgstr "" + +#: templates/strings.js:34 +msgid "There was a problem checking we cover this location. Please try again later." +msgstr "" + +#: templates/strings.js:25 +msgid "There was a problem logging you in. Please check your email and password" +msgstr "" + +#: templates/strings.js:23 +msgid "There was a problem logging you in. Please try later" +msgstr "" + +#: templates/strings.js:24 +msgid "There was a problem logging you out. Please try later" +msgstr "" + +#: templates/strings.js:28 +msgid "There was a problem looking up your location" +msgstr "" + +#: templates/strings.js:32 +msgid "There was a problem submitting your report. Please try again" +msgstr "" + +#: templates/strings.js:31 +msgid "There was a problem submitting your report. Please try again later." +msgstr "" + +#: templates/strings.js:43 +msgid "There was a problem taking your photo" +msgstr "" + +#: templates/strings.js:26 +msgid "There was a problem with your email/password combination. If you have forgotten your password, or do not have one, you can set one by returning to the email screen and selecting the set password option" +msgstr "" + +#: templates/submit_email.html:13 +msgid "This app needs to send you a confirmation email before we can send your report to the council." +msgstr "" + +#: templates/offline.html:25 +msgid "This report has a position." +msgstr "" + +#: templates/submit_name.html:16 templates/submit_name.html:17 +msgid "Title" +msgstr "" + +#: templates/submit_email.html:17 +msgid "To skip this step in future, you can set a password now." +msgstr "" + +#: templates/offline.html:2 +msgid "Try Again" +msgstr "" + +#: templates/existing.html:2 +msgid "Unsent Report" +msgstr "" + +#: templates/sent.html:15 +msgid "View it on the site" +msgstr "" + +#: templates/sent.html:10 +msgid "We've sent you a confirmation email which may take a few minutes to arrive. Once it arrives click the link in the email to confirm your report." +msgstr "" + +#. ('<%= user.email %>') +#. ("<%= user.email %>") +#: templates/submit_confirm.html:7 +msgid "You are logged in as %s" +msgstr "" + +#: templates/login.html:24 +msgid "Your Email" +msgstr "" + +#: templates/offline.html:56 +msgid "Your Photo" +msgstr "" + +#: templates/submit_confirm.html:2 templates/submit_email.html:2 templates/submit_name.html:2 templates/submit_password.html:2 templates/submit_set_password.html:2 +msgid "Your details" +msgstr "" + +#: templates/login.html:27 templates/submit_password.html:11 templates/submit_set_password.html:11 +msgid "Your password" +msgstr "" + +#: templates/save_offline.html:13 +msgid "discard" +msgstr "" + +#: templates/strings.js:40 +msgid "required" +msgstr "" + +#: templates/save_offline.html:12 +msgid "save" +msgstr "" + diff --git a/locale/en_GB.UTF-8/LC_MESSAGES/FixMyStreetMobileApp.po b/locale/en_GB.UTF-8/LC_MESSAGES/FixMyStreetMobileApp.po new file mode 100644 index 0000000..81d076f --- /dev/null +++ b/locale/en_GB.UTF-8/LC_MESSAGES/FixMyStreetMobileApp.po @@ -0,0 +1,463 @@ +# FixMyStreet mobile app original .po file, autogenerated by gettext-extract. +# Copyright (C) 2013 UK Citizens Online Democracy +# This file is distributed under the same license as the main FixMyStreet code. +# Struan Donald <struan@mysociety.org>, 2013. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.0\n" +"Report-Msgid-Bugs-To: struan@mysociety.org\n" +"POT-Creation-Date: 2013-07-30 16:37+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <team@fixmystreet.com>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#: templates/offline.html:46 templates/photo.html:10 +msgid "(optional)" +msgstr "" + +#: templates/existing.html:12 templates/strings.js:39 +msgid "-- Pick a category --" +msgstr "" + +#: templates/around.html:7 +msgid "Account" +msgstr "" + +#: templates/photo.html:2 +msgid "Add Photo" +msgstr "" + +#: templates/photo.html:10 +msgid "Add a Photo" +msgstr "" + +#: templates/offline.html:46 +msgid "Add a Photo " +msgstr "" + +#: templates/offline.html:48 templates/photo.html:19 +msgid "Add an existing photo" +msgstr "" + +#: templates/strings.js:30 +msgid "An error was encountered when submitting your report: " +msgstr "" + +#: templates/around.html:23 templates/around.html:5 templates/offline.html:14 +msgid "Cancel" +msgstr "" + +#: templates/existing.html:31 +msgid "Complete report now" +msgstr "" + +#: templates/around.html:43 +msgid "Confirm Location" +msgstr "" + +#: templates/submit_password.html:38 +msgid "Confirm name" +msgstr "" + +#: templates/sent.html:7 +msgid "Confirmation email sent" +msgstr "" + +#: templates/submit_set_password.html:15 +msgid "Continue" +msgstr "" + +#: templates/strings.js:38 +msgid "Could not access location services. Please check permissions." +msgstr "" + +#: templates/strings.js:37 +msgid "" +"Could not determine your location, please search for a street name and area, " +"or postcode instead." +msgstr "" + +#: templates/reports.html:22 +msgid "Delete" +msgstr "" + +#: templates/details.html:17 templates/details.html:2 +msgid "Details" +msgstr "" + +#: templates/existing.html:33 +msgid "Discard" +msgstr "" + +#: templates/reports.html:3 +msgid "Draft Reports" +msgstr "" + +#: templates/around.html:3 +msgid "Drafts" +msgstr "" + +#: templates/around.html:19 +msgid "Finding your location" +msgstr "" + +#: templates/details_extra.html:2 +msgid "Further Details" +msgstr "" + +#: templates/login.html:2 templates/reports.html:2 templates/sent.html:2 +msgid "Home" +msgstr "" + +#: templates/submit_email.html:21 +msgid "I don't want to set a password" +msgstr "" + +#: templates/submit_email.html:22 +msgid "I'd like to set a password" +msgstr "" + +#: templates/submit_email.html:23 +msgid "I've already got one - login" +msgstr "" + +#: templates/reports.html:6 +msgid "" +"If you start compiling a report, but don't finish and send it, it'll appear " +"in this menu so you can finish it later" +msgstr "" + +#: templates/strings.js:41 +msgid "Invalid email" +msgstr "" + +#: templates/strings.js:42 +msgid "Invalid report" +msgstr "" + +#: templates/offline.html:27 +msgid "Locate" +msgstr "" + +#: templates/strings.js:27 +msgid "Location error" +msgstr "" + +#: templates/login.html:3 +msgid "Login" +msgstr "" + +#: templates/strings.js:45 +msgid "More details" +msgstr "" + +#: templates/strings.js:29 +msgid "" +"More than one location matched that name. Select one below or try entering " +"street name and area, or a postcode." +msgstr "" + +#: templates/around.html:37 +msgid "New Report Here" +msgstr "" + +#: templates/around.html:8 templates/details.html:3 +#: templates/details_extra.html:3 templates/photo.html:6 +msgid "Next" +msgstr "" + +#: templates/strings.js:44 +msgid "" +"No network connection available for submitting your report. Please try again " +"later" +msgstr "" + +#: templates/submit_name.html:9 +msgid "No problem - we don't like faffing with passwords either." +msgstr "" + +#: templates/offline.html:3 templates/save_offline.html:2 +msgid "Offline" +msgstr "" + +#: templates/offline.html:20 +msgid "" +"Oh dear - we can't detect an internet connection. However you can still " +"start a report now and complete it later, by going to 'drafts' when you're " +"back online." +msgstr "" + +#: templates/submit_confirm.html:21 templates/submit_name.html:26 +msgid "Optionally enter your phone number" +msgstr "" + +#: templates/strings.js:11 +msgid "Please choose a category" +msgstr "" + +#: templates/submit_confirm.html:11 templates/submit_password.html:21 +msgid "" +"Please confirm your name, if you want it to be public and optionally your " +"phone number." +msgstr "" + +#: templates/strings.js:33 +msgid "Please enter a location" +msgstr "" + +#: templates/strings.js:4 +msgid "Please enter a message" +msgstr "" + +#: templates/strings.js:20 +msgid "Please enter a password" +msgstr "" + +#: templates/strings.js:5 +msgid "Please enter a subject" +msgstr "" + +#: templates/strings.js:14 templates/strings.js:18 +msgid "Please enter a valid email" +msgstr "" + +#: templates/strings.js:6 +msgid "Please enter some details" +msgstr "" + +#: templates/strings.js:13 templates/strings.js:17 +msgid "Please enter your email" +msgstr "" + +#: templates/submit_email.html:8 +msgid "Please enter your email address" +msgstr "" + +#: templates/strings.js:9 +msgid "" +"Please enter your full name, councils need this information - if you do not " +"wish your name to be shown on the site, untick the box below" +msgstr "" + +#: templates/strings.js:8 templates/submit_confirm.html:18 +#: templates/submit_name.html:23 +msgid "Please enter your name" +msgstr "" + +#: templates/submit_password.html:28 +msgid "Please enter your phone number (optional)" +msgstr "" + +#: templates/details.html:18 +msgid "Please fill in details of the problem." +msgstr "" + +#: templates/submit_name.html:11 +msgid "Please give us some basic details, and you're nearly done." +msgstr "" + +#: templates/strings.js:36 +msgid "Please search for a street name and area, or postcode." +msgstr "" + +#: templates/details.html:9 templates/offline.html:33 +msgid "Provide a title" +msgstr "" + +#: templates/offline.html:60 templates/photo.html:21 +msgid "Remove Photo" +msgstr "" + +#: templates/submit_confirm.html:29 templates/submit_password.html:15 +msgid "Report" +msgstr "" + +#: templates/sent.html:3 +msgid "Report Created" +msgstr "" + +#: templates/around.html:40 +msgid "Reposition Report Here" +msgstr "" + +#: templates/existing.html:32 +msgid "Save for later" +msgstr "" + +#: templates/around.html:29 +msgid "Search or scroll the map" +msgstr "" + +#: templates/submit_name.html:36 +msgid "Send confirmation email" +msgstr "" + +#: templates/submit_confirm.html:25 templates/submit_name.html:31 +#: templates/submit_password.html:33 +msgid "Show my name publicly" +msgstr "" + +#: templates/login.html:12 templates/login.html:40 +msgid "Sign Out" +msgstr "" + +#: templates/login.html:36 +msgid "Signed in!" +msgstr "" + +#: templates/login.html:17 +msgid "Signed out!" +msgstr "" + +#: templates/offline.html:4 templates/photo.html:4 +msgid "Skip" +msgstr "" + +#: templates/details.html:8 +msgid "Subject" +msgstr "" + +#: templates/offline.html:47 templates/photo.html:20 +msgid "Take a new photo" +msgstr "" + +#: templates/sent.html:13 +msgid "Thanks. Your report will be sent to the authorities immediately." +msgstr "" + +#: templates/save_offline.html:5 +msgid "There is no internet connection" +msgstr "" + +#: templates/save_offline.html:8 +msgid "" +"There isn't an internet connection, do you want to save the current report " +"for later?" +msgstr "" + +#: templates/strings.js:35 +msgid "" +"There was a problem checking if we have all the details we need. Please try " +"again later" +msgstr "" + +#: templates/strings.js:34 +msgid "" +"There was a problem checking we cover this location. Please try again later." +msgstr "" + +#: templates/strings.js:25 +msgid "" +"There was a problem logging you in. Please check your email and password" +msgstr "" + +#: templates/strings.js:23 +msgid "There was a problem logging you in. Please try later" +msgstr "" + +#: templates/strings.js:24 +msgid "There was a problem logging you out. Please try later" +msgstr "" + +#: templates/strings.js:28 +msgid "There was a problem looking up your location" +msgstr "" + +#: templates/strings.js:32 +msgid "There was a problem submitting your report. Please try again" +msgstr "" + +#: templates/strings.js:31 +msgid "There was a problem submitting your report. Please try again later." +msgstr "" + +#: templates/strings.js:43 +msgid "There was a problem taking your photo" +msgstr "" + +#: templates/strings.js:26 +msgid "" +"There was a problem with your email/password combination. If you have " +"forgotten your password, or do not have one, you can set one by returning to " +"the email screen and selecting the set password option" +msgstr "" + +#: templates/submit_email.html:13 +msgid "" +"This app needs to send you a confirmation email before we can send your " +"report to the council." +msgstr "" + +#: templates/offline.html:25 +msgid "This report has a position." +msgstr "" + +#: templates/submit_name.html:16 templates/submit_name.html:17 +msgid "Title" +msgstr "" + +#: templates/submit_email.html:17 +msgid "To skip this step in future, you can set a password now." +msgstr "" + +#: templates/offline.html:2 +msgid "Try Again" +msgstr "" + +#: templates/existing.html:2 +msgid "Unsent Report" +msgstr "" + +#: templates/sent.html:15 +msgid "View it on the site" +msgstr "" + +#: templates/sent.html:10 +msgid "" +"We've sent you a confirmation email which may take a few minutes to arrive. " +"Once it arrives click the link in the email to confirm your report." +msgstr "" + +#. ('<%= user.email %>') +#. ("<%= user.email %>") +#: templates/submit_confirm.html:7 +msgid "You are logged in as %s" +msgstr "" + +#: templates/login.html:24 +msgid "Your Email" +msgstr "" + +#: templates/offline.html:56 +msgid "Your Photo" +msgstr "" + +#: templates/submit_confirm.html:2 templates/submit_email.html:2 +#: templates/submit_name.html:2 templates/submit_password.html:2 +#: templates/submit_set_password.html:2 +msgid "Your details" +msgstr "" + +#: templates/login.html:27 templates/submit_password.html:11 +#: templates/submit_set_password.html:11 +msgid "Your password" +msgstr "" + +#: templates/save_offline.html:13 +msgid "discard" +msgstr "" + +#: templates/strings.js:40 +msgid "required" +msgstr "" + +#: templates/save_offline.html:12 +msgid "save" +msgstr "" diff --git a/src/templates/en/sent.html b/src/templates/en/sent.html index 46ae694..d926303 100644 --- a/src/templates/en/sent.html +++ b/src/templates/en/sent.html @@ -7,8 +7,7 @@ <h3>Confirmation email sent</h3> <p> - We've sent you a confirmation email which may take a few minutes to arrive. Once it arrives - click the link in the email to confirm your report. + We've sent you a confirmation email which may take a few minutes to arrive. Once it arrives click the link in the email to confirm your report. </p> <% } else { %> <h3>Thanks. Your report will be sent to the authorities immediately.</h3> diff --git a/src/templates/en/submit_name.html b/src/templates/en/submit_name.html index fe0803c..f057842 100644 --- a/src/templates/en/submit_name.html +++ b/src/templates/en/submit_name.html @@ -6,7 +6,7 @@ <div id="errors"></div> <p class="top"> <% if ( nopassword ) { %> - No problem - we don't like faffing with passwords either. + No problem - we don't like faffing with passwords either. <% } %> Please give us some basic details, and you're nearly done. </p> diff --git a/templates/address_search.html b/templates/address_search.html new file mode 100644 index 0000000..b8bc71e --- /dev/null +++ b/templates/address_search.html @@ -0,0 +1,21 @@ +<div id="search-header" data-role="header"> + <a href="#" id="locate" data-transition="slidedown" class="ui-btn-left">Cancel</a> + <h1>Search</h1> +</div> +<div data-role="content"> + <div id="front-main"> + <h3 class="notopmargin">Enter a nearby GB postcode, or street name and area</h3> + <form class="inputcard" name="postcodeForm" id="postcodeForm"> + <div> + <input data-role="none" type="text" name="pc" value="" id="pc" size="10" maxlength="200" placeholder="e.g. ‘B2 4QA’ or ‘Tib St, Manchester’"> + </div> + </form> + <input type="button" value="Go" id="submit" data-theme="a"> + </div> + + <div id="front-howto"> + <% if (typeof msg != 'undefined' && msg !== '') { %> + <h2><%= msg %></h2> + <% } %> + </div> +</div> diff --git a/templates/around.html b/templates/around.html new file mode 100644 index 0000000..6ca584b --- /dev/null +++ b/templates/around.html @@ -0,0 +1,46 @@ +<div data-id="locate" id="around-header" data-role="header"> + <a id="view-my-reports" class="nodisplay ui-btn ui-btn-left ui-btn-up-a ui-shadow ui-btn-corner-all" data-role="none" href="#"> + <span class="ui-btn-inner"<span class="ui-btn-text">[% loc('Drafts') %] <span class="draft_count"><% print( FMS.allDrafts.length ) %></span></span></span> + </a> + <a id="cancel" class="nodisplay" data-role="button" data-icon="arrow-l">[% loc('Cancel') %]</a> + <h1>FixMyStreet</h1> + <a id="login-options" data-icon="fms-account" class="nodisplay ui-btn-right">[% loc('Account') %]</a> + <a id="confirm" class="nodisplay" data-role="button" data-iconpos="right" data-icon="arrow-r">[% loc('Next') %]</a> +</div> + + <div id="locating" class="nodisplay"> + <div class="radar"></div> + <div id="progress"> + <div id="progress-bar"> + </div> + </div> + + <p> + [% loc('Finding your location') %] + </p> + + <p> + <input data-theme="c" type="button" id="locate_cancel" value="[% loc( 'Cancel' ) %]"> + </p> + </div> +<div data-role="content"> + <div class="frontpage-menu"> + <form class="inputcard" name="postcodeForm" id="postcodeForm"> + <input type="search" id="pc" name="pc" placeholder="[% loc('Search or scroll the map') %]"> + </form> + <a data-role="none" id="relocate" class="nodisplay"><img src="images/location@x2.png"></a> + + <div class="nodisplay" id="front-howto"></div> + </div> + + <a id="mark-here" data-role="button" data-theme="a" class="map-bottom-btn"> + [% loc('New Report Here') %] + </a> + <a id="reposition" data-role="button" data-theme="c" class="map-bottom-btn nodisplay"> + [% loc('Reposition Report Here') %] + </a> + <a id="confirm-map" data-role="button" data-theme="a" class="map-bottom-btn"> + [% loc('Confirm Location') %] + </a> + +</div> diff --git a/templates/details.html b/templates/details.html new file mode 100644 index 0000000..1b68026 --- /dev/null +++ b/templates/details.html @@ -0,0 +1,21 @@ +<div data-role="header"> + <h1>[% loc('Details') %]</h1> + <a id="next" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Next') %]</a> +</div> +<div data-role="content"> + <div class="gmailstyletest"> + <div> + <label for="form_title">[% loc('Subject') %]</label> + <input data-role="none" type="text" name="title" id="form_title" placeholder="[% loc('Provide a title') %]" value="<%= title %>" required> + </div> + + <div> + <%= categories %> + </div> + + <div class="noborder"> + <label for="form_detail">[% loc('Details') %]</label> + <textarea data-role="none" name="detail" id="form_detail" placeholder="[% loc('Please fill in details of the problem.') %]" required><%= details %></textarea> + </div> + </div> +</div> diff --git a/templates/details_extra.html b/templates/details_extra.html new file mode 100644 index 0000000..8449447 --- /dev/null +++ b/templates/details_extra.html @@ -0,0 +1,7 @@ +<div data-role="header" data-position="fixed"> + <h1>[% loc('Further Details') %]</h1> + <a id="next" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Next') %]</a> +</div> +<div data-role="content" data-enhance="false"> + <%= category_extras %> +</div> diff --git a/templates/existing.html b/templates/existing.html new file mode 100644 index 0000000..ac2739a --- /dev/null +++ b/templates/existing.html @@ -0,0 +1,35 @@ +<div data-role="header"> + <h1>[% loc('Unsent Report') %]</h1> +</div> +<div data-role="content" role="main"> + <div id="existing_report"> + <% if ( title ) { %> + <h3><%= title %></h3> + <% } %> + + <div class="meta"> + <p> + <% if ( category && category != '[% loc('-- Pick a category --') %]' ) { %> + [% tprintf('Saved in the %s category', '<%= category %>') %] + <% } %> + </p> + + <p><% print( moment( created ).fromNow() ) %></p> + </div> + + <% if ( file ) { %> + <div class="photo" style="background-image: url(<%= file %>)"></div> + <% } %> + + <% if ( details ) { %> + <div class="details"><div><%= details %></div></div> + <% } %> + </div> + + + <div class="right"> + <input id="use_report" type="button" value="[% loc('Complete report now') %]" data-role="button" data-theme="a" /> + <input id="save_report" type="button" value="[% loc('Save for later') %]" data-role="button" data-theme="a" /> + <input id="discard" type="button" value="[% loc('Discard') %]" data-role="button" data-theme="a" /> + </div> +</div> diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..e8e0e8c --- /dev/null +++ b/templates/home.html @@ -0,0 +1,5 @@ +<div data-role="content"> + <div id="locating"> + <div class="radar"></div> + </div> +</div> diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..4db70d8 --- /dev/null +++ b/templates/login.html @@ -0,0 +1,43 @@ +<div id="submit-header" data-role="header"> + <a id="reports-next-btn" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">[% loc('Home') %]</a> + <h1>[% loc('Login') %]</h1> +</div> + +<div data-role="content"> + <% if ( FMS.isLoggedIn ) { %> + <div id="signed_in_row"> + <p class="notopmargin">[% tprintf('You are signed in as %s', '<%= email %>') %]</p> + <div id="err" class="nodisplay"></div> + <div class="bottom-btn"> + <input type="button" id="logout" name="logout" value="[% loc('Sign Out') %]" data-theme="a"> + </div> + </div> + <div id="password_row" class="nodisplay"> + <p class="notopmargin"> + [% loc('Signed out!') %] + </p> + <% } else { %> + <div id="password_row"> + <% } %> + <form name="signinForm" class="inputcard" id="signinForm"> + <div> + <input data-role="none" type="email" value="" name="email" id="form_email" placeholder="[% loc('Your Email') %]" required> + </div> + <div> + <input data-role="none" type="password" value="" name="password" id="form_password" placeholder="[% loc('Your password') %]" required> + </div> + <div class="bottom-btn"> + <input type="submit" id="login" name="login" value="Login" data-theme="a"> + </div> + </form> + </div> + <div id="success_row" class="nodisplay"> + <p class="notopmargin"> + [% loc('Signed in!') %] + </p> + <div id="err" class="nodisplay"></div> + <div class="bottom-btn"> + <input type="button" id="logout" name="logout" value="[% loc('Sign Out') %]" data-theme="a"> + </div> + </div> +</div> diff --git a/templates/offline.html b/templates/offline.html new file mode 100644 index 0000000..a7fb8c0 --- /dev/null +++ b/templates/offline.html @@ -0,0 +1,63 @@ +<div data-role="header" data-position="fixed"> + <a id="offline-prev-btn" class="ui-btn-left">[% loc('Try Again') %]</a> + <h1>[% loc('Offline') %]</h1> + <a id="offline-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Skip') %]</a> +</div> + <div id="locating" class="nodisplay"> + <div class="radar"></div> + <div id="progress"> + <div id="progress-bar"> + </div> + </div> + + <p> + <input data-theme="c" type="button" id="locate_cancel" value="[% loc('Cancel') %]"> + </p> + </div> +<div data-role="content"> + <div> + <p class="notopmargin"> + [% loc("Oh dear - we can't detect an internet connection. However you can still start a report now and complete it later, by going to 'drafts' when you're back online.") %] + </p> + + <p id="locate_result"> + <% if ( lat ) { %> + [% loc('This report has a position.') %] + <% } else { %> + <input type="button" data-role="button" data-theme="a" id="locate" value="[% loc('Locate') %]" > + <% } %> + </p> + + <div class="inputcard"> + <div> + <input data-role="none" type="text" value="<%= title %>" name="title" id="form_title" placeholder="[% loc('Provide a title') %]" required> + </div> + + <div> + <textarea data-role="none" rows="7" cols="26" name="detail" id="form_detail" placeholder="Please fill in details of the problem." required><%= details %></textarea> + </div> + </div> + + <% if ( file != '' ) { %> + <div id="add_photo" style="display: none"> + <% } else { %> + <div id="add_photo"> + <% } %> + <label>[% loc('Add a Photo ') %]<em>[% loc('(optional)') %]</em></label> + <input data-icon="fms-photo-new" value="[% loc('Take a new photo') %]" type="button" name="photo_button" id="id_photo_button" data-role="button" data-theme="a"> + <input data-icon="fms-photo-existing" value="[% loc('Add an existing photo') %]" type="button" name="existing" id="id_existing" data-role="button" data-theme="c"> + </div> + + <% if ( file == '' ) { %> + <div id="display_photo" style="display: none"> + <% } else { %> + <div id="display_photo"> + <% } %> + <label>[% loc('Your Photo') %]</label> + <div class="photo"> + <img class="small" id="photo" src="<%= file %>" /> + </div> + <input value="[% loc('Remove Photo') %]" type="button" name="del_photo_button" id="id_del_photo_button" data-role="button" data-theme="a"> + </div> + </div> +</div> diff --git a/templates/photo.html b/templates/photo.html new file mode 100644 index 0000000..2bc586b --- /dev/null +++ b/templates/photo.html @@ -0,0 +1,23 @@ +<div data-role="header"> + <h1>[% loc('Add Photo') %]</h1> + <% if ( file == '' ) { %> + <a id="photo-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Skip') %]</a> + <% } else { %> + <a id="photo-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">[% loc('Next') %]</a> + <% } %> +</div> +<div data-role="content"> + <h2>[% loc('Add a Photo') %] <em>[% loc('(optional)') %]</em>:</h2> + <div class="photo"> + <% if ( file == '' ) { %> + <img class="placeholder" src="images/placeholder-photo.png" alt="" id="photo"> + <% } else { %> + <img class="small" id="photo" src="<%= file %>" /> + <% } %> + </div> + <div class="bottom-btn"> + <input data-icon="fms-photo-existing" type="button" id="id_existing" data-theme="c" value="[% loc('Add an existing photo') %]" > + <input data-icon="fms-photo-new" id="id_photo_button" type="button" data-theme="a" value="[% loc('Take a new photo') %]"> + <input id="id_del_photo_button" type="button" data-theme="a" value="[% loc('Remove Photo') %]"> + </div> +</div> diff --git a/templates/reports.html b/templates/reports.html new file mode 100644 index 0000000..c7a91d7 --- /dev/null +++ b/templates/reports.html @@ -0,0 +1,27 @@ +<div data-role="header" data-position="fixed"> + <a id="reports-next-btn" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">[% loc('Home') %]</a> + <h1>[% loc('Draft Reports') %]</h1> +</div> +<div id="drafts"> + <p id="noreports" class="nodisplay">[% loc("If you start compiling a report, but don't finish and send it, it'll appear in this menu so you can finish it later") %]</p> + <div id="report-list" class="nodisplay"> + <ul data-role="listview" data-split-theme="c" data-inset="true" data-split-icon="delete" class="notopmargin reports"> + <% drafts.each(function(draft) { + if ( draft ) { + var classes = []; + if ( draft.get('lat') ) { + classes.push('with_location'); + } + if ( draft.get('file') ) { + classes.push('with_photo'); + } + var draftClass = ''; + if ( classes.length ) { + draftClass = 'class="' + classes.join(' ') + '"'; + } + print( '<li id="' + draft.id + '"' + draftClass + '><a href="#" class="use_report">' + draft.description() + '</a><a class="del_report" href="#" title="delete">[% loc('Delete') %]</a></li>' ); + } + } ); %> + </ul> + </div> +</div> diff --git a/templates/save_offline.html b/templates/save_offline.html new file mode 100644 index 0000000..833f057 --- /dev/null +++ b/templates/save_offline.html @@ -0,0 +1,15 @@ +<div data-role="header"> + <h1>[% loc('Offline') %]</h1> +</div> +<div data-role="content"> + <h3 class="notopmargin">[% loc('There is no internet connection') %]</h3> + + <p> + [% loc("There isn't an internet connection, do you want to save the current report for later?") %] + </p> + + <div class="bottom-btn"> + <input id="save_report" type="button" value="[% loc('save') %]"> + <input id="discard" type="button" value="[% loc('discard') %]"> + </div> +</div> diff --git a/templates/sent.html b/templates/sent.html new file mode 100644 index 0000000..ee86958 --- /dev/null +++ b/templates/sent.html @@ -0,0 +1,17 @@ +<div id="report-created-header" data-role="header"> + <a class="ui-btn-left">[% loc('Home') %]</a> + <h1>[% loc('Report Created') %]</h1> +</div> +<div data-role="content"> + <% if ( typeof email_confirm != 'undefined' && email_confirm === 1 ) { %> + <h3>[% loc('Confirmation email sent') %]</h3> + + <p> + [% loc("We've sent you a confirmation email which may take a few minutes to arrive. Once it arrives click the link in the email to confirm your report.") %] + </p> + <% } else { %> + <h3>[% loc('Thanks. Your report will be sent to the authorities immediately.') %]</h3> + + <p class="center"><a onclick="FMS.openExternal(event); return false;" href="<%= site_url %>">[% loc('View it on the site') %]</a></p> + <% } %> +</div> diff --git a/templates/strings.js b/templates/strings.js new file mode 100644 index 0000000..85af084 --- /dev/null +++ b/templates/strings.js @@ -0,0 +1,48 @@ +(function (FMS, _) { + _.extend( FMS, { + validationStrings: { + update: '[% loc('Please enter a message') %]', + title: '[% loc('Please enter a subject') %]', + detail: '[% loc('Please enter some details') %]', + name: { + required: '[% loc('Please enter your name') %]', + validName: '[% loc('Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box below') %]' + }, + category: '[% loc('Please choose a category') %]', + rznvy: { + required: '[% loc('Please enter your email') %]', + email: '[% loc('Please enter a valid email') %]' + }, + email: { + required: '[% loc('Please enter your email') %]', + email: '[% loc('Please enter a valid email') %]' + }, + password: '[% loc('Please enter a password') %]' + }, + strings: { + login_error: '[% loc('There was a problem logging you in. Please try later') %]', + logout_error: '[% loc('There was a problem logging you out. Please try later') %]', + login_details_error: '[% loc('There was a problem logging you in. Please check your email and password') %]', + password_problem: '[% loc('There was a problem with your email/password combination. If you have forgotten your password, or do not have one, you can set one by returning to the email screen and selecting the set password option') %]', + location_error: '[% loc('Location error') %]', + location_problem: '[% loc('There was a problem looking up your location') %]', + multiple_locations: '[% loc('More than one location matched that name. Select one below or try entering street name and area, or a postcode.') %]', + sync_error: '[% loc('An error was encountered when submitting your report: ') %]', + unknown_sync_error: '[% loc('There was a problem submitting your report. Please try again later.') %]', + report_send_error: '[% loc('There was a problem submitting your report. Please try again') %]', + missing_location: '[% loc('Please enter a location') %]', + location_check_failed: '[% loc('There was a problem checking we cover this location. Please try again later.') %]', + category_extra_check_error: '[% loc('There was a problem checking if we have all the details we need. Please try again later') %]', + locate_dismissed: '[% loc('Please search for a street name and area, or postcode.') %]', + geolocation_failed: '[% loc('Could not determine your location, please search for a street name and area, or postcode instead.') %]', + geolocation_denied: '[% loc('Could not access location services. Please check permissions.') %]', + select_category: '[% loc('-- Pick a category --') %]', + required: '[% loc('required') %]', + invalid_email: '[% loc('Invalid email') %]', + invalid_report: '[% loc('Invalid report') %]', + photo_failed: '[% loc('There was a problem taking your photo') %]', + no_connection: '[% loc('No network connection available for submitting your report. Please try again later') %]', + more_details: '[% loc('More details') %]' + } + }); +})(FMS, _); diff --git a/templates/submit.html b/templates/submit.html new file mode 100644 index 0000000..a36d1e2 --- /dev/null +++ b/templates/submit.html @@ -0,0 +1,98 @@ +<div id="submit-header" data-role="header" data-position="fixed" data-id="locate"> + <h1>Submit</h1> +</div> + +<div class="container" data-role="content" data-enhance="false"> + <div class="content" role="main"> + + + <fieldset> + <div id="problem_form"> + <% if ( user && user.password ) { %> + <div id="signed_in"> + <p> + You are signed in as <span id="username"><%= user.name %></span> + </p> + + <p id="confirm_details">Confirm details</p> + <div id="name_details"> + <label for="form_may_show_name">Name</label> + <input type="text" class="validName" value="<%= user.name %>" name="name" id="form_name" placeholder="Your name"> + + <div class="checkbox-group"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked> + <label class="inline" for="form_may_show_name">Show my name publicly</label> + </div> + + <label for="form_phone">Phone number</label> + <input type="text" value="<%= user.phone %>" name="phone" id="form_phone" placeholder="Your phone number (optional)"> + </div> + + <div class="form-txt-submit-box"> + <input class="green-btn" type="button" id="submit_signed_in" name="submit_signed_in" value="Report"> + </div> + </div> + <% } else { %> + <div id="signed_out"> + <label for="form_email" id="email_label">Your email</label> + <input type="email" value="<%= user.email %>" name="email" id="form_email" placeholder="Please enter your email address" required> + + <div id="form_sign_in"> + <h4 id="have_password">Do you have a FixMyStreet password?</h4> + + <div id="form_sign_in_yes" class="form-box"> + + <h5><strong>Yes</strong> I have a password</h5> + + <label class="hidden-js n" for="password_sign_in">Yes I have a password</label> + <div class="form-txt-submit-box"> + <input type="password" name="password_sign_in" id="password_sign_in" placeholder="Your password" value=""> + <input class="green-btn" type="button" id="submit_sign_in" name="submit_sign_in" value="Report"> + </div> + </div> + + <div id="form_sign_in_no" class="form-box"> + <h5 id="let_me_confirm"><strong>No</strong> Let me confirm my report by email</h5> + + <div id="name_details"> + <label for="form_may_show_name">Name</label> + <input type="text" class="validName" value="<%= user.name %>" name="name" id="form_name" placeholder="Your name"> + + <div class="checkbox-group"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked> + <label class="inline" for="form_may_show_name">Show my name publicly</label> + </div> + + <label for="form_phone">Phone number</label> + <input type="text" value="<%= user.phone %>" name="phone" id="form_phone" placeholder="Your phone number (optional)"> + </div> + + <div id="password_surround"> + <label class="form-focus-hidden" for="password_register" id="password_label">Password</label> + </div> + + <div class="form-txt-submit-box form-focus-hidden"> + <input type="password" name="password_register" id="password_register" value="" placeholder="Enter a password (optional)"> + <input class="green-btn" type="button" id="submit_register" name="submit_register" value="Report"> + </div> + + </div> + </div> + </div> + <% } %> + + <div id="report_save" class="form-box"> + <h5>Save this report for completion later</h5> + <div class="form-txt-submit-box"> + <input class="green-btn" type="button" id="save_report" name="save_report" value="Save"> + </div> + </div> + </div> + </fieldset> + + <input type="hidden" name="submit_problem" value="1"> + </div> + + </div> + </div> +</div> diff --git a/templates/submit_confirm.html b/templates/submit_confirm.html new file mode 100644 index 0000000..1a20b28 --- /dev/null +++ b/templates/submit_confirm.html @@ -0,0 +1,31 @@ +<div id="submit-header" data-role="header"> + <h1>[% loc('Your details') %]</h1> +</div> + +<div data-role="content"> + <p class="notopmargin"> + [% tprintf('You are logged in as %s', '<%= user.email %>') %]. + </p> + + <p> + [% loc('Please confirm your name, if you want it to be public and optionally your phone number.') %] + </p> + + <div id="errors"></div> + + <div class="inputcard"> + <div> + <input data-role="none" type="text" value="<%= user.name %>" name="name" id="form_name" placeholder="[% loc('Please enter your name') %]" required> + </div> + <div> + <input data-role="none" type="tel" value="<%= user.phone %>" name="name" id="form_phone" placeholder="[% loc('Optionally enter your phone number') %]"> + </div> + <div class="checkbox-group noborder"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked> + <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label> + </div> + </div> + <div class="bottom-btn"> + <input data-role="button" data-theme="a" type="button" id="report" name="report" value="[% loc('Report') %]"> + </div> +</div> diff --git a/templates/submit_email.html b/templates/submit_email.html new file mode 100644 index 0000000..17f1824 --- /dev/null +++ b/templates/submit_email.html @@ -0,0 +1,25 @@ +<div id="submit-header" data-role="header"> + <h1>[% loc('Your details') %]</h1> +</div> + +<div data-role="content"> + <div class="inputcard"> + <div> + <input data-role="none" type="email" value="<%= user.email %>" name="email" id="form_email" placeholder="[% loc('Please enter your email address') %]" required> + </div> + </div> + + <p> + [% loc('This app needs to send you a confirmation email before we can send your report to the council.') %] + </p> + + <p> + [% loc('To skip this step in future, you can set a password now.') %] + </p> + + <div class="bottom-btn"> + <input data-role="button" data-theme="a" type="button" id="email_confirm" name="email_confirm" value="[% loc("I don't want to set a password") %]"> + <input data-role="button" data-theme="a" type="button" id="set_password" name="set_password" value="[% loc("I'd like to set a password") %]"> + <input data-role="button" data-theme="a" type="button" id="have_password" name="have_password" value="[% loc("I've already got one - login") %]"> + </div> +</div> diff --git a/templates/submit_name.html b/templates/submit_name.html new file mode 100644 index 0000000..986a1e6 --- /dev/null +++ b/templates/submit_name.html @@ -0,0 +1,38 @@ +<div id="submit-header" data-role="header"> + <h1>[% loc('Your details') %]</h1> +</div> + +<div data-role="content"> + <div id="errors"></div> + <p class="top"> + <% if ( nopassword ) { %> + [% loc("No problem - we don't like faffing with passwords either.") %] + <% } %> + [% loc("Please give us some basic details, and you're nearly done.") %] + </p> + <div class="inputcard"> + <% if ( typeof model.title_list !== 'undefined' ) { %> + <div> + <select data-role="none" placeholder="[% loc('Title') %]" id="form_title" name="title" required> + <option value="">[% loc('Title') %]</option> + <% for ( var i = 0; i < model.title_list.length; i++ ) { var title = model.title_list[i]; print( '<option value="' + title + '">' + title + '</option>' ); } %> + </select> + </div> + <% } %> + <div> + <input data-role="none" type="text" value="<%= user.name %>" name="name" id="form_name" placeholder="[% loc('Please enter your name') %]" required> + </div> + <div> + <input data-role="none" type="tel" value="<%= user.phone %>" name="name" id="form_phone" placeholder="[% loc('Optionally enter your phone number') %]"> + </div> + <div data-role="fieldcontain"> + <fieldset data-role="controlgroup"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked> + <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> + </fieldset> + </div> + </div> + <div class="bottom-btn"> + <input data-role="button" data-theme="a" type="button" id="send_confirm" name="send_confirm" value="[% loc('Send confirmation email') %]"> + </div> +</div> diff --git a/templates/submit_password.html b/templates/submit_password.html new file mode 100644 index 0000000..11565b1 --- /dev/null +++ b/templates/submit_password.html @@ -0,0 +1,42 @@ +<div id="submit-header" data-role="header"> + <h1>[% loc('Your details') %]</h1> +</div> + +<div data-role="content"> + <div id="errors"></div> + <form id="passwordForm" name="passwordForm"> + <div id="password_row"> + <div class="inputcard"> + <div> + <input data-role="none" type="password" value="" name="password" id="form_password" placeholder="[% loc('Your password') %]" required> + </div> + </div> + <div class="bottom-btn"> + <input data-role="button" data-theme="a" type="submit" id="report" name="report" value="[% loc('Report') %]"> + </div> + </div> + <div id="check_name" class="nodisplay"> + <div class="inputcard"> + <p> + [% loc('Please confirm your name, if you want it to be public and optionally your phone number.') %] + </p> + + <div> + <input data-role="none" type="text" value="" id="form_name" name="name"> + </div> + <div> + <input data-role="none"type="tel" value="<%= user.phone %>" name="name" id="form_phone" placeholder="[% loc('Please enter your phone number (optional)') %]"> + </div> + <div data-role="fieldcontain"> + <fieldset data-role="controlgroup"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked> + <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> + </fieldset> + </div> + </div> + <div class="bottom-btn"> + <input data-role="button" data-theme="a" type="submit" id="confirm_name" name="report" value="[% loc('Confirm name') %]"> + </div> + </div> + </form> +</div> diff --git a/templates/submit_set_password.html b/templates/submit_set_password.html new file mode 100644 index 0000000..6c63b40 --- /dev/null +++ b/templates/submit_set_password.html @@ -0,0 +1,19 @@ +<div id="submit-header" data-role="header"> + <h1>[% loc('Your details') %]</h1> +</div> + +<div data-role="content"> + <div id="errors"></div> + <form id="passwordForm" name="passwordForm"> + <div id="password_row"> + <div class="inputcard"> + <div> + <input data-role="none" type="password" value="" name="password" id="form_password" placeholder="[% loc('Your password') %]" required> + </div> + </div> + <div class="bottom-btn"> + <input data-role="button" data-theme="a" type="submit" id="continue" name="report" value="[% loc('Continue') %]"> + </div> + </div> + </form> +</div> |