diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/email/default/partial.txt (renamed from templates/emails/partial) | 6 | ||||
-rw-r--r-- | templates/web/default/reports/new/fill_in_details.html | 7 | ||||
-rw-r--r-- | templates/web/default/reports/new/report_import.html | 92 | ||||
-rw-r--r-- | templates/web/default/reports/new/report_new.html | 16 |
4 files changed, 115 insertions, 6 deletions
diff --git a/templates/emails/partial b/templates/email/default/partial.txt index d754744b5..279d76ea0 100644 --- a/templates/emails/partial +++ b/templates/email/default/partial.txt @@ -1,12 +1,12 @@ Subject: Confirm your report on FixMyStreet -Hi<?=$values['name']?>, +Hi [% report.name || report.email %], To confirm the report you have uploaded to FixMyStreet via -<?=$values['service']?>, and to check or add any details, +[% report.service %], and to check or add any details, please visit the following URL: -<?=$values['url']?> +[% token_url %] Thanks! diff --git a/templates/web/default/reports/new/fill_in_details.html b/templates/web/default/reports/new/fill_in_details.html index a6c7bf047..b58d0b827 100644 --- a/templates/web/default/reports/new/fill_in_details.html +++ b/templates/web/default/reports/new/fill_in_details.html @@ -87,7 +87,12 @@ [% IF upload_fileid || report.photo %] <p>[% loc('You have already attached a photo to this report, attaching another one will replace it.') %]</p> + [% IF upload_fileid %] <input type="hidden" name="upload_fileid" value="[% upload_fileid %]" /> + [% END %] + [% IF report.photo %] + <img align="right" src="/photo?id=[% report.id %]" hspace="5"> + [% END %] [% END %] <div class='form-field'> @@ -102,7 +107,7 @@ <div class='form-field'> <label for="form_name">[% loc('Name:') %]</label> - <input type="text" value="[% report_user.name | html %]" name="name" id="form_name" size="25"> + <input type="text" value="[% report.name || report_user.name | html %]" name="name" id="form_name" size="25"> </div> diff --git a/templates/web/default/reports/new/report_import.html b/templates/web/default/reports/new/report_import.html new file mode 100644 index 000000000..7aa105afe --- /dev/null +++ b/templates/web/default/reports/new/report_import.html @@ -0,0 +1,92 @@ +[% INCLUDE 'header.html', title => 'External import' %] + +<h1>External import</h1> + +<p>You may inject problem reports into FixMyStreet programatically using this +simple interface. Upon receipt, an email will be sent to the address given, +with a link the user must click in order to check the details of their report, +add any other information they wish, and then submit to the council. + +<p>This interface returns a plain text response; either <samp>SUCCESS</samp> if +the report has been successfully received, or if not, a list of errors, one per +line each starting with <samp>ERROR:</samp>. + +<p>You may submit the following information by POST to this URL +(i.e. <samp>[% c.uri_for('/import') %]</samp> ):</p> + +<style type="text/css" media="screen"> + input { + /* Hide the form elements - they are just here for simpler testing */ + display: none; + } +</style> + +<form method="POST" action="/import" enctype="multipart/form-data"> + +<dl> + <dt>service</dt> + <dd> + <em>Required</em>. + Name of application/service using this interface. + <input type="text" name="service" /> + </dd> + + <dt>id</dt> + <dd> + Unique ID of a user/device, for possible future use.<br> + <small>(e.g. used by Flickr import to know which accounts to look at)</small> + <input type="text" name="id" /> + </dd> + + <dt>subject</dt> + <dd> + <em>Required</em>. Subject of problem report. + <input type="text" name="subject" /> + </dd> + + <dt>detail</dt> + <dd> + Main body and details of problem report. + <input type="text" name="detail" /> + </dd> + + <dt>name</dt> + <dd> + <em>Required</em>. Name of problem reporter. + <input type="text" name="name" /> + </dd> + + <dt>email</dt> + <dd> + <em>Required</em>. Email address of problem reporter. + <input type="text" name="email" /> + </dd> + + <dt>phone</dt> + <dd> + Telephone number of problem reporter. + <input type="text" name="phone" /> + </dd> + + <dt>easting / northing</dt> + <dt>lat / lon</dt> + <dd> + Location of problem report. You can either supply eastings/northings, or WGS84 latitude/longitude. + <input type="text" name="easting" /> + <input type="text" name="northing" /> + <input type="text" name="lat" /> + <input type="text" name="lon" /> + </dd> + + <dt>photo</dt> + <dd> + Photo of problem (JPEG only). + <input type="file" name="photo" /> + </dd> +</dl> + +<input type="submit" /> + +</form> + +[% INCLUDE 'footer.html' %]
\ No newline at end of file diff --git a/templates/web/default/reports/new/report_new.html b/templates/web/default/reports/new/report_new.html index 34e0c981b..14d68b029 100644 --- a/templates/web/default/reports/new/report_new.html +++ b/templates/web/default/reports/new/report_new.html @@ -6,9 +6,20 @@ <div class="error">[% location_error %]</div> [% END %] -Please select where to create this report: +[% IF partial_token %] -<form action="[% c.uri_for() %]" method="POST"> + <p style="margin-top: 0; color: #cc0000;"> + <img align="right" src="/photo?id=[% report.id %]" hspace="5"> + [% loc("Thanks for uploading your photo. We now need to locate your problem, so please enter a nearby street name or postcode in the box below :") %] + </p> + + <input type="hidden" name="partial" value="[% partial_token.token %]"> + +[% ELSE %] + Please select where to create this report: +[% END %] + +<form action="/reports/new" method="POST"> [% IF pc_error %] <div class='form-error'>[% pc_error %]</div> @@ -20,6 +31,7 @@ Please select where to create this report: </div> <p> + <input type="hidden" name="partial" value="[% partial_token.token %]"> <input type="submit" value="[% loc('Search') %]"> </p> |