diff options
author | Struan Donald <struan@exo.org.uk> | 2013-03-01 11:37:29 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-03-01 11:37:29 +0000 |
commit | cb43a115cce80e2ec6f1f9466523a30a1fc8377f (patch) | |
tree | efb99de339f773c16c0be9474184785eec0de619 | |
parent | 18df1a462e57419854ac66111b931b6f17db7b9e (diff) |
basic routing to submit screen
-rw-r--r-- | www/index.html | 1 | ||||
-rw-r--r-- | www/js/app.js | 2 | ||||
-rw-r--r-- | www/js/router.js | 8 | ||||
-rw-r--r-- | www/js/views/details.js | 3 | ||||
-rw-r--r-- | www/js/views/submit.js | 9 | ||||
-rw-r--r-- | www/templates/en/submit.html | 86 |
6 files changed, 106 insertions, 3 deletions
diff --git a/www/index.html b/www/index.html index 2c46107..d50851d 100644 --- a/www/index.html +++ b/www/index.html @@ -38,6 +38,7 @@ <script type="text/javascript" src="js/views/around.js"></script> <script type="text/javascript" src="js/views/photo.js"></script> <script type="text/javascript" src="js/views/details.js"></script> + <script type="text/javascript" src="js/views/submit.js"></script> <script type="text/javascript" src="js/models/report.js"></script> diff --git a/www/js/app.js b/www/js/app.js index 36bf827..cba1707 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -38,7 +38,7 @@ var tpl = { ;(function (FMS, Backbone, _, $) { _.extend(FMS, { templates: [ - 'home', 'around', 'photo', 'details' + 'home', 'around', 'photo', 'details', 'submit' ], initialized: 0, diff --git a/www/js/router.js b/www/js/router.js index 7ee585a..60901bf 100644 --- a/www/js/router.js +++ b/www/js/router.js @@ -8,7 +8,8 @@ 'home': 'home', 'around': 'around', 'photo': 'photo', - 'details': 'details' + 'details': 'details', + 'submit': 'submit' }, initialize: function() { @@ -40,6 +41,11 @@ this.changeView(detailsView); }, + submit: function(){ + var submitView = new FMS.SubmitView({ model: FMS.currentReport }); + this.changeView(submitView); + }, + changeView: function(view) { console.log( 'change View to ' + view.id ); $(view.el).attr('data-role', 'page'); diff --git a/www/js/views/details.js b/www/js/views/details.js index 2c16c43..2647624 100644 --- a/www/js/views/details.js +++ b/www/js/views/details.js @@ -3,7 +3,8 @@ DetailsView: FMS.FMSView.extend({ template: 'details', id: 'details-page', - prev: 'photo' + prev: 'photo', + next: 'submit' }) }); })(FMS, Backbone, _, $); diff --git a/www/js/views/submit.js b/www/js/views/submit.js new file mode 100644 index 0000000..3a04621 --- /dev/null +++ b/www/js/views/submit.js @@ -0,0 +1,9 @@ +;(function (FMS, Backbone, _, $) { + _.extend( FMS, { + SubmitView: FMS.FMSView.extend({ + template: 'submit', + id: 'submit-page', + prev: 'details' + }) + }); +})(FMS, Backbone, _, $); diff --git a/www/templates/en/submit.html b/www/templates/en/submit.html new file mode 100644 index 0000000..af05003 --- /dev/null +++ b/www/templates/en/submit.html @@ -0,0 +1,86 @@ +<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"> + + <form action="" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data" class="validate" data-ajax="false"> + + <fieldset> + <div id="problem_form"> + <div id="signed_in"> + <p> + You are signed in as <span id="username"></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="" 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="" name="phone" id="form_phone" placeholder="Your phone number (optional)"> + </div> + + <div class="form-txt-submit-box"> + <input class="green-btn" type="submit" id="submit_signed_in" name="submit_signed_in" value="Report"> + </div> + </div> + + <div id="signed_out"> + <label for="form_email" id="email_label">Your email</label> + <input type="email" value="" 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="submit" 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="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="submit" 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> + </form> + </div> +</div> |