diff options
24 files changed, 135 insertions, 55 deletions
diff --git a/bin/update-schema b/bin/update-schema index f728f8c56..81c9ff4ab 100644 --- a/bin/update-schema +++ b/bin/update-schema @@ -84,6 +84,7 @@ 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 '0029' if column_exists('body', 'deleted'); return '0028' if table_exists('body'); return '0027' if column_exists('problem', 'subcategory'); return '0026' if column_exists('open311conf', 'send_extended_statuses'); diff --git a/db/schema.sql b/db/schema.sql index 5e4bc4a3e..5c54e2d88 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -64,7 +64,8 @@ create table body ( comment_user_id int references users(id), suppress_alerts boolean not null default 'f', can_be_devolved boolean not null default 'f', - send_extended_statuses boolean not null default 'f' + send_extended_statuses boolean not null default 'f', + deleted boolean not null default 'f' ); create table body_areas ( diff --git a/db/schema_0029-add_deleted_flag_to_body.sql b/db/schema_0029-add_deleted_flag_to_body.sql new file mode 100644 index 000000000..3a8be7890 --- /dev/null +++ b/db/schema_0029-add_deleted_flag_to_body.sql @@ -0,0 +1,6 @@ +BEGIN; + +ALTER table body + ADD column deleted BOOL NOT NULL DEFAULT 'f'; + +COMMIT; diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index ba8f22a05..4973b7c4e 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -413,7 +413,7 @@ sub update_contacts : Private { sub body_params : Private { my ( $self, $c ) = @_; - my @fields = qw/name endpoint jurisdiction api_key send_method send_comments suppress_alerts send_extended_statuses comment_user_id can_be_devolved parent/; + my @fields = qw/name endpoint jurisdiction api_key send_method send_comments suppress_alerts send_extended_statuses comment_user_id can_be_devolved parent deleted/; my %defaults = map { $_ => '' } @fields; %defaults = ( %defaults, send_comments => 0, @@ -422,6 +422,7 @@ sub body_params : Private { send_extended_statuses => 0, can_be_devolved => 0, parent => undef, + deleted => 0, ); my %params = map { $_ => $c->req->param($_) || $defaults{$_} } @fields; return \%params; diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 3d3ddce1e..6018dfa80 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -956,6 +956,9 @@ sub check_for_errors : Private { delete $field_errors{name}; my $report = $c->stash->{report}; $report->title( Utils::cleanup_text( substr($report->detail, 0, 25) ) ); + if ( ! $c->req->param('phone') ) { + $field_errors{phone} = _("This information is required"); + } } # FIXME: need to check for required bromley fields here diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 1bbe3b088..6e507037a 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -660,10 +660,31 @@ sub admin_stats { ); if ( $c->req->params->{export} ) { - my $problems = $c->model('DB::Problem')->search( { %params }, { columns => [ 'id', 'created', 'latitude', 'longitude', 'cobrand', 'category' ] } ); - my $body = "ID,Created,E,N,Category\n"; - while (my $report = $problems->next) { - $body .= join( ',', $report->id, $report->created, $report->local_coords, $report->category ) . "\n"; + my $problems = $c->model('DB::Problem')->search( + {%params}, + { + columns => [ + 'id', 'created', + 'latitude', 'longitude', + 'cobrand', 'category', + 'state', 'user_id', + 'external_body' + ] + } + ); + my $body = "ID,Created,E,N,Category,Status,UserID,External Body\n"; + while ( my $report = $problems->next ) { + my $external_body; + my $body_name = ""; + if ( $external_body = $report->body($c) ) { + $body_name = $external_body->name; + } + $body .= join( ',', + $report->id, $report->created, + $report->local_coords, $report->category, + $report->state, $report->user_id, + "\"$body_name\"" ) + . "\n"; } $c->res->content_type('text/csv; charset=utf-8'); $c->res->body($body); diff --git a/perllib/FixMyStreet/DB/Result/Alert.pm b/perllib/FixMyStreet/DB/Result/Alert.pm index fc84c8fd5..4ce72f873 100644 --- a/perllib/FixMyStreet/DB/Result/Alert.pm +++ b/perllib/FixMyStreet/DB/Result/Alert.pm @@ -48,7 +48,7 @@ __PACKAGE__->belongs_to( "alert_type", "FixMyStreet::DB::Result::AlertType", { ref => "alert_type" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); __PACKAGE__->has_many( "alerts_sent", @@ -60,12 +60,12 @@ __PACKAGE__->belongs_to( "user", "FixMyStreet::DB::Result::User", { id => "user_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vump36YxUO4FQi5Do6DwvA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d9yIFiTGtbtFaULXZNKstQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/AlertSent.pm b/perllib/FixMyStreet/DB/Result/AlertSent.pm index a537c95cd..422e010a9 100644 --- a/perllib/FixMyStreet/DB/Result/AlertSent.pm +++ b/perllib/FixMyStreet/DB/Result/AlertSent.pm @@ -26,12 +26,12 @@ __PACKAGE__->belongs_to( "alert", "FixMyStreet::DB::Result::Alert", { id => "alert_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oN+36hDWJuc0hqkCW9BHOw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:COwsprqRSNZS1IxJrPYgMQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm index 83704563a..c2b0555fb 100644 --- a/perllib/FixMyStreet/DB/Result/Body.pm +++ b/perllib/FixMyStreet/DB/Result/Body.pm @@ -20,6 +20,8 @@ __PACKAGE__->add_columns( }, "name", { data_type => "text", is_nullable => 0 }, + "parent", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "endpoint", { data_type => "text", is_nullable => 1 }, "jurisdiction", @@ -38,8 +40,8 @@ __PACKAGE__->add_columns( { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "send_extended_statuses", { data_type => "boolean", default_value => \"false", is_nullable => 0 }, - "parent", - { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "deleted", + { data_type => "boolean", default_value => \"false", is_nullable => 0 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->has_many( @@ -59,10 +61,10 @@ __PACKAGE__->belongs_to( "FixMyStreet::DB::Result::User", { id => "comment_user_id" }, { - is_deferrable => 1, + is_deferrable => 0, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "NO ACTION", + on_update => "NO ACTION", }, ); __PACKAGE__->has_many( @@ -76,10 +78,10 @@ __PACKAGE__->belongs_to( "FixMyStreet::DB::Result::Body", { id => "parent" }, { - is_deferrable => 1, + is_deferrable => 0, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "NO ACTION", + on_update => "NO ACTION", }, ); __PACKAGE__->has_many( @@ -90,8 +92,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-19 12:47:10 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DdtXjMWRpz20ZHjtY3oP2w +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 18:11:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hTOxxiiHmC8nmQK/p8dXhQ sub url { my ( $self, $c ) = @_; diff --git a/perllib/FixMyStreet/DB/Result/BodyArea.pm b/perllib/FixMyStreet/DB/Result/BodyArea.pm index 844a3277d..4447777dc 100644 --- a/perllib/FixMyStreet/DB/Result/BodyArea.pm +++ b/perllib/FixMyStreet/DB/Result/BodyArea.pm @@ -21,12 +21,12 @@ __PACKAGE__->belongs_to( "body", "FixMyStreet::DB::Result::Body", { id => "body_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-19 12:47:10 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aAr+Nadyu8IckZlK6+PTNg +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+hzie6kHleUBoEt199c/nQ __PACKAGE__->set_primary_key(__PACKAGE__->columns); diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index d1626599e..2d5b6b2c3 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -54,6 +54,10 @@ __PACKAGE__->add_columns( { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "problem_state", { data_type => "text", is_nullable => 1 }, + "external_id", + { data_type => "text", is_nullable => 1 }, + "extra", + { data_type => "text", is_nullable => 1 }, "send_fail_count", { data_type => "integer", default_value => 0, is_nullable => 0 }, "send_fail_reason", @@ -62,28 +66,24 @@ __PACKAGE__->add_columns( { data_type => "timestamp", is_nullable => 1 }, "whensent", { data_type => "timestamp", is_nullable => 1 }, - "external_id", - { data_type => "text", is_nullable => 1 }, - "extra", - { data_type => "text", is_nullable => 1 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to( "problem", "FixMyStreet::DB::Result::Problem", { id => "problem_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); __PACKAGE__->belongs_to( "user", "FixMyStreet::DB::Result::User", { id => "user_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-07-11 18:53:26 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tSejJzLxHD/fMWjpa10lfA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:D/+UWcF7JO/EkCiJaAHUOw __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); __PACKAGE__->rabx_column('extra'); diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index 5cbf335f1..eca028c9b 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -53,12 +53,12 @@ __PACKAGE__->belongs_to( "body", "FixMyStreet::DB::Result::Body", { id => "body_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-13 12:34:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:imXq3EtrC0FrQwj+E2xfBw +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hq/BFHDEu4OUI4MSy3OyHg __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); __PACKAGE__->rabx_column('extra'); diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 6aa9695ce..f14a29f56 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -120,12 +120,12 @@ __PACKAGE__->belongs_to( "user", "FixMyStreet::DB::Result::User", { id => "user_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-13 15:13:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:H2P3Og37G569nQdQA1IWaA +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U/4BT8EGfcCLKA/7LX+qyQ # Add fake relationship to stored procedure table __PACKAGE__->has_one( diff --git a/perllib/FixMyStreet/DB/Result/Questionnaire.pm b/perllib/FixMyStreet/DB/Result/Questionnaire.pm index fcaa17d99..7f9c79d9a 100644 --- a/perllib/FixMyStreet/DB/Result/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/Result/Questionnaire.pm @@ -36,12 +36,12 @@ __PACKAGE__->belongs_to( "problem", "FixMyStreet::DB::Result::Problem", { id => "problem_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" }, ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NGlSRjoBpDoIvK3EueqN6Q +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oL1Hk4/bNG14CY74GA75SA use DateTime::TimeZone; use Moose; diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 481b654c9..523382670 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -58,10 +58,10 @@ __PACKAGE__->belongs_to( "FixMyStreet::DB::Result::Body", { id => "from_body" }, { - is_deferrable => 1, + is_deferrable => 0, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "NO ACTION", + on_update => "NO ACTION", }, ); __PACKAGE__->has_many( @@ -72,8 +72,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-12-14 09:23:59 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aw374WQraL5ysOvUmUIU3w +# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jRAtXRLRNozCmthAg9p0dA __PACKAGE__->add_columns( "password" => { diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t index a6cf934ef..035cdafe0 100644 --- a/t/cobrand/zurich.t +++ b/t/cobrand/zurich.t @@ -335,17 +335,38 @@ $mech->clear_emails_ok; $mech->log_out_ok; # Test only superuser can edit bodies -$user = $mech->log_in_ok( 'dm1@example.org') ; +$user = $mech->log_in_ok( 'dm1@example.org' ); $mech->get( '/admin/body/' . $zurich->id ); is $mech->res->code, 404, "only superuser should be able to edit bodies"; $mech->log_out_ok; # Test only superuser can see "Add body" form -$user = $mech->log_in_ok( 'dm1@example.org') ; +$user = $mech->log_in_ok( 'dm1@example.org' ); $mech->get_ok( '/admin/bodies' ); $mech->content_lacks( '<form method="post" action="bodies"' ); $mech->log_out_ok; +# Test phone number is mandatory +$user = $mech->log_in_ok( 'dm1@example.org' ); +$mech->get_ok( '/report/new?latitude=51.500802;longitude=-0.143005' ); +$mech->submit_form( with_fields => { phone => "" } ); +$mech->content_contains( 'Diese Information wird benötigt' ); +$mech->log_out_ok; + +# Test problems can't be assigned to deleted bodies +$user = $mech->log_in_ok( 'dm1@example.org' ); +$user->from_body( 1 ); +$user->update; +$report->state( 'confirmed' ); +$report->update; +$mech->get_ok( '/admin/body/' . $external_body->id ); +$mech->submit_form_ok( { with_fields => { deleted => 1 } } ); +$mech->get_ok( '/admin/report_edit/' . $report->id ); +$mech->content_lacks( $external_body->name ); +$user->from_body( 2 ); +$user->update; +$mech->log_out_ok; + $mech->delete_problems_for_body( 2 ); $mech->delete_user( 'dm1@example.org' ); $mech->delete_user( 'sdm1@example.org' ); diff --git a/templates/web/default/admin/bodies.html b/templates/web/default/admin/bodies.html index fabaf8923..c0824521e 100644 --- a/templates/web/default/admin/bodies.html +++ b/templates/web/default/admin/bodies.html @@ -16,6 +16,7 @@ <th>[% loc('Name') %]</th> [% IF c.cobrand.moniker == 'zurich' %] <th>[% loc('Email') %]</th> + <th>[% loc('Deleted') %]</th> [% ELSE %] <th>[% loc('Category') %]</th> [% END %] @@ -23,7 +24,7 @@ [%- FOREACH body IN bodies %] [%- SET id = body.id %] [% NEXT IF c.cobrand.moniker == 'zurich' AND admin_type == 'dm' AND (body.parent OR body.bodies) %] - <tr> + <tr[% IF c.cobrand.moniker == 'zurich' AND body.deleted %] class="muted"[% END %]> <td> [% IF c.cobrand.moniker == 'zurich' %] [% FILTER repeat(4*body.api_key) %] [% END %] @@ -39,6 +40,7 @@ </td> [% IF c.cobrand.moniker == 'zurich' %] <td>[% body.endpoint %]</td> + <td>[% IF body.deleted %]Yes[% END %]</td> [% ELSE %] <td> [% IF counts.$id %] diff --git a/templates/web/default/js/translation_strings.html b/templates/web/default/js/translation_strings.html index f6c4f7d41..8f834a81c 100644 --- a/templates/web/default/js/translation_strings.html +++ b/templates/web/default/js/translation_strings.html @@ -15,6 +15,9 @@ required: '[% loc('Please enter your email') | replace("'", "\\'") %]', email: '[% loc('Please enter a valid email') | replace("'", "\\'") %]' }, + phone: { + required: '[% loc('Please enter your phone number') | replace("'", "\\'") %]' + }, fms_extra_title: '[% loc('Please enter your title') | replace("'", "\\'") %]', first_name: '[% loc('Please enter your first name') | replace("'", "\\'") %]', last_name: '[% loc('Please enter your second name') | replace("'", "\\'") %]', diff --git a/templates/web/zurich/admin/body-form.html b/templates/web/zurich/admin/body-form.html index 5ae8eb8a6..4e570a058 100644 --- a/templates/web/zurich/admin/body-form.html +++ b/templates/web/zurich/admin/body-form.html @@ -10,7 +10,6 @@ <input type="text" name="endpoint" id="email" value="[% body.endpoint %]" size="50"> </p> -[% IF admin_type == 'super' %] <p> <label for="parent">[% loc('Parent') %]</label> <select name="parent" id="parent"> @@ -31,7 +30,11 @@ [% END %] </select> </p> -[% END %] + + <p> + <label for="deleted">[% loc('Flag as deleted') %]</label> + <input type="checkbox" name="deleted" id="deleted" value="1"[% ' checked' IF body.deleted %] /> + </p> <input type="hidden" name="send_method" value="Email"> <input type="hidden" name="jurisdiction" id="jurisdiction" value="[% body.jurisdiction %]"> diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html index 128e74766..723086c46 100644 --- a/templates/web/zurich/admin/report_edit.html +++ b/templates/web/zurich/admin/report_edit.html @@ -136,7 +136,7 @@ <select name="body_external" id="body_external"> <option value="">--</option> [% FOR body IN bodies %] - [% NEXT IF body.parent OR body.bodies %] + [% NEXT IF body.parent OR body.bodies OR body.deleted %] <option value="[% body.id %]"[% IF body.id == problem.bodies_str %] selected[% END %]>[% body.name %]</option> [% END %] </select> diff --git a/templates/web/zurich/admin/reports.html b/templates/web/zurich/admin/reports.html index b0bc733c4..68f98c44a 100644 --- a/templates/web/zurich/admin/reports.html +++ b/templates/web/zurich/admin/reports.html @@ -13,6 +13,7 @@ [% FOREACH col IN [ [ 'category', loc('Category') ], [ 'created', loc('Submitted') ], [ 'lastupdate', loc('Updated') ], [ 'state', loc('Status') ] ] %] <th><a href="[% INCLUDE sort_link choice = col.0 %]">[% col.1 %] [% INCLUDE sort_arrow choice = col.0 %]</a></th> [% END %] + <th>[% loc('Photo') %]</th> <th class='edit'>*</th> </tr> [% INCLUDE 'admin/problem_row.html' %] diff --git a/templates/web/zurich/js/validation_rules.html b/templates/web/zurich/js/validation_rules.html new file mode 100644 index 000000000..d98bc1118 --- /dev/null +++ b/templates/web/zurich/js/validation_rules.html @@ -0,0 +1,8 @@ + validation_rules = { + title: { required: true }, + detail: { required: true }, + email: { required: true }, + update: { required: true }, + phone: { required: true }, + rznvy: { required: true } + }; diff --git a/templates/web/zurich/report/new/fill_in_details_form.html b/templates/web/zurich/report/new/fill_in_details_form.html index 1cecf036d..076536601 100644 --- a/templates/web/zurich/report/new/fill_in_details_form.html +++ b/templates/web/zurich/report/new/fill_in_details_form.html @@ -103,7 +103,10 @@ [% END %] <input type="text" value="[% report.name | html %]" name="name" id="form_name" placeholder="[% loc('Your name') %]"> - <label for="form_phone">[% loc('Phone number (optional)') %]</label> + <label for="form_phone">[% loc('Phone number') %]</label> + [% IF field_errors.phone %] + <p class='form-error'>[% field_errors.phone %]</p> + [% END %] <input type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> <div class="form-txt-submit-box"> diff --git a/web/cobrands/zurich/_zurich.scss b/web/cobrands/zurich/_zurich.scss index c9eb7a080..f9ea29d9a 100644 --- a/web/cobrands/zurich/_zurich.scss +++ b/web/cobrands/zurich/_zurich.scss @@ -35,3 +35,7 @@ body.frontpage #zurich-footer-wrapper { #zurich-footer a:hover { color: #3c3c3c; } + +.muted, .muted a { + color: #aaa; +} |