aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-05-17 10:55:26 +0100
committerStruan Donald <struan@exo.org.uk>2011-05-17 10:55:26 +0100
commit202abd84b382816d7095929a8d4b85a395f21489 (patch)
tree9e0b84007dfe670b71052c4fec133f10911ca526
parentf8d743d74930d7632d00718be697c11a7c3581a7 (diff)
replace more old template tags with TT ones
-rw-r--r--t/app/controller/report_display.t16
-rw-r--r--templates/web/default/report/display.html51
2 files changed, 41 insertions, 26 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t
index 26b7db759..ee9172d11 100644
--- a/t/app/controller/report_display.t
+++ b/t/app/controller/report_display.t
@@ -105,10 +105,18 @@ subtest "test a good report" => sub {
is $mech->extract_problem_meta,
'Reported by Test User at 15:47, Saturday 16 April 2011',
'correct problem meta information';
- $mech->content_contains( 'Test 2 Detail' );
-
- my $update_form = $mech->form_name( 'updateForm' );
- is $update_form->value( 'fixed' ), undef, 'problem is not fixed';
+ $mech->content_contains('Test 2 Detail');
+
+ my $update_form = $mech->form_name('updateForm');
+
+ my %fields = (
+ name => '',
+ rznvy => '',
+ update => '',
+ add_alert => undef,
+ fixed => undef
+ );
+ is $update_form->value($_), $fields{$_}, "$_ value" for keys %fields;
};
foreach my $meta (
diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html
index ed2a221c1..c647809ef 100644
--- a/templates/web/default/report/display.html
+++ b/templates/web/default/report/display.html
@@ -43,8 +43,8 @@
<form action="{{ $form_alert_action }}" method="post" id="email_alert_box">
<p>{{ $blurb }}</p>
<label class="n" for="alert_rznvy">[% loc('Email') %]</label>
- <input type="text" name="rznvy" id="alert_rznvy" value="{{ $input_h{rznvy} }}" size="30">
- <input type="hidden" name="id" value="{{ $input_h{id} }}">
+ <input type="text" name="rznvy" id="alert_rznvy" value="[% email %]" size="30">
+ <input type="hidden" name="id" value="[% problem.id %]">
<input type="hidden" name="type" value="updates">
<input type="submit" value="[% loc('Subscribe') %]">
{{ $cobrand_form_elements1 }}
@@ -63,35 +63,37 @@
[% loc( 'Provide an update') %]
</h2>
- {{ $update_blurb }}
+ <p>
+ <small>[% loc( 'Please note that updates are not sent to the council. If you leave your name it will be public. Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>' ) %]</small>
+ </p>
- {{ $errors }}
+ [% INCLUDE 'errors.html' %]
- <form method="post" action="{{ $form_action }}" name="updateForm" id="fieldset"{{ $enctype }}>
+ <form method="post" action="{{ $form_action }}" name="updateForm" id="fieldset"[% IF allow_photo_upload %] enctype="multipart/form-data"[% END %]>
<input type="hidden" name="submit_update" value="1">
<input type="hidden" name="id" value="{{ $input_h{id} }}">
<div>
- <label for="form_name">{{ $name_label }}</label>
- <input type="text" name="name" id="form_name" value="{{ $input_h{name} }}" size="20"> {{ $optional }}
+ <label for="form_name">[% loc( 'Name:') %]</label>
+ <input type="text" name="name" id="form_name" value="[% email %]" size="20"> [% loc( '(optional)' ) %]
</div>
- {{ if ( $field_errors{email}) {
- "<div class='form-error'>$field_errors{email}</div>";
- } }}
+ [% IF field_errors.email %]
+ <div class='form-error'>[% field_errors.email %]</div>
+ [% END %]
<div class="form-field">
- <label for="form_rznvy">{{ $email_label }}</label>
- <input type="text" name="rznvy" id="form_rznvy" value="{{ $input_h{rznvy} }}" size="20">
+ <label for="form_rznvy">[% loc('Email' ) %]</label>
+ <input type="text" name="rznvy" id="form_rznvy" value="[% email %]" size="20">
</div>
- {{ if ( $field_errors{update}) {
- "<div class='form-error'>$field_errors{update}</div>";
- } }}
+ [% IF field_errors.update %]
+ <div class='form-error'>[% field_errors.update %]</div>
+ [% END %]
<div class="form-field">
- <label for="form_update">{{ $update_label }}</label>
- <textarea name="update" id="form_update" rows="7" cols="30">{{ $input_h{update} }}</textarea>
+ <label for="form_update">[% loc( 'Update:' ) %]</label>
+ <textarea name="update" id="form_update" rows="7" cols="30">[% update %]</textarea>
</div>
@@ -101,19 +103,24 @@
<label for="form_fixed">[% loc('This problem has been fixed') %]</label>
</div>
[% END %]
-
- {{ $photo_element }}
-
+
+ [% IF allow_photo_upload %]
+ <div id="fileupload_normalUI">
+ <label for="form_photo">[% loc('Photo:') %]</label>
+ <input type="file" name="photo" id="form_photo">
+ </div>
+ [% END %]
+
<div class="checkbox">
<input type="checkbox" name="add_alert" id="form_add_alert" value="1"{{ $add_alert_checked }}>
- <label for="form_add_alert">{{ $alert_label }}</label>
+ <label for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label>
</div>
<div class="checkbox">
- <input type="submit" id="update_post" value="{{ $post_label }}">
+ <input type="submit" id="update_post" value="[% loc('Post:') %]">
</div>