diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-06-20 12:34:04 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-08 16:18:18 +0100 |
commit | 3f88c42fed3a1bbe8541c9ec69affebb2358717f (patch) | |
tree | 1b78626c6c14a78080748c6297e0f0b40ff96db4 | |
parent | ed3f37c379694c545cb6976fa9f52cc65211804e (diff) |
[Borsetshire] Demo behaviour and help.
The front page redirects to report area, ignoring whatever is entered,
and the sign in page includes details of the demo accounts.
-rw-r--r-- | templates/web/base/auth/general.html | 2 | ||||
-rw-r--r-- | templates/web/borsetshire/around/postcode_form.html | 26 | ||||
-rw-r--r-- | templates/web/borsetshire/auth/_general_top.html | 27 | ||||
-rw-r--r-- | templates/web/borsetshire/footer_extra_js.html | 5 | ||||
-rw-r--r-- | web/cobrands/borsetshire/js.js | 9 |
5 files changed, 69 insertions, 0 deletions
diff --git a/templates/web/base/auth/general.html b/templates/web/base/auth/general.html index 41ff3a2e1..2a8bea402 100644 --- a/templates/web/base/auth/general.html +++ b/templates/web/base/auth/general.html @@ -2,6 +2,8 @@ <h1>[% loc('Sign in') %]</h1> +[% TRY %][% INCLUDE 'auth/_general_top.html' %][% CATCH file %][% END %] + [% IF oauth_need_email %] <p class="form-error">[% loc('We need your email address, please give it below.') %]</p> [% END %] diff --git a/templates/web/borsetshire/around/postcode_form.html b/templates/web/borsetshire/around/postcode_form.html new file mode 100644 index 000000000..bb4accf26 --- /dev/null +++ b/templates/web/borsetshire/around/postcode_form.html @@ -0,0 +1,26 @@ +<div id="front-main"> + <div id="front-main-container"> + [% INCLUDE 'around/intro.html' %] + + [% + question = c.cobrand.enter_postcode_text || loc('Enter a nearby street name and area'); + %] + + <form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> + <label for="pc">[% question %]:</label> + <div> + <input type="hidden" name="pc" value="[% c.cobrand.problems.first.postcode | html %]"> + <input type="text" name="_pc" value="[% pc | html %]" id="pc" size="10" maxlength="200" placeholder="[% tprintf(loc('e.g. ā%sā or ā%sā'), c.cobrand.example_places) %]"> + <input type="submit" value="[% loc('Go') %]" id="sub"> + </div> + + [% IF partial_token %] + <input type="hidden" name="partial" value="[% partial_token.token %]"> + [% END %] + + [% IF c.user_exists AND c.user.categories.size %] + <input type="hidden" name="filter_category" value="[% c.user.categories.join(",") | html %]"> + [% END %] + </form> + </div> +</div> diff --git a/templates/web/borsetshire/auth/_general_top.html b/templates/web/borsetshire/auth/_general_top.html new file mode 100644 index 000000000..efff99018 --- /dev/null +++ b/templates/web/borsetshire/auth/_general_top.html @@ -0,0 +1,27 @@ +<p>The following users exist, all with password <kbd>password</kbd>:</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> + +<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> + diff --git a/templates/web/borsetshire/footer_extra_js.html b/templates/web/borsetshire/footer_extra_js.html new file mode 100644 index 000000000..a1f790e18 --- /dev/null +++ b/templates/web/borsetshire/footer_extra_js.html @@ -0,0 +1,5 @@ +[% scripts.push( + version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js') + version('/cobrands/fixmystreet-uk-councils/js.js'), + version('/cobrands/borsetshire/js.js'), +) %] diff --git a/web/cobrands/borsetshire/js.js b/web/cobrands/borsetshire/js.js new file mode 100644 index 000000000..b612c3a8b --- /dev/null +++ b/web/cobrands/borsetshire/js.js @@ -0,0 +1,9 @@ +(function(){ + $('#demo-user-list dt').click(function(){ + var form = document.forms.general_auth; + form.email.value = $(this).text(); + form.password_sign_in.value = 'password'; + form.r.value = 'admin'; + form.submit(); + }); +})(); |