aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/fixmystreet.com/fixture160
-rw-r--r--perllib/FixMyStreet/DB/Factories.pm2
-rw-r--r--templates/web/base/auth/general.html3
-rw-r--r--templates/web/borsetshire/auth/_general_top.html47
-rw-r--r--templates/web/borsetshire/front/footer-marketing.html6
-rw-r--r--web/cobrands/borsetshire/base.scss52
-rw-r--r--web/cobrands/borsetshire/js.js4
-rw-r--r--web/cobrands/borsetshire/layout.scss48
8 files changed, 278 insertions, 44 deletions
diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture
index 02f0505e9..194bdc48c 100755
--- a/bin/fixmystreet.com/fixture
+++ b/bin/fixmystreet.com/fixture
@@ -15,6 +15,7 @@ BEGIN {
require "$d/../../setenv.pl";
}
+use List::Util qw(shuffle);
use FixMyStreet;
use FixMyStreet::Cobrand;
use FixMyStreet::DB::Factories;
@@ -68,13 +69,26 @@ my $body = FixMyStreet::DB::Factory::Body->find_or_create({
});
say "Created body " . $body->name . " for MapIt area ID " . $opt->area_id . ', categories ' . join(', ', @$categories);
-FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Generic' });
-FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Fixed', state => 'fixed - council' });
-FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Monitoring', state => 'unable to fix' });
-my $template = FixMyStreet::DB::Factory::ResponseTemplate->create({ body => $body, title => 'Not us', state => 'not responsible' });
+FixMyStreet::DB::Factory::ResponseTemplate->create({
+ body => $body, title => 'Generic',
+ text => 'Thank you for your report, we will be in touch with an update soon.' });
+FixMyStreet::DB::Factory::ResponseTemplate->create({
+ body => $body, title => 'Fixed', state => 'fixed - council',
+ text => 'Thank you for reporting that issue, it has now been resolved.' });
+FixMyStreet::DB::Factory::ResponseTemplate->create({
+ body => $body, title => 'Monitoring', state => 'unable to fix',
+ text => 'Thank you for your enquiry. I have visited the site and assessed the problem that you have identified. Unfortunately it doesn’t meet our current intervention criteria so I cannot arrange a repair. We will continue to monitor this during our routine inspections.' });
+FixMyStreet::DB::Factory::ResponseTemplate->create({
+ body => $body, title => 'Taxed in date', state => 'unable to fix',
+ text => 'We have investigated this report and found the vehicle to be taxed therefore no further action will be taken. Please note that from October 2014 it is no longer a legal requirement to display a tax disc.' });
+my $template = FixMyStreet::DB::Factory::ResponseTemplate->create({
+ body => $body, title => 'Not responsible', state => 'not responsible',
+ text => 'This report is not the responsibility of the council and will be passed to the relevant organisation.' });
$template->add_to_contacts($body->contacts->first);
-my $priority = FixMyStreet::DB::Factory::ResponsePriority->create_batch(3, { body => $body });
-$priority->[0]->add_to_contacts($body->contacts->first);
+my $priority = FixMyStreet::DB::Factory::ResponsePriority->create({ body => $body, description => '4 hour fix' });
+FixMyStreet::DB::Factory::ResponsePriority->create({ body => $body, description => '28 day fix' });
+FixMyStreet::DB::Factory::ResponsePriority->create({ body => $body, description => 'For information only' });
+$priority->add_to_contacts($body->contacts->first);
# Users
say "Created users, all with password 'password':";
@@ -109,6 +123,37 @@ my %titles = (
'Graffiti' => ['Graffiti', 'Graffiti', 'Offensive graffiti', 'Graffiti on the bridge', 'Remove graffiti'],
'Other' => ['Loose drain cover', 'Flytipping on country lane', 'Vehicle blocking footpath', 'Hedge encroaching pavement', 'Full litter bins'],
);
+my %descriptions = (
+ 'Potholes' => [
+ '6” deep pothole in the very centre of the Bristol road; cars are swerving to avoid it. Please treat this as a matter of urgency.',
+ 'It’s small but it’s a trip hazard. Right where people cross over to get into the school or church. About 3” across but will become larger if not attended to.',
+ 'Just went over my handlebars as I didn’t see this pothole on Banbury road, just before the traffic lights. Dread to think what might have happened if the traffic had been busier.',
+ 'I work in the cafe at 34 Clarington Avenue and we’ve had four people come in having tripped over in the last seven days. The pothole’s right outside the key-cutting shop, just near the alleyway.',
+ 'This has been here, next to the side of the road, for a month',
+ 'A manhole on the junction of Etherington Road is sinking into the road surface. Not only is it an accident waiting to happen but it’s making a terrible noise every time a car passes over it.',
+ ],
+ 'Street lighting' => [
+ 'I saw a workman attempting to fix this streetlight over a week ago, and ever since then it’s come on in the daytime and gone off as soon as it gets dark. Come and sort it out please!',
+ 'Every Tuesday night I have to walk across the carpark outside the station at around 9pm. Not a problem in summer but now the nights are drawing in I feel very unsafe. Please get the streetlight by the exit fixed as I’m sure I can’t be the only woman feeling vulnerable.',
+ 'My toddler is too scared to go in now, as soon as you’re more than a few paces in it’s absolutely pitch black with no hope of seeing any puddles or worse on the floor. I think this needs seeing to as a priority. Thank you.',
+ 'I think the lights in the multi storey carpark are motion sensitive but I’ve actually never seen them come on. Maybe the bulb needs replacing??',
+ 'This streetlight is right outside my bedroom window. It is on 24 hours a day, even in blazing sunlight. Apart from the fact that it’s a waste of electricity, it makes my bedroom feel like an interrogation chamber. Please come and fix it.',
+ ],
+ 'Graffiti' => [
+ 'Someone has scrawled a really offensive piece of graffiti (are they called ‘tags’??) on the side of the town hall. You might want to see about getting it cleaned off. Wouldn’t want my own children to see that, I’m sure others feel the same.',
+ 'Can’t see the timetable at the bus shelter cos some idiot’s covered it all in red spray paint. Honestly. Kids of today.',
+ 'Not gonna write down what it depicts cos I suspect that’d get caught in your profanity filter lol. But please do come and paint over this monstrosity before it causes an accident.',
+ 'That same guy that’s graffitied all over town has gone and done the same on the passenger bridge over the tracks, you can see it as you come into the station. Ugly bit of garbage graffiti. Bit of a poor first impression for the town eh.',
+ 'What’s the procedure for requesting a bit of graffiti be removed? There’s been a huge scrawl on the wall outside the club for months. Nice sentiment maybe but really brings the tone of the area down.',
+ ],
+ 'Other' => [
+ 'Surprised me so much when I crossed the road I nearly took a tumble! Glad I didn’t fall in, this really needs securing now.',
+ 'Some unmentionable has driven down Larker’s Lane and left a huge heap of old rubbish on the verge. Talk about ruining the view! Such a beautiful spot and these lowlifes come and dump their junk. Probably trying to avoid paying the tip.',
+ 'Well someone on foot can just about squeeze through but good luck if you’ve got a pushchair or god forbid a wheelchair. Think someone’s abandoned this car; it hasn’t moved in weeks.',
+ 'Awful trying to walk past after a rain shower, well any time really.',
+ 'I think these need seeing to more frequently, they’re always full to overflowing by midday.',
+ ],
+);
my ($location, $lat, $lon);
if ($opt->coords) {
@@ -139,6 +184,8 @@ for (1..$num) {
$confirmed->add(seconds => rand(7000));
my $category = $categories->[int(rand(@$categories))];
my $titles = $titles{$category};
+ my $descs = $descriptions{$category};
+ my $rand = int(rand(@$titles));
push @$problems, FixMyStreet::DB::Factory::Problem->create({
body => $body,
areas => ',' . $opt->area_id . ',',
@@ -148,8 +195,8 @@ for (1..$num) {
longitude => $lon + rand(3 * $inaccurate_km) - 1.5 * $inaccurate_km,
category => $category,
cobrand => $cobrand,
- title => $titles->[int(rand(@$titles))],
- detail => 'The details of the report would be here, provided by the user, including exact location and how long it has been here.',
+ title => $titles->[$rand],
+ detail => $descs->[$rand],
confirmed => DateTime::Format::Pg->format_datetime($confirmed),
});
}
@@ -159,16 +206,101 @@ for (1..3) {
$users{'inspector@example.org'}->add_to_planned_reports($p);
}
-# Comment
+# Flow comments
+my @fixed_user = (
+ 'Brilliant! Seen to within two days and no more problems, thanks.',
+ 'Thank you for getting this sorted out so quickly.',
+ 'Walked past last Tuesday and it seems to have been fixed, hooray.',
+ 'Well it took a few emails back and forth to understand the exact location etc but pleased to say it’s all ok now.',
+ 'Yep, all good.',
+ 'The council deserve every penny of their salaries, honestly can’t give them higher praise for the way they’ve handled this issue. Bravo.',
+ 'All seems ok now, fingers crossed.',
+ 'Bish bash bosh. Sorted. Thanks so much.',
+);
+
+my @problems = shuffle(@$problems);
+
+for (1..3) {
+ my $problem = $problems[$_];
+ $confirmed->add(seconds => rand(10000));
+ FixMyStreet::DB::Factory::Comment->create({
+ problem => $problem,
+ user => $users{'cs@example.org'},
+ text => 'Could you please provide a better picture so we can locate this issue more easily.',
+ confirmed => DateTime::Format::Pg->format_datetime($confirmed),
+ });
+ $confirmed->add(seconds => rand(10000));
+ FixMyStreet::DB::Factory::Comment->create({
+ problem => $problem,
+ user => $user,
+ text => 'Here you go!',
+ confirmed => DateTime::Format::Pg->format_datetime($confirmed),
+ });
+ $confirmed->add(seconds => rand(10000));
+ FixMyStreet::DB::Factory::Comment->create({
+ problem => $problem,
+ problem_state => 'investigating',
+ user => $users{'cs@example.org'},
+ text => 'Thanks, we are now looking into this.',
+ confirmed => DateTime::Format::Pg->format_datetime($confirmed),
+ });
+ $confirmed->add(seconds => rand(10000));
+ FixMyStreet::DB::Factory::Comment->create({
+ problem => $problem,
+ problem_state => 'action scheduled',
+ user => $users{'inspector@example.org'},
+ text => 'Confirmed and scheduled for fixing.',
+ confirmed => DateTime::Format::Pg->format_datetime($confirmed),
+ });
+ $confirmed->add(seconds => rand(10000));
+ FixMyStreet::DB::Factory::Comment->create({
+ problem => $problem,
+ problem_state => 'fixed - council',
+ user => $users{'inspector@example.org'},
+ text => 'Fixed',
+ confirmed => DateTime::Format::Pg->format_datetime($confirmed),
+ });
+ $problem->update({ state => 'fixed - council' });
+ $confirmed->add(seconds => rand(10000));
+ FixMyStreet::DB::Factory::Comment->create({
+ problem => $problem,
+ user => $user,
+ text => $fixed_user[int(rand(@fixed_user))],
+ confirmed => DateTime::Format::Pg->format_datetime($confirmed),
+ });
+}
+
+# Some 'still open' updates
+my @open_user = (
+ 'I’m afraid this problem is recurrent. Could it be prioritised please?',
+ 'Ongoing issue.',
+ 'Council rang to say they’re aware and it’s on their list.',
+ 'Still awaiting news on this one.',
+ 'Council let me know it’s not a top priority, which TBH I do understand now they’ve talked it through.',
+);
my $updates = [];
-for (1..$num) {
- $confirmed->add(seconds => rand(1000));
+for (5..9) {
+ $confirmed->add(seconds => rand(10000));
push @$updates, FixMyStreet::DB::Factory::Comment->create({
- problem => $problems->[int(rand(@$problems))],
+ problem => $problems[$_],
user => $user,
- text => 'This is an update on this problem, perhaps providing further relevant information or letting everyone know it is being worked on or fixed.',
+ text => $open_user[int(rand(@open_user))],
+ confirmed => DateTime::Format::Pg->format_datetime($confirmed),
+ });
+}
+
+# Some not responsible updates
+for (11..13) {
+ my $problem = $problems[$_];
+ $confirmed->add(seconds => rand(10000));
+ push @$updates, FixMyStreet::DB::Factory::Comment->create({
+ problem => $problem,
+ problem_state => 'not responsible',
+ user => $users{'cs@example.org'},,
+ text => 'This issue is outside our responsibility.',
confirmed => DateTime::Format::Pg->format_datetime($confirmed),
});
+ $problem->update({ state => 'not responsible' });
}
-say "Created $num updates on problems " . join(', ', map { $_->problem_id } @$updates);
+say "Created updates on problems " . join(', ', map { $_->problem_id } @$updates);
diff --git a/perllib/FixMyStreet/DB/Factories.pm b/perllib/FixMyStreet/DB/Factories.pm
index ec4dd630a..7b8234aec 100644
--- a/perllib/FixMyStreet/DB/Factories.pm
+++ b/perllib/FixMyStreet/DB/Factories.pm
@@ -118,7 +118,7 @@ use parent "DBIx::Class::Factory";
__PACKAGE__->resultset(FixMyStreet::DB->resultset("ResponsePriority"));
__PACKAGE__->fields({
- name => __PACKAGE__->seq(sub { 'Priority #' . (shift()+1) }),
+ name => __PACKAGE__->seq(sub { 'Priority ' . (shift()+1) }),
description => __PACKAGE__->seq(sub { 'Description #' . (shift()+1) }),
});
diff --git a/templates/web/base/auth/general.html b/templates/web/base/auth/general.html
index 76426f5d8..8fc5578c1 100644
--- a/templates/web/base/auth/general.html
+++ b/templates/web/base/auth/general.html
@@ -50,7 +50,8 @@
[% ELSIF sign_in_error %]
<div class="form-error">[% loc('There was a problem with your login information. If you cannot remember your password, or do not have one, please fill in the &lsquo;No&rsquo; section of the form.') %]</div>
[% END %]
- <input type="text" class="form-control required" id="username" name="username" value="[% username | html %]" autofocus>
+ <input type="text" class="form-control required" id="username" name="username" value="[% username | html %]"
+ [%~ IF c.cobrand.moniker != 'borsetshire' %] autofocus[% END %]>
<div id="form_sign_in">
<h3>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name) %]</h3>
diff --git a/templates/web/borsetshire/auth/_general_top.html b/templates/web/borsetshire/auth/_general_top.html
index 6e65bf90b..0af3737e8 100644
--- a/templates/web/borsetshire/auth/_general_top.html
+++ b/templates/web/borsetshire/auth/_general_top.html
@@ -1,28 +1,23 @@
-<p>The following users exist, all with password <kbd>password</kbd>
-(click them to quickly log in):</p>
-<style>
-#demo-user-list dt {
- padding: 0 0.5em;
-}
-#demo-user-list dd {
- color: #666;
- font-size: 87.5%;
- padding: 0 0.5em;
-}
-.js #demo-user-list dt:hover {
- background-color: #faebac;
- cursor: pointer;
-}
-</style>
+<p>
+Click on one of the buttons below to log in as one of the four
+different types of user we’ve set up on this demo site:
+</p>
-<dl id='demo-user-list'>
- <dt>inspector@example.org</dt>
- <dd>an inspector, who can shortlist and inspect reports.</dd>
- <dt>cs@example.org</dt>
- <dd>a customer service rep, who can create reports as the council or another user, and moderate reports.</dd>
- <dt>super@example.org</dt>
- <dd>a council super user, who can do all the above, plus also edit users, templates, priorities, and more.</dd>
- <dt>user@example.org</dt>
- <dd>a normal user, who has created the example reports on the site.</dd>
-</dl>
+<ul id='demo-user-list' class="clearfix">
+ <li>
+<button class="btn" data-email="user@example.org">Normal user</button>
+<span>A local resident who has created reports and updates on the site.</span>
+ <li>
+<button class="btn" data-email="cs@example.org">Customer service</button>
+<span>A customer service staff member, who can create and moderate existing reports.</span>
+ <li>
+<button class="btn" data-email="inspector@example.org">Inspector</button>
+<span>An inspector staff member, who can inspect reports and create shortlists.</span>
+ <li>
+<button class="btn" data-email="super@example.org">Super user</button>
+<span>A superuser staff member, who can do all the above, plus also edit users, templates, and priorities in the Admin screen.</span>
+</ul>
+<p>
+Or sign in as normal, with an email address and password:
+</p>
diff --git a/templates/web/borsetshire/front/footer-marketing.html b/templates/web/borsetshire/front/footer-marketing.html
new file mode 100644
index 000000000..78b4fa89b
--- /dev/null
+++ b/templates/web/borsetshire/front/footer-marketing.html
@@ -0,0 +1,6 @@
+<div class="fms-pro-promo">
+ <h2>FixMyStreet Professional</h2>
+ <p class="lead">The one-stop street reporting service for councils.</p>
+ <p>Integrate FixMyStreet with your council system for smooth, end-to-end report fullfilment.</p>
+ <p><a href="/about/professional" class="btn--borsetshire">Learn more</a></p>
+</div>
diff --git a/web/cobrands/borsetshire/base.scss b/web/cobrands/borsetshire/base.scss
index f5113e0be..a92d54427 100644
--- a/web/cobrands/borsetshire/base.scss
+++ b/web/cobrands/borsetshire/base.scss
@@ -63,3 +63,55 @@
text-decoration: underline;
}
}
+
+body.authpage {
+ .content {
+ max-width: 27em;
+ margin-#{$left}: auto;
+ margin-#{$right}: auto;
+ }
+}
+
+#demo-user-list {
+ @include list-reset-soft();
+ border-bottom: 1px solid #eee;
+ margin-bottom: 2em;
+
+ li {
+ margin: 2em 0;
+ }
+
+ button {
+ width: 100%;
+ }
+
+ span {
+ color: #666;
+ font-size: (14em / 16);
+ display: block;
+ margin-top: 0.5em;
+ }
+}
+
+.fms-pro-promo {
+ margin: 2em -1em;
+ padding: 1em;
+ background: $primary;
+ color: $primary_text;
+
+ .lead {
+ font-weight: bold;
+ }
+
+ & > :first-child {
+ margin-top: 0;
+ }
+
+ & > :last-child {
+ margin-bottom: 0;
+ }
+}
+
+.btn--borsetshire {
+ @include button-reset($text: #000, $hover-text: #000);
+}
diff --git a/web/cobrands/borsetshire/js.js b/web/cobrands/borsetshire/js.js
index a9842ffdd..2888a9548 100644
--- a/web/cobrands/borsetshire/js.js
+++ b/web/cobrands/borsetshire/js.js
@@ -15,9 +15,9 @@
}
}
- $('#demo-user-list dt').click(function(){
+ $('#demo-user-list button').click(function(){
var form = document.forms.general_auth;
- form.username.value = $(this).text();
+ form.username.value = $(this).data('email');
form.password_sign_in.value = 'password';
set_redirect(form);
form.submit();
diff --git a/web/cobrands/borsetshire/layout.scss b/web/cobrands/borsetshire/layout.scss
index 6aa7f5801..66d1bb692 100644
--- a/web/cobrands/borsetshire/layout.scss
+++ b/web/cobrands/borsetshire/layout.scss
@@ -54,3 +54,51 @@
}
}
}
+
+body.authpage {
+ .content {
+ width: auto;
+ max-width: 30em;
+ }
+
+ input {
+ max-width: none;
+ }
+}
+
+#demo-user-list {
+ li {
+ @include clearfix();
+ }
+
+ button {
+ float: left;
+ width: 40%;
+ }
+
+ span {
+ float: right;
+ width: 55%;
+ margin-top: 0;
+ }
+}
+
+.fms-pro-promo {
+ margin: 1em 0 3em 0;
+ padding: 2em;
+
+ p {
+ font-size: 1.2em;
+ max-width: 26em;
+ }
+
+ h2 {
+ font-family: inherit;
+ font-weight: bold;
+ font-size: 2em;
+ }
+
+ @media (min-width: 60em) {
+ padding: 3em;
+ }
+}